use PAPO; my $uniqed=0; 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")) monto = hack.a2f(payBlock.cashEntry) / hack.a2f(rs.current.getField("rate")) currencyTypeBlock.currencyBox.formatEntry = rs.current.getField("format") currencyTypeBlock.currencyBox.amountEntry = str(currencyTypeBlock.currencyBox.formatEntry) % monto currencyTypeBlock.currencyBox.payEntry = 0.0 more = rs.nextRecord() 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(payBlock.cashEntry) ]]> 0: total -= hack.a2f(currencyTypeBlock.currencyBox.payEntry) * hack.a2f(currencyTypeBlock.currencyBox.rateEntry) rc = currencyTypeBlock.getRecordCount() for recNum in range(rc): currencyTypeBlock.jumpRecord(recNum) if hack.a2f(currencyTypeBlock.currencyBox.rateEntry) > 0: monto = total / hack.a2f(currencyTypeBlock.currencyBox.rateEntry) currencyTypeBlock.currencyBox.amountEntry = str(currencyTypeBlock.currencyBox.formatEntry) % monto ]]> 0: total -= hack.a2f(currencyTypeBlock.currencyBox.payEntry) * hack.a2f(currencyTypeBlock.currencyBox.rateEntry) if total > 0: genericBox("El los montos no completan el total del documento\n",['Aceptar']) else: currencyMovementBlock = getParameter ('currency') rc = currencyTypeBlock.getRecordCount() for recNum in range(rc): currencyTypeBlock.jumpRecord(recNum) if hack.a2f(currencyTypeBlock.currencyBox.payEntry) > 0: if not currencyMovementBlock.getCurrentRecord().isEmpty(): currencyMovementBlock.newRecord() currencyMovementBlock.currencyTypeEntry = str(currencyTypeBlock.currencyBox.idEntry) currencyMovementBlock.amountEntry = str(hack.a2f(currencyTypeBlock.currencyBox.payEntry) * hack.a2f(currencyTypeBlock.currencyBox.rateEntry)) exit() ]]>