/[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.4 by apronotti, Thu Jul 24 18:14:17 2003 UTC revision 1.5 by apronotti, Thu Jul 31 21:45:44 2003 UTC
# Line 75  Line 75 
75    </datasource>    </datasource>
76    
77    <datasource name="clientSearchDataSource" database="papo"    <datasource name="clientSearchDataSource" database="papo"
78      table="_entity_data, _alien_entity_data, _persona_data, _persona_tax_profile_data, _tax_profile_data,      table="_entity_data, _persona_tax_profile_data, _tax_profile_data, entity_type_uid_conf,
                      _client_data, entity_type_uid_conf,  
79                       _entity_uid_data" order_by="_entity_data.name">                       _entity_uid_data" order_by="_entity_data.name">
80      <condition>      <condition>
81        <and>        <and>
82         <eq>         <eq>
          <cfield name="_entity_data._table"/>  
          <cfield name="_alien_entity_data.entity"/>  
        </eq>  
        <eq>  
          <cfield name="_alien_entity_data._table"/>  
          <cfield name="_persona_data.alien_entity"/>  
        </eq>  
        <eq>  
          <cfield name="_persona_data._table"/>  
          <cfield name="_client_data.persona"/>  
        </eq>  
        <eq>  
83          <cfield name="_entity_data._table"/>          <cfield name="_entity_data._table"/>
84           <cfield name="_entity_uid_data.entity"/>           <cfield name="_entity_uid_data.entity"/>
85         </eq>         </eq>
# Line 120  Line 107 
107            <cfield name="_entity_data._end_t"/>            <cfield name="_entity_data._end_t"/>
108         </null>         </null>
109         <null>         <null>
           <cfield name="_alien_entity_data._end_t"/>  
        </null>  
        <null>  
           <cfield name="_persona_data._end_t"/>  
        </null>  
        <null>  
           <cfield name="_client_data._end_t"/>  
        </null>  
        <null>  
110           <cfield name="_entity_uid_data._end_t"/>           <cfield name="_entity_uid_data._end_t"/>
111         </null>         </null>
112          <null>          <null>
# Line 413  Line 391 
391      </condition>      </condition>
392    </datasource>    </datasource>
393    
394      <datasource database="papo" name="ownDocumentTaxShowDataSource"
395        table="own_document_tax"/>
396    
397    <datasource database="papo" name="ownDocumentClientShowDataSource"    <datasource database="papo" name="ownDocumentClientShowDataSource"
398      table="own_document, _entity_data as client" detaillink="own_document.id"      table="own_document, _entity_data as client" detaillink="own_document.id"
399      master="ownDocumentShowDataSource" masterlink="id"      master="ownDocumentShowDataSource" masterlink="id"
# Line 426  Line 407 
407    </datasource>    </datasource>
408    
409    <datasource database="papo" name="ownItemShowDataSource"    <datasource database="papo" name="ownItemShowDataSource"
410      table="own_item, own_product_item, own_item_tax">      table="own_item, own_product_item">
411      <condition>      <condition>
412        <and>        <eq>
413          <eq>          <cfield name="own_item.id"/>
414            <cfield name="own_item.id"/>          <cfield name="own_product_item.own_item"/>
415            <cfield name="own_product_item.own_item"/>        </eq>
         </eq>  
         <eq>  
            <cfield name="own_item.id"/>  
            <cfield name="own_item_tax.own_item"/>  
         </eq>  
         <eq>  
            <cfield name="own_item_tax.tax"/>  
            <cconst value="1"/>  
          </eq>  
       </and>  
416      </condition>      </condition>
417    </datasource>    </datasource>
418    
# Line 554  Line 525 
525    </trigger>    </trigger>
526    
527    <trigger name="deleteTrigger" type="NAMED">    <trigger name="deleteTrigger" type="NAMED">
528    from gnue.common.GDataObjects import ConnectionError as DBError    if genericBox("¿ Está seguro que desea borrar ?",['Sí','No']) == 1:
529    try:      from gnue.common.GDataObjects import ConnectionError as DBError
530        lOwnDocId = str(ownDocumentShowBlock.idEntry)      try:
531        ownDocumentProceedingShowBlock.initQuery()          lOwnDocId = str(ownDocumentShowBlock.idEntry)
532        ownDocumentProceedingShowBlock.ownDocumentEntry = lOwnDocId          ownDocumentProceedingShowBlock.initQuery()
533        ownDocumentProceedingShowBlock.processQuery()          ownDocumentProceedingShowBlock.ownDocumentEntry = lOwnDocId
534        proceedingId = str(ownDocumentProceedingShowBlock.proceedingEntry)          ownDocumentProceedingShowBlock.processQuery()
535        ownDocumentProceedingShowBlock.deleteRecord()          proceedingId = str(ownDocumentProceedingShowBlock.proceedingEntry)
536        postChangeAdvance = 0          ownDocumentProceedingShowBlock.deleteRecord()
537        ownDocumentProceedingShowBlock.postChanges()          postChangeAdvance = 0
538            ownDocumentProceedingShowBlock.postChanges()
539        if proceedingId:    
540          currencyMovementBlock.initQuery()          if proceedingId:
541          currencyMovementBlock.proceedingEntry = proceedingId            currencyMovementBlock.initQuery()
542          currencyMovementBlock.processQuery()            currencyMovementBlock.proceedingEntry = proceedingId
543          postChangeAdvance = 1            currencyMovementBlock.processQuery()
544          rc = currencyMovementBlock.getRecordCount()            postChangeAdvance = 1
545          for recNum in range(rc):            rc = currencyMovementBlock.getRecordCount()
546            currencyMovementBlock.jumpRecord(recNum)            for recNum in range(rc):
547            currencyMovementBlock.deleteRecord()              currencyMovementBlock.jumpRecord(recNum)
548          currencyMovementBlock.postChanges()              currencyMovementBlock.deleteRecord()
549              currencyMovementBlock.postChanges()
550              
551              proceedingBlock.initQuery()      
552              proceedingBlock.idEntry = proceedingId
553              proceedingBlock.processQuery()
554              postChangeAdvance = 2
555              proceedingBlock.deleteRecord()
556              proceedingBlock.postChanges()
557      
558            postChangeAdvance = 3
559            tmpValuesDataSource.idEntry = str(ownDocumentShowBlock.idEntry)
560            if  str(ownPosBlock.stockByInvoice) == "1":
561              print "llamado al trigger"
562              callTrigger('stockAddTrigger')
563      
564            lRecordCount = ownItemShowBlock.getRecordCount()
565            for recNum in range(lRecordCount):
566                ownItemShowBlock.jumpRecord(recNum)
567                ownItemTaxShowBlock.initQuery()
568                ownItemTaxShowBlock.ownItemEntry = str(ownItemShowBlock.idEntry)
569                ownItemTaxShowBlock.processQuery()
570                lTaxRecordCount = ownItemTaxShowBlock.getRecordCount()
571                for taxRecNum in range(lTaxRecordCount):
572                  ownItemTaxShowBlock.jumpRecord(taxRecNum)
573                  ownItemTaxShowBlock.deleteRecord()
574                  ownItemTaxShowBlock.postChanges()
575                ownItemDeleteBlock.initQuery()
576                ownItemDeleteBlock.idEntry = str(ownItemShowBlock.idEntry)
577                ownItemDeleteBlock.processQuery()
578                ownItemDeleteBlock.deleteRecord()
579                ownItemDeleteBlock.postChanges()
580      
581            ownItemShowBlock.clear()
582                    
583          proceedingBlock.initQuery()                postChangeAdvance = 4
584          proceedingBlock.idEntry = proceedingId  
585          proceedingBlock.processQuery()          ownDocumentTaxShowBlock.initQuery()
586          postChangeAdvance = 2          ownDocumentTaxShowBlock.ownDocumentEntry = tmpValuesDataSource.idEntry+"%"
587          proceedingBlock.deleteRecord()          ownDocumentTaxShowBlock.processQuery()
588          proceedingBlock.postChanges()          
589            lRecordCount = ownDocumentTaxShowBlock.getRecordCount()
590        postChangeAdvance = 3          for recNum in range(lRecordCount):
591        tmpValuesDataSource.idEntry = str(ownDocumentShowBlock.idEntry)            ownDocumentTaxShowBlock.jumpRecord(recNum)
592        if  str(ownPosBlock.stockByInvoice) == "1":            ownDocumentTaxShowBlock.deleteRecord()
593          print "llamado al trigger"          ownDocumentTaxShowBlock.postChanges()
594          callTrigger('stockAddTrigger')  
595            postChangeAdvance = 5
596        lRecordCount = ownItemShowBlock.getRecordCount()          
597        for recNum in range(lRecordCount):          ownDocumentShowBlock.deleteRecord()
598            ownItemShowBlock.jumpRecord(recNum)          ownDocumentShowBlock.postChanges()
599            ownItemTaxShowBlock.initQuery()    
600            ownItemTaxShowBlock.ownItemEntry = str(ownItemShowBlock.idEntry)          commitConnection()
601            ownItemTaxShowBlock.processQuery()      except DBError, err:
602            lTaxRecordCount = ownItemTaxShowBlock.getRecordCount()          rollbackConnection()
603            for taxRecNum in range(lTaxRecordCount):          callTrigger('rollbackTrigger')
604              ownItemTaxShowBlock.jumpRecord(taxRecNum)          message = ["el procedimiento de la Factura", "Los Montos de la factura",
605              ownItemTaxShowBlock.deleteRecord()                     "el procedimiento","los Items de la Factura","los impuestos de la Factura",
606              ownItemTaxShowBlock.postChanges()                     "la Factura"]
607            ownItemDeleteBlock.initQuery()          genericBox("Hay problemas para borrar "+message[postChangeAdvance]+"\n"+str(err),['Aceptar'])
608            ownItemDeleteBlock.idEntry = str(ownItemShowBlock.idEntry)    
609            ownItemDeleteBlock.processQuery()    
610            ownItemDeleteBlock.deleteRecord()      totalShowBlock.ivaEntry = "0.00"
611            ownItemDeleteBlock.postChanges()      totalShowBlock.netoEntry = "0.00"
612        totalShowBlock.totalEntry = "0.00"
613        ownItemShowBlock.clear()      totalShowBlock.clear()
         
       
       postChangeAdvance = 4  
       ownDocumentShowBlock.deleteRecord()  
       ownDocumentShowBlock.postChanges()  
   
       commitConnection()  
   except DBError, err:  
       rollbackConnection()  
       callTrigger('rollbackTrigger')  
       message = ["el procedimiento de la Factura", "Los Montos de la factura",  
                  "el procedimiento","los Items de la Factura", "la Factura"]  
       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()  
614    </trigger>    </trigger>
615    
616    
# Line 647  Line 632 
632     if resultBlock.getRecordCount() > 0 and not resultBlock.getCurrentRecord().isEmpty():     if resultBlock.getRecordCount() > 0 and not resultBlock.getCurrentRecord().isEmpty():
633       import hack       import hack
634    
635       recordCount = ownItemShowBlock.getRecordCount()       #recordCount = ownItemShowBlock.getRecordCount()
636       ownItemShowBlock.firstRecord()       #ownItemShowBlock.firstRecord()
637       for index in range(recordCount):       #for index in range(recordCount):
638         ownItemShowBlock.jumpRecord(index)       #  ownItemShowBlock.jumpRecord(index)
639         try:       #  try:
640           ownItemShowBlock.taxPercentEntry = hack.a2f(ownItemShowBlock.taxAmountEntry,2) / \       #    ownItemShowBlock.taxPercentEntry = hack.a2f(ownItemShowBlock.taxAmountEntry,2) / \
641                                                hack.a2f(ownItemShowBlock.unitPriceEntry,2) / \       #                                         hack.a2f(ownItemShowBlock.unitPriceEntry,2) / \
642                                                hack.a2f(ownItemShowBlock.qtyEntry,2) * 100       #                                         hack.a2f(ownItemShowBlock.qtyEntry,2) * 100
643         except:       #  except:
644           print "Error en el calculo del total"       #    print "Error en el calculo del total"
645           pass       #    pass
646    
647       ownItemShowBlock.firstRecord()       ownItemShowBlock.firstRecord()
648    
# Line 692  Line 677 
677        clientResultBlock.reset()        clientResultBlock.reset()
678        clientResultBlock.initQuery()        clientResultBlock.initQuery()
679        if codeToSearch:        if codeToSearch:
680          clientResultBlock.clientCodeEntry = codeToSearch+"%"          clientResultBlock.uidEntry = codeToSearch+"%"
681        if nameToSearch:        if nameToSearch:
682          clientResultBlock.clientNameEntry = nameToSearch+"%"          clientResultBlock.nameEntry = nameToSearch+"%"
683        clientResultBlock.processQuery()        clientResultBlock.processQuery()
684        callTrigger('endWaitingModeTrigger')        callTrigger('endWaitingModeTrigger')
685    
# Line 877  Line 862 
862            <entry name="amountEntry" field="amount" hidden="" x="1" y="1" width="12"/>            <entry name="amountEntry" field="amount" hidden="" x="1" y="1" width="12"/>
863      </block>      </block>
864    
865        <block name="ownDocumentTaxShowBlock" datasource="ownDocumentTaxShowDataSource" transparentBlock="">
866              <entry name="ownDocumentEntry" field="own_document" hidden="" x="1" y="1" width="12"/>
867        </block>
868    
869      <block datasource="ownDocumentShowDataSource" name="ownDocumentShowBlock" restrictInsert="t">      <block datasource="ownDocumentShowDataSource" name="ownDocumentShowBlock" restrictInsert="t">
870    
871          <entry field="own_document.id" hidden="" name="idEntry" x="1" y="1"/>          <entry field="own_document.id" hidden="" name="idEntry" x="1" y="1"/>
# Line 948  Line 937 
937          <label name="taxLbl" text="IVA" x="65" y="13" />          <label name="taxLbl" text="IVA" x="65" y="13" />
938          <entry x="65" y="14" name="taxPercentEntry" width="5" rows="7" style="label" typecast="number" displaymask="%0.2f"/>          <entry x="65" y="14" name="taxPercentEntry" width="5" rows="7" style="label" typecast="number" displaymask="%0.2f"/>
939    
940          <entry x="65" y="14" readonly="" field="own_item_tax.amount" name="taxAmountEntry" width="5" rows="5" hidden=""/>  <!--      <entry x="65" y="14" readonly="" field="own_item_tax.amount" name="taxAmountEntry" width="5" rows="5" hidden=""/> -->
941          <entry x="47" y="4" readonly="" field="own_item_tax.tax" name="taxTypeEntry" width="5" rows="5" default="1" hidden=""/>  <!--      <entry x="47" y="4" readonly="" field="own_item_tax.tax" name="taxTypeEntry" width="5" rows="5" default="1" hidden=""/> -->
942    
943          <label name="discountLbl" text="Descuento" x="71" y="13"/>          <label name="discountLbl" text="Descuento" x="71" y="13"/>
944          <entry field="own_item.discount" name="discountEntry" typecast="number" displaymask="%0.2f"          <entry field="own_item.discount" name="discountEntry" typecast="number" displaymask="%0.2f"

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

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