use PAPO; my $uniqed=0; #cargo el own-pos entity id callTrigger('searchOwnPosData') #/cargo el own-pos entity id = 0.5 from gnue.common.events.Event import Event as GFEvent # busy clock self._object.dispatchEvent(GFEvent('beginWAIT')) ]]> = 0.5 from gnue.common.events.Event import Event as GFEvent self._object.dispatchEvent(GFEvent('endWAIT')) setStatusText("Listo") ]]> clear() callTrigger('searchOwnPosData') from gnue.common.GDataObjects import ConnectionError as DBError try: lOwnDocId = str(ownDocumentShowBlock.idEntry) ownDocumentProceedingShowBlock.initQuery() ownDocumentProceedingShowBlock.ownDocumentEntry = lOwnDocId ownDocumentProceedingShowBlock.processQuery() proceedingId = str(ownDocumentProceedingShowBlock.proceedingEntry) ownDocumentProceedingShowBlock.deleteRecord() postChangeAdvance = 0 ownDocumentProceedingShowBlock.postChanges() if proceedingId: currencyMovementBlock.initQuery() currencyMovementBlock.proceedingEntry = proceedingId currencyMovementBlock.processQuery() postChangeAdvance = 1 rc = currencyMovementBlock.getRecordCount() for recNum in range(rc): currencyMovementBlock.jumpRecord(recNum) currencyMovementBlock.deleteRecord() currencyMovementBlock.postChanges() proceedingBlock.initQuery() proceedingBlock.idEntry = proceedingId proceedingBlock.processQuery() postChangeAdvance = 2 proceedingBlock.deleteRecord() proceedingBlock.postChanges() postChangeAdvance = 3 tmpValuesDataSource.idEntry = str(ownDocumentShowBlock.idEntry) if str(ownPosBlock.stockByInvoice) == "1": print "llamado al trigger" callTrigger('stockSubstractTrigger') lRecordCount = ownItemShowBlock.getRecordCount() for recNum in range(lRecordCount): ownItemShowBlock.jumpRecord(recNum) ownItemTaxShowBlock.initQuery() ownItemTaxShowBlock.ownItemEntry = str(ownItemShowBlock.idEntry) ownItemTaxShowBlock.processQuery() lTaxRecordCount = ownItemTaxShowBlock.getRecordCount() for taxRecNum in range(lTaxRecordCount): ownItemTaxShowBlock.jumpRecord(taxRecNum) ownItemTaxShowBlock.deleteRecord() ownItemTaxShowBlock.postChanges() ownItemDeleteBlock.initQuery() ownItemDeleteBlock.idEntry = str(ownItemShowBlock.idEntry) ownItemDeleteBlock.processQuery() ownItemDeleteBlock.deleteRecord() ownItemDeleteBlock.postChanges() ownItemShowBlock.clear() postChangeAdvance = 4 ownDocumentShowBlock.deleteRecord() ownDocumentShowBlock.postChanges() commitConnection() except DBError, err: rollbackConnection() callTrigger('rollbackTrigger') message = ["el procedimiento de la Nota de Crédito", "Los Montos de la nota de crédito", "el procedimiento","los Items de la Nota de Crédito", "la Nota de Crédito"] genericBox("Hay problemas para borrar "+message[postChangeAdvance]+"\n"+str(err),['Aceptar']) totalShowBlock.ivaEntry = "0.00" totalShowBlock.netoEntry = "0.00" totalShowBlock.totalEntry = "0.00" totalShowBlock.clear() if resultBlock.getRecordCount() > 0 and not resultBlock.getCurrentRecord().isEmpty(): typeInvoice = int(str(ownDocumentShowBlock.typeEntry)) result = "" if typeInvoice == 2: result = "A" elif typeInvoice == 10: result = "B" elif typeInvoice == 11: result = "C" ownDocumentShowBlock.invoiceTypeEntry = result if resultBlock.getRecordCount() > 0 and not resultBlock.getCurrentRecord().isEmpty(): import hack recordCount = ownItemShowBlock.getRecordCount() ownItemShowBlock.firstRecord() for index in range(recordCount): ownItemShowBlock.jumpRecord(index) try: ownItemShowBlock.taxPercentEntry = hack.a2f(ownItemShowBlock.taxAmountEntry,2) / \ hack.a2f(ownItemShowBlock.unitPriceEntry,2) / \ hack.a2f(ownItemShowBlock.qtyEntry,2) * 100 except: pass ownItemShowBlock.firstRecord() totalShowBlock.totalEntry = str(hack.a2f(totalShowBlock.netoEntry,2)+hack.a2f(totalShowBlock.ivaEntry,2)) else: totalShowBlock.clear() clear() resultBlock.clear() resultBlock.initQuery() #resultBlock.typeREntry = "2" resultBlock.clientREntry = str(ownDocumentSearchBlock.clientSEntry) resultBlock.numberREntry = str(ownDocumentSearchBlock.numberSEntry)+"%" resultBlock.dateREntry = str(ownDocumentSearchBlock.dateSEntry) resultBlock.processQuery() genericBox("No implementado",["Aceptar"]) codeToSearch = str(ownDocumentSearchBlock.clientCodeSEntry) nameToSearch = str(ownDocumentSearchBlock.clientNameSEntry) callTrigger('startWaitingModeTrigger') clientResultBlock.reset() clientResultBlock.initQuery() if codeToSearch: clientResultBlock.clientCodeEntry = codeToSearch+"%" if nameToSearch: clientResultBlock.clientNameEntry = nameToSearch+"%" clientResultBlock.processQuery() callTrigger('endWaitingModeTrigger') recordCount = clientResultBlock.getRecordCount() if recordCount > 1: def callback (returnValue): global block if returnValue >= 0: clientResultBlock.jumpRecord(returnValue) callTrigger('afterClientSearchTrigger') runForm ('clientSelect.gfd', {'data': clientResultBlock, 'callback': callback}) elif recordCount == 1: clientResultBlock.jumpRecord(0) callTrigger('afterClientSearchTrigger') ownDocumentSearchBlock.clientCodeSEntry = str(clientResultBlock.uidEntry) ownDocumentSearchBlock.clientNameSEntry = str(clientResultBlock.nameEntry) ownDocumentSearchBlock.clientSEntry = str(clientResultBlock.idEntry) import hack ownDocumentShowBlock.clear() ownItemShowBlock.clear() if resultBlock.getRecordCount() > 0 and not resultBlock.getCurrentRecord().isEmpty(): ownDocumentShowBlock.initQuery() ownDocumentShowBlock.idEntry = ("%s" % resultBlock.idREntry) ownDocumentShowBlock.processQuery() ownItemShowBlock.initQuery() ownItemShowBlock.ownDocumentEntry = ("%s" % ownDocumentShowBlock.idEntry) ownItemShowBlock.processQuery() recordCount = ownItemShowBlock.getRecordCount() ownItemShowBlock.firstRecord() runForm('client.gfd') runForm('product.gfd')