mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for custom value reports
This commit is contained in:
parent
e82104f6ae
commit
648e7fa3fc
@ -298,9 +298,6 @@ class BaseExport
|
||||
|
||||
$transformed_invoices = $transformed_invoices['App\\Models\\Invoice'];
|
||||
|
||||
nlog(count($transformed_invoices));
|
||||
nlog(array_key_exists($column, $transformed_invoices[0]));
|
||||
|
||||
if(count($transformed_invoices) == 1 && array_key_exists($column, $transformed_invoices[0]))
|
||||
return $transformed_invoices[0][$column];
|
||||
|
||||
|
@ -146,12 +146,18 @@ class InvoiceItemExport extends BaseExport
|
||||
|
||||
foreach ($invoice->line_items as $item) {
|
||||
$item_array = [];
|
||||
nlog($this->input['report_keys']);
|
||||
|
||||
foreach (array_values($this->input['report_keys']) as $key) { //items iterator produces item array
|
||||
|
||||
if (str_contains($key, "item.")) {
|
||||
|
||||
$key = str_replace("item.", "", $key);
|
||||
|
||||
$keyval = $key;
|
||||
|
||||
$keyval = str_replace("custom_value", "invoice", $key);
|
||||
|
||||
if($key == 'type_id')
|
||||
$keyval = 'type';
|
||||
|
||||
@ -177,8 +183,6 @@ class InvoiceItemExport extends BaseExport
|
||||
$entity[$keyval] = "";
|
||||
}
|
||||
}
|
||||
// nlog("entity");
|
||||
// nlog($entity);
|
||||
|
||||
$transformed_items = array_merge($transformed_invoice, $item_array);
|
||||
$entity = $this->decorateAdvancedFields($invoice, $transformed_items);
|
||||
|
Loading…
x
Reference in New Issue
Block a user