Fixes for importing payments in CSVs, do not apply payments to Zero amount invoices

This commit is contained in:
David Bomba 2021-05-24 14:57:30 +10:00
parent 347f10caa6
commit 954692ce6d

View File

@ -293,10 +293,14 @@ class CSVImport implements ShouldQueue {
], ],
]; ];
$payment_repository->save( /* Make sure we don't apply any payments to invoices with a Zero Amount*/
$payment_data, if($invoice->amount > 0)
PaymentFactory::create( $this->company->id, $invoice->user_id, $invoice->client_id ) {
); $payment_repository->save(
$payment_data,
PaymentFactory::create( $this->company->id, $invoice->user_id, $invoice->client_id )
);
}
} }
} }
} }