fixed item price (sale/purchase) price

This commit is contained in:
Cüneyt Şentürk 2021-01-13 14:11:23 +03:00
parent 781ae067e9
commit 1e1d72d567

View File

@ -118,6 +118,11 @@ export default {
default: 'sale', default: 'sale',
description: 'Show item price' description: 'Show item price'
}, },
price: {
type: String,
default: 'sale_price',
description: 'Show item price'
},
items: { items: {
type: Array, type: Array,
default: () => [], default: () => [],
@ -243,7 +248,7 @@ export default {
id: item.id, id: item.id,
name: (item.title) ? item.title : (item.display_name) ? item.display_name : item.name, name: (item.title) ? item.title : (item.display_name) ? item.display_name : item.name,
description: (item.description) ? item.description : '', description: (item.description) ? item.description : '',
price: (item.price) ? item.price : (this.type == 'sale') ? item.sale_price : item.purchase_price, price: (item.price) ? item.price : (this.price == 'purchase_price') ? item.purchase_price : item.sale_price,
tax_ids: (item.tax_ids) ? item.tax_ids : [], tax_ids: (item.tax_ids) ? item.tax_ids : [],
}); });
}, this); }, this);
@ -274,7 +279,7 @@ export default {
id: item.id, id: item.id,
name: (item.title) ? item.title : (item.display_name) ? item.display_name : item.name, name: (item.title) ? item.title : (item.display_name) ? item.display_name : item.name,
description: (item.description) ? item.description : '', description: (item.description) ? item.description : '',
price: (item.price) ? item.price : (this.type == 'sale') ? item.sale_price : item.purchase_price, price: (item.price) ? item.price : (this.price == 'purchase_price') ? item.purchase_price : item.sale_price,
tax_ids: (item.tax_ids) ? item.tax_ids : [], tax_ids: (item.tax_ids) ? item.tax_ids : [],
}); });
}, this); }, this);
@ -430,7 +435,7 @@ export default {
id: item.id, id: item.id,
name: (item.title) ? item.title : (item.display_name) ? item.display_name : item.name, name: (item.title) ? item.title : (item.display_name) ? item.display_name : item.name,
description: (item.description) ? item.description : '', description: (item.description) ? item.description : '',
price: (item.price) ? item.price : (this.type == 'sale') ? item.sale_price : item.purchase_price, price: (item.price) ? item.price : (this.price == 'purchase_price') ? item.purchase_price : item.sale_price,
tax_ids: (item.tax_ids) ? item.tax_ids : [], tax_ids: (item.tax_ids) ? item.tax_ids : [],
}); });