fix pdf issue & payment update issue

This commit is contained in:
harshjagad20
2021-12-09 18:06:25 +05:30
parent 8b07632fd7
commit 725afa9f65
8 changed files with 8 additions and 1 deletions

View File

@ -195,7 +195,7 @@ class Payment extends Model implements HasMedia
$invoice->addInvoicePayment($this->amount);
}
if ($this->invoice_id === $request->invoice_id && $request->amount !== $this->amount) {
if ($this->invoice_id && $this->invoice_id === $request->invoice_id && $request->amount !== $this->amount) {
$invoice = Invoice::find($this->invoice_id);
$invoice->addInvoicePayment($this->amount);
$invoice->subtractInvoicePayment($request->amount);