-
Notifications
You must be signed in to change notification settings - Fork 0
/
S2PrinterData.py
75 lines (58 loc) · 2.06 KB
/
S2PrinterData.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import datetime
from .Util import Util
class S2PrinterData(object):
_subTotalBases = 0
_subTotalTax = 0
_dataDummy = ""
_amountPayable = 0
_numberPaymentsMade = 0
_typeDocument = 0
_quantityArticles = 0
_condition = 0
def __init__(self, trama):
if (trama != None):
if (len(trama) > 69):
try:
_arrayParameter = str(trama[1:-1]).split(chr(0X0A))
if (len(_arrayParameter) > 1):
self._setSubTotalBases(Util().DoValueDouble(_arrayParameter[0][3:]))
self._setSubTotalTax(Util().DoValueDouble(_arrayParameter[1][1:]))
self._setDataDummy(_arrayParameter[2][1:])
self._setQuantityArticles(int(_arrayParameter[3]))
self._setAmountPayable(Util().DoValueDouble(_arrayParameter[4][1:]))
self._setNumberPaymentsMade(int(_arrayParameter[5]))
self._setTypeDocument(int(_arrayParameter[6]))
except (ValueError):
return
def SubTotalBases(self):
return self._subTotalBases
def SubTotalTax(self):
return self._subTotalTax
def DataDummy(self):
return self._dataDummy
def AmountPayable(self):
return self._amountPayable
def NumberPaymentsMade(self):
return self._numberPaymentsMade
def QuantityArticles(self):
return self._quantityArticles
def TypeDocument(self):
return self._typeDocument
def Condition(self):
return self._condition
def _setQuantityArticles(self, value):
self._quantityArticles = value
def _setTypeDocument(self, type):
self._typeDocument = type
def _setCondition(self, condition):
self._condition = condition
def _setSubTotalBases(self, subTotalBases):
self._subTotalBases = subTotalBases
def _setSubTotalTax(self, subTotalTax):
self._subTotalTax = subTotalTax
def _setDataDummy(self, dataDummy):
self._dataDummy = dataDummy
def _setAmountPayable(self, amountPayable):
self._amountPayable = amountPayable
def _setNumberPaymentsMade(self, numberPaymentsMade):
self._numberPaymentsMade = numberPaymentsMade