Fix for renewel logic
This commit is contained in:
parent
88b9046ac7
commit
e619bacf66
1 changed files with 3 additions and 1 deletions
|
|
@ -218,7 +218,9 @@ class PaymentService extends BaseService
|
|||
$account = Account::with('users')->find($invoice->client->public_id);
|
||||
if ($account->pro_plan_paid && $account->pro_plan_paid != '0000-00-00') {
|
||||
$date = DateTime::createFromFormat('Y-m-d', $account->pro_plan_paid);
|
||||
$account->pro_plan_paid = $date->modify('+1 year')->format('Y-m-d');
|
||||
$date->modify('+1 year');
|
||||
$date = max($date, date_create());
|
||||
$account->pro_plan_paid = $date->format('Y-m-d');
|
||||
} else {
|
||||
$account->pro_plan_paid = date_create()->format('Y-m-d');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue