Fix notification error when creating sample data
This commit is contained in:
parent
c50c8acd75
commit
eaf79b3a4b
@ -11,10 +11,14 @@ class SendDocumentPaymentNotification
|
||||
* Handle the event.
|
||||
*
|
||||
* @param $event
|
||||
* @return array
|
||||
* @return void
|
||||
*/
|
||||
public function handle(Event $event)
|
||||
{
|
||||
if ($event->request['type'] !== 'income') {
|
||||
return;
|
||||
}
|
||||
|
||||
$document = $event->document;
|
||||
$transaction = $document->transactions()->latest()->first();
|
||||
|
||||
|
@ -24,6 +24,7 @@ return [
|
||||
'due_at' => 'invoices.due_date',
|
||||
],
|
||||
'category_type' => 'income',
|
||||
'transaction_type' => 'income',
|
||||
'contact_type' => 'customer', // use contact type
|
||||
'hide' => [], // for document items
|
||||
'class' => [],
|
||||
@ -47,6 +48,7 @@ return [
|
||||
'due_at' => 'bills.due_date',
|
||||
],
|
||||
'category_type' => 'expense',
|
||||
'transaction_type' => 'expense',
|
||||
'contact_type' => 'vendor',
|
||||
'hide' => [],
|
||||
],
|
||||
|
@ -327,7 +327,7 @@ class Document extends AbstractFactory
|
||||
case 'paid':
|
||||
$payment_request = [
|
||||
'paid_at' => $updated_document->due_at,
|
||||
'type' => 'income',
|
||||
'type' => config('type.' . $document->type . '.transaction_type'),
|
||||
];
|
||||
|
||||
if ($init_status === 'partial') {
|
||||
|
Loading…
x
Reference in New Issue
Block a user