fixed zero amount document status

This commit is contained in:
Cihan Şentürk 2024-11-25 18:46:28 +03:00 committed by GitHub
parent 031de95f5b
commit b1ee1605b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View File

@ -21,6 +21,11 @@ class MarkDocumentReceived
if (! in_array($event->document->status, ['partial', 'paid'])) {
$event->document->status = 'received';
//This control will be removed when approval status is added to documents.
if ($event->document->amount == 0) {
$event->document->status = 'paid';
}
$event->document->save();
}

View File

@ -16,6 +16,11 @@ class MarkDocumentSent
if (! in_array($event->document->status, ['partial', 'paid'])) {
$event->document->status = 'sent';
//This control will be removed when approval status is added to documents.
if ($event->document->amount == 0) {
$event->document->status = 'paid';
}
$event->document->save();
}