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

Diff of /papo/forms/receipt.gfd

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

revision 1.24 by styxman, Thu Apr 17 16:54:57 2003 UTC revision 1.25 by charlie, Tue May 6 21:56:10 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 title="Carga de Recibos a Clientes" height="13" width="88">  <form title="Carga de Recibos a Clientes" height="20" width="73">
5    
6    <datasource name="clientSearchDataSource" database="papo"    <datasource name="clientSearchDataSource" database="papo"
7                table="_entity_data, _alien_entity_data, _persona_data, _client_data,                table="_entity_data, _alien_entity_data, _persona_data, _client_data,
# Line 105  Line 105 
105            </eq>            </eq>
106            <eq>            <eq>
107              <cfield name="own_document.own_document_type"/>              <cfield name="own_document.own_document_type"/>
108              <cconst value="10"/> <!-- Factura tipo B -->              <cconst value="8"/> <!-- Factura tipo B -->
109            </eq>            </eq>
110            <eq>            <eq>
111              <cfield name="own_document.own_document_type"/>              <cfield name="own_document.own_document_type"/>
112              <cconst value="11"/> <!-- Factura tipo C -->              <cconst value="9"/> <!-- Factura tipo C -->
113            </eq>            </eq>
114          </or>          </or>
115        </and>        </and>
# Line 146  Line 146 
146      </condition>      </condition>
147    </datasource>    </datasource>
148    
149    <datasource name="invTaxTotDataSource" database="papo"    <datasource name="ownDocumentTaxTotDataSource" database="papo"
150                table="own_document, own_document_tax">                table="own_document, own_document_tax">
151      <condition>      <condition>
152        <eq>        <eq>
# Line 226  Line 226 
226    
227    <datasource name="invoiceToPayedDataSource" cache="1"/>    <datasource name="invoiceToPayedDataSource" cache="1"/>
228    
229      <!-- Origen de datos que contiene el numero de la proxima factura -->
230      <datasource name="branchDocumentDataSource" database="papo"
231        table="branch_document, _branch_document_data" historytable="_branch_document_data">
232        <condition>
233          <and>
234            <eq>
235              <cfield name="branch_document.id"/>
236              <cfield name="_branch_document_data._table"/>
237            </eq>
238            <null>
239              <cfield name="_branch_document_data._end_t"/>
240            </null>
241          </and>
242        </condition>
243      </datasource>
244    
245    <trigger type="NAMED" name="showInvoiceToPayTrigger"><![CDATA[    <trigger type="NAMED" name="showInvoiceToPayTrigger"><![CDATA[
246    
247  callTrigger('startWaitingModeTrigger')  callTrigger('startWaitingModeTrigger')
# Line 256  if str(ownDocumentBlock.clientRecipientB Line 272  if str(ownDocumentBlock.clientRecipientB
272      GConditions.GCField(eq,"_entity_data._table")      GConditions.GCField(eq,"_entity_data._table")
273      GConditions.GCConst(eq,str(ownDocumentBlock.clientRecipientBox.clientEntry))      GConditions.GCConst(eq,str(ownDocumentBlock.clientRecipientBox.clientEntry))
274    
     # Calculo del total facturado por Productos  
275      productInvoiceResultSet = productInvoiceDataSource.createResultSet(condProductInvoice)      productInvoiceResultSet = productInvoiceDataSource.createResultSet(condProductInvoice)
276      more = productInvoiceResultSet.firstRecord()      more = productInvoiceResultSet.firstRecord()
277    
278      while more:      while more:
279          invoiceTotal = 0          invoiceTotal = 0
280          currOwnDoc = productInvoiceResultSet.current.getField("own_document.id")          currOwnDoc = productInvoiceResultSet.current.getField("own_document.id")
281            tmpInvToPayedBlock.idEntry = str(productInvoiceResultSet.current.getField("own_document.id"))
         tmpInvToPayedBlock.idEntry = str(productInvoiceResultSet.current.getField("own_document.id"))  
282          tmpInvToPayedBlock.numberEntry = str(productInvoiceResultSet.current.getField("own_document.number"))          tmpInvToPayedBlock.numberEntry = str(productInvoiceResultSet.current.getField("own_document.number"))
283          tmpInvToPayedBlock.dateEntry = str(productInvoiceResultSet.current.getField("own_document.date"))          tmpInvToPayedBlock.dateEntry = str(productInvoiceResultSet.current.getField("own_document.date"))
284            while productInvoiceResultSet.current.getField("own_document.id") == currOwnDoc and more:
285          while productInvoiceResultSet.current.getField("own_document.id") == currOwnDoc and more:              lQty = hack.a2f(productInvoiceResultSet.current.getField("own_product_item.qty"))
286              lQty = hack.a2f(productInvoiceResultSet.current.getField("own_product_item.qty"))              lUnitPrice = hack.a2f(productInvoiceResultSet.current.getField("own_product_item.unit_price"))
287              lUnitPrice = hack.a2f(productInvoiceResultSet.current.getField("own_product_item.unit_price"))              lBonus = hack.a2f(productInvoiceResultSet.current.getField("own_item.bonus"))
288              lBonus = hack.a2f(productInvoiceResultSet.current.getField("own_item.bonus"))              lDiscount = hack.a2f(productInvoiceResultSet.current.getField("own_item.discount"))
289              lDiscount = hack.a2f(productInvoiceResultSet.current.getField("own_item.discount"))              item = lQty * lUnitPrice - lBonus - lDiscount
290              item = lQty * lUnitPrice - lBonus - lDiscount              #print "qty %d * unit_price %d - bonus %d - discount %d = %d " % (lQty, lUnitPrice, lBonus, lDiscount, lQty * lUnitPrice - lBonus - lDiscount)
291              itemTaxTotal = 0              itemTaxTotal = 0
292              currItem = productInvoiceResultSet.current.getField("own_item.id")              currItem = productInvoiceResultSet.current.getField("own_item.id")
293              while productInvoiceResultSet.current.getField("own_item.id") == currItem and more:              while productInvoiceResultSet.current.getField("own_item.id") == currItem and more:
294                  itemTaxTotal += hack.a2f(productInvoiceResultSet.current.getField("own_item_tax.amount"))                  itemTaxTotal += hack.a2f(productInvoiceResultSet.current.getField("own_item_tax.amount"))
295                  more = productInvoiceResultSet.nextRecord()                  more = productInvoiceResultSet.nextRecord()
296              invoiceTotal += item + itemTaxTotal              invoiceTotal += item + itemTaxTotal
297          odt_rs = invTaxTotDataSource.createResultSet({"own_document.id":currOwnDoc})          # Calcula los impuestos del documento en si
298          odt_more = odt_rs.firstRecord()          odt_rs = ownDocumentTaxTotDataSource.createResultSet({"own_document.id":currOwnDoc})
299          while odt_more:          odt_more = odt_rs.firstRecord()
300              invoiceTotal += hack.a2f(odt_rs.current.getField("own_document_tax.amount"))          while odt_more:
301              odt_more = odt_rs.nextRecord()              invoiceTotal += hack.a2f(odt_rs.current.getField("own_document_tax.amount"))
302                odt_more = odt_rs.nextRecord()
303    
304          tmpInvToPayedBlock.amountEntry = str(invoiceTotal)          tmpInvToPayedBlock.amountEntry = str(invoiceTotal)
305          tmpInvToPayedBlock.payedEntry = "0.0"          tmpInvToPayedBlock.payedEntry = "0.0"
# Line 521  invoiceToPayedBlock.invoiceBox.totalEntr Line 536  invoiceToPayedBlock.invoiceBox.totalEntr
536      <block datasource="ownDocumentDataSource" name="ownDocumentBlock">      <block datasource="ownDocumentDataSource" name="ownDocumentBlock">
537        <entry field="id" hidden="" name="idEntry" x="1" y="1"/>        <entry field="id" hidden="" name="idEntry" x="1" y="1"/>
538        <entry field="own_document_type" hidden="" name="typeEntry" x="1" y="1"/>        <entry field="own_document_type" hidden="" name="typeEntry" x="1" y="1"/>
539        <box height="5" label="Datos del Cliente" name="clientRecipientBox" width="85" x="0" y="0">        <box height="5" label="Datos del Cliente" name="clientRecipientBox" width="72" x="0" y="0">
540    
541          <entry x="1" y="1" field="recipient" name="clientEntry" width="30" hidden=""/>          <entry x="1" y="1" field="recipient" name="clientEntry" width="30" hidden=""/>
542          <entry x="1" y="1" name="clientCodeEntry" width="20"/>          <entry x="1" y="1" name="clientCodeEntry" width="20"/>
# Line 531  invoiceToPayedBlock.invoiceBox.totalEntr Line 546  invoiceToPayedBlock.invoiceBox.totalEntr
546            rows="1" width="24" x="7" y="7"/>            rows="1" width="24" x="7" y="7"/>
547    
548          <button name="showInvoicesButton" trigger="showInvoiceToPayTrigger"          <button name="showInvoicesButton" trigger="showInvoiceToPayTrigger"
549            label="Facturas Pendientes" width="20" height="1" x="60" y="2"/>            label="Facturas Pendientes" width="20" height="1" x="37" y="2"/>
550          <button name="clientSearchButton" trigger="clientSearchTrigger" label="Buscar"          <button name="clientSearchButton" trigger="clientSearchTrigger" label="Buscar"
551            width="10" height="1" x="60" y="1"/>            width="10" height="1" x="58" y="1"/>
552          <button name="cancelButton" trigger="cancelTrigger" label="Cancelar"          <button name="cancelButton" trigger="cancelTrigger" label="Cancelar"
553            width="10" height="1" x="70" y="1"/>            width="10" height="1" x="58" y="2"/>
554    
555        </box>        </box>
556      </block>      </block>
# Line 549  invoiceToPayedBlock.invoiceBox.totalEntr Line 564  invoiceToPayedBlock.invoiceBox.totalEntr
564      </block>      </block>
565    
566      <block name="invoiceToPayedBlock" datasource="invoiceToPayedDataSource">      <block name="invoiceToPayedBlock" datasource="invoiceToPayedDataSource">
567        <box height="12" label="Facturas Pendientes de Pago" name="invoiceBox"        <box height="13" label="Facturas Pendientes de Pago" name="invoiceBox"
568          width="85" x="0" y="4">          width="72" x="0" y="4">
569          <label name="numberLbl" text="Numero" x="1" y="1"/>          <label name="numberLbl" text="Numero" x="1" y="1"/>
570          <label name="dateLbl" text="Fecha" x="20" y="1"/>          <label name="dateLbl" text="Fecha" x="20" y="1"/>
571          <label name="amountLbl" text="Monto" x="33" y="1"/>          <label name="amountLbl" text="Monto" x="33" y="1"/>
# Line 571  invoiceToPayedBlock.invoiceBox.totalEntr Line 586  invoiceToPayedBlock.invoiceBox.totalEntr
586          </entry>          </entry>
587          <scrollbar page="2" x="68" y="2" width="1" height="8"/>          <scrollbar page="2" x="68" y="2" width="1" height="8"/>
588    
589          <label name="totalLbl" text="Total a Pagar" x="70" y="5"/>          <label name="totalLbl" text="Total a Pagar" x="43" y="10"/>
590          <entry name="totalEntry" field="total" x="70" y="6" width="10" readonly=""          <entry name="totalEntry" field="total" x="57" y="10" width="10" readonly=""
591            typecast="number" displaymask="%0.2f"/>            typecast="number" displaymask="%0.2f"/>
592    
593          <button name="acceptButton" trigger="acceptTrigger" label="Aceptar"          <button name="acceptButton" trigger="acceptTrigger" label="Aceptar"

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25

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