/[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.18 by apronotti, Thu Nov 28 16:10:11 2002 UTC revision 1.19 by apronotti, Thu Nov 28 16:41:38 2002 UTC
# Line 434  Line 434 
434                  eq = GConditions.GCeq(cond)                  eq = GConditions.GCeq(cond)
435                  GConditions.GCField(eq,"_entity_data._table")                  GConditions.GCField(eq,"_entity_data._table")
436                  GConditions.GCConst(eq,str(ownDocumentBlock.clientRecipientBox.currentClientEntry))                  GConditions.GCConst(eq,str(ownDocumentBlock.clientRecipientBox.currentClientEntry))
                 print "currentClientEntry",ownDocumentBlock.clientRecipientBox.currentClientEntry  
437    
438              # Calculo del total facturado              # Calculo del total facturado
439              #rs = invTotDataSource.createResultSet(cond)              #rs = invTotDataSource.createResultSet(cond)
# Line 445  Line 444 
444              while more:              while more:
445                  itemTot = 0                  itemTot = 0
446                  currOwnDoc = rs.current.getField("own_document.id")                  currOwnDoc = rs.current.getField("own_document.id")
                 print currOwnDoc  
447                  while rs.current.getField("own_document.id") == currOwnDoc and more:                  while rs.current.getField("own_document.id") == currOwnDoc and more:
448                      lQty = hack.a2f(rs.current.getField("own_product_item.qty"))                      lQty = hack.a2f(rs.current.getField("own_product_item.qty"))
449                      lUnitPrice = hack.a2f(rs.current.getField("_price_data.unit_price"))                      lUnitPrice = hack.a2f(rs.current.getField("_price_data.unit_price"))
450                      lBonus = hack.a2f(rs.current.getField("own_item.bonus"))                      lBonus = hack.a2f(rs.current.getField("own_item.bonus"))
451                      lDiscount = hack.a2f(rs.current.getField("own_item.discount"))                      lDiscount = hack.a2f(rs.current.getField("own_item.discount"))
452                      itemTot += lQty * lUnitPrice - lBonus - lDiscount                      lItem = lQty * lUnitPrice - lBonus - lDiscount
453                      print "qty %d * unit_price %d - bonus %d - discount %d = %d " % (lQty, lUnitPrice, lBonus, lDiscount, lQty * lUnitPrice - lBonus - lDiscount)                      itemTot += lItem
454                        #print "qty %d * unit_price %d - bonus %d - discount %d = %d " % (lQty, lUnitPrice, lBonus, lDiscount, lQty * lUnitPrice - lBonus - lDiscount)
455                      taxTot = 0                              taxTot = 0        
456                      currItem = rs.current.getField("own_item.id")                      currItem = rs.current.getField("own_item.id")
457                      while rs.current.getField("own_item.id") == currItem and more:                      while rs.current.getField("own_item.id") == currItem and more:
458                          taxTot += itemTot * (hack.a2f(rs.current.getField("own_item_tax.amount"))/100)                          taxTot += lItem * (hack.a2f(rs.current.getField("own_item_tax.amount"))/100)
459                          more = rs.nextRecord()                          more = rs.nextRecord()
460                      invTotal += taxTot                      invTotal += taxTot
                     print invTotal  
461                  invTotal += itemTot #- hack.a2f(rs.current.getField("own_document.bonus"))                  invTotal += itemTot #- hack.a2f(rs.current.getField("own_document.bonus"))
462                  # Calcula los impuestos del documento en si                  # Calcula los impuestos del documento en si
463                  odt_rs = invTaxTotDataSource.createResultSet({"own_document.id":currOwnDoc})                  odt_rs = invTaxTotDataSource.createResultSet({"own_document.id":currOwnDoc})
# Line 478  Line 475 
475              payTotal = 0              payTotal = 0
476    
477              while more:              while more:
                 print "proceeding ",hack.a2f(rs.current.getField("own_document_proceeding.amount"))  
478                  payTotal += hack.a2f(rs.current.getField("own_document_proceeding.amount"))                  payTotal += hack.a2f(rs.current.getField("own_document_proceeding.amount"))
479                  more = rs.nextRecord()                  more = rs.nextRecord()
480    
481              print "invTotal ", invTotal              #print "invTotal ", invTotal
482              print "balance ", balance              #print "balance ", balance
483              print "payTotal ", payTotal              #print "payTotal ", payTotal
484              # Calculo del total adeudado              # Calculo del total adeudado
485              deudaTotal = invTotal - balance - payTotal              deudaTotal = invTotal - balance - payTotal
486              ownDocumentBlock.clientRecipientBox.deudaEntry = deudaTotal              ownDocumentBlock.clientRecipientBox.deudaEntry = deudaTotal

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

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