Allow tasks to be imported as a type

This commit is contained in:
David Bomba 2023-02-02 09:15:11 +11:00
parent f218b47154
commit 5b3e087c66
2 changed files with 7 additions and 1 deletions

View File

@ -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)
{
return (isset($data->$field) && $data->$field) ? (int)$data->$field : 0;

View File

@ -222,9 +222,10 @@ class InvoiceTransformer extends BaseTransformer
$record,
'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;
return $transformed;