mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for tests and partial_due_date output
This commit is contained in:
parent
1f77856829
commit
8880dd3f49
@ -78,7 +78,7 @@ class ExpenseExport extends BaseExport
|
|||||||
'expense.net_amount'
|
'expense.net_amount'
|
||||||
];
|
];
|
||||||
|
|
||||||
$this->input['report_keys'] = array_merge($this->input['report_keys'], $tax_keys);
|
$this->input['report_keys'] = array_unique(array_merge($this->input['report_keys'], $tax_keys));
|
||||||
|
|
||||||
$query = Expense::query()
|
$query = Expense::query()
|
||||||
->with('client')
|
->with('client')
|
||||||
|
@ -167,7 +167,7 @@ class InvoiceExport extends BaseExport
|
|||||||
$entity['invoice.user_id'] = $invoice->user ? $invoice->user->present()->name() : '';
|
$entity['invoice.user_id'] = $invoice->user ? $invoice->user->present()->name() : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nlog($entity);
|
||||||
return $entity;
|
return $entity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ use Laracasts\Presenter\PresentableTrait;
|
|||||||
* @property float $amount
|
* @property float $amount
|
||||||
* @property float $balance
|
* @property float $balance
|
||||||
* @property float|null $partial
|
* @property float|null $partial
|
||||||
* @property string|null $partial_due_date
|
* @property string|null|\Carbon\Carbon $partial_due_date
|
||||||
* @property string|null $last_viewed
|
* @property string|null $last_viewed
|
||||||
* @property int|null $created_at
|
* @property int|null $created_at
|
||||||
* @property int|null $updated_at
|
* @property int|null $updated_at
|
||||||
@ -401,7 +401,7 @@ class Invoice extends BaseModel
|
|||||||
public function getStatusAttribute()
|
public function getStatusAttribute()
|
||||||
{
|
{
|
||||||
$due_date = $this->due_date ? Carbon::parse($this->due_date) : false;
|
$due_date = $this->due_date ? Carbon::parse($this->due_date) : false;
|
||||||
$partial_due_date = $this->partial_due_Date ? Carbon::parse($this->partial_due_date) : false;
|
$partial_due_date = $this->partial_due_date ? Carbon::parse($this->partial_due_date) : false;
|
||||||
|
|
||||||
if ($this->status_id == self::STATUS_SENT && $due_date && $due_date->gt(now())) {
|
if ($this->status_id == self::STATUS_SENT && $due_date && $due_date->gt(now())) {
|
||||||
return self::STATUS_UNPAID;
|
return self::STATUS_UNPAID;
|
||||||
|
@ -132,7 +132,7 @@ class InvoiceTransformer extends EntityTransformer
|
|||||||
'is_amount_discount' => (bool) ($invoice->is_amount_discount ?: false),
|
'is_amount_discount' => (bool) ($invoice->is_amount_discount ?: false),
|
||||||
'footer' => $invoice->footer ?: '',
|
'footer' => $invoice->footer ?: '',
|
||||||
'partial' => (float) ($invoice->partial ?: 0.0),
|
'partial' => (float) ($invoice->partial ?: 0.0),
|
||||||
'partial_due_date' => ($invoice->partial_due_date && $invoice->partial_due_date != "-0001-11-30") ? $invoice->partial_due_date : '',
|
'partial_due_date' => ($invoice->partial_due_date && $invoice->partial_due_date != "-0001-11-30") ? $invoice->partial_due_date->format('Y-m-d') : '',
|
||||||
'custom_value1' => (string) $invoice->custom_value1 ?: '',
|
'custom_value1' => (string) $invoice->custom_value1 ?: '',
|
||||||
'custom_value2' => (string) $invoice->custom_value2 ?: '',
|
'custom_value2' => (string) $invoice->custom_value2 ?: '',
|
||||||
'custom_value3' => (string) $invoice->custom_value3 ?: '',
|
'custom_value3' => (string) $invoice->custom_value3 ?: '',
|
||||||
|
@ -2207,6 +2207,8 @@ class ReportCsvGenerationTest extends TestCase
|
|||||||
$response = $this->poll($hash);
|
$response = $this->poll($hash);
|
||||||
$csv = $response->body();
|
$csv = $response->body();
|
||||||
|
|
||||||
|
nlog($csv);
|
||||||
|
|
||||||
$this->assertEquals('100', $this->getFirstValueByColumn($csv, 'Expense Amount'));
|
$this->assertEquals('100', $this->getFirstValueByColumn($csv, 'Expense Amount'));
|
||||||
$this->assertEquals('Public', $this->getFirstValueByColumn($csv, 'Expense Public Notes'));
|
$this->assertEquals('Public', $this->getFirstValueByColumn($csv, 'Expense Public Notes'));
|
||||||
$this->assertEquals('Private', $this->getFirstValueByColumn($csv, 'Expense Private Notes'));
|
$this->assertEquals('Private', $this->getFirstValueByColumn($csv, 'Expense Private Notes'));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user