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

Diff of /papo/forms/payOrder.gfd

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

revision 1.14 by charlie, Mon Feb 17 20:37:08 2003 UTC revision 1.15 by charlie, Mon Feb 24 23:07:20 2003 UTC
# Line 1  Line 1 
1  <?xml version="1.0" encoding="ISO-8859-1"?>  <?xml version="1.0" encoding="ISO-8859-1"?>
2  <!DOCTYPE form SYSTEM "gnue-forms.dtd">  <!DOCTYPE form SYSTEM "gnue-forms.dtd">
3    
4  <form width="78" height="13" title="Carga de Ordenes de Pago a Proveedores">  <form width="88" height="13" title="Carga de Ordenes de Pago a Proveedores">
5    
6    <datasource name="tmpSearchDataSource" cache="1"/>    <datasource name="tmpSearchDataSource" cache="1"/>
7    
# Line 95  Line 95 
95      </condition>      </condition>
96    </datasource>    </datasource>
97    
   <datasource name="serviceInvoiceDataSource" database="papo"  
               table="_entity_data, alien_document, alien_item, alien_service_item, alien_item_tax"  
               order_by="alien_service_item.id">  
     <condition>  
       <and>  
         <eq>  
           <!-- Aqui se refiere al cliente  -->  
           <cfield name="_entity_data.id"/>  
           <cfield name="alien_document.sender"/>  
         </eq>  
         <eq>  
           <cfield name="alien_document.id"/>  
           <cfield name="alien_item.alien_document"/>  
         </eq>  
         <eq>  
           <cfield name="alien_item.id"/>  
           <cfield name="alien_service_item.alien_item"/>  
         </eq>  
         <eq>  
           <cfield name="alien_item.id"/>  
           <cfield name="alien_item_tax.alien_item"/>  
         </eq>  
         <eq>  
           <cfield name="alien_document.alien_document_type"/>  
           <cconst value="5"/>  
         </eq>  
      </and>  
     </condition>  
   </datasource>  
   
98    <datasource name="productInvoiceDataSource" database="papo"    <datasource name="productInvoiceDataSource" database="papo"
99                table="_entity_data, alien_document, alien_item, alien_product_item, alien_item_tax"                table="_entity_data, alien_document, alien_item, alien_product_item, alien_item_tax"
100                order_by="alien_product_item.id">                order_by="alien_product_item.id">
# Line 132  Line 102 
102        <and>        <and>
103          <eq>          <eq>
104            <!-- Aqui se refiere al cliente  -->            <!-- Aqui se refiere al cliente  -->
105            <cfield name="_entity_data.id"/>            <cfield name="_entity_data._table"/>
106            <cfield name="alien_document.sender"/>            <cfield name="alien_document.sender"/>
107          </eq>          </eq>
108          <eq>          <eq>
# Line 223  if str(alienDocumentSearchBlock.provider Line 193  if str(alienDocumentSearchBlock.provider
193      GConditions.GCField(eq,"_entity_data._table")      GConditions.GCField(eq,"_entity_data._table")
194      GConditions.GCConst(eq,str(alienDocumentSearchBlock.providerSearchBox.providerEntry))      GConditions.GCConst(eq,str(alienDocumentSearchBlock.providerSearchBox.providerEntry))
195    
     eq = GConditions.GCeq(condServiceInvoice)  
     GConditions.GCField(eq,"_entity_data._table")  
     GConditions.GCConst(eq,str(alienDocumentSearchBlock.providerSearchBox.providerEntry))  
   
196      eq = GConditions.GCeq(condPay)      eq = GConditions.GCeq(condPay)
197      GConditions.GCField(eq,"_entity_data._table")      GConditions.GCField(eq,"_entity_data._table")
198      GConditions.GCConst(eq,str(alienDocumentSearchBlock.providerSearchBox.providerEntry))      GConditions.GCConst(eq,str(alienDocumentSearchBlock.providerSearchBox.providerEntry))
# Line 235  if str(alienDocumentSearchBlock.provider Line 201  if str(alienDocumentSearchBlock.provider
201      productInvoiceResultSet = productInvoiceDataSource.createResultSet(condProductInvoice)      productInvoiceResultSet = productInvoiceDataSource.createResultSet(condProductInvoice)
202      more = productInvoiceResultSet.firstRecord()      more = productInvoiceResultSet.firstRecord()
203    
204    
205      while more:      while more:
206          invoiceTotal = 0          invoiceTotal = 0
207          currAlienDoc = productInvoiceResultSet.current.getField("alien_document.id")          currAlienDoc = productInvoiceResultSet.current.getField("alien_document.id")
208          tmpInvToPayedBlock.idEntry = str(productInvoiceResultSet.current.getField("alien_document.id"))          tmpInvToPayedBlock.idEntry = str(productInvoiceResultSet.current.getField("alien_document.id"))
   
209          while productInvoiceResultSet.current.getField("alien_document.id") == currAlienDoc and more:          while productInvoiceResultSet.current.getField("alien_document.id") == currAlienDoc and more:
210              lQty = hack.a2f(productInvoiceResultSet.current.getField("alien_product_item.qty"))              lQty = hack.a2f(productInvoiceResultSet.current.getField("alien_product_item.qty"))
211              lUnitPrice = hack.a2f(productInvoiceResultSet.current.getField("alien_product_item.unit_price"))              lUnitPrice = hack.a2f(productInvoiceResultSet.current.getField("alien_product_item.unit_price"))
# Line 264  if str(alienDocumentSearchBlock.provider Line 230  if str(alienDocumentSearchBlock.provider
230          tmpInvToPayedBlock.payedEntry = "0.0"          tmpInvToPayedBlock.payedEntry = "0.0"
231          tmpInvToPayedBlock.newRecord()          tmpInvToPayedBlock.newRecord()
232    
     # Calculo del total facturado por Servicios  
     serviceInvoiceResultSet = serviceInvoiceDataSource.createResultSet(condServiceInvoice)  
     more = serviceInvoiceResultSet.firstRecord()  
   
     while more:  
         invoiceTotal = 0  
         currAlienDoc = serviceInvoiceResultSet.current.getField("alien_document.id")  
         tmpInvToPayedBlock.idEntry = str(serviceInvoiceResultSet.current.getField("alien_document.id"))  
   
         while serviceInvoiceResultSet.current.getField("alien_document.id") == currAlienDoc and more:  
             lUnitPrice = hack.a2f(serviceInvoiceResultSet.current.getField("alien_service_item.amount"))  
             lBonus = hack.a2f(serviceInvoiceResultSet.current.getField("alien_item.bonus"))  
             lDiscount = hack.a2f(serviceInvoiceResultSet.current.getField("alien_item.discount"))  
             item = lUnitPrice - lBonus - lDiscount  
             itemTaxTotal = 0          
             currItem = serviceInvoiceResultSet.current.getField("alien_item.id")  
             while serviceInvoiceResultSet.current.getField("alien_item.id") == currItem and more:  
                 itemTaxTotal += hack.a2f(serviceInvoiceResultSet.current.getField("alien_item_tax.amount"))  
                 more = serviceInvoiceResultSet.nextRecord()  
             invoiceTotal += item + itemTaxTotal  
         odt_rs = invTaxTotDataSource.createResultSet({"alien_document.id":currAlienDoc})  
         odt_more = odt_rs.firstRecord()  
         while odt_more:  
             invoiceTotal += hack.a2f(odt_rs.current.getField("alien_document_tax.amount"))  
             odt_more = odt_rs.nextRecord()  
                   
         tmpInvToPayedBlock.dateEntry = str(serviceInvoiceResultSet.current.getField("alien_document.date"))  
         tmpInvToPayedBlock.numberEntry = str(serviceInvoiceResultSet.current.getField("alien_document.number"))  
         tmpInvToPayedBlock.amountEntry = str(invoiceTotal)  
         tmpInvToPayedBlock.payedEntry = "0.0"  
         tmpInvToPayedBlock.newRecord()  
   
233      # Busco las que ya han sido pagadas      # Busco las que ya han sido pagadas
234      rs = payTotDataSource.createResultSet(condPay)      rs = payTotDataSource.createResultSet(condPay)
235      more = rs.firstRecord()      more = rs.firstRecord()
# Line 303  if str(alienDocumentSearchBlock.provider Line 237  if str(alienDocumentSearchBlock.provider
237          rc = tmpInvToPayedBlock.getRecordCount()          rc = tmpInvToPayedBlock.getRecordCount()
238          for recNum in range(rc):          for recNum in range(rc):
239              tmpInvToPayedBlock.jumpRecord(recNum)              tmpInvToPayedBlock.jumpRecord(recNum)
240              if tmpInvToPayedBlock.idEntry == rs.current.getField("alien_document_proceeding.alien_document"):              if hack.a2f(tmpInvToPayedBlock.idEntry) == hack.a2f(rs.current.getField("alien_document_proceeding.alien_document")):
241                  tmpInvToPayedBlock.payedEntry = str(                  tmpInvToPayedBlock.payedEntry = str(
242                      hack.a2f(tmpInvToPayedBlock.payedEntry) + \                      hack.a2f(tmpInvToPayedBlock.payedEntry) + \
243                      hack.a2f(rs.current.getField("alien_document_proceeding.amount") ) )                      hack.a2f(rs.current.getField("alien_document_proceeding.amount") ) )
# Line 380  callTrigger('cancelTrigger') Line 314  callTrigger('cancelTrigger')
314      ]]></trigger>      ]]></trigger>
315    
316      <trigger name="providerSearchTrigger" type="NAMED"><![CDATA[      <trigger name="providerSearchTrigger" type="NAMED"><![CDATA[
       codeToSearch = str(alienDocumentSearchBlock.providerSearchBox.providerCodeEntry)  
       nameToSearch = str(alienDocumentSearchBlock.providerSearchBox.providerNameEntry)  
317    
318        alienDocumentSearchBlock.providerSearchBox.providerCodeEntry = codeToSearch  callTrigger('startWaitingModeTrigger')
319        alienDocumentSearchBlock.providerSearchBox.providerNameEntry = nameToSearch  providerResultBlock.initQuery()
320    providerResultBlock.providerCodeEntry = str(alienDocumentSearchBlock.providerSearchBox.providerCodeEntry)+"%"
321    providerResultBlock.providerNameEntry = str(alienDocumentSearchBlock.providerSearchBox.providerNameEntry)+"%"
322    providerResultBlock.processQuery()
323    callTrigger('endWaitingModeTrigger')
324    recordCount = providerResultBlock.getRecordCount()
325    
326        callTrigger('startWaitingModeTrigger')  if recordCount > 1:
327        providerResultBlock.initQuery()      
328        providerResultBlock.providerCodeEntry = codeToSearch+"%"      def callback (returnValue):
329        providerResultBlock.providerNameEntry = nameToSearch+"%"          global block
330        providerResultBlock.processQuery()          if returnValue >= 0:
       callTrigger('endWaitingModeTrigger')  
       recordCount = providerResultBlock.getRecordCount()  
   
       if recordCount > 1:  
   
         def callback (returnValue):  
           global block  
           if returnValue >= 0:  
331              providerResultBlock.jumpRecord(returnValue)              providerResultBlock.jumpRecord(returnValue)
332              alienDocumentSearchBlock.providerSearchBox.providerCodeEntry = str(providerResultBlock.providerCodeEntry)              alienDocumentSearchBlock.providerSearchBox.providerCodeEntry = str(providerResultBlock.providerCodeEntry)
333              alienDocumentSearchBlock.providerSearchBox.providerNameEntry = str(providerResultBlock.providerNameEntry)              alienDocumentSearchBlock.providerSearchBox.providerNameEntry = str(providerResultBlock.providerNameEntry)
334              alienDocumentSearchBlock.providerSearchBox.providerEntry = str(providerResultBlock.providerEntry)              alienDocumentSearchBlock.providerSearchBox.providerEntry = str(providerResultBlock.providerEntry)
335                            
336          runForm ('providerSelect.gfd', {'data': providerResultBlock, 'callback': callback})      runForm ('providerSelect.gfd', {'data': providerResultBlock, 'callback': callback})
337        elif recordCount == 1:  elif recordCount == 1:
338          providerResultBlock.jumpRecord(0)      providerResultBlock.jumpRecord(0)
339          alienDocumentSearchBlock.providerSearchBox.providerCodeEntry = str(providerResultBlock.providerCodeEntry)      alienDocumentSearchBlock.providerSearchBox.providerCodeEntry = str(providerResultBlock.providerCodeEntry)
340          alienDocumentSearchBlock.providerSearchBox.providerNameEntry = str(providerResultBlock.providerNameEntry)      alienDocumentSearchBlock.providerSearchBox.providerNameEntry = str(providerResultBlock.providerNameEntry)
341          alienDocumentSearchBlock.providerSearchBox.providerEntry = str(providerResultBlock.providerEntry)      alienDocumentSearchBlock.providerSearchBox.providerEntry = str(providerResultBlock.providerEntry)
342    
343    ]]></trigger>    ]]></trigger>
344    
345    <trigger name="startWaitingModeTrigger" type="NAMED"><![CDATA[    <trigger name="startWaitingModeTrigger" type="NAMED"><![CDATA[
# Line 448  callTrigger('cancelTrigger') Line 378  callTrigger('cancelTrigger')
378    
379      <block datasource="alienDocumentDataSource" name="alienDocumentSearchBlock" restrictInsert="">      <block datasource="alienDocumentDataSource" name="alienDocumentSearchBlock" restrictInsert="">
380    
381        <box height="4" label="Proveedores"        <box height="5" label="Proveedores"
382          name="providerSearchBox" width="75" x="1" y="0">          name="providerSearchBox" width="85" x="1" y="0">
383    
384          <entry field="id" hidden="" name="idEntry" x="1" y="1"/>          <entry field="id" hidden="" name="idEntry" x="1" y="1"/>
385          <entry field="alien_document_type" hidden="" name="typeEntry" x="1" y="1"/>          <entry field="alien_document_type" hidden="" name="typeEntry" x="1" y="1"/>
# Line 457  callTrigger('cancelTrigger') Line 387  callTrigger('cancelTrigger')
387          <entry x="1" y="1" field="sender" name="providerEntry" width="30" hidden=""/>          <entry x="1" y="1" field="sender" name="providerEntry" width="30" hidden=""/>
388          <entry x="1" y="1" name="providerCodeEntry" width="20"/>          <entry x="1" y="1" name="providerCodeEntry" width="20"/>
389          <entry x="21" y="1" name="providerNameEntry" width="35"/>          <entry x="21" y="1" name="providerNameEntry" width="35"/>
         <button name="providerSearchButton" trigger="providerSearchTrigger" label="Buscar"  
           width="7" height="1" x="56" y="1"/>  
   
390          <entry field="date" hidden="" name="dateEntry" style="label" readonly="" typecast="date"          <entry field="date" hidden="" name="dateEntry" style="label" readonly="" typecast="date"
391            rows="1" width="24" x="7" y="7"/>            rows="1" width="24" x="7" y="7"/>
392    
393          <button x="50" y="2" trigger="searchTrigger" width="16" label="Facturas a Pagar"          <button name="providerSearchButton" trigger="providerSearchTrigger" label="Buscar"
394              width="10" height="1" x="60" y="1"/>
395    
396            <button name="cancelButton" trigger="cancelTrigger" label="Cancelar"
397              width="10" height="1" x="71" y="1"/>
398    
399            <button x="60" y="2" trigger="searchTrigger" width="21" label="Facturas a Pagar"
400            name="searchBtn" height="1"/>            name="searchBtn" height="1"/>
401    
402        </box>        </box>
403      </block>      </block>
404    
# Line 478  callTrigger('cancelTrigger') Line 412  callTrigger('cancelTrigger')
412    
413      <block name="invoiceToPayBlock" datasource="invoiceToPayDataSource">      <block name="invoiceToPayBlock" datasource="invoiceToPayDataSource">
414        <box height="12" label="Facturas A Pagar" name="invoiceBox"        <box height="12" label="Facturas A Pagar" name="invoiceBox"
415          width="75" x="1" y="4">          width="85" x="1" y="4">
416          <label name="numberLbl" text="Numero" x="1" y="1"/>          <label name="numberLbl" text="Numero" x="1" y="1"/>
417          <label name="dateLbl" text="Fecha" x="18" y="1"/>          <label name="dateLbl" text="Fecha" x="20" y="1"/>
418          <label name="amountLbl" text="Monto" x="29" y="1"/>          <label name="amountLbl" text="Monto" x="33" y="1"/>
419          <label name="payedLbl" text="Pagado" x="39" y="1"/>          <label name="payedLbl" text="Pagado" x="45" y="1"/>
420          <label name="payLbl" text="A Pagar" x="49" y="1"/>          <label name="payLbl" text="A Pagar" x="57" y="1"/>
421    
422          <entry name="idEntry" field="id" style="label" hidden="" rows="8"          <entry name="idEntry" field="id" style="label" hidden="" rows="8"
423            x="1" y="2" width="1" />            x="1" y="2" width="1" />
424          <entry name="numberEntry" field="number" style="label" rows="8"          <entry name="numberEntry" field="number" style="label" rows="8"
425            x="1" y="2" width="16" readonly=""/>            x="1" y="2" width="19" readonly=""/>
426          <entry name="dateEntry" field="date" style="label" rows="8"          <entry name="dateEntry" field="date" style="label" rows="8"
427            x="18" y="2" width="11" readonly=""/>            x="20" y="2" width="11" readonly=""/>
428          <entry name="amountEntry" field="amount" style="label" rows="8"          <entry name="amountEntry" field="amount" style="label" rows="8"
429            typecast="number" displaymask="%0.2f"            typecast="number" displaymask="%0.2f"
430            x="29" y="2" width="10" readonly=""/>            x="33" y="2" width="10" readonly=""/>
431          <entry name="payedEntry" field="payed" style="label" rows="8"          <entry name="payedEntry" field="payed" style="label" rows="8"
432            x="39" y="2" width="10" readonly=""/>            x="45" y="2" width="11" readonly="" typecast="number" displaymask="%0.2f"/>
433          <entry name="payEntry" field="pay"  rows="8" x="49" y="2" width="10"          <entry name="payEntry" field="pay"  rows="8" x="57" y="2" width="10"
434            typecast="number" displaymask="%0.2f">            typecast="number" displaymask="%0.2f">
435            <trigger type="PRE-FOCUSOUT" src="totalTrigger"/>            <trigger type="PRE-FOCUSOUT" src="totalTrigger"/>
436          </entry>          </entry>
437          <scrollbar page="2" x="59" y="2" width="1" height="8"/>          <scrollbar page="2" x="68" y="2" width="1" height="8"/>
438    
439          <label name="totalLbl" text="Total a Pagar" x="61" y="5"/>          <label name="totalLbl" text="Total a Pagar" x="70" y="5"/>
440          <entry name="totalEntry" field="total" x="61" y="6" width="10" readonly="" typecast="number" displaymask="%0.2f"/>          <entry name="totalEntry" field="total" x="70" y="6" width="10" readonly="" typecast="number" displaymask="%0.2f"/>
441    
442          <button name="acceptButton" trigger="acceptTrigger" label="Aceptar"          <button name="acceptButton" trigger="acceptTrigger" label="Aceptar"
443            width="10" height="1" x="61" y="8"/>            width="10" height="1" x="70" y="8"/>
444          <button name="cancelButton" trigger="cancelTrigger" label="Cancelar"          <button name="cancelButton" trigger="cancelTrigger" label="Cancelar"
445            width="10" height="1" x="61" y="9"/>            width="10" height="1" x="70" y="9"/>
446        </box>        </box>
447      </block>      </block>
448    

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

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