mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 09:34:34 -04:00
Fixes for variables in recurring invoices
This commit is contained in:
parent
c9bebde8f4
commit
a6079b0cc1
@ -187,7 +187,7 @@ class BaseRepository
|
|||||||
if(!$model->id){
|
if(!$model->id){
|
||||||
$this->new_model = true;
|
$this->new_model = true;
|
||||||
|
|
||||||
if(is_array($model->line_items))
|
if(is_array($model->line_items) && !($model instanceof RecurringInvoice))
|
||||||
{
|
{
|
||||||
$model->line_items = (collect($model->line_items))->map(function ($item) use($model,$client) {
|
$model->line_items = (collect($model->line_items))->map(function ($item) use($model,$client) {
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ class RecurringInvoiceTest extends TestCase
|
|||||||
$item->cost = 10;
|
$item->cost = 10;
|
||||||
$item->task_id = $this->encodePrimaryKey($this->task->id);
|
$item->task_id = $this->encodePrimaryKey($this->task->id);
|
||||||
$item->expense_id = $this->encodePrimaryKey($this->expense->id);
|
$item->expense_id = $this->encodePrimaryKey($this->expense->id);
|
||||||
$item->description = "Hello this is the month of :MONTH";
|
$item->notes = "Hello this is the month of :MONTH";
|
||||||
|
|
||||||
$line_items[] = $item;
|
$line_items[] = $item;
|
||||||
|
|
||||||
@ -93,7 +93,9 @@ class RecurringInvoiceTest extends TestCase
|
|||||||
$arr = $response->json();
|
$arr = $response->json();
|
||||||
$this->assertEquals(RecurringInvoice::STATUS_DRAFT, $arr['data']['status_id']);
|
$this->assertEquals(RecurringInvoice::STATUS_DRAFT, $arr['data']['status_id']);
|
||||||
|
|
||||||
$this->assertIsArray($arr['data']['line_items']);
|
$notes = end($arr['data']['line_items'])['notes'];
|
||||||
|
|
||||||
|
$this->assertTrue(str_contains($notes, ':MONTH'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user