[POS-commit] r1973 - stoqdrivers/trunk/stoqdrivers/devices/printers/perto

Henrique Romano henrique at async.com.br
Fri Dec 23 12:54:13 BRST 2005


Author: henrique
Date: Fri Dec 23 12:54:12 2005
New Revision: 1973

Modified:
   stoqdrivers/trunk/stoqdrivers/devices/printers/perto/Pay2023.py
Log:
Fixing two bugs: 1) self._customer_* must be defined in class 
instantiation time and 2) parse_value must consider values
greater than 1000 (these values are in the format 'XX.XXX,XX')



Modified: stoqdrivers/trunk/stoqdrivers/devices/printers/perto/Pay2023.py
==============================================================================
--- stoqdrivers/trunk/stoqdrivers/devices/printers/perto/Pay2023.py	(original)
+++ stoqdrivers/trunk/stoqdrivers/devices/printers/perto/Pay2023.py	Fri Dec 23 12:54:12 2005
@@ -119,6 +119,9 @@
         SerialBase.__init__(self, device, baudrate=baudrate, bytesize=bytesize,
                             parity=parity, stopbits=stopbits)
         BaseChequePrinter.__init__(self)
+        self._customer_name = ''
+        self._customer_document = ''
+        self._customer_address = ''
 
     #
     # Helper methods
@@ -212,6 +215,8 @@
         format used in the FISCnet protocol) and convert it to the
         Python's float format.
         """
+        if '.' in value:
+            value = value.replace(".", '')
         if ',' in value:
             value = value.replace(',', '.')
         return float(value)


More information about the POS-commit mailing list