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

Diff of /papo/forms/queryDeleteInvoice.neb

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

revision 1.1 by apronotti, Wed Jul 23 22:06:44 2003 UTC revision 1.2 by apronotti, Thu Jul 24 16:15:32 2003 UTC
# Line 9  Line 9 
9      use PAPO;      use PAPO;
10      my $uniqed=0;      my $uniqed=0;
11    </neb:Block>    </neb:Block>
   <parameter name="invoiceDate" default=""/>  
12    
13    <datasource name="nil" cache="1"/>    <datasource name="nil" cache="1"/>
   <datasource name="payDataSource" cache="1"/>  
14    <datasource name="tmpValuesDataSource" cache="1"/>    <datasource name="tmpValuesDataSource" cache="1"/>
15    <datasource name="tmpSearchDataSource" cache="1"/>    <datasource name="tmpSearchDataSource" cache="1"/>
16    <datasource name="currentSearchIdDataSource" cache="1"/>    <datasource name="currentSearchIdDataSource" cache="1"/>
# Line 555  Line 553 
553        postChangeAdvance = 0        postChangeAdvance = 0
554        ownDocumentProceedingShowBlock.postChanges()        ownDocumentProceedingShowBlock.postChanges()
555    
556        currencyMovementBlock.initQuery()        if proceedingId:
557        currencyMovementBlock.proceedingEntry = proceedingId          currencyMovementBlock.initQuery()
558        currencyMovementBlock.processQuery()          currencyMovementBlock.proceedingEntry = proceedingId
559        postChangeAdvance = 1          currencyMovementBlock.processQuery()
560        rc = currencyMovementBlock.getRecordCount()          postChangeAdvance = 1
561        for recNum in range(rc):          rc = currencyMovementBlock.getRecordCount()
562          currencyMovementBlock.jumpRecord(recNum)          for recNum in range(rc):
563          currencyMovementBlock.deleteRecord()            currencyMovementBlock.jumpRecord(recNum)
564        currencyMovementBlock.postChanges()            currencyMovementBlock.deleteRecord()
565            currencyMovementBlock.postChanges()
566        proceedingBlock.initQuery()                
567        proceedingBlock.idEntry = proceedingId          proceedingBlock.initQuery()      
568        proceedingBlock.processQuery()          proceedingBlock.idEntry = proceedingId
569        postChangeAdvance = 2          proceedingBlock.processQuery()
570        proceedingBlock.deleteRecord()          postChangeAdvance = 2
571        proceedingBlock.postChanges()          proceedingBlock.deleteRecord()
572            proceedingBlock.postChanges()
573    
574        postChangeAdvance = 3        postChangeAdvance = 3
575        tmpValuesDataSource.idEntry = str(ownDocumentShowBlock.idEntry)        tmpValuesDataSource.idEntry = str(ownDocumentShowBlock.idEntry)
# Line 645  Line 644 
644                                                hack.a2f(ownItemShowBlock.unitPriceEntry,2) / \                                                hack.a2f(ownItemShowBlock.unitPriceEntry,2) / \
645                                                hack.a2f(ownItemShowBlock.qtyEntry,2) * 100                                                hack.a2f(ownItemShowBlock.qtyEntry,2) * 100
646         except:         except:
647             print "Error en el calculo del total"
648           pass           pass
649    
650       ownItemShowBlock.firstRecord()       ownItemShowBlock.firstRecord()
651    
652       totalShowBlock.totalEntry = str(hack.a2f(totalShowBlock.netoEntry,2)+hack.a2f(totalShowBlock.ivaEntry,2))       totalShowBlock.totalEntry = str(hack.a2f(totalShowBlock.netoEntry,2)+hack.a2f(totalShowBlock.ivaEntry,2))
653     else:     else:
654       totalShowBlock.totalEntry = "0.00"       totalShowBlock.clear()
655    </trigger>    </trigger>
656    
657    <trigger name="newSearchTrigger" type="NAMED">    <trigger name="newSearchTrigger" type="NAMED">
658      ownDocumentSearchBlock.clear()      clear()
659    </trigger>    </trigger>
660    
661    <trigger name="searchTrigger" type="NAMED">    <trigger name="searchTrigger" type="NAMED">
# Line 707  Line 707 
707    ownDocumentSearchBlock.clientSEntry = str(clientResultBlock.idEntry)    ownDocumentSearchBlock.clientSEntry = str(clientResultBlock.idEntry)
708    </trigger>    </trigger>
709    
   <trigger name="productSearchTrigger" type="NAMED">  
       codeToSearch = str(ownItemBlock.productCodeEntry)  
       nameToSearch = str(ownItemBlock.productNameEntry)  
   
       callTrigger('startWaitingModeTrigger')  
       productResultBlock.initQuery()  
       productResultBlock.prodCodeEntry = codeToSearch+"%"  
       productResultBlock.prodNameEntry = nameToSearch+"%"  
       productResultBlock.processQuery()  
       callTrigger('endWaitingModeTrigger')  
   
       recordCount = productResultBlock.getRecordCount()  
       if recordCount > 1:  
         def callback (returnValue):  
           global block  
           if returnValue >= 0:  
             productResultBlock.jumpRecord(returnValue)  
             callTrigger('afterProductSearchTrigger')  
   
         runForm ('productSelect.gfd', {'data': productResultBlock, 'callback': callback})  
       elif recordCount == 1:  
         productResultBlock.jumpRecord(0)  
         callTrigger('afterProductSearchTrigger')  
   </trigger>  
   
   <trigger name="afterProductSearchTrigger" type="NAMED">  
     ownItemBlock.productCodeEntry = str(productResultBlock.prodCodeEntry)  
     ownItemBlock.productNameEntry = str(productResultBlock.prodNameEntry)  
     ownItemBlock.productEntry = str(productResultBlock.prodIdEntry)  
     ownItemBlock.taxPercentEntry = str(productResultBlock.prodIVATaxEntry)  
   </trigger>  
   
   <trigger name="productDeleteTrigger" type="NAMED">  
     ownItemBlock.productCodeEntry = ""  
     ownItemBlock.productNameEntry = ""  
     ownItemBlock.qtyEntry = 0.00  
     ownItemBlock.unitPriceEntry = 0.00  
     ownItemBlock.productEntry = "0"  
     ownItemBlock.taxAmountEntry = 0  
     ownItemBlock.taxPercentEntry = 0  
     ownItemBlock.discountEntry = 0.00  
     ownItemBlock.itemTotalEntry = 0.00  
   
   
   </trigger>  
   
710    <trigger name="resultFocusOutTrigger" type="NAMED">    <trigger name="resultFocusOutTrigger" type="NAMED">
711     import hack     import hack
712     ownDocumentShowBlock.clear()     ownDocumentShowBlock.clear()
713       ownItemShowBlock.clear()
714     if resultBlock.getRecordCount() > 0 and not resultBlock.getCurrentRecord().isEmpty():     if resultBlock.getRecordCount() > 0 and not resultBlock.getCurrentRecord().isEmpty():
715       ownDocumentShowBlock.initQuery()       ownDocumentShowBlock.initQuery()
716       ownDocumentShowBlock.idEntry = ("%s" % resultBlock.idREntry)       ownDocumentShowBlock.idEntry = ("%s" % resultBlock.idREntry)
# Line 767  Line 722 
722    
723       recordCount = ownItemShowBlock.getRecordCount()       recordCount = ownItemShowBlock.getRecordCount()
724       ownItemShowBlock.firstRecord()       ownItemShowBlock.firstRecord()
      setParameter('invoiceDate',str(ownDocumentShowBlock.dateEntry))  
725    
726    </trigger>    </trigger>
727    
# Line 893  Line 847 
847          <entry field="own_document.date" name="dateEntry" typecast="date"          <entry field="own_document.date" name="dateEntry" typecast="date"
848            rows="1" width="22" x="22" y="9" style="label"/>            rows="1" width="22" x="22" y="9" style="label"/>
849    
         <label name="invoiceTypeLbl" text="Tipo" x="48" y="8" />  
         <entry name="invoiceTypeEntry" width="4" x="48" y="9" readonly="t" style="label"/>  
   
850        </block>        </block>
851    
852        <block datasource="ownDocumentClientShowDataSource" name="ownDocumentClientShowBlock" restrictInsert="t">        <block datasource="ownDocumentClientShowDataSource" name="ownDocumentClientShowBlock" restrictInsert="t">

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

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