mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-09 20:52:56 +01:00
Support importing custom product fields
This commit is contained in:
parent
7e4627a423
commit
1aa59512fe
@ -47,6 +47,8 @@ class Product extends EntityModel
|
||||
'product_key',
|
||||
'notes',
|
||||
'cost',
|
||||
'custom_value1',
|
||||
'custom_value2',
|
||||
];
|
||||
}
|
||||
|
||||
@ -59,6 +61,8 @@ class Product extends EntityModel
|
||||
'product|item' => 'product_key',
|
||||
'notes|description|details' => 'notes',
|
||||
'cost|amount|price' => 'cost',
|
||||
'custom_value1' => 'custom_value1',
|
||||
'custom_value2' => 'custom_value2',
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -27,6 +27,8 @@ class ProductTransformer extends BaseTransformer
|
||||
'product_key' => $this->getString($data, 'product_key'),
|
||||
'notes' => $this->getString($data, 'notes'),
|
||||
'cost' => $this->getFloat($data, 'cost'),
|
||||
'custom_value1' => $this->getString($data, 'custom_value1'),
|
||||
'custom_value2' => $this->getString($data, 'custom_value2'),
|
||||
];
|
||||
});
|
||||
}
|
||||
|
@ -651,7 +651,7 @@ class ImportService
|
||||
$this->checkForFile($fileName);
|
||||
$file = file_get_contents($fileName);
|
||||
$data = array_map("str_getcsv", preg_split('/\r*\n+|\r+/', $file));
|
||||
dd($data);
|
||||
|
||||
if (count($data) > 0) {
|
||||
$headers = $data[0];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user