Working on deleted invoice accounting
This commit is contained in:
parent
c298ab40fa
commit
0837252c47
2 changed files with 4 additions and 1 deletions
|
|
@ -108,10 +108,12 @@ class MarkInvoiceDeleted extends AbstractService
|
|||
->where('paymentable_type', '=', 'invoices')
|
||||
->where('paymentable_id', $this->invoice->id)
|
||||
->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 - refunded');
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -172,10 +172,11 @@ class DeleteInvoiceTest extends TestCase
|
|||
$client_hash_id = $arr['data']['id'];
|
||||
$client = Client::find($this->decodePrimaryKey($client_hash_id));
|
||||
|
||||
//new client
|
||||
$this->assertEquals($client->balance, 0);
|
||||
$this->assertEquals($client->paid_to_date, 0);
|
||||
//create new invoice.
|
||||
|
||||
//create new invoice.
|
||||
$line_items = [];
|
||||
|
||||
$item = InvoiceItemFactory::create();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue