wip
This commit is contained in:
@@ -52,9 +52,11 @@ class MakePaymentNovaVisaMaster extends Action
|
||||
|
||||
$resource = $models->first();
|
||||
|
||||
$today = today();
|
||||
|
||||
$hasBeenPaid = false;
|
||||
$resource->paymentItems->each(function ($item) use ($hasBeenPaid) {
|
||||
if (boolval($item->paid) && now()->format('m Y') == $item->created_at->format('m Y')) {
|
||||
$resource->paymentItems->each(function ($item) use ($hasBeenPaid, $today) {
|
||||
if (boolval($item->paid) && $today->format('m Y') == $item->created_at->format('m Y')) {
|
||||
$hasBeenPaid = true;
|
||||
}
|
||||
});
|
||||
@@ -66,6 +68,13 @@ class MakePaymentNovaVisaMaster extends Action
|
||||
]);
|
||||
}
|
||||
|
||||
if (lastDayOfMonth($today->format('m'), $today->format('Y'))) {
|
||||
return Action::modal('modal-response', [
|
||||
'title' => 'Bu gun aýyn sonky guni!',
|
||||
'body' => 'Ayyn sonky guni toleg alynmayar.',
|
||||
]);
|
||||
}
|
||||
|
||||
if (! $resource->branch || ! $resource->branch->billing_visa_master_username) {
|
||||
return Action::modal('modal-response', [
|
||||
'title' => 'Billing maglumatlary şahamçada ýok!',
|
||||
|
||||
Reference in New Issue
Block a user