[POS-commit] r3315 -
stoqdrivers/trunk/stoqdrivers/devices/printers/daruma
Henrique Romano
henrique at async.com.br
Mon Apr 24 16:04:55 BRT 2006
Author: henrique
Date: Mon Apr 24 16:04:55 2006
New Revision: 3315
Modified:
stoqdrivers/trunk/stoqdrivers/devices/printers/daruma/FS345.py
Log:
Minor change: separating helper methods from interface implementation
Modified: stoqdrivers/trunk/stoqdrivers/devices/printers/daruma/FS345.py
==============================================================================
--- stoqdrivers/trunk/stoqdrivers/devices/printers/daruma/FS345.py (original)
+++ stoqdrivers/trunk/stoqdrivers/devices/printers/daruma/FS345.py Mon Apr 24 16:04:55 2006
@@ -305,6 +305,18 @@
def _get_coupon_number(self):
return int(self._get_totalizers()[8:14])
+ def _add_payment(self, payment_method, value, description=''):
+ pm = self._consts.get_constant_value(payment_method)
+ rv = self.send_command(CMD_DESCRIBE_PAYMENT_FORM,
+ '%c%012d%s\xff' % (pm, int(float(value) * 1e2),
+ description[:48]))
+ return float(rv) / 1e2
+
+ def _add_voucher(self, type, value):
+ data = "%s1%s%012d\xff" % (type, "0" * 12, # padding
+ int(float(value) * 1e2))
+ self.send_command(CMD_OPEN_VOUCHER, data)
+
#
# API implementation
#
@@ -345,13 +357,6 @@
def coupon_cancel_item(self, item_id):
self.send_command(CMD_CANCEL_ITEM, "%03d" % item_id)
- def _add_payment(self, payment_method, value, description=''):
- pm = self._consts.get_constant_value(payment_method)
- rv = self.send_command(CMD_DESCRIBE_PAYMENT_FORM,
- '%c%012d%s\xff' % (pm, int(float(value) * 1e2),
- description[:48]))
- return float(rv) / 1e2
-
def coupon_add_payment(self, payment_method, value, description=''):
self._check_status()
self._verify_coupon_open()
@@ -427,11 +432,6 @@
date = time.strftime('%d%m%y%H%M%S', time.localtime())
self.send_command(CMD_REDUCE_Z, date)
- def _add_voucher(self, type, value):
- data = "%s1%s%012d\xff" % (type, "0" * 12, # padding
- int(float(value) * 1e2))
- self.send_command(CMD_OPEN_VOUCHER, data)
-
def till_add_cash(self, value):
self._add_voucher(CASH_IN_TYPE, value)
self._add_payment(MONEY_PM, value, '')
More information about the POS-commit
mailing list