mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Working on deleted invoice accounting
This commit is contained in:
parent
c298ab40fa
commit
0837252c47
@ -108,10 +108,12 @@ class MarkInvoiceDeleted extends AbstractService
|
|||||||
->where('paymentable_type', '=', 'invoices')
|
->where('paymentable_type', '=', 'invoices')
|
||||||
->where('paymentable_id', $this->invoice->id)
|
->where('paymentable_id', $this->invoice->id)
|
||||||
->sum(DB::raw('amount'));
|
->sum(DB::raw('amount'));
|
||||||
|
//->sum(DB::raw('amount - refunded'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$this->total_payments = $this->invoice->payments->sum('amount');
|
$this->total_payments = $this->invoice->payments->sum('amount');
|
||||||
|
// $this->total_payments = $this->invoice->payments->sum('amount - refunded');
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -172,10 +172,11 @@ class DeleteInvoiceTest extends TestCase
|
|||||||
$client_hash_id = $arr['data']['id'];
|
$client_hash_id = $arr['data']['id'];
|
||||||
$client = Client::find($this->decodePrimaryKey($client_hash_id));
|
$client = Client::find($this->decodePrimaryKey($client_hash_id));
|
||||||
|
|
||||||
|
//new client
|
||||||
$this->assertEquals($client->balance, 0);
|
$this->assertEquals($client->balance, 0);
|
||||||
$this->assertEquals($client->paid_to_date, 0);
|
$this->assertEquals($client->paid_to_date, 0);
|
||||||
//create new invoice.
|
|
||||||
|
|
||||||
|
//create new invoice.
|
||||||
$line_items = [];
|
$line_items = [];
|
||||||
|
|
||||||
$item = InvoiceItemFactory::create();
|
$item = InvoiceItemFactory::create();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user