Additional checks when reversing
This commit is contained in:
parent
8c34d0cc5c
commit
2dd324c0bf
|
|
@ -66,6 +66,10 @@ class ValidInvoiceCreditRule implements Rule
|
||||||
$this->error_message = 'Cannot reverse an invoice that has already been reversed.';
|
$this->error_message = 'Cannot reverse an invoice that has already been reversed.';
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
else if($invoice->is_deleted) {
|
||||||
|
$this->error_message = 'Cannot reverse an invoice that has already been deleted.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$existing_credit_amounts = $invoice->credits()->sum('amount');
|
$existing_credit_amounts = $invoice->credits()->sum('amount');
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue