From 22de4f762498dfe93f91fc5f15a2a1120689fb10 Mon Sep 17 00:00:00 2001 From: tanshu Date: Tue, 15 Dec 2020 22:15:51 +0530 Subject: [PATCH] Fix: Reports were not working as they were not adapted to the new Enums Fix: The docker image borked on printing as it did not have the en_IN locale Fix: Angular errored as it needed typescript < 4.1.0 Fix: chd yml had a typo in host name --- barker/barker/routers/reports/beer_consumption_report.py | 6 +++--- barker/barker/routers/reports/discount_report.py | 2 +- barker/barker/routers/reports/sale_report.py | 2 +- barker/barker/routers/reports/tax_report.py | 2 +- bookie/package.json | 2 +- docker/app/Dockerfile | 9 +++++++++ docker/vars/chd.yml | 2 +- 7 files changed, 17 insertions(+), 8 deletions(-) diff --git a/barker/barker/routers/reports/beer_consumption_report.py b/barker/barker/routers/reports/beer_consumption_report.py index 0408f00..d8a3a12 100644 --- a/barker/barker/routers/reports/beer_consumption_report.py +++ b/barker/barker/routers/reports/beer_consumption_report.py @@ -59,9 +59,9 @@ def beer_consumption( ), Voucher.voucher_type.in_( [ - VoucherType.REGULAR_BILL.value, - VoucherType.NO_CHARGE.value, - VoucherType.STAFF.value, + VoucherType.REGULAR_BILL, + VoucherType.NO_CHARGE, + VoucherType.STAFF, ] ), ) diff --git a/barker/barker/routers/reports/discount_report.py b/barker/barker/routers/reports/discount_report.py index a02645f..2318020 100644 --- a/barker/barker/routers/reports/discount_report.py +++ b/barker/barker/routers/reports/discount_report.py @@ -73,7 +73,7 @@ def get_discount_report(s: date, f: date, db: Session) -> List[DiscountReportIte ProductVersion.valid_till == None, # noqa: E711 ProductVersion.valid_till >= day, ), - Voucher.voucher_type.in_([VoucherType.REGULAR_BILL.value, VoucherType.KOT.value]), + Voucher.voucher_type.in_([VoucherType.REGULAR_BILL, VoucherType.KOT]), ) .group_by(SaleCategory.name) .order_by(SaleCategory.name) diff --git a/barker/barker/routers/reports/sale_report.py b/barker/barker/routers/reports/sale_report.py index 9e3170e..a781f61 100644 --- a/barker/barker/routers/reports/sale_report.py +++ b/barker/barker/routers/reports/sale_report.py @@ -72,7 +72,7 @@ def get_sale(s: date, f: date, db: Session) -> List[SaleReportItem]: .filter( Voucher.date >= start_date, Voucher.date <= finish_date, - Voucher.voucher_type == VoucherType.REGULAR_BILL.value, + Voucher.voucher_type == VoucherType.REGULAR_BILL, or_( ProductVersion.valid_from == None, # noqa: E711 ProductVersion.valid_from <= day, diff --git a/barker/barker/routers/reports/tax_report.py b/barker/barker/routers/reports/tax_report.py index c548aa3..8942dac 100644 --- a/barker/barker/routers/reports/tax_report.py +++ b/barker/barker/routers/reports/tax_report.py @@ -64,7 +64,7 @@ def get_tax(s: date, f: date, db: Session) -> List[TaxReportItem]: .filter( Voucher.date >= start_date, Voucher.date <= finish_date, - Voucher.voucher_type == VoucherType.REGULAR_BILL.value, + Voucher.voucher_type == VoucherType.REGULAR_BILL, ) .group_by(Tax.name, Inventory.tax_rate) .order_by(Tax.name, Inventory.tax_rate) diff --git a/bookie/package.json b/bookie/package.json index c9880c6..2426d30 100644 --- a/bookie/package.json +++ b/bookie/package.json @@ -64,7 +64,7 @@ "prettier": "^2.2.1", "standard-version": "^9.0.0", "ts-node": "^9.1.1", - "typescript": "^4.1.3" + "typescript": "~4.0.5" }, "husky": { "hooks": { diff --git a/docker/app/Dockerfile b/docker/app/Dockerfile index 8d702e9..51c929b 100644 --- a/docker/app/Dockerfile +++ b/docker/app/Dockerfile @@ -7,6 +7,15 @@ RUN npm install --unsafe-perm --legacy-peer-deps && /app/bookie/node_modules/.bi FROM python:latest LABEL maintainer="Amritanshu " + +RUN apt-get update && \ + apt-get install -y locales && \ + sed --in-place --expression='s/# en_IN UTF-8/en_IN UTF-8/' /etc/locale.gen && \ + dpkg-reconfigure --frontend=noninteractive locales + +ENV LANG en_IN +ENV LC_ALL en_IN + COPY --from=builder /app/barker /app COPY --from=builder /app/frontend /app/frontend WORKDIR /app diff --git a/docker/vars/chd.yml b/docker/vars/chd.yml index 2418b1b..1f3fbdc 100644 --- a/docker/vars/chd.yml +++ b/docker/vars/chd.yml @@ -1,5 +1,5 @@ --- -http_host: "knox.greatbear.id" +http_host: "knox.greatbear.in" http_conf: "knox.greatbear.in.conf" host_port: "8337" host_directory: "barker-chd"