Bill recurring send-auto issue fixed..

This commit is contained in:
Cüneyt Şentürk 2023-11-06 17:57:22 +03:00
parent b95723d576
commit 0f1ee3e878
3 changed files with 8 additions and 2 deletions

View File

@ -18,7 +18,7 @@ class MarkDocumentReceived
*/
public function handle(Event $event)
{
if ($event->document->status != 'partial') {
if (! in_array($event->document->status, ['partial', 'paid'])) {
$event->document->status = 'received';
$event->document->save();

View File

@ -36,7 +36,9 @@ class SendDocumentRecurringNotification
$document->contact->notify(new $notification($document, "{$document->type}_recur_customer"));
}
event(new DocumentSent($document));
$sent = config('type.document.' . $document->type . '.auto_send', DocumentSent::class);
event(new $sent($document));
// Check if should notify users
if (! $config['notify_user']) {

View File

@ -143,6 +143,7 @@ return [
'notify_contact' => true,
'notify_user' => true,
],
'auto_send' => 'App\Events\Document\DocumentSent',
'script' => [
'folder' => 'common',
'file' => 'documents',
@ -192,6 +193,7 @@ return [
'notification' => [
],
'auto_send' => 'App\Events\Document\DocumentSent',
'image_empty_page' => 'public/img/empty_pages/recurring_templates.png',
'script' => [
'folder' => 'common',
@ -244,6 +246,7 @@ return [
'notify_contact' => false,
'notify_user' => true,
],
'auto_send' => 'App\Events\Document\DocumentReceived',
'script' => [
'folder' => 'common',
'file' => 'documents',
@ -291,6 +294,7 @@ return [
'notification' => [
],
'auto_send' => 'App\Events\Document\DocumentReceived',
'image_empty_page' => 'public/img/empty_pages/recurring_templates.png',
'script' => [
'folder' => 'common',