mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-19 03:04:05 +00:00
Fix transaction delete issue
This commit is contained in:
@@ -139,7 +139,12 @@ class Customer extends Authenticatable implements HasMedia
|
||||
}
|
||||
|
||||
if ($customer->invoices()->exists()) {
|
||||
$customer->invoices()->delete();
|
||||
$customer->invoices->map(function ($invoice) {
|
||||
if ($invoice->transactions()->exists()) {
|
||||
$invoice->transactions()->delete();
|
||||
}
|
||||
$invoice->delete();
|
||||
});
|
||||
}
|
||||
|
||||
if ($customer->payments()->exists()) {
|
||||
|
||||
Reference in New Issue
Block a user