1
0
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:
Hillel Coren 2018-02-14 13:44:00 +02:00
parent 7e4627a423
commit 1aa59512fe
3 changed files with 7 additions and 1 deletions

View File

@ -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',
];
}

View File

@ -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'),
];
});
}

View File

@ -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];