Fix: Product sale report would mix different product versions as it was checking the product id and not version id
Feature: Cannot add na product to bill
This commit is contained in:
parent
1a4e51051c
commit
a174f6b847
@ -22,3 +22,7 @@ class SaleCategory(Base):
|
||||
self.discount_limit = discount_limit if discount_limit is not None else 1
|
||||
self.tax_id = tax_id
|
||||
self.id = id_
|
||||
|
||||
@classmethod
|
||||
def cash_charges(cls):
|
||||
return uuid.UUID("f3d6441a-7018-4454-9704-6b99db9333c7")
|
||||
|
@ -179,13 +179,11 @@ def for_product(
|
||||
"maximum": item.maximum,
|
||||
"isActive": item.is_active,
|
||||
"modifiers": [
|
||||
{"id": m.id, "name": m.name, "price": m.price}
|
||||
for m in item.modifiers
|
||||
if m.is_active == True # noqa: E712
|
||||
{"id": m.id, "name": m.name, "price": m.price} for m in item.modifiers if m.is_active is True
|
||||
],
|
||||
}
|
||||
for item in product.modifier_categories
|
||||
if item.is_active == True
|
||||
if item.is_active is True
|
||||
]
|
||||
|
||||
|
||||
|
@ -51,7 +51,7 @@ def product_sale_report(s: date, f: date, db: Session):
|
||||
day = func.date_trunc("day", Voucher.date - timedelta(minutes=settings.NEW_DAY_OFFSET_MINUTES)).label("day")
|
||||
list_ = db.execute(
|
||||
select(
|
||||
ProductVersion.product_id,
|
||||
ProductVersion.id,
|
||||
ProductVersion.full_name,
|
||||
Voucher.voucher_type,
|
||||
Inventory.is_happy_hour,
|
||||
@ -77,7 +77,7 @@ def product_sale_report(s: date, f: date, db: Session):
|
||||
.group_by(
|
||||
SaleCategory.name,
|
||||
MenuCategory.name,
|
||||
ProductVersion.product_id,
|
||||
ProductVersion.id,
|
||||
ProductVersion.full_name,
|
||||
Voucher.voucher_type,
|
||||
Inventory.is_happy_hour,
|
||||
|
@ -22,6 +22,9 @@ export class ProductsComponent implements OnInit {
|
||||
}
|
||||
|
||||
addProduct(product: Product): void {
|
||||
if (product.isNotAvailable) {
|
||||
return;
|
||||
}
|
||||
this.bs.addProduct(product, 1, 0);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user