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

Diff of /papo/forms/queryDeleteCreditNote.neb

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

revision 1.2 by apronotti, Thu Jul 24 18:14:17 2003 UTC revision 1.3 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 542  Line 513 
513    </trigger>    </trigger>
514    
515    <trigger name="deleteTrigger" type="NAMED">    <trigger name="deleteTrigger" type="NAMED">
516    from gnue.common.GDataObjects import ConnectionError as DBError    if genericBox("¿ Está seguro que desea borrar ?",['Sí','No']) == 1:
517    try:      from gnue.common.GDataObjects import ConnectionError as DBError
518        lOwnDocId = str(ownDocumentShowBlock.idEntry)      try:
519        ownDocumentProceedingShowBlock.initQuery()          lOwnDocId = str(ownDocumentShowBlock.idEntry)
520        ownDocumentProceedingShowBlock.ownDocumentEntry = lOwnDocId          ownDocumentProceedingShowBlock.initQuery()
521        ownDocumentProceedingShowBlock.processQuery()          ownDocumentProceedingShowBlock.ownDocumentEntry = lOwnDocId
522        proceedingId = str(ownDocumentProceedingShowBlock.proceedingEntry)          ownDocumentProceedingShowBlock.processQuery()
523        ownDocumentProceedingShowBlock.deleteRecord()          proceedingId = str(ownDocumentProceedingShowBlock.proceedingEntry)
524        postChangeAdvance = 0          ownDocumentProceedingShowBlock.deleteRecord()
525        ownDocumentProceedingShowBlock.postChanges()          postChangeAdvance = 0
526            ownDocumentProceedingShowBlock.postChanges()
527        if proceedingId:    
528          currencyMovementBlock.initQuery()          if proceedingId:
529          currencyMovementBlock.proceedingEntry = proceedingId            currencyMovementBlock.initQuery()
530          currencyMovementBlock.processQuery()            currencyMovementBlock.proceedingEntry = proceedingId
531          postChangeAdvance = 1            currencyMovementBlock.processQuery()
532          rc = currencyMovementBlock.getRecordCount()            postChangeAdvance = 1
533          for recNum in range(rc):            rc = currencyMovementBlock.getRecordCount()
534            currencyMovementBlock.jumpRecord(recNum)            for recNum in range(rc):
535            currencyMovementBlock.deleteRecord()              currencyMovementBlock.jumpRecord(recNum)
536          currencyMovementBlock.postChanges()              currencyMovementBlock.deleteRecord()
537              currencyMovementBlock.postChanges()
538            
539              proceedingBlock.initQuery()      
540              proceedingBlock.idEntry = proceedingId
541              proceedingBlock.processQuery()
542              postChangeAdvance = 2
543              proceedingBlock.deleteRecord()
544              proceedingBlock.postChanges()
545      
546            postChangeAdvance = 3
547            tmpValuesDataSource.idEntry = str(ownDocumentShowBlock.idEntry)
548            if  str(ownPosBlock.stockByInvoice) == "1":
549              print "llamado al trigger"
550              callTrigger('stockSubstractTrigger')
551      
552            lRecordCount = ownItemShowBlock.getRecordCount()
553            for recNum in range(lRecordCount):
554                ownItemShowBlock.jumpRecord(recNum)
555                ownItemTaxShowBlock.initQuery()
556                ownItemTaxShowBlock.ownItemEntry = str(ownItemShowBlock.idEntry)
557                ownItemTaxShowBlock.processQuery()
558                lTaxRecordCount = ownItemTaxShowBlock.getRecordCount()
559                for taxRecNum in range(lTaxRecordCount):
560                  ownItemTaxShowBlock.jumpRecord(taxRecNum)
561                  ownItemTaxShowBlock.deleteRecord()
562                  ownItemTaxShowBlock.postChanges()
563                ownItemDeleteBlock.initQuery()
564                ownItemDeleteBlock.idEntry = str(ownItemShowBlock.idEntry)
565                ownItemDeleteBlock.processQuery()
566                ownItemDeleteBlock.deleteRecord()
567                ownItemDeleteBlock.postChanges()
568      
569            ownItemShowBlock.clear()
570            
571                
572          proceedingBlock.initQuery()                postChangeAdvance = 4
         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()  
573    
574        ownItemShowBlock.clear()          ownDocumentTaxShowBlock.initQuery()
575                  ownDocumentTaxShowBlock.ownDocumentEntry = tmpValuesDataSource.idEntry+"%"
576                ownDocumentTaxShowBlock.processQuery()
577        postChangeAdvance = 4          
578        ownDocumentShowBlock.deleteRecord()          lRecordCount = ownDocumentTaxShowBlock.getRecordCount()
579        ownDocumentShowBlock.postChanges()          for recNum in range(lRecordCount):
580              ownDocumentTaxShowBlock.jumpRecord(recNum)
581        commitConnection()            ownDocumentTaxShowBlock.deleteRecord()
582    except DBError, err:          ownDocumentTaxShowBlock.postChanges()
583        rollbackConnection()  
584        callTrigger('rollbackTrigger')          postChangeAdvance = 5
585        message = ["el procedimiento de la Nota de Crédito", "Los Montos de la nota de crédito",          
586                   "el procedimiento","los Items de la Nota de Crédito", "la Nota de Crédito"]          ownDocumentShowBlock.deleteRecord()
587        genericBox("Hay problemas para borrar "+message[postChangeAdvance]+"\n"+str(err),['Aceptar'])          ownDocumentShowBlock.postChanges()
588      
589            commitConnection()
590    totalShowBlock.ivaEntry = "0.00"      except DBError, err:
591    totalShowBlock.netoEntry = "0.00"          rollbackConnection()
592    totalShowBlock.totalEntry = "0.00"          callTrigger('rollbackTrigger')
593    totalShowBlock.clear()          message = ["el procedimiento de la Nota de Crédito", "Los Montos de la nota de crédito",
594                       "el procedimiento","los Items de la Nota de Crédito", "los impuestos de la Nota de Crédito",
595                       "la Nota de Crédito"]
596            genericBox("Hay problemas para borrar "+message[postChangeAdvance]+"\n"+str(err),['Aceptar'])
597      
598      
599        totalShowBlock.ivaEntry = "0.00"
600        totalShowBlock.netoEntry = "0.00"
601        totalShowBlock.totalEntry = "0.00"
602        totalShowBlock.clear()
603    </trigger>    </trigger>
604    
605    
# Line 635  Line 621 
621     if resultBlock.getRecordCount() > 0 and not resultBlock.getCurrentRecord().isEmpty():     if resultBlock.getRecordCount() > 0 and not resultBlock.getCurrentRecord().isEmpty():
622       import hack       import hack
623    
624       recordCount = ownItemShowBlock.getRecordCount()       #recordCount = ownItemShowBlock.getRecordCount()
625       ownItemShowBlock.firstRecord()       #ownItemShowBlock.firstRecord()
626       for index in range(recordCount):       #for index in range(recordCount):
627         ownItemShowBlock.jumpRecord(index)       #  ownItemShowBlock.jumpRecord(index)
628         try:       #  try:
629           ownItemShowBlock.taxPercentEntry = hack.a2f(ownItemShowBlock.taxAmountEntry,2) / \       #    ownItemShowBlock.taxPercentEntry = hack.a2f(ownItemShowBlock.taxAmountEntry,2) / \
630                                                hack.a2f(ownItemShowBlock.unitPriceEntry,2) / \       #                                         hack.a2f(ownItemShowBlock.unitPriceEntry,2) / \
631                                                hack.a2f(ownItemShowBlock.qtyEntry,2) * 100       #                                         hack.a2f(ownItemShowBlock.qtyEntry,2) * 100
632         except:       #  except:
633           pass       #    pass
634    
635       ownItemShowBlock.firstRecord()       ownItemShowBlock.firstRecord()
636    
# Line 679  Line 665 
665        clientResultBlock.reset()        clientResultBlock.reset()
666        clientResultBlock.initQuery()        clientResultBlock.initQuery()
667        if codeToSearch:        if codeToSearch:
668          clientResultBlock.clientCodeEntry = codeToSearch+"%"          clientResultBlock.uidEntry = codeToSearch+"%"
669        if nameToSearch:        if nameToSearch:
670          clientResultBlock.clientNameEntry = nameToSearch+"%"          clientResultBlock.nameEntry = nameToSearch+"%"
671        clientResultBlock.processQuery()        clientResultBlock.processQuery()
672        callTrigger('endWaitingModeTrigger')        callTrigger('endWaitingModeTrigger')
673    
# Line 832  Line 818 
818            <entry name="amountEntry" field="amount" hidden="" x="1" y="1" width="12"/>            <entry name="amountEntry" field="amount" hidden="" x="1" y="1" width="12"/>
819      </block>      </block>
820    
821        <block name="ownDocumentTaxShowBlock" datasource="ownDocumentTaxShowDataSource" transparentBlock="">
822              <entry name="ownDocumentEntry" field="own_document" hidden="" x="1" y="1" width="12"/>
823        </block>
824    
825      <block datasource="ownDocumentShowDataSource" name="ownDocumentShowBlock" restrictInsert="t">      <block datasource="ownDocumentShowDataSource" name="ownDocumentShowBlock" restrictInsert="t">
826    
827          <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 903  Line 893 
893          <label name="taxLbl" text="IVA" x="65" y="13" />          <label name="taxLbl" text="IVA" x="65" y="13" />
894          <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"/>
895    
896          <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=""/> -->
897          <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=""/> -->
898    
899          <label name="discountLbl" text="Descuento" x="71" y="13"/>          <label name="discountLbl" text="Descuento" x="71" y="13"/>
900          <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.2  
changed lines
  Added in v.1.3

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