mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-12 22:22:32 +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',
|
'product_key',
|
||||||
'notes',
|
'notes',
|
||||||
'cost',
|
'cost',
|
||||||
|
'custom_value1',
|
||||||
|
'custom_value2',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,6 +61,8 @@ class Product extends EntityModel
|
|||||||
'product|item' => 'product_key',
|
'product|item' => 'product_key',
|
||||||
'notes|description|details' => 'notes',
|
'notes|description|details' => 'notes',
|
||||||
'cost|amount|price' => 'cost',
|
'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'),
|
'product_key' => $this->getString($data, 'product_key'),
|
||||||
'notes' => $this->getString($data, 'notes'),
|
'notes' => $this->getString($data, 'notes'),
|
||||||
'cost' => $this->getFloat($data, 'cost'),
|
'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);
|
$this->checkForFile($fileName);
|
||||||
$file = file_get_contents($fileName);
|
$file = file_get_contents($fileName);
|
||||||
$data = array_map("str_getcsv", preg_split('/\r*\n+|\r+/', $file));
|
$data = array_map("str_getcsv", preg_split('/\r*\n+|\r+/', $file));
|
||||||
dd($data);
|
|
||||||
if (count($data) > 0) {
|
if (count($data) > 0) {
|
||||||
$headers = $data[0];
|
$headers = $data[0];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user