Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f637f01954 | |||
| 236c746e1c | |||
| a4db3b24f0 | |||
| 9f4ec3697c | |||
| 9fe84800a7 |
@ -1 +1 @@
|
||||
__version__ = "10.3.1"
|
||||
__version__ = "10.3.3"
|
||||
|
||||
@ -62,12 +62,14 @@ def print_bill(voucher_id: uuid.UUID, db: Session):
|
||||
for i in [it for it in items_dict.values() if it.quantity != 0]:
|
||||
get_tax_item(i.tax.id, i.tax.name, i.tax_amount, tax)
|
||||
data = design_bill(voucher, list(items_dict.values()), list(tax.values()), db)
|
||||
redis: ArqRedis = asyncio.run(create_pool(redis_settings))
|
||||
asyncio.run(
|
||||
loop = asyncio.new_event_loop()
|
||||
redis: ArqRedis = loop.run_until_complete(create_pool(redis_settings))
|
||||
loop.run_until_complete(
|
||||
redis.enqueue_job(
|
||||
"sent_to_printer", data, printer.address, printer.cut_code, _queue_name=f"barker:print:{printer.name}"
|
||||
)
|
||||
)
|
||||
loop.close()
|
||||
|
||||
|
||||
def get_tax_item(
|
||||
|
||||
@ -28,12 +28,14 @@ def print_cashier_report(report: CashierReport, device_id: uuid.UUID, db: Sessio
|
||||
.where(SectionPrinter.sale_category_id == None) # noqa: E711
|
||||
).scalar_one()
|
||||
|
||||
redis: ArqRedis = asyncio.run(create_pool(redis_settings))
|
||||
asyncio.run(
|
||||
loop = asyncio.new_event_loop()
|
||||
redis: ArqRedis = loop.run_until_complete(create_pool(redis_settings))
|
||||
loop.run_until_complete(
|
||||
redis.enqueue_job(
|
||||
"sent_to_printer", data, printer.address, printer.cut_code, _queue_name=f"barker:print:{printer.name}"
|
||||
)
|
||||
)
|
||||
loop.close()
|
||||
|
||||
|
||||
def design_cashier_report(report: CashierReport):
|
||||
|
||||
@ -25,12 +25,14 @@ def print_discount_report(report: DiscountReport, device_id: uuid.UUID, db: Sess
|
||||
.where(SectionPrinter.sale_category_id == None) # noqa: E711
|
||||
).scalar_one()
|
||||
|
||||
redis: ArqRedis = asyncio.run(create_pool(redis_settings))
|
||||
asyncio.run(
|
||||
loop = asyncio.new_event_loop()
|
||||
redis: ArqRedis = loop.run_until_complete(create_pool(redis_settings))
|
||||
loop.run_until_complete(
|
||||
redis.enqueue_job(
|
||||
"sent_to_printer", data, printer.address, printer.cut_code, _queue_name=f"barker:print:{printer.name}"
|
||||
)
|
||||
)
|
||||
loop.close()
|
||||
|
||||
|
||||
def design_discount_report(report: DiscountReport):
|
||||
|
||||
@ -104,13 +104,14 @@ def print_kot(voucher_id: uuid.UUID, db: Session):
|
||||
if key not in my_hash:
|
||||
my_hash[key] = (printer, [])
|
||||
my_hash[key][1].append(item)
|
||||
redis: ArqRedis = asyncio.run(create_pool(redis_settings))
|
||||
loop = asyncio.new_event_loop()
|
||||
redis: ArqRedis = loop.run_until_complete(create_pool(redis_settings))
|
||||
for key, value in my_hash.items():
|
||||
printer_id, copies = key
|
||||
printer, items = value
|
||||
for c in range(int(copies)):
|
||||
data = design_kot(voucher, kot, items, c, db)
|
||||
asyncio.run(
|
||||
loop.run_until_complete(
|
||||
redis.enqueue_job(
|
||||
"sent_to_printer",
|
||||
data,
|
||||
@ -119,3 +120,4 @@ def print_kot(voucher_id: uuid.UUID, db: Session):
|
||||
_queue_name=f"barker:print:{printer.name}",
|
||||
)
|
||||
)
|
||||
loop.close()
|
||||
|
||||
@ -26,12 +26,14 @@ def print_product_sale_report(report, device_id: uuid.UUID, db: Session):
|
||||
.where(SectionPrinter.sale_category_id == None) # noqa: E711
|
||||
).scalar_one()
|
||||
|
||||
redis: ArqRedis = asyncio.run(create_pool(redis_settings))
|
||||
asyncio.run(
|
||||
loop = asyncio.new_event_loop()
|
||||
redis: ArqRedis = loop.run_until_complete(create_pool(redis_settings))
|
||||
loop.run_until_complete(
|
||||
redis.enqueue_job(
|
||||
"sent_to_printer", data, printer.address, printer.cut_code, _queue_name=f"barker:print:{printer.name}"
|
||||
)
|
||||
)
|
||||
loop.close()
|
||||
|
||||
|
||||
def design_product_sale_report(report):
|
||||
|
||||
@ -28,12 +28,14 @@ def print_sale_report(report: SaleReport, device_id: uuid.UUID, db: Session):
|
||||
.where(SectionPrinter.sale_category_id == None) # noqa: E711
|
||||
).scalar_one()
|
||||
|
||||
redis: ArqRedis = asyncio.run(create_pool(redis_settings))
|
||||
asyncio.run(
|
||||
loop = asyncio.new_event_loop()
|
||||
redis: ArqRedis = loop.run_until_complete(create_pool(redis_settings))
|
||||
loop.run_until_complete(
|
||||
redis.enqueue_job(
|
||||
"sent_to_printer", data, printer.address, printer.cut_code, _queue_name=f"barker:print:{printer.name}"
|
||||
)
|
||||
)
|
||||
loop.close()
|
||||
|
||||
|
||||
def design_sale_report(report: SaleReport):
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "barker"
|
||||
version = "10.3.1"
|
||||
version = "10.3.3"
|
||||
description = "Point of Sale for a restaurant"
|
||||
authors = ["tanshu <git@tanshu.com>"]
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "bookie",
|
||||
"version": "10.3.1",
|
||||
"version": "10.3.3",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"start": "ng serve",
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
export const environment = {
|
||||
production: true,
|
||||
ACCESS_TOKEN_REFRESH_MINUTES: 10, // refresh token 10 minutes before expiry
|
||||
version: '10.3.1',
|
||||
version: '10.3.3',
|
||||
};
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
export const environment = {
|
||||
production: false,
|
||||
ACCESS_TOKEN_REFRESH_MINUTES: 10, // refresh token 10 minutes before expiry
|
||||
version: '10.3.1',
|
||||
version: '10.3.3',
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@ -13,7 +13,7 @@ RUN mv /node_modules /app/bookie/ \
|
||||
&& /app/bookie/node_modules/.bin/ng build
|
||||
|
||||
|
||||
FROM python:3.9
|
||||
FROM python:3.10
|
||||
LABEL maintainer="Amritanshu <docker@tanshu.com>"
|
||||
|
||||
COPY pyproject.toml /app/pyproject.toml
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
[Unit]
|
||||
Description=Frank container service
|
||||
After=docker.service knox-redis-tunnel.service
|
||||
Wants=network-online.target docker.socket knox-redis-tunnel.service
|
||||
Requires=docker.socket knox-redis-tunnel.service
|
||||
After=docker.service beacon-redis-tunnel.service
|
||||
Wants=network-online.target docker.socket beacon-redis-tunnel.service
|
||||
Requires=docker.socket beacon-redis-tunnel.service
|
||||
PartOf=beacon-redis-tunnel.service
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "frank"
|
||||
version = "10.3.1"
|
||||
version = "10.3.3"
|
||||
description = "Point of Sale for a restaurant"
|
||||
authors = ["tanshu <git@tanshu.com>"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user