Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f637f01954 | |||
| 236c746e1c |
@ -1 +1 @@
|
||||
__version__ = "10.3.2"
|
||||
__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.2"
|
||||
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.2",
|
||||
"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.2',
|
||||
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.2',
|
||||
version: '10.3.3',
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "frank"
|
||||
version = "10.3.2"
|
||||
version = "10.3.3"
|
||||
description = "Point of Sale for a restaurant"
|
||||
authors = ["tanshu <git@tanshu.com>"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user