31 |
if (s and s[0] != 'n' and s[0] != 'N'): |
if (s and s[0] != 'n' and s[0] != 'N'): |
32 |
r = 1 |
r = 1 |
33 |
return r |
return r |
34 |
|
|
35 |
|
|
36 |
# hace que rollback funcione como uno en general quiere (por |
# hace que rollback funcione como uno en general quiere (por |
37 |
# ejemplo, que haga rollback) |
# ejemplo, que haga rollback) |
114 |
form.setFocus(entry) |
form.setFocus(entry) |
115 |
|
|
116 |
# 'imprime' a travez de un report |
# 'imprime' a travez de un report |
117 |
def pleasePrint (form, printer, docType, report, args, command="lpr"): |
def pleasePrint (form, docType, clientreport, args, command="lpr"): |
118 |
from os import system, remove |
from os import system, remove |
119 |
from tempfile import mktemp |
from tempfile import mktemp |
120 |
|
|
123 |
# argStr= " ".join (map (lambda key: "%s=%s" % (key, args[key]), args.keys ())) |
# argStr= " ".join (map (lambda key: "%s=%s" % (key, args[key]), args.keys ())) |
124 |
argStr= " ".join (args) |
argStr= " ".join (args) |
125 |
system ("grcvs -D file --filter csv -d "+fileName+" ../report/"+report+".grd "+argStr) |
system ("grcvs -D file --filter csv -d "+fileName+" ../report/"+report+".grd "+argStr) |
126 |
#system ("../print/print.py "+' '.join([printer, docType, fileName])+" | " + command) |
system ("../print/print.py "+' '.join([docType, fileName])+" | " + command) |
|
system ("../print/print.py "+' '.join([printer, docType, fileName])+" > /tmp/invoice.txt ") |
|
127 |
while form.genericBox ('Verifique que se haya impreso bien', ['Listo', 'Reintentar'])==2: |
while form.genericBox ('Verifique que se haya impreso bien', ['Listo', 'Reintentar'])==2: |
128 |
#system ("../print/print.py "+' '.join([printer, docType, fileName])+" | " + command) |
system ("../print/print.py "+' '.join([docType, fileName])+" | " + command) |
|
system ("../print/print.py "+' '.join([printer, docType, fileName])+" > /tmp/invoice.txt ") |
|
129 |
remove (fileName) |
remove (fileName) |
130 |
|
|
131 |
|
|
132 |
def previewPrint (table): |
def previewPrint (table): |
133 |
from os import system, remove |
from os import system, remove |
134 |
from tempfile import mktemp |
from tempfile import mktemp |
135 |
|
|
136 |
file= mktemp (".txt") |
file= mktemp (".txt") |
|
#filePS = mktemp (".ps") |
|
137 |
fileOut = open(file,'w') |
fileOut = open(file,'w') |
138 |
for line in table: |
for line in table: |
139 |
fileOut.write(line+"\n") |
fileOut.write(line+"\n") |
140 |
fileOut.close() |
fileOut.close() |
141 |
|
|
142 |
system(gConfig('PrintCommand') % (file)) |
system(gConfig('PrintCommand') % (file)) |
|
#system ("enscript --header='%W|Página $% de $=' -o "+filePS+" "+file) |
|
|
|
|
|
#system ("gv "+filePS) |
|
143 |
|
|
144 |
remove (file) |
remove (file) |
|
#remove (filePS) |
|
145 |
|
|
146 |
def runFormWCallback (formFile, args, callbackFunction): |
def runFormWCallback (formFile, args, callbackFunction): |
147 |
runForm (formFile, args.update ({ 'callback': callbackFunction })) |
runForm (formFile, args.update ({ 'callback': callbackFunction })) |
157 |
#4 = 'Monotributo' |
#4 = 'Monotributo' |
158 |
#5 = 'Consumidor Final' |
#5 = 'Consumidor Final' |
159 |
result = 'C' |
result = 'C' |
160 |
|
|
161 |
if str(providerIvaTaxProfile).strip() == '1': |
if str(providerIvaTaxProfile).strip() == '1': |
162 |
if str(clientIvaTaxProfile) in ('1','2'): |
if str(clientIvaTaxProfile) in ('1','2'): |
163 |
result = 'A' |
result = 'A' |
164 |
elif str(clientIvaTaxProfile) in ('3','4','5'): |
elif str(clientIvaTaxProfile) in ('3','4','5'): |
165 |
result = 'B' |
result = 'B' |
166 |
return result |
return result |
|
|
|