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

Diff of /papo/forms/productInvoice.gfd

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

revision 1.32 by styxman, Tue Jan 14 19:26:19 2003 UTC revision 1.33 by apronotti, Fri Jan 24 14:13:47 2003 UTC
# Line 314  Line 314 
314    <datasource name="ownDocumentProceedingDataSource" database="papo" table="own_document_proceeding"/>    <datasource name="ownDocumentProceedingDataSource" database="papo" table="own_document_proceeding"/>
315    
316    <trigger name="printTrigger" type="NAMED"><![CDATA[    <trigger name="printTrigger" type="NAMED"><![CDATA[
317      from hack import pleasePrint      import hack
318            lCurrentCredit = hack.a2f(tmpValuesDataSource.creditLimitAmount) - \
319      callTrigger ('commitTrigger')                       hack.a2f(ownDocumentBlock.clientRecipientBox.deudaEntry)
     # it's _such_ a pitty  
     # pleasePrint ('serviceInvoice', { 'id': str(ownDocumentBlock.idEntry) })  
     # BUG: select the correct type of invoice?  
     # pleasePrint (self, 'p1', '1', 'serviceInvoice-discriminated', [ 'id='+str(ownDocumentBlock.idEntry) ])  
     pleasePrint (self, 'p1', '1', 'productInvoice', [ 'id='+str(ownDocumentBlock.idEntry) ])  
     callTrigger('rollbackTrigger')  
   ]]></trigger>  
     
   <trigger name="commitTrigger" type="NAMED">  
   import hack  
   lCurrentCredit = hack.a2f(tmpValuesDataSource.creditLimitAmount) - \  
                    hack.a2f(ownDocumentBlock.clientRecipientBox.deudaEntry)  
320    
321    if hack.a2f(payBlock.ctaCteEntry) > lCurrentCredit:      if hack.a2f(payBlock.ctaCteEntry) > lCurrentCredit:
322        genericBox("Esta excedido el Límite de Crédito",["Ok"])        genericBox("Esta excedido el Límite de Crédito",["Ok"])
323    else:      else:
324        if ownItemBlock.getRecordCount() > 0 and len(ownItemBlock.productCNameEntry) > 0:        if ownItemBlock.getRecordCount() > 0 and len(ownItemBlock.productCNameEntry) > 0:
325            callTrigger ('commitTrigger')
326            # it's _such_ a pitty
327            # pleasePrint ('serviceInvoice', { 'id': str(ownDocumentBlock.idEntry) })
328            # BUG: select the correct type of invoice?
329            # pleasePrint (self, 'p1', '1', 'serviceInvoice-discriminated', [ 'id='+str(ownDocumentBlock.idEntry) ])
330            hack.pleasePrint (self, 'p1', '1', 'productInvoice', [ 'id='+str(ownDocumentBlock.idEntry) ])
331            callTrigger('rollbackTrigger')
332            
333      ]]></trigger>
334      
335      <trigger name="commitTrigger" type="NAMED">
336         ownDocumentBlock.numberEntry= str(branchDocumentBlock.documentNumberEntry)
337         branchDocumentBlock.documentNumberEntry.atomicModify (lambda x: int(x)+1)
338    
339            ownDocumentBlock.numberEntry= str(branchDocumentBlock.documentNumberEntry)       ownDocumentBlock.dateEntry = str(tmpBlock.tmpDateEntry )
340            branchDocumentBlock.documentNumberEntry.atomicModify (lambda x: int(x)+1)       if len(ownDocumentBlock.dateEntry) == 0:
341             ownDocumentBlock.dateEntry = ownDocumentDataSource.getTimeStamp()
342            ownDocumentBlock.dateEntry = str(tmpBlock.tmpDateEntry )  
343            if len(ownDocumentBlock.dateEntry) == 0:       proceedingBlock.processRollback()
344                ownDocumentBlock.dateEntry = ownDocumentDataSource.getTimeStamp()       proceedingBlock.idEntry.autofillBySequence('proceeding_id_seq')
345         proceedingBlock.dateEntry = proceedingDataSource.getTimeStamp()
346            proceedingBlock.processRollback()      
347            proceedingBlock.idEntry.autofillBySequence('proceeding_id_seq')       ownDocumentBlock.idEntry.autofillBySequence('own_document_id_seq')
348            proceedingBlock.dateEntry = proceedingDataSource.getTimeStamp()       ownDocumentBlock.typeEntry = "4"
349                  
350            ownDocumentBlock.idEntry.autofillBySequence('own_document_id_seq')       ownDocumentProceedingBlock.processRollback()
351            ownDocumentBlock.typeEntry = "4"       ownDocumentProceedingBlock.proceedingEntry = str(proceedingBlock.idEntry)
352                   ownDocumentProceedingBlock.ownDocumentEntry = str(ownDocumentBlock.idEntry)
353            ownDocumentProceedingBlock.processRollback()       ownDocumentProceedingBlock.amountEntry = str(payBlock.cashEntry)
354            ownDocumentProceedingBlock.proceedingEntry = str(proceedingBlock.idEntry)      
355            ownDocumentProceedingBlock.ownDocumentEntry = str(ownDocumentBlock.idEntry)       currencyMovementBlock.processRollback()
356            ownDocumentProceedingBlock.amountEntry = str(payBlock.cashEntry)       currencyMovementBlock.proceedingEntry = str(proceedingBlock.idEntry)
357                   currencyMovementBlock.movementTypeEntry = "" # Revisar com queda esto
358            currencyMovementBlock.processRollback()       currencyMovementBlock.currencyTypeEntry = "1"
359            currencyMovementBlock.proceedingEntry = str(proceedingBlock.idEntry)       currencyMovementBlock.amountEntry = str(payBlock.cashEntry)
360            currencyMovementBlock.movementTypeEntry = "" # Revisar com queda esto  
361            currencyMovementBlock.currencyTypeEntry = "1"       ownDocumentBlock.commit()
362            currencyMovementBlock.amountEntry = str(payBlock.cashEntry)       lOwnDocId = str(ownDocumentBlock.idEntry)
363    
364            ownDocumentBlock.commit()       ownItemToUpdBlock.initQuery()
365            lOwnDocId = str(ownDocumentBlock.idEntry)       ownItemToUpdBlock.ownDocumentEntry = lOwnDocId
366         ownItemToUpdBlock.processQuery()
367            ownItemToUpdBlock.initQuery()       lRecordCount = ownItemToUpdBlock.getRecordCount()
368            ownItemToUpdBlock.ownDocumentEntry = lOwnDocId       for recNum in range(lRecordCount):
369            ownItemToUpdBlock.processQuery()          ownItemToUpdBlock.jumpRecord(recNum)
370            lRecordCount = ownItemToUpdBlock.getRecordCount()          ownItemToUpdBlock.levelEntry.atomicModify(lambda x:x-round(float(str(ownItemToUpdBlock.qtyEntry)),4))
371            for recNum in range(lRecordCount):       ownItemToUpdBlock.processRollback()
              ownItemToUpdBlock.jumpRecord(recNum)  
              ownItemToUpdBlock.levelEntry.atomicModify(lambda x:x-round(float(str(ownItemToUpdBlock.qtyEntry)),4))  
           ownItemToUpdBlock.processRollback()  
372    
373            setFocus(ownDocumentBlock.clientRecipientBox.clientEntry)       setFocus(ownDocumentBlock.clientRecipientBox.clientEntry)
374    
375    </trigger>    </trigger>
376    
# Line 386  Line 384 
384    
385        
386    tmpBlock.tmpDateEntry = ownDocumentDataSource.getTimeStamp()    tmpBlock.tmpDateEntry = ownDocumentDataSource.getTimeStamp()
   totalBlock.netoEntry = 0  
   totalBlock.ivaEntry = 0  
   totalBlock.totalEntry = 0  
   payBlock.cashEntry = 0  
   payBlock.ctaCteEntry = 0  
387    </trigger>    </trigger>
388    <trigger name="startUp" type="On-Startup">    <trigger name="startUp" type="On-Startup">
389    tmpBlock.tmpDateEntry = ownDocumentDataSource.getTimeStamp()    tmpBlock.tmpDateEntry = ownDocumentDataSource.getTimeStamp()
# Line 641  Line 634 
634            rows="1" width="24" x="7" y="7"/>            rows="1" width="24" x="7" y="7"/>
635          <entry field="number" name="numberEntry" style="label" hidden="" rows="1" width="24" x="7" y="7"/>          <entry field="number" name="numberEntry" style="label" hidden="" rows="1" width="24" x="7" y="7"/>
636    
         <!--button x="65" y="5" trigger="commitTrigger" width="14" label="Aceptar"  
           name="commitBtn" height="1"/-->  
         <button x="65" y="6" trigger="rollbackTrigger" width="14" label="Deshacer"  
           name="rollbackBtn" height="1"/>  
         <button name="printButton" label="Imprimir" trigger="printTrigger"  
           x="65" y="7" width="14" height="1"/>  
 <!--         <button x="65" y="7" trigger="quitTrigger" width="14" label="Salir" -->  
 <!--           name="quitBtn" height="1"/> -->  
637        </block>        </block>
638    
639        <block name="tmpBlock" datasource="tmpValuesDataSource" transparentBlock="">        <block name="tmpBlock" datasource="tmpValuesDataSource" transparentBlock="">
# Line 896  Line 881 
881      <!--     Datasource que sirve para almacenar el resultado de la búsqueda -->      <!--     Datasource que sirve para almacenar el resultado de la búsqueda -->
882        <block datasource="tmpValuesDataSource" name="totalBlock" restrictInsert="">        <block datasource="tmpValuesDataSource" name="totalBlock" restrictInsert="">
883          <label text="Neto " x="1" y="8"/>          <label text="Neto " x="1" y="8"/>
884          <entry name="netoEntry" style="label" readonly="" x="6" y="8" width="12" typecast="number" displaymask="%0.2f"/>          <entry name="netoEntry" style="label" readonly="" x="6" y="8" width="12" typecast="number" displaymask="%0.2f"
885              default="0.00"/>
886          <label text="IVA " x="19" y="8"/>          <label text="IVA " x="19" y="8"/>
887          <entry name="ivaEntry" style="label" readonly="" x="23" y="8" width="12" typecast="number" displaymask="%0.2f"/>          <entry name="ivaEntry" style="label" readonly="" x="23" y="8" width="12" typecast="number" displaymask="%0.2f"
888              default="0.00"/>
889          <label text="Total " x="36" y="8"/>          <label text="Total " x="36" y="8"/>
890          <entry name="totalEntry" style="label" readonly="" x="42" y="8" width="12" typecast="number" displaymask="%0.2f"/>          <entry name="totalEntry" style="label" readonly="" x="42" y="8" width="12" typecast="number" displaymask="%0.2f"
891              default="0.00"/>
892        </block>        </block>
893        <block datasource="ownItemToUpdDataSource" name="ownItemToUpdBlock">        <block datasource="ownItemToUpdDataSource" name="ownItemToUpdBlock">
894          <entry name="ownDocumentEntry" field="own_item.own_document" hidden="" x="1" y="109" width="10"/>              <entry name="ownDocumentEntry" field="own_item.own_document" hidden="" x="1" y="109" width="10"/>    
# Line 925  Line 913 
913        width="82" x="0" y="23">        width="82" x="0" y="23">
914        <block datasource="payDataSource" name="payBlock">        <block datasource="payDataSource" name="payBlock">
915        <label text="Efectivo : " x="1" y="1"/>        <label text="Efectivo : " x="1" y="1"/>
916        <entry name="cashEntry" typecast="number" displaymask="%0.2f" default="0"        <entry name="cashEntry" typecast="number" displaymask="%0.2f" default="0.00"
917          x="11" y="1" width="12">              x="11" y="1" width="12">    
918          <trigger name="cashEntryPreFocusout" type="Pre-Focusout">          <trigger name="cashEntryPreFocusout" type="Pre-Focusout">
919             import hack             import hack
# Line 933  Line 921 
921          </trigger>          </trigger>
922        </entry>        </entry>
923        <label text="Cta. Cte. : " x="24" y="1"/>        <label text="Cta. Cte. : " x="24" y="1"/>
924        <entry name="ctaCteEntry" typecast="number" displaymask="%0.2f" default="0"        <entry name="ctaCteEntry" typecast="number" displaymask="%0.2f" default="0.00"
925          x="36" y="1" width="12">              x="36" y="1" width="12">    
926          <trigger name="ctaCteEntryPreFocusOut" type="Pre-Focusout">          <trigger name="ctaCteEntryPreFocusOut" type="Pre-Focusout">
927             import hack             import hack
928             payBlock.cashEntry = str(hack.a2f(totalBlock.totalEntry) - hack.a2f(payBlock.ctaCteEntry))             payBlock.cashEntry = str(hack.a2f(totalBlock.totalEntry) - hack.a2f(payBlock.ctaCteEntry))
929          </trigger>          </trigger>
930        </entry>        </entry>
931            <button x="65" y="1" trigger="rollbackTrigger" width="14" label="Deshacer"
932              name="rollbackBtn" height="1"/>
933            <button name="printButton" label="Imprimir" trigger="printTrigger"
934              x="50" y="1" width="14" height="1"/>
935    
936        </block>        </block>
937      </box>      </box>
938    </page>    </page>

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.33

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