0:
currencyTypeBlock.clear()
currencyDataBlock.clear()
rs = currencyTypeDataSource.createResultSet()
client = 0
more = rs.firstRecord()
while more:
if not currencyTypeBlock.getCurrentRecord().isEmpty():
currencyTypeBlock.newRecord()
currencyTypeBlock.currencyBox.idEntry = rs.current.getField("_table")
currencyTypeBlock.currencyBox.nameEntry = rs.current.getField("name")
currencyTypeBlock.currencyBox.rateEntry = hack.a2f(rs.current.getField("rate"),4)
monto = round(hack.a2f(payBlock.cashEntry,4) / hack.a2f(rs.current.getField("rate"),4),4)
currencyTypeBlock.currencyBox.formatEntry = rs.current.getField("format")
currencyTypeBlock.currencyBox.amountEntry = str(currencyTypeBlock.currencyBox.formatEntry) % monto
currencyTypeBlock.currencyBox.payEntry = 0.0
more = rs.nextRecord()
currencyTypeBlock.firstRecord ()
currencyDataBlock.recipientBox.dateEntry = str(tmpBlock.tmpDateEntry)
currencyDataBlock.recipientBox.numberEntry = str(ownPosDocumentBlock.documentNumberEntry)
currencyDataBlock.clientRecipientBox.clientCodeEntry = str(ownDocumentBlock.clientRecipientBox.clientCodeEntry)
currencyDataBlock.clientRecipientBox.clientNameEntry = str(ownDocumentBlock.clientRecipientBox.clientNameEntry)
#payBlock.dateEntry = str(tmpBlock.tmpDateEntry)
currencyDataBlock.clientRecipientBox.totalEntry = str(hack.a2f(payBlock.cashEntry,2))
]]>
0:
total -= round(hack.a2f(currencyTypeBlock.currencyBox.payEntry,4) * hack.a2f(currencyTypeBlock.currencyBox.rateEntry,4),4)
rc = currencyTypeBlock.getRecordCount()
for recNum in range(rc):
currencyTypeBlock.jumpRecord(recNum)
if hack.a2f(currencyTypeBlock.currencyBox.rateEntry,4) > 0:
monto = round(total / hack.a2f(currencyTypeBlock.currencyBox.rateEntry,4),4)
currencyTypeBlock.currencyBox.amountEntry = str(currencyTypeBlock.currencyBox.formatEntry) % monto
currencyTypeBlock.jumpRecord(rn)
]]>
0:
total -= round(hack.a2f(currencyTypeBlock.currencyBox.payEntry,4) * hack.a2f(currencyTypeBlock.currencyBox.rateEntry,4),4)
if round(total,2) != 0:
genericBox("El los montos no completan el total del documento\n",['Aceptar'])
else:
from gnue.common.GDataObjects import ConnectionError as DBError
callTrigger('startWaitingModeTrigger')
try:
callTrigger ('commitTrigger')
if str(totalBlock.printDespatchNote) == "1":
callTrigger('makeDespatchNote')
else:
reportNo= str(ownDocumentBlock.typeEntry)
print 'here: %s, %s' % (str(tmpValuesDataSource.alienIVACond), str(tmpValuesDataSource.ownIVACond))
if str(tmpValuesDataSource.alienIVACond)=='2' and str(tmpValuesDataSource.ownIVACond)=='1':
# hack to use alternative report and print config
reportNo= '4_and_half'
report='productInvoice-%s' % reportNo
print 'here: %s' % reportNo
hack.pleasePrint (self, reportNo, report, [ 'id='+str(ownDocumentBlock.idEntry) ],str(ownPosDocumentBlock.documentPrintCommand))
callTrigger('makeDespatchNote')
callTrigger('rollbackTrigger')
except DBError:
# just ignore, as the commit trigger already reports the error to the user
pass
callTrigger('endWaitingModeTrigger')
]]>
import hack
lCurrentCredit = round(hack.a2f(tmpValuesDataSource.creditLimitAmount,2) - \
hack.a2f(ownDocumentBlock.clientRecipientBox.deudaEntry,2),2)
newCtaCteValue = round(hack.a2f(totalBlock.totalEntry,2) - hack.a2f(retentionTmpBlock.retentionTotal,2) - hack.a2f(payBlock.cashEntry,2),2)
if newCtaCteValue > lCurrentCredit and hack.a2f(payBlock.cashEntry,2) != (hack.a2f(totalBlock.totalEntry,2) - hack.a2f(retentionTmpBlock.retentionTotal,2)):
genericBox("Esta excedido el Límite de Crédito",["Aceptar"])
payBlock.ctaCteEntry = "0.00"
payBlock.cashEntry = hack.a2f(totalBlock.totalEntry,2) - hack.a2f(retentionTmpBlock.retentionTotal,2)
else:
payBlock.ctaCteEntry = newCtaCteValue
callTrigger('currencyTypeTrigger')
import hack
lCurrentCredit = round(hack.a2f(tmpValuesDataSource.creditLimitAmount,2) - \
hack.a2f(ownDocumentBlock.clientRecipientBox.deudaEntry,2),2)
if not (0 >= lCurrentCredit and hack.a2f(payBlock.ctaCteEntry,2) == 0.00):
if hack.a2f(payBlock.ctaCteEntry,2) > lCurrentCredit:
genericBox("Esta excedido el Límite de Crédito",["Aceptar"])
payBlock.ctaCteEntry = "0.00"
payBlock.cashEntry = hack.a2f(totalBlock.totalEntry,2) - hack.a2f(retentionTmpBlock.retentionTotal,2)
else:
payBlock.cashEntry = str(round(hack.a2f(totalBlock.totalEntry,2) - hack.a2f(retentionTmpBlock.retentionTotal,2) - hack.a2f(payBlock.ctaCteEntry,2),2))
callTrigger('currencyTypeTrigger')
import hack
#levanto proceeding
proceedingBlock.clear()
proceedingBlock.dateEntry = proceedingDataSource.getTimeStamp()
proceedingBlock.postChanges()
#alien document proceeding
#recorro los documentos de retenciones cargo los alien_document_proceeding
rc = retentionBlock.getRecordCount()
for recNum in range(rc):
if (recNum > 0):
alienDocumentProceedingBlock.nextRecord()
retentionBlock.jumpRecord(recNum)
alienDocumentProceedingBlock.proceedingEntry = str(proceedingBlock.idEntry)
alienDocumentProceedingBlock.alienDocumentEntry = str(retentionBlock.idEntry)
alienDocumentProceedingBlock.amountEntry = str(retentionBlock.retentionAmountEntry)
#own document proceeding
ownDocumentProceedingBlock.clear()
ownDocumentProceedingBlock.proceedingEntry = str(proceedingBlock.idEntry)
ownDocumentProceedingBlock.ownDocumentEntry = str(ownDocumentBlock.idEntry)
ownDocumentProceedingBlock.amountEntry = hack.a2f(payBlock.cashEntry)+hack.a2f(retentionTmpBlock.retentionTotal)
#currency
rc = currencyTypeBlock.getRecordCount()
for recNum in range(rc):
currencyTypeBlock.jumpRecord(recNum)
if hack.a2f(currencyTypeBlock.currencyBox.payEntry,2) > 0:
if not currencyMovementBlock.getCurrentRecord().isEmpty():
currencyMovementBlock.newRecord()
currencyMovementBlock.proceedingEntry = str(proceedingBlock.idEntry)
currencyMovementBlock.movementTypeEntry = "" # Revisar com queda esto
currencyMovementBlock.currencyTypeEntry = str(currencyTypeBlock.currencyBox.idEntry)
currencyMovementBlock.amountEntry = str(round(hack.a2f(currencyTypeBlock.currencyBox.payEntry,2) * hack.a2f(currencyTypeBlock.currencyBox.rateEntry,4),2))
#post changes
postChangeAdvance = 3
ownDocumentProceedingBlock.postChanges()
alienDocumentProceedingBlock.postChanges()
postChangeAdvance = 4
currencyMovementBlock.postChanges()
import hack
payBlock.cashEntry = round(hack.a2f(totalBlock.totalEntry,2) - hack.a2f(retentionTmpBlock.retentionTotal,2),2)
callTrigger('cashEntryPreFocusout')