mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-02 09:54:35 -04:00
Fixes for tests
This commit is contained in:
parent
fec6fe8f31
commit
2bc75feb21
@ -925,21 +925,27 @@ class BaseExport
|
|||||||
{
|
{
|
||||||
$parts = explode(".", $value);
|
$parts = explode(".", $value);
|
||||||
|
|
||||||
if(in_array($parts[0], ['credit','quote','invoice','purchase_order','recurring_invoice'])){
|
if(count($parts) == 2 && in_array($parts[0], ['credit','quote','invoice','purchase_order','recurring_invoice'])){
|
||||||
$entity = "invoice".substr($parts[1], -1);
|
$entity = "invoice".substr($parts[1], -1);
|
||||||
|
$header[] = "{$prefix}" . $helper->makeCustomField($this->company->custom_fields, $entity);
|
||||||
}
|
}
|
||||||
else {
|
elseif(count($parts) == 2 && stripos($parts[0], 'contact') !== false) {
|
||||||
$entity = $parts[0].substr($parts[1], -1);
|
$entity = "contact".substr($parts[1], -1);
|
||||||
|
$custom_field_string = strlen($helper->makeCustomField($this->company->custom_fields, $entity)) > 1 ? $helper->makeCustomField($this->company->custom_fields, $entity) : ctrans("texts.{$parts[1]}");
|
||||||
|
$header[] = ctrans("texts.{$parts[0]}") . " " . $custom_field_string;
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
$header[] = $helper->makeCustomField($this->company->custom_fields, $entity);
|
nlog("else".$key);
|
||||||
|
$header[] = "{$prefix}" . ctrans("texts.{$key}");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$header[] = "{$prefix}" . ctrans("texts.{$key}");
|
$header[] = "{$prefix}" . ctrans("texts.{$key}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
nlog($header);
|
||||||
return $header;
|
return $header;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -673,7 +673,7 @@ class ReportCsvGenerationTest extends TestCase
|
|||||||
])->post('/api/v1/reports/clients', $data);
|
])->post('/api/v1/reports/clients', $data);
|
||||||
|
|
||||||
$csv = $response->streamedContent();
|
$csv = $response->streamedContent();
|
||||||
|
nlog($csv);
|
||||||
$reader = Reader::createFromString($csv);
|
$reader = Reader::createFromString($csv);
|
||||||
$reader->setHeaderOffset(0);
|
$reader->setHeaderOffset(0);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user