mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Allow tasks to be imported as a type
This commit is contained in:
parent
f218b47154
commit
5b3e087c66
@ -68,6 +68,11 @@ class BaseTransformer
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getInvoiceTypeId($data, $field)
|
||||||
|
{
|
||||||
|
return isset($data[$field]) && $data[$field] ? (string)$data[$field] : '1';
|
||||||
|
}
|
||||||
|
|
||||||
public function getNumber($data, $field)
|
public function getNumber($data, $field)
|
||||||
{
|
{
|
||||||
return (isset($data->$field) && $data->$field) ? (int)$data->$field : 0;
|
return (isset($data->$field) && $data->$field) ? (int)$data->$field : 0;
|
||||||
|
@ -222,9 +222,10 @@ class InvoiceTransformer extends BaseTransformer
|
|||||||
$record,
|
$record,
|
||||||
'item.custom_value4'
|
'item.custom_value4'
|
||||||
),
|
),
|
||||||
'type_id' => '1', //$this->getInvoiceTypeId( $record, 'item.type_id' ),
|
'type_id' => $this->getInvoiceTypeId( $record, 'item.type_id' ),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
$transformed['line_items'] = $line_items;
|
$transformed['line_items'] = $line_items;
|
||||||
|
|
||||||
return $transformed;
|
return $transformed;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user