/[papo]/papo/forms/productInvoice.neb
ViewVC logotype

Diff of /papo/forms/productInvoice.neb

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by mhepp, Fri May 9 22:23:18 2003 UTC revision 1.4 by apronotti, Mon May 12 19:49:49 2003 UTC
# Line 607  Line 607 
607    <trigger name="commitTrigger" type="NAMED">    <trigger name="commitTrigger" type="NAMED">
608    
609       ownDocumentBlock.numberEntry= str(ownPosDocumentBlock.documentNumberEntry)       ownDocumentBlock.numberEntry= str(ownPosDocumentBlock.documentNumberEntry)
      ownPosDocumentBlock.documentNumberEntry.atomicModify (lambda x: int(x)+1)  
610    
611       ownDocumentBlock.dateEntry = str(tmpBlock.tmpDateEntry )       ownDocumentBlock.dateEntry = str(tmpBlock.tmpDateEntry )
612       if len(ownDocumentBlock.dateEntry) == 0:       if len(ownDocumentBlock.dateEntry) == 0:
613           ownDocumentBlock.dateEntry = ownDocumentDataSource.getTimeStamp()           ownDocumentBlock.dateEntry = ownDocumentDataSource.getTimeStamp()
614    
615       proceedingBlock.processRollback()       proceedingBlock.clear()
616       proceedingBlock.idEntry.autofillBySequence('proceeding_id_seq')       proceedingBlock.idEntry.autofillBySequence('proceeding_id_seq')
617       proceedingBlock.dateEntry = proceedingDataSource.getTimeStamp()       proceedingBlock.dateEntry = proceedingDataSource.getTimeStamp()
618    
619       ownDocumentBlock.idEntry.autofillBySequence('own_document_id_seq')       ownDocumentBlock.idEntry.autofillBySequence('own_document_id_seq')
620    
621       ownDocumentProceedingBlock.processRollback()       ownDocumentProceedingBlock.clear()
622       ownDocumentProceedingBlock.proceedingEntry = str(proceedingBlock.idEntry)       ownDocumentProceedingBlock.proceedingEntry = str(proceedingBlock.idEntry)
623       ownDocumentProceedingBlock.ownDocumentEntry = str(ownDocumentBlock.idEntry)       ownDocumentProceedingBlock.ownDocumentEntry = str(ownDocumentBlock.idEntry)
624       ownDocumentProceedingBlock.amountEntry = str(payBlock.cashEntry)       ownDocumentProceedingBlock.amountEntry = str(payBlock.cashEntry)
625    
626       currencyMovementBlock.processRollback()       currencyMovementBlock.clear()
627       currencyMovementBlock.proceedingEntry = str(proceedingBlock.idEntry)       currencyMovementBlock.proceedingEntry = str(proceedingBlock.idEntry)
628       currencyMovementBlock.movementTypeEntry = "" # Revisar com queda esto       currencyMovementBlock.movementTypeEntry = "" # Revisar com queda esto
629       currencyMovementBlock.currencyTypeEntry = "1"       currencyMovementBlock.currencyTypeEntry = "1"
630       currencyMovementBlock.amountEntry = str(payBlock.cashEntry)       currencyMovementBlock.amountEntry = str(payBlock.cashEntry)
631    
632       ownDocumentBlock.commit()       #ownDocumentBlock.commit()
633       lOwnDocId = str(ownDocumentBlock.idEntry)  
634       #if stock by invoice       try:
635       if  str(ownPosBlock.stockByInvoice) == 1:         postChangeAdvance = 0
636         ownItemToUpdBlock.initQuery()         ownDocumentBlock.postChanges()
637         ownItemToUpdBlock.ownDocumentEntry = lOwnDocId         postChangeAdvance = 1
638         ownItemToUpdBlock.processQuery()         ownPosDocumentBlock.documentNumberEntry.postAtomicModify (lambda x: int(x)+1)
639         lRecordCount = ownItemToUpdBlock.getRecordCount()         postChangeAdvance = 2
640         for recNum in range(lRecordCount):         proceedingBlock.postChanges()
641            ownItemToUpdBlock.jumpRecord(recNum)         postChangeAdvance = 3
642            ownItemToUpdBlock.levelEntry.atomicModify(lambda x:x-round(float(str(ownItemToUpdBlock.qtyEntry)),4))         ownDocumentProceedingBlock.postChanges()
643         ownItemToUpdBlock.processRollback()         postChangeAdvance = 4
644       #/if stock by invoice         currencyMovementBlock.postChanges()
645           postChangeAdvance = 5
646           lOwnDocId = str(ownDocumentBlock.idEntry)
647           #if stock by invoice
648           if  str(ownPosBlock.stockByInvoice) == 1:
649             ownItemToUpdBlock.initQuery()
650             ownItemToUpdBlock.ownDocumentEntry = lOwnDocId
651             ownItemToUpdBlock.processQuery()
652             lRecordCount = ownItemToUpdBlock.getRecordCount()
653             for recNum in range(lRecordCount):
654                ownItemToUpdBlock.jumpRecord(recNum)
655                ownItemToUpdBlock.levelEntry.postAtomicModify(lambda x:x-round(float(str(ownItemToUpdBlock.qtyEntry)),4))
656             ownItemToUpdBlock.clear()
657             #/if stock by invoice
658           commitConnection()
659         except :
660           message = "Hay problemas para actualizar "
661           if postChangeAdvance == 0:
662             message += "la Factura"
663           elif postChangeAdvance == 1:
664             message += "el número de la Factura"
665           elif postChangeAdvance == 2:
666             message += "el procedimiento General"
667           elif postChangeAdvance == 3:
668             message += "el procedimiento de la Factura"
669           elif postChangeAdvance == 4:
670             message += "las monedas de pago de la Factura"
671           elif postChangeAdvance == 5:
672             message += "el stock"
673              
674           rollbackConnection()  
675    </trigger>    </trigger>
676    
677    <trigger name="rollbackTrigger" type="NAMED">    <trigger name="rollbackTrigger" type="NAMED">
678    tmpValuesDataSource.priceTypeId = None    tmpValuesDataSource.priceTypeId = None
679    for block in form._object._blockList:  
680      block.processRollback ()    clear()
681    
682    ownDocumentBlock.newRecord()    ownDocumentBlock.newRecord()
683    
# Line 658  Line 687 
687    <trigger name="startUp" type="On-Startup">    <trigger name="startUp" type="On-Startup">
688    tmpValuesDataSource.priceTypeId = None    tmpValuesDataSource.priceTypeId = None
689    tmpValuesDataSource.onSwitch = "0"    tmpValuesDataSource.onSwitch = "0"
690    ownOrganizationBlock.processRollback()    ownOrganizationBlock.clear()
691    ownOrganizationBlock.initQuery()    ownOrganizationBlock.initQuery()
692    ownOrganizationBlock.processQuery()    ownOrganizationBlock.processQuery()
693    tmpValuesDataSource.ownIVACond = str(ownOrganizationBlock.condIVAEntry)    tmpValuesDataSource.ownIVACond = str(ownOrganizationBlock.condIVAEntry)
# Line 667  Line 696 
696    
697    <trigger name="quitTrigger" type="NAMED">    <trigger name="quitTrigger" type="NAMED">
698    callTrigger('rollbackTrigger')    callTrigger('rollbackTrigger')
699    ownDocumentBlock.processRollback()    ownDocumentBlock.clear()
700    exit()    exit()
701    </trigger>    </trigger>
702    
# Line 751  Line 780 
780          ownDocumentBlock.clientRecipientBox.priceTypeEntry = str(ownDocumentBlock.clientRecipientBox.clientEntry)          ownDocumentBlock.clientRecipientBox.priceTypeEntry = str(ownDocumentBlock.clientRecipientBox.clientEntry)
781          # Aca si existe un balance, calcula la deuda desde ese balance en adelante sino          # Aca si existe un balance, calcula la deuda desde ese balance en adelante sino
782          # calcula la deuda desde el primer documento vinculado al cliente actual          # calcula la deuda desde el primer documento vinculado al cliente actual
783          creditLimit1Block.processRollback()          creditLimit1Block.clear()
784          creditLimit1Block.initQuery()          creditLimit1Block.initQuery()
785          creditLimit1Block.entityEntry = str(ownDocumentBlock.clientRecipientBox.currentClientEntry)          creditLimit1Block.entityEntry = str(ownDocumentBlock.clientRecipientBox.currentClientEntry)
786          creditLimit1Block.processQuery()          creditLimit1Block.processQuery()
# Line 1150  Line 1179 
1179            priceTypeBlock.processQuery()            priceTypeBlock.processQuery()
1180            search_id = str(priceTypeBlock.priceTypeParentId)            search_id = str(priceTypeBlock.priceTypeParentId)
1181            priceListsChain.append("%s" % priceTypeBlock.priceTypeId)            priceListsChain.append("%s" % priceTypeBlock.priceTypeId)
1182        tmpProdResultBlock.processRollback()        tmpProdResultBlock.clear()
1183        tmpProdResultBlock.initQuery()        tmpProdResultBlock.initQuery()
1184        tmpProdResultBlock.prodNameEntry = ("%s" % ownItemBlock.prodNameSEntry)+"%"        tmpProdResultBlock.prodNameEntry = ("%s" % ownItemBlock.prodNameSEntry)+"%"
1185        tmpProdResultBlock.prodCodeEntry = ("%s" % ownItemBlock.prodCodeSEntry)+"%"        tmpProdResultBlock.prodCodeEntry = ("%s" % ownItemBlock.prodCodeSEntry)+"%"
# Line 1159  Line 1188 
1188        # cargar la parte visible de modificacion de precios        # cargar la parte visible de modificacion de precios
1189        tmpProdResultBlock.firstRecord()        tmpProdResultBlock.firstRecord()
1190        product_id_anterior = None        product_id_anterior = None
1191        prodResultBlock.processRollback()        prodResultBlock.clear()
1192        for index in range(tmpProdResultBlock.getRecordCount()):        for index in range(tmpProdResultBlock.getRecordCount()):
1193            product_id=("%s" %tmpProdResultBlock.prodIdEntry)            product_id=("%s" %tmpProdResultBlock.prodIdEntry)
1194            if product_id != product_id_anterior:            if product_id != product_id_anterior:

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26