implemented adding stock items to documents
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -29,14 +29,24 @@
|
||||
}
|
||||
|
||||
function itemSelected(item){
|
||||
let unit_price = null;
|
||||
let description = '';
|
||||
for (let prop of item.properties) {
|
||||
if (prop.name.toLowerCase().indexOf(t('price').toLowerCase())>-1){
|
||||
unit_price = 100*prop.value.replace(',','.');
|
||||
} else {
|
||||
description += `* ${prop.name}: ${prop.value}\n`;
|
||||
}
|
||||
}
|
||||
|
||||
select({
|
||||
item_code : item.code,
|
||||
title : item.name,
|
||||
description : item.description.source,
|
||||
description : description,
|
||||
amount : 1,
|
||||
unit : item.unit,
|
||||
unit_price : item.unit_price,
|
||||
tax : item.tax
|
||||
unit : t('pieces'),
|
||||
unit_price : unit_price,
|
||||
tax : 0
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user