/[papo]/papo/forms/serviceInvoice.gfd
ViewVC logotype

Diff of /papo/forms/serviceInvoice.gfd

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

revision 1.17 by styxman, Mon Jan 6 17:52:15 2003 UTC revision 1.18 by apronotti, Fri Jan 24 14:13:47 2003 UTC
# Line 296  Line 296 
296        
297    <!-- buttons triggers -->    <!-- buttons triggers -->
298    <trigger name="printTrigger" type="NAMED"><![CDATA[    <trigger name="printTrigger" type="NAMED"><![CDATA[
299      from hack import pleasePrint      import hack
300        
301      callTrigger ('commitTrigger')      currentCredit= hack.a2f (calculatedValuesDataSource.creditLimitAmount) - \
302      # it's _such_ a pitty        hack.a2f (ownDocumentBlock.clientRecipientBox.debtEntry)
303      # pleasePrint ('serviceInvoice', { 'id': str(ownDocumentBlock.idEntry) })  
304      # BUG: select the correct type of invoice?      if hack.a2f (paymentBlock.ctaCteEntry) > currentCredit:
305      # pleasePrint (self, 'p1', '1', 'serviceInvoice-discriminated', [ 'id='+str(ownDocumentBlock.idEntry) ])        genericBox ("Está excedido el Límite de Crédito",["Ok"])
306        else:
307          if ownItemBlock.getRecordCount () > 0 and len (ownItemBlock.serviceEntry) > 0:
308            callTrigger ('commitTrigger')
309            # it's _such_ a pitty
310            # pleasePrint ('serviceInvoice', { 'id': str(ownDocumentBlock.idEntry) })
311            # BUG: select the correct type of invoice?
312            # pleasePrint (self, 'p1', '1', 'serviceInvoice-discriminated', [ 'id='+str(ownDocumentBlock.idEntry) ])
313    
314      pleasePrint (self, 'p1', '1', 'serviceInvoice', [ 'id='+str(ownDocumentBlock.idEntry) ])          hack.pleasePrint (self, 'p1', '1', 'serviceInvoice', [ 'id='+str(ownDocumentBlock.idEntry) ])
315      callTrigger('rollbackTrigger')          callTrigger('rollbackTrigger')
316            
317    ]]></trigger>    ]]></trigger>
318        
319    <trigger name="fixDateTrigger" type="NAMED"><![CDATA[    <trigger name="fixDateTrigger" type="NAMED"><![CDATA[
# Line 333  Line 341 
341      branchDocumentBlock.processQuery()      branchDocumentBlock.processQuery()
342            
343      dateBlock.dateEntry= ownDocumentDataSource.getTimeStamp ()      dateBlock.dateEntry= ownDocumentDataSource.getTimeStamp ()
     totalBlock.totalEntry= ""  
     paymentBlock.cashEntry= ""  
     paymentBlock.ctaCteEntry= ""  
344    ]]></trigger>    ]]></trigger>
345        
346    <trigger name="commitTrigger" type="NAMED"><![CDATA[    <trigger name="commitTrigger" type="NAMED"><![CDATA[
347      from hack import a2f       # copy the date
348         ownDocumentBlock.dateEntry= str(dateBlock.dateEntry)
349         ownDocumentBlock.numberEntry= str(branchDocumentBlock.documentNumberEntry)
350      currentCredit= a2f (calculatedValuesDataSource.creditLimitAmount) - \       branchDocumentBlock.documentNumberEntry.atomicModify (lambda x: int(x)+1)
351        a2f (ownDocumentBlock.clientRecipientBox.debtEntry)      
352         # el form no esta vacio
353      if a2f (paymentBlock.ctaCteEntry) > currentCredit:       if len(ownDocumentBlock.dateEntry)==0:
354        genericBox ("Está excedido el Límite de Crédito",["Ok"])         ownDocumentBlock.dateEntry= ownDocumentDataSource.getTimeStamp ()
355      else:  
356        if ownItemBlock.getRecordCount () > 0 and len (ownItemBlock.serviceEntry) > 0:       proceedingBlock.processRollback ()
357          # copy the date       proceedingBlock.idEntry.autofillBySequence ('proceeding_id_seq')
358          ownDocumentBlock.dateEntry= str(dateBlock.dateEntry)       proceedingBlock.dateEntry= proceedingDataSource.getTimeStamp ()
359          ownDocumentBlock.numberEntry= str(branchDocumentBlock.documentNumberEntry)  
360          branchDocumentBlock.documentNumberEntry.atomicModify (lambda x: int(x)+1)       ownDocumentBlock.idEntry.autofillBySequence ('own_document_id_seq')
361                 ownDocumentBlock.typeEntry= "1"
362          # el form no esta vacio  
363          if len(ownDocumentBlock.dateEntry)==0:       ownDocumentProceedingBlock.processRollback ()
364            ownDocumentBlock.dateEntry= ownDocumentDataSource.getTimeStamp ()       ownDocumentProceedingBlock.proceedingEntry= str (proceedingBlock.idEntry)
365         ownDocumentProceedingBlock.ownDocumentEntry= str (ownDocumentBlock.idEntry)
366          proceedingBlock.processRollback ()       ownDocumentProceedingBlock.amountEntry= str (paymentBlock.cashEntry)
367          proceedingBlock.idEntry.autofillBySequence ('proceeding_id_seq')  
368          proceedingBlock.dateEntry= proceedingDataSource.getTimeStamp ()       # movimiento en pesos
369         currencyMovementBlock.processRollback ()
370          ownDocumentBlock.idEntry.autofillBySequence ('own_document_id_seq')       currencyMovementBlock.proceedingEntry= str (proceedingBlock.idEntry)
371          ownDocumentBlock.typeEntry= "1"       currencyMovementBlock.movementTypeEntry= "" # Revisar como queda esto
372         currencyMovementBlock.currencyTypeEntry= "1"
373          ownDocumentProceedingBlock.processRollback ()       currencyMovementBlock.amountEntry= str (paymentBlock.cashEntry)
         ownDocumentProceedingBlock.proceedingEntry= str (proceedingBlock.idEntry)  
         ownDocumentProceedingBlock.ownDocumentEntry= str (ownDocumentBlock.idEntry)  
         ownDocumentProceedingBlock.amountEntry= str (paymentBlock.cashEntry)  
   
         # movimiento en pesos  
         currencyMovementBlock.processRollback ()  
         currencyMovementBlock.proceedingEntry= str (proceedingBlock.idEntry)  
         currencyMovementBlock.movementTypeEntry= "" # Revisar como queda esto  
         currencyMovementBlock.currencyTypeEntry= "1"  
         currencyMovementBlock.amountEntry= str (paymentBlock.cashEntry)  
374    
375          ownDocumentBlock.commit ()       ownDocumentBlock.commit ()
376    
377          setFocus(ownDocumentBlock.clientRecipientBox.clientEntry)       setFocus(ownDocumentBlock.clientRecipientBox.clientEntry)
378    
379        # this is enough       # this is enough
380        # and more modularized       # and more modularized
381    ]]></trigger>    ]]></trigger>
382    
383    <trigger name="commitAndRollBackTrigger" type="NAMED"><![CDATA[    <trigger name="commitAndRollBackTrigger" type="NAMED"><![CDATA[
# Line 568  Line 563 
563              x="43" y="1"/>              x="43" y="1"/>
564            <!-- foreign_key y foreign_key_description estan deprecados -->            <!-- foreign_key y foreign_key_description estan deprecados -->
565            <!-- se van a llamar fk_source y fk_description respectivamente -->            <!-- se van a llamar fk_source y fk_description respectivamente -->
566            <entry name="creditLimitEntry" field="recipient" style="textlookup" readonly="" typecast="number" displaymask="%0.2f"            <entry name="creditLimitEntry" field="recipient" style="textlookup" readonly=""  
567              foreign_key="textLookUpCreditLimitDataSource._entity_data.id"              foreign_key="textLookUpCreditLimitDataSource._entity_data.id"
568              foreign_key_description="_credit_limit_data.credit_limit"              foreign_key_description="_credit_limit_data.credit_limit"
569              x="43" y="2" width="8"/>              x="43" y="2" width="8"/>
# Line 578  Line 573 
573              x="55" y="2" width="12"/>              x="55" y="2" width="12"/>
574          </box>          </box>
575                    
         <!-- buttons -->  
         <!--button name="commitButton" label="Aceptar" trigger="commitAndRollBackTrigger"  
           x="65" y="3" width="14" height="1"/-->  
         <button name="rollbackButton" label="Deshacer" trigger="rollbackTrigger"  
           x="65" y="4" width="14" height="1"/>  
         <button name="printButton" label="Imprimir" trigger="printTrigger"  
           x="65" y="5" width="14" height="1"/>  
         <!-- button name="quitButton" label="Salir" trigger="quitTrigger"  
           x="65" y="6" width="14" height="1"/ -->  
576        </block>        </block>
577                
578        <!-- fecha -->        <!-- fecha -->
# Line 671  Line 657 
657        <block name="totalBlock" datasource="calculatedValuesDataSource">        <block name="totalBlock" datasource="calculatedValuesDataSource">
658          <label text="Total"          <label text="Total"
659            x="53" y="13"/>            x="53" y="13"/>
660          <entry name="totalEntry" style="label" typecast="number" displaymask="%0.2f"          <entry name="totalEntry" style="label" typecast="number" displaymask="%0.2f" default="0.00"
661            x="64" y="13" width="12"/>            x="64" y="13" width="12"/>
662        </block>        </block>
663      </box>      </box>
# Line 680  Line 666 
666        <block name="paymentBlock" datasource="paymentDataSource">        <block name="paymentBlock" datasource="paymentDataSource">
667          <label text="Efectivo :"          <label text="Efectivo :"
668            x="1" y="1"/>            x="1" y="1"/>
669          <entry name="cashEntry" typecast="number" displaymask="%0.2f"          <entry name="cashEntry" typecast="number" displaymask="%0.2f" default="0.00"
670            x="11" y="1" width="12">                x="11" y="1" width="12">    
671            <trigger name="cashEntryPreFocusOut" type="Pre-Focusout"><![CDATA[            <trigger name="cashEntryPreFocusOut" type="Pre-Focusout"><![CDATA[
672              from hack import a2f              from hack import a2f
# Line 690  Line 676 
676          </entry>          </entry>
677          <label text="Cta. Cte. :"          <label text="Cta. Cte. :"
678            x="24" y="1"/>            x="24" y="1"/>
679          <entry name="ctaCteEntry" typecast="number" displaymask="%0.2f"          <entry name="ctaCteEntry" typecast="number" displaymask="%0.2f" default="0.00"
680            x="36" y="1" width="12">                x="36" y="1" width="12">    
681            <trigger name="ctaCteEntryPreFocusOut" type="Pre-Focusout"><![CDATA[            <trigger name="ctaCteEntryPreFocusOut" type="Pre-Focusout"><![CDATA[
682              from hack import a2f              from hack import a2f
# Line 698  Line 684 
684              paymentBlock.cashEntry= str (a2f (totalBlock.totalEntry) - a2f (paymentBlock.ctaCteEntry))              paymentBlock.cashEntry= str (a2f (totalBlock.totalEntry) - a2f (paymentBlock.ctaCteEntry))
685            ]]></trigger>            ]]></trigger>
686          </entry>          </entry>
687            <!-- buttons -->
688            <!--button name="commitButton" label="Aceptar" trigger="commitAndRollBackTrigger"
689              x="65" y="3" width="14" height="1"/-->
690            <button name="rollbackButton" label="Deshacer" trigger="rollbackTrigger"
691              x="65" y="1" width="14" height="1"/>
692            <button name="printButton" label="Imprimir" trigger="printTrigger"
693              x="50" y="1" width="14" height="1"/>
694            <!-- button name="quitButton" label="Salir" trigger="quitTrigger"
695              x="65" y="6" width="14" height="1"/ -->
696    
697        </block>        </block>
698      </box>      </box>
699      <!-- blocks needed due to broken functionality -->      <!-- blocks needed due to broken functionality -->

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

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