mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for removing items from collection appropriately
This commit is contained in:
parent
a36f2a9c4b
commit
35f7e125fb
@ -95,6 +95,29 @@ class LateFeeTest extends TestCase
|
||||
return $client;
|
||||
}
|
||||
|
||||
public function testAddLateFeeAppropriately()
|
||||
{
|
||||
$invoice_item = new InvoiceItem;
|
||||
$invoice_item->type_id = '5';
|
||||
$invoice_item->product_key = trans('texts.fee');
|
||||
$invoice_item->notes = ctrans('texts.late_fee_added', ['date' => 'xyz']);
|
||||
$invoice_item->quantity = 1;
|
||||
$invoice_item->cost = 20;
|
||||
|
||||
$invoice_items = $this->invoice->line_items;
|
||||
$invoice_items[] = $invoice_item;
|
||||
|
||||
$this->invoice->line_items = $invoice_items;
|
||||
|
||||
$this->assertGreaterThan(1, count($this->invoice->line_items));
|
||||
|
||||
/**Refresh Invoice values*/
|
||||
$invoice = $this->invoice->calc()->getInvoice();
|
||||
|
||||
$this->assertGreaterThan(1, count($this->invoice->line_items));
|
||||
|
||||
}
|
||||
|
||||
public function testModelBehaviourInsideMap()
|
||||
{
|
||||
$i = Invoice::factory()->count(5)
|
||||
|
Loading…
x
Reference in New Issue
Block a user