113 |
</eq> |
</eq> |
114 |
<eq> |
<eq> |
115 |
<cfield name="own_document.own_document_type"/> |
<cfield name="own_document.own_document_type"/> |
116 |
<cconst value="1"/> |
<cconst value="1"/> |
117 |
</eq> |
</eq> |
118 |
</and> |
</and> |
119 |
</condition> |
</condition> |
257 |
]]></trigger> |
]]></trigger> |
258 |
|
|
259 |
<!-- buttons triggers --> |
<!-- buttons triggers --> |
260 |
|
<trigger name="printTrigger" type="NAMED"><![CDATA[ |
261 |
|
from os import system |
262 |
|
from tempfile import mktemp |
263 |
|
|
264 |
|
callTrigger ('commitTrigger') |
265 |
|
fileName= mktemp (".html") |
266 |
|
print fileName |
267 |
|
print "exec'ing grcvs -D file --filter html -d "+fileName+" ../report/serviceInvoice.grd id="+str(ownDocumentBlock.idEntry) |
268 |
|
system ("grcvs -D file --filter html -d "+fileName+" ../report/serviceInvoice.grd id="+str(ownDocumentBlock.idEntry)) |
269 |
|
system ("galeon "+fileName) |
270 |
|
callTrigger('rollbackTrigger') |
271 |
|
]]></trigger> |
272 |
|
|
273 |
<trigger name="quitTrigger" type="NAMED"><![CDATA[ |
<trigger name="quitTrigger" type="NAMED"><![CDATA[ |
274 |
callTrigger ('rollbackTrigger') |
callTrigger ('rollbackTrigger') |
275 |
ownDocumentBlock.processRollback () |
ownDocumentBlock.processRollback () |
293 |
# copy the date |
# copy the date |
294 |
ownDocumentBlock.dateEntry= dateBlock.dateEntry |
ownDocumentBlock.dateEntry= dateBlock.dateEntry |
295 |
|
|
|
# print "here 1!" |
|
296 |
currentCredit= a2f (calculatedValuesDataSource.creditLimitAmount) - \ |
currentCredit= a2f (calculatedValuesDataSource.creditLimitAmount) - \ |
297 |
a2f (ownDocumentBlock.clientRecipientBox.debtEntry) |
a2f (ownDocumentBlock.clientRecipientBox.debtEntry) |
298 |
|
|
299 |
if a2f (paymentBlock.ctaCteEntry)>currentCredit: |
if a2f (paymentBlock.ctaCteEntry)>currentCredit: |
300 |
genericBox ("Está excedido el Límite de Crédito",["Ok"]) |
genericBox ("Está excedido el Límite de Crédito",["Ok"]) |
301 |
else: |
else: |
|
# print "here 2!" |
|
302 |
if ownItemBlock.getRecordCount ()>0 and len (ownItemBlock.serviceEntry)>0: |
if ownItemBlock.getRecordCount ()>0 and len (ownItemBlock.serviceEntry)>0: |
|
# print "here 3!" |
|
303 |
# el form no esta vacio |
# el form no esta vacio |
304 |
if len(ownDocumentBlock.dateEntry)==0: |
if len(ownDocumentBlock.dateEntry)==0: |
305 |
ownDocumentBlock.dateEntry= ownDocumentDataSource.getTimeStamp () |
ownDocumentBlock.dateEntry= ownDocumentDataSource.getTimeStamp () |
334 |
|
|
335 |
setFocus(ownDocumentBlock.clientRecipientBox.clientEntry) |
setFocus(ownDocumentBlock.clientRecipientBox.clientEntry) |
336 |
|
|
337 |
# print "here 4!" |
# this is enough |
338 |
callTrigger('rollbackTrigger') |
# and more modularized |
|
ownDocumentBlock.newRecord () |
|
|
ownDocumentBlock.dateEntry= ownDocumentDataSource.getTimeStamp() |
|
|
totalBlock.totalEntry= "" |
|
|
paymentBlock.cashEntry= "" |
|
|
paymentBlock.ctaCteEntry= "" |
|
339 |
]]></trigger> |
]]></trigger> |
340 |
|
|
341 |
|
<trigger name="commitAndRollBackTrigger" type="NAMED"><![CDATA[ |
342 |
|
callTrigger ('commitTrigger') |
343 |
|
callTrigger ('rollbackTrigger') |
344 |
|
]]></trigger> |
345 |
|
|
346 |
<!-- the form --> |
<!-- the form --> |
347 |
<page name="Factura de Servicios"> |
<page name="Factura de Servicios"> |
348 |
<box name="invoiceHeaderBox" label="Factura de servicios" |
<box name="invoiceHeaderBox" label="Factura de servicios" |
531 |
</box> |
</box> |
532 |
|
|
533 |
<!-- buttons --> |
<!-- buttons --> |
534 |
<button name="commitButton" label="Aceptar" trigger="commitTrigger" |
<button name="commitButton" label="Aceptar" trigger="commitAndRollBackTrigger" |
535 |
x="65" y="1" width="14" height="1"/> |
x="65" y="1" width="14" height="1"/> |
536 |
<button name="rollbackButton" label="Deshacer" trigger="rollbackTrigger" |
<button name="rollbackButton" label="Deshacer" trigger="rollbackTrigger" |
537 |
x="65" y="2" width="14" height="1"/> |
x="65" y="2" width="14" height="1"/> |
538 |
|
<button name="printButton" label="Imprimir" trigger="printTrigger" |
539 |
|
x="65" y="3" width="14" height="1"/> |
540 |
<!-- button name="quitButton" label="Salir" trigger="quitTrigger" |
<!-- button name="quitButton" label="Salir" trigger="quitTrigger" |
541 |
x="65" y="5" width="14" height="1"/ --> |
x="65" y="5" width="14" height="1"/ --> |
542 |
</block> |
</block> |