Fix: Product units

This commit is contained in:
Amritanshu
2019-08-21 14:27:11 +05:30
parent fd1111f378
commit 5603c5d8fb
3 changed files with 5 additions and 7 deletions

View File

@ -216,8 +216,7 @@ def show_list_sale(request):
products.append( products.append(
{ {
"id": item.id, "id": item.id,
"name": "H H " + item.name, "name": "H H " + item.full_name,
"units": item.units,
"saleCategory": { "saleCategory": {
"id": item.sale_category_id, "id": item.sale_category_id,
"name": item.sale_category.name, "name": item.sale_category.name,

View File

@ -113,8 +113,7 @@ def voucher_info(item):
"sortOrder": i.sort_order, "sortOrder": i.sort_order,
"product": { "product": {
"id": i.product_id, "id": i.product_id,
"name": i.product.name, "name": i.product.full_name,
"units": i.product.units,
"menuCategory": { "menuCategory": {
"id": i.product.menu_category_id, "id": i.product.menu_category_id,
"name": i.product.menu_category.name, "name": i.product.menu_category.name,

View File

@ -55,7 +55,7 @@ export class BillService {
productId: i.product.id, productId: i.product.id,
isHappyHour: i.isHappyHour, isHappyHour: i.isHappyHour,
isPrinted: true, isPrinted: true,
info: `${i.product.name} (${i.product.units}) @ ${i.price} - ${math.round(i.discount * 100, 2)}%`, info: `${i.product.name} @ ${i.price} - ${math.round(i.discount * 100, 2)}%`,
price: i.price, price: i.price,
quantity: i.quantity, quantity: i.quantity,
discount: i.discount, discount: i.discount,
@ -83,7 +83,7 @@ export class BillService {
product: product, product: product,
productId: product.id, productId: product.id,
isHappyHour: product.hasHappyHour, isHappyHour: product.hasHappyHour,
info: `${product.name} (${product.units}) @ ${product.price} - ${0}%`, info: `${product.name} @ ${product.price} - ${0}%`,
price: product.price, price: product.price,
quantity: 1, quantity: 1,
discount: 0, discount: 0,
@ -159,7 +159,7 @@ export class BillService {
this.data.forEach(x => { this.data.forEach(x => {
if (!x.isKot) { if (!x.isKot) {
x.discount = discounts.find(d => d.id === x.product.saleCategory.id).discount / 100; x.discount = discounts.find(d => d.id === x.product.saleCategory.id).discount / 100;
x.info = `${x.product.name} (${x.product.units}) @ ${x.price} - ${math.round(x.discount * 100, 2)}%`; x.info = `${x.product.name} @ ${x.price} - ${math.round(x.discount * 100, 2)}%`;
} }
}); });
this.dataObs.next(this.data); this.dataObs.next(this.data);