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

Diff of /papo/forms/ivaSales.neb

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

revision 1.9 by mhepp, Fri Jun 6 19:42:35 2003 UTC revision 1.10 by mhepp, Mon Jun 9 18:36:11 2003 UTC
# Line 6  Line 6 
6    </neb:Block>    </neb:Block>
7    <datasource name="printDataSource" cache="1"/>    <datasource name="printDataSource" cache="1"/>
8    
9    <!-- Origen de datos que srive para calcular el total facturado -->    <!-- Origen de datos que srive para calcular el total facturado  
10            own_item, own_product_item, _price_data, own_item_tax,      -->
11    
12    <datasource name="productInvoiceDataSource" database="papo"    <datasource name="productInvoiceDataSource" database="papo"
13                table=" _entity_data as client, own_document, own_item, own_product_item, _price_data, own_item_tax, _entity_uid_data"                table=" _entity_data as client, own_document, _entity_uid_data"
14                order_by="own_document.date">                order_by="own_document.date">
15      <condition>      <condition>
16        <and>        <and>
# Line 22  Line 23 
23            <cfield name="own_document.id"/>            <cfield name="own_document.id"/>
24            <cfield name="own_item.own_document"/>            <cfield name="own_item.own_document"/>
25          </eq>          </eq>
26          <eq>          <!--  <eq> -->
27            <cfield name="own_item.id"/>          <!--           <cfield name="own_item.id"/> -->
28            <cfield name="own_product_item.own_item"/>          <!--           <cfield name="own_product_item.own_item"/> -->
29          </eq>          <!--         </eq> -->
30          <eq>          <!--         <eq> -->
31            <cfield name="own_product_item.price"/>          <!--           <cfield name="own_product_item.price"/> -->
32            <cfield name="_price_data.id"/>          <!--           <cfield name="_price_data.id"/> -->
33          </eq>          <!--         </eq> -->
34          <eq>          <!--         <eq> -->
35            <cfield name="own_item.id"/>          <!--           <cfield name="own_item.id"/> -->
36            <cfield name="own_item_tax.own_item"/>          <!--           <cfield name="own_item_tax.own_item"/> -->
37          </eq>          <!--         </eq> -->
38          <eq>          <eq>
39            <cfield name="client._table"/>            <cfield name="client._table"/>
40            <cfield name="_entity_uid_data.entity"/>            <cfield name="_entity_uid_data.entity"/>
# Line 275  else: Line 276  else:
276        else :        else :
277           voidDocument = "false"           voidDocument = "false"
278                
279        while productInvoiceResultSet.current.getField("own_document.id") == currOwnDoc and more:        #while productInvoiceResultSet.current.getField("own_document.id") == currOwnDoc and more:
280          lQty = hack.a2f(productInvoiceResultSet.current.getField("own_product_item.qty"))        #lQty = hack.a2f(productInvoiceResultSet.current.getField("own_product_item.qty"))
281          lUnitPrice = hack.a2f(productInvoiceResultSet.current.getField("_price_data.unit_price"))        #lUnitPrice = hack.a2f(productInvoiceResultSet.current.getField("_price_data.unit_price"))
282          lBonus = hack.a2f(productInvoiceResultSet.current.getField("own_item.bonus"))        #lBonus = hack.a2f(productInvoiceResultSet.current.getField("own_item.bonus"))
283          lDiscount = hack.a2f(productInvoiceResultSet.current.getField("own_item.discount"))        #lDiscount = hack.a2f(productInvoiceResultSet.current.getField("own_item.discount"))
284          item = lQty * lUnitPrice - lBonus - lDiscount        #item = lQty * lUnitPrice - lBonus - lDiscount
285          currItem = productInvoiceResultSet.current.getField("own_item.id")        #currItem = productInvoiceResultSet.current.getField("own_item.id")
286          while productInvoiceResultSet.current.getField("own_document.id") == currOwnDoc and productInvoiceResultSet.current.getField("own_item.id") == currItem and more:        #while productInvoiceResultSet.current.getField("own_document.id") == currOwnDoc and productInvoiceResultSet.current.getField("own_item.id") == currItem and more:
287              #print currOwnDoc,currItem,str(productInvoiceResultSet.current.getField("own_item_tax.id")),"\n"        #print currOwnDoc,currItem,str(productInvoiceResultSet.current.getField("own_item_tax.id")),"\n"
288              itemTaxTotal += hack.a2f(productInvoiceResultSet.current.getField("own_item_tax.amount"))        #    itemTaxTotal += hack.a2f(productInvoiceResultSet.current.getField("own_item_tax.amount"))
289              more = productInvoiceResultSet.nextRecord()        #    more = productInvoiceResultSet.nextRecord()
290          invoiceTotal += item        #invoiceTotal += item
291        odt_rs = invTaxTotDataSource.createResultSet({"own_document.id":currOwnDoc})        #odt_rs = invTaxTotDataSource.createResultSet({"own_document.id":currOwnDoc})
292        odt_more = odt_rs.firstRecord()        #odt_more = odt_rs.firstRecord()
293        while odt_more:        #while odt_more:
294          invoiceTotal += hack.a2f(odt_rs.current.getField("own_document_tax.amount"))        #invoiceTotal += hack.a2f(odt_rs.current.getField("own_document_tax.amount"))
295          odt_more = odt_rs.nextRecord()        #odt_more = odt_rs.nextRecord()
296        #signo del comprobante        #signo del comprobante
297        if voidDocument == "true" :        if voidDocument == "true" :
298         line += "|" + printing.printTitle("anulado",14)         line += "|" + printing.printTitle("anulado",14)
299         line += "|" + printing.printTitle("anulado",12)         line += "|" + printing.printTitle("anulado",12)
300         line += "|" + printing.printTitle("anulado",14)         line += "|" + printing.printTitle("anulado",14)
301        else:        else:
302         itemTaxTotal = itemTaxTotal * hack.a2f(sign)         itemTaxTotal =hack.a2f( productInvoiceResultSet.current.getField("own_document.tax_total")) * hack.a2f(sign)
303         invoiceTotal = invoiceTotal * hack.a2f(sign)         invoiceTotal =hack.a2f( productInvoiceResultSet.current.getField("own_document.net_total")) * hack.a2f(sign)
304         line += "|" + printing.printAccount(invoiceTotal,14)         line += "|" + printing.printAccount(invoiceTotal,14)
305         line += "|" + printing.printAccount(itemTaxTotal,12)         line += "|" + printing.printAccount(itemTaxTotal,12)
306         line += "|" + printing.printAccount((itemTaxTotal+invoiceTotal),14)         line += "|" + printing.printAccount((itemTaxTotal+invoiceTotal),14)
307         totalIVA += itemTaxTotal         totalIVA += itemTaxTotal
308         totalNeto += invoiceTotal         totalNeto += invoiceTotal
309        table.append(line)        table.append(line)
310          more = productInvoiceResultSet.nextRecord()
311    callTrigger('endWaitingModeTrigger')    callTrigger('endWaitingModeTrigger')
312    
313    line = "\n"+printing.printField("Total",80,'r') + "|"    line = "\n"+printing.printField("Total",80,'r') + "|"

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

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