From 4745099706649aff2ca8296be7566657be47873e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Fri, 28 Mar 2014 14:44:01 +0100 Subject: [PATCH] [FIX] hw_escops, point_of_sale: backporting fixes from the pos-restaurant branch bzr revid: fva@openerp.com-20140328134401-ao85rr8b29nqg626 --- addons/hw_escpos/controllers/main.py | 1 + addons/hw_escpos/escpos/constants.py | 2 ++ addons/hw_escpos/escpos/escpos.py | 9 +++++++-- addons/point_of_sale/static/src/xml/pos.xml | 4 ++-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/addons/hw_escpos/controllers/main.py b/addons/hw_escpos/controllers/main.py index 9e5656e..b6c302a 100644 --- a/addons/hw_escpos/controllers/main.py +++ b/addons/hw_escpos/controllers/main.py @@ -288,6 +288,7 @@ class EscposDriver(Thread): +' '+ str(receipt['date']['hour']).zfill(2) +':'+ str(receipt['date']['minute']).zfill(2) ) + driver = EscposDriver() driver.push_task('printstatus') diff --git a/addons/hw_escpos/escpos/constants.py b/addons/hw_escpos/escpos/constants.py index 6f0be0b..7b9d92c 100644 --- a/addons/hw_escpos/escpos/constants.py +++ b/addons/hw_escpos/escpos/constants.py @@ -33,6 +33,8 @@ TXT_FONT_B = '\x1b\x4d\x01' # Font type B TXT_ALIGN_LT = '\x1b\x61\x00' # Left justification TXT_ALIGN_CT = '\x1b\x61\x01' # Centering TXT_ALIGN_RT = '\x1b\x61\x02' # Right justification +TXT_COLOR_BLACK = '\x1b\x72\x00' # Default Color +TXT_COLOR_RED = '\x1b\x72\x01' # Alternative Color ( Usually Red ) # Text Encoding diff --git a/addons/hw_escpos/escpos/escpos.py b/addons/hw_escpos/escpos/escpos.py index 84b52f9..8b6a94c 100644 --- a/addons/hw_escpos/escpos/escpos.py +++ b/addons/hw_escpos/escpos/escpos.py @@ -60,6 +60,7 @@ class StyleStack: 'tabwidth': 2, 'bullet': ' - ', 'line-ratio':0.5, + 'color': 'black', 'value-decimals': 2, 'value-symbol': '', @@ -107,7 +108,11 @@ class StyleStack: 'double-height': TXT_2HEIGHT, 'double-width': TXT_2WIDTH, 'double': TXT_DOUBLE, - } + }, + 'color': { + 'black': TXT_COLOR_BLACK, + 'red': TXT_COLOR_RED, + }, } self.push(self.defaults) @@ -595,7 +600,7 @@ class Escpos: width=stylestack.get('value-width'), decimals_separator=stylestack.get('value-decimals-separator'), thousands_separator=stylestack.get('value-thousands-separator'), - autoint=(stylestack.get('autoint') == 'on'), + autoint=(stylestack.get('value-autoint') == 'on'), symbol=stylestack.get('value-symbol'), position=stylestack.get('value-symbol-position') )) diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index baea81b..02c6374 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -400,7 +400,7 @@ -------- - Subtotal receipt.subtotal + Subtotal @@ -411,7 +411,7 @@ - ------- + --------
        TOTAL
-- 1.7.10.4