mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for tests
This commit is contained in:
parent
173c8efaed
commit
bbe138ef79
@ -148,7 +148,7 @@ class RecurringInvoiceExport extends BaseExport
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (in_array('recurring_invoice.frequency_id', $this->input['report_keys']) || in_array('frequency_id', $this->input['report_keys'])) {
|
if (in_array('recurring_invoice.frequency_id', $this->input['report_keys']) || in_array('frequency_id', $this->input['report_keys'])) {
|
||||||
$entity['frequency_id'] = $invoice->frequencyForKey($invoice->frequency_id);
|
$entity['recurring_invoice.frequency_id'] = $invoice->frequencyForKey($invoice->frequency_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $entity;
|
return $entity;
|
||||||
|
@ -214,19 +214,19 @@ class TaskExport extends BaseExport
|
|||||||
|
|
||||||
foreach ($logs as $key => $item) {
|
foreach ($logs as $key => $item) {
|
||||||
if (in_array('task.start_date', $this->input['report_keys']) || in_array('start_date', $this->input['report_keys'])) {
|
if (in_array('task.start_date', $this->input['report_keys']) || in_array('start_date', $this->input['report_keys'])) {
|
||||||
$entity['start_date'] = Carbon::createFromTimeStamp($item[0])->setTimezone($timezone_name)->format($date_format_default);
|
$entity['task.start_date'] = Carbon::createFromTimeStamp($item[0])->setTimezone($timezone_name)->format($date_format_default);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((in_array('task.end_date', $this->input['report_keys']) || in_array('end_date', $this->input['report_keys'])) && $item[1] > 0) {
|
if ((in_array('task.end_date', $this->input['report_keys']) || in_array('end_date', $this->input['report_keys'])) && $item[1] > 0) {
|
||||||
$entity['end_date'] = Carbon::createFromTimeStamp($item[1])->setTimezone($timezone_name)->format($date_format_default);
|
$entity['task.end_date'] = Carbon::createFromTimeStamp($item[1])->setTimezone($timezone_name)->format($date_format_default);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((in_array('task.end_date', $this->input['report_keys']) || in_array('end_date', $this->input['report_keys'])) && $item[1] == 0) {
|
if ((in_array('task.end_date', $this->input['report_keys']) || in_array('end_date', $this->input['report_keys'])) && $item[1] == 0) {
|
||||||
$entity['end_date'] = ctrans('texts.is_running');
|
$entity['task.end_date'] = ctrans('texts.is_running');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array('task.duration', $this->input['report_keys']) || in_array('duration', $this->input['report_keys'])) {
|
if (in_array('task.duration', $this->input['report_keys']) || in_array('duration', $this->input['report_keys'])) {
|
||||||
$entity['duration'] = $task->calcDuration();
|
$entity['task.duration'] = $task->calcDuration();
|
||||||
}
|
}
|
||||||
|
|
||||||
$entity = $this->decorateAdvancedFields($task, $entity);
|
$entity = $this->decorateAdvancedFields($task, $entity);
|
||||||
|
@ -488,14 +488,14 @@ class ReportCsvGenerationTest extends TestCase
|
|||||||
|
|
||||||
$csv = $response->streamedContent();
|
$csv = $response->streamedContent();
|
||||||
|
|
||||||
$this->assertEquals(3600, $this->getFirstValueByColumn($csv, 'Duration'));
|
$this->assertEquals(3600, $this->getFirstValueByColumn($csv, 'Task Duration'));
|
||||||
$this->assertEquals('test', $this->getFirstValueByColumn($csv, 'Description'));
|
$this->assertEquals('test', $this->getFirstValueByColumn($csv, 'Task Description'));
|
||||||
$this->assertEquals('16/Jul/2023', $this->getFirstValueByColumn($csv, 'Start Date'));
|
$this->assertEquals('16/Jul/2023', $this->getFirstValueByColumn($csv, 'Task Start Date'));
|
||||||
$this->assertEquals('16/Jul/2023', $this->getFirstValueByColumn($csv, 'End Date'));
|
$this->assertEquals('16/Jul/2023', $this->getFirstValueByColumn($csv, 'Task End Date'));
|
||||||
$this->assertEquals('Custom 1', $this->getFirstValueByColumn($csv, 'Custom Value 1'));
|
$this->assertEquals('Custom 1', $this->getFirstValueByColumn($csv, 'Task Custom Value 1'));
|
||||||
$this->assertEquals('Custom 2', $this->getFirstValueByColumn($csv, 'Custom Value 2'));
|
$this->assertEquals('Custom 2', $this->getFirstValueByColumn($csv, 'Task Custom Value 2'));
|
||||||
$this->assertEquals('Custom 3', $this->getFirstValueByColumn($csv, 'Custom Value 3'));
|
$this->assertEquals('Custom 3', $this->getFirstValueByColumn($csv, 'Task Custom Value 3'));
|
||||||
$this->assertEquals('Custom 4', $this->getFirstValueByColumn($csv, 'Custom Value 4'));
|
$this->assertEquals('Custom 4', $this->getFirstValueByColumn($csv, 'Task Custom Value 4'));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1567,29 +1567,29 @@ class ReportCsvGenerationTest extends TestCase
|
|||||||
|
|
||||||
$csv = $response->streamedContent();
|
$csv = $response->streamedContent();
|
||||||
|
|
||||||
$this->assertEquals('100', $this->getFirstValueByColumn($csv, 'Amount'));
|
$this->assertEquals('100', $this->getFirstValueByColumn($csv, 'Recurring Invoice Amount'));
|
||||||
$this->assertEquals('50', $this->getFirstValueByColumn($csv, 'Balance'));
|
$this->assertEquals('50', $this->getFirstValueByColumn($csv, 'Recurring Invoice Balance'));
|
||||||
$this->assertEquals('10', $this->getFirstValueByColumn($csv, 'Discount'));
|
$this->assertEquals('10', $this->getFirstValueByColumn($csv, 'Recurring Invoice Discount'));
|
||||||
$this->assertEquals('1234', $this->getFirstValueByColumn($csv, 'PO Number'));
|
$this->assertEquals('1234', $this->getFirstValueByColumn($csv, 'Recurring Invoice PO Number'));
|
||||||
$this->assertEquals('Public', $this->getFirstValueByColumn($csv, 'Public Notes'));
|
$this->assertEquals('Public', $this->getFirstValueByColumn($csv, 'Recurring Invoice Public Notes'));
|
||||||
$this->assertEquals('Private', $this->getFirstValueByColumn($csv, 'Private Notes'));
|
$this->assertEquals('Private', $this->getFirstValueByColumn($csv, 'Recurring Invoice Private Notes'));
|
||||||
$this->assertEquals('Terms', $this->getFirstValueByColumn($csv, 'Terms'));
|
$this->assertEquals('Terms', $this->getFirstValueByColumn($csv, 'Recurring Invoice Terms'));
|
||||||
$this->assertEquals('2020-01-01', $this->getFirstValueByColumn($csv, 'Date'));
|
$this->assertEquals('2020-01-01', $this->getFirstValueByColumn($csv, 'Recurring Invoice Date'));
|
||||||
$this->assertEquals('2021-01-02', $this->getFirstValueByColumn($csv, 'Due Date'));
|
$this->assertEquals('2021-01-02', $this->getFirstValueByColumn($csv, 'Recurring Invoice Due Date'));
|
||||||
$this->assertEquals('2021-01-03', $this->getFirstValueByColumn($csv, 'Partial Due Date'));
|
$this->assertEquals('2021-01-03', $this->getFirstValueByColumn($csv, 'Recurring Invoice Partial Due Date'));
|
||||||
$this->assertEquals('10', $this->getFirstValueByColumn($csv, 'Partial/Deposit'));
|
$this->assertEquals('10', $this->getFirstValueByColumn($csv, 'Recurring Invoice Partial/Deposit'));
|
||||||
$this->assertEquals('Custom 1', $this->getFirstValueByColumn($csv, 'Custom Value 1'));
|
$this->assertEquals('Custom 1', $this->getFirstValueByColumn($csv, 'Recurring Invoice Custom Value 1'));
|
||||||
$this->assertEquals('Custom 2', $this->getFirstValueByColumn($csv, 'Custom Value 2'));
|
$this->assertEquals('Custom 2', $this->getFirstValueByColumn($csv, 'Recurring Invoice Custom Value 2'));
|
||||||
$this->assertEquals('Custom 3', $this->getFirstValueByColumn($csv, 'Custom Value 3'));
|
$this->assertEquals('Custom 3', $this->getFirstValueByColumn($csv, 'Recurring Invoice Custom Value 3'));
|
||||||
$this->assertEquals('Custom 4', $this->getFirstValueByColumn($csv, 'Custom Value 4'));
|
$this->assertEquals('Custom 4', $this->getFirstValueByColumn($csv, 'Recurring Invoice Custom Value 4'));
|
||||||
$this->assertEquals('Footer', $this->getFirstValueByColumn($csv, 'Footer'));
|
$this->assertEquals('Footer', $this->getFirstValueByColumn($csv, 'Recurring Invoice Footer'));
|
||||||
$this->assertEquals('Tax 1', $this->getFirstValueByColumn($csv, 'Tax Name 1'));
|
$this->assertEquals('Tax 1', $this->getFirstValueByColumn($csv, 'Recurring Invoice Tax Name 1'));
|
||||||
$this->assertEquals('10', $this->getFirstValueByColumn($csv, 'Tax Rate 1'));
|
$this->assertEquals('10', $this->getFirstValueByColumn($csv, 'Recurring Invoice Tax Rate 1'));
|
||||||
$this->assertEquals('Tax 2', $this->getFirstValueByColumn($csv, 'Tax Name 2'));
|
$this->assertEquals('Tax 2', $this->getFirstValueByColumn($csv, 'Recurring Invoice Tax Name 2'));
|
||||||
$this->assertEquals('20', $this->getFirstValueByColumn($csv, 'Tax Rate 2'));
|
$this->assertEquals('20', $this->getFirstValueByColumn($csv, 'Recurring Invoice Tax Rate 2'));
|
||||||
$this->assertEquals('Tax 3', $this->getFirstValueByColumn($csv, 'Tax Name 3'));
|
$this->assertEquals('Tax 3', $this->getFirstValueByColumn($csv, 'Recurring Invoice Tax Name 3'));
|
||||||
$this->assertEquals('30', $this->getFirstValueByColumn($csv, 'Tax Rate 3'));
|
$this->assertEquals('30', $this->getFirstValueByColumn($csv, 'Recurring Invoice Tax Rate 3'));
|
||||||
$this->assertEquals('Daily', $this->getFirstValueByColumn($csv, 'How Often'));
|
$this->assertEquals('Daily', $this->getFirstValueByColumn($csv, 'Recurring Invoice How Often'));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user