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.
|
* Handle the event.
|
||||||
*
|
*
|
||||||
* @param $event
|
* @param $event
|
||||||
* @return array
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function handle(Event $event)
|
public function handle(Event $event)
|
||||||
{
|
{
|
||||||
|
if ($event->request['type'] !== 'income') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$document = $event->document;
|
$document = $event->document;
|
||||||
$transaction = $document->transactions()->latest()->first();
|
$transaction = $document->transactions()->latest()->first();
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ return [
|
|||||||
'due_at' => 'invoices.due_date',
|
'due_at' => 'invoices.due_date',
|
||||||
],
|
],
|
||||||
'category_type' => 'income',
|
'category_type' => 'income',
|
||||||
|
'transaction_type' => 'income',
|
||||||
'contact_type' => 'customer', // use contact type
|
'contact_type' => 'customer', // use contact type
|
||||||
'hide' => [], // for document items
|
'hide' => [], // for document items
|
||||||
'class' => [],
|
'class' => [],
|
||||||
@ -47,6 +48,7 @@ return [
|
|||||||
'due_at' => 'bills.due_date',
|
'due_at' => 'bills.due_date',
|
||||||
],
|
],
|
||||||
'category_type' => 'expense',
|
'category_type' => 'expense',
|
||||||
|
'transaction_type' => 'expense',
|
||||||
'contact_type' => 'vendor',
|
'contact_type' => 'vendor',
|
||||||
'hide' => [],
|
'hide' => [],
|
||||||
],
|
],
|
||||||
|
@ -327,7 +327,7 @@ class Document extends AbstractFactory
|
|||||||
case 'paid':
|
case 'paid':
|
||||||
$payment_request = [
|
$payment_request = [
|
||||||
'paid_at' => $updated_document->due_at,
|
'paid_at' => $updated_document->due_at,
|
||||||
'type' => 'income',
|
'type' => config('type.' . $document->type . '.transaction_type'),
|
||||||
];
|
];
|
||||||
|
|
||||||
if ($init_status === 'partial') {
|
if ($init_status === 'partial') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user