mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-13 22:54:25 +01:00
Ensure order of Item exports
This commit is contained in:
parent
91ddacc3dd
commit
aca580780a
@ -137,16 +137,16 @@ class InvoiceItemExport extends BaseExport
|
||||
|
||||
if (str_contains($key, "item.")) {
|
||||
|
||||
$key = str_replace("item.", "", $key);
|
||||
$tmp_key = str_replace("item.", "", $key);
|
||||
|
||||
if($key == 'type_id')
|
||||
$key = 'type';
|
||||
if($tmp_key == 'type_id')
|
||||
$tmp_key = 'type';
|
||||
|
||||
if($key == 'tax_id')
|
||||
$key = 'tax_category';
|
||||
if($tmp_key == 'tax_id')
|
||||
$tmp_key = 'tax_category';
|
||||
|
||||
if (property_exists($item, $key)) {
|
||||
$item_array[$key] = $item->{$key};
|
||||
if (property_exists($item, $tmp_key)) {
|
||||
$item_array[$key] = $item->{$tmp_key};
|
||||
}
|
||||
else {
|
||||
$item_array[$key] = '';
|
||||
@ -156,6 +156,8 @@ class InvoiceItemExport extends BaseExport
|
||||
|
||||
$transformed_items = array_merge($transformed_invoice, $item_array);
|
||||
$entity = $this->decorateAdvancedFields($invoice, $transformed_items);
|
||||
|
||||
$entity = array_merge(array_flip(array_values($this->input['report_keys'])), $entity);
|
||||
|
||||
$this->storage_array[] = $entity;
|
||||
|
||||
|
@ -147,6 +147,7 @@ class PurchaseOrderItemExport extends BaseExport
|
||||
|
||||
$transformed_items = array_merge($transformed_purchase_order, $item_array);
|
||||
$entity = $this->decorateAdvancedFields($purchase_order, $transformed_items);
|
||||
$entity = array_merge(array_flip(array_values($this->input['report_keys'])), $entity);
|
||||
|
||||
$this->storage_array[] = $entity;
|
||||
}
|
||||
|
@ -152,6 +152,7 @@ class QuoteItemExport extends BaseExport
|
||||
|
||||
$transformed_items = array_merge($transformed_quote, $item_array);
|
||||
$entity = $this->decorateAdvancedFields($quote, $transformed_items);
|
||||
$entity = array_merge(array_flip(array_values($this->input['report_keys'])), $entity);
|
||||
|
||||
$this->storage_array[] = $entity;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user