-
Notifications
You must be signed in to change notification settings - Fork 0
/
S4PrinterData.py
31 lines (27 loc) · 1.06 KB
/
S4PrinterData.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from .Util import Util
class S4PrinterData(object):
def __init__(self, trama):
if (trama != None):
if (len(trama) > 0):
self._allMeansOfPayment = ""
try:
_arrayParameter=str(trama[1:-1]).split(chr(0X0A))
if (len(_arrayParameter) > 1):
_numberOfMeansOfPayment = len(_arrayParameter) - 1
_iteration = 0
_valor = 0
while (_iteration < _numberOfMeansOfPayment):
_cadena = _arrayParameter[_iteration]
if (_iteration == 0):
_valor = str(_cadena[2:])
else:
_valor = str(_cadena)
self._allMeansOfPayment += "\nMedio de Pago " + str(_iteration+1) + " : " + str(Util().DoValueDouble(_valor))
_iteration+=1
self._setAllMeansOfPayment(self._allMeansOfPayment)
except (ValueError):
return
def AllMeansOfPayment(self):
return self._allMeansOfPayment
def _setAllMeansOfPayment(self, pAllMeansOfPayment):
self._allMeansOfPayment = pAllMeansOfPayment