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

Diff of /papo/forms/productInvoice.neb

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

revision 1.16 by charlie, Thu May 29 21:33:37 2003 UTC revision 1.17 by charlie, Fri May 30 21:32:44 2003 UTC
# Line 573  Line 573 
573    # print "Leng Product Name: ", len(ownItemBlock.prodNameSEntry)    # print "Leng Product Name: ", len(ownItemBlock.prodNameSEntry)
574    if ownItemBlock.getRecordCount() > 0 and len(ownItemBlock.prodNameSEntry) > 0:    if ownItemBlock.getRecordCount() > 0 and len(ownItemBlock.prodNameSEntry) > 0:
575        import hack        import hack
576        lCurrentCredit = hack.a2f(tmpValuesDataSource.creditLimitAmount) - \        lCurrentCredit = round(hack.a2f(tmpValuesDataSource.creditLimitAmount,2) - \
577                         hack.a2f(ownDocumentBlock.clientRecipientBox.deudaEntry)                         hack.a2f(ownDocumentBlock.clientRecipientBox.deudaEntry,2),2)
578    
579        if hack.a2f(payBlock.ctaCteEntry) > lCurrentCredit:        if hack.a2f(payBlock.ctaCteEntry,2) > lCurrentCredit:
580            genericBox("Esta excedido el Límite de Crédito",["Aceptar"])            genericBox("Esta excedido el Límite de Crédito",["Aceptar"])
581        elif not str(ownDocumentBlock.invoiceTypeEntry):        elif not str(ownDocumentBlock.invoiceTypeEntry):
582            genericBox("Falta el tipo de factura",["Aceptar"])            genericBox("Falta el tipo de factura",["Aceptar"])
# Line 618  Line 618 
618        rc = currencyTypeBlock.getRecordCount()        rc = currencyTypeBlock.getRecordCount()
619        for recNum in range(rc):        for recNum in range(rc):
620            currencyTypeBlock.jumpRecord(recNum)            currencyTypeBlock.jumpRecord(recNum)
621            if hack.a2f(currencyTypeBlock.currencyBox.payEntry) > 0:            if hack.a2f(currencyTypeBlock.currencyBox.payEntry,2) > 0:
622                if not currencyMovementBlock.getCurrentRecord().isEmpty():                if not currencyMovementBlock.getCurrentRecord().isEmpty():
623                    currencyMovementBlock.newRecord()                    currencyMovementBlock.newRecord()
624                currencyMovementBlock.proceedingEntry = str(proceedingBlock.idEntry)                currencyMovementBlock.proceedingEntry = str(proceedingBlock.idEntry)
625                currencyMovementBlock.movementTypeEntry = "" # Revisar com queda esto                currencyMovementBlock.movementTypeEntry = "" # Revisar com queda esto
626                currencyMovementBlock.currencyTypeEntry = str(currencyTypeBlock.currencyBox.idEntry)                currencyMovementBlock.currencyTypeEntry = str(currencyTypeBlock.currencyBox.idEntry)
627                currencyMovementBlock.amountEntry = str(hack.a2f(currencyTypeBlock.currencyBox.payEntry) * hack.a2f(currencyTypeBlock.currencyBox.rateEntry))                currencyMovementBlock.amountEntry = str(round(hack.a2f(currencyTypeBlock.currencyBox.payEntry,2) * hack.a2f(currencyTypeBlock.currencyBox.rateEntry,2),2))
628            
629        # Antes de Multimoneda        # Antes de Multimoneda
630        #currencyMovementBlock.clear()        #currencyMovementBlock.clear()
# Line 691  Line 691 
691    <trigger name="totalCalcTrigger" type="NAMED">    <trigger name="totalCalcTrigger" type="NAMED">
692      import hack      import hack
693    
694      lQty = hack.a2f(ownItemBlock.qtyEntry)      lQty = hack.a2f(ownItemBlock.qtyEntry,2)
695      lBonus = hack.a2f(ownItemBlock.bonusEntry)      lBonus = hack.a2f(ownItemBlock.bonusEntry,2)
696      lDiscount = hack.a2f(ownItemBlock.discountEntry)      lDiscount = hack.a2f(ownItemBlock.discountEntry,2)
697      lUnitPrice = hack.a2f(ownItemBlock.unitPriceEntry)      lUnitPrice = hack.a2f(ownItemBlock.unitPriceEntry,2)
698    
699      lItemPrice = (lQty * lUnitPrice) - lBonus - lDiscount      lItemPrice = round((lQty * lUnitPrice) - lBonus - lDiscount,2)
700    
701      sourceCode = str(tmpValuesDataSource.taxSourceCode)      sourceCode = str(tmpValuesDataSource.taxSourceCode)
702      ownIVACond = hack.a2f(tmpValuesDataSource.ownIVACond)      ownIVACond = hack.a2f(tmpValuesDataSource.ownIVACond,2)
703      alienIVACond = hack.a2f(tmpValuesDataSource.alienIVACond)      alienIVACond = hack.a2f(tmpValuesDataSource.alienIVACond,2)
704      amount = lItemPrice      amount = lItemPrice
705      taxPercent = hack.a2f(ownItemBlock.ivaEntry)      taxPercent = hack.a2f(ownItemBlock.ivaEntry,2)
706    
707      exec(sourceCode)      exec(sourceCode)
708      ownItemBlock.taxAmountEntry = hack.a2f(graft(ownIVACond,alienIVACond,amount,taxPercent))      ownItemBlock.taxAmountEntry = hack.a2f(graft(ownIVACond,alienIVACond,amount,taxPercent),2)
709      ownItemBlock.itemNetoEntry = lItemPrice      ownItemBlock.itemNetoEntry = lItemPrice
710      ownItemBlock.itemTotalEntry = lItemPrice + hack.a2f(ownItemBlock.taxAmountEntry)      ownItemBlock.itemTotalEntry = lItemPrice + hack.a2f(ownItemBlock.taxAmountEntry,2)
711    
712      lTNeto = 0      lTNeto = 0
713      lTTax = 0      lTTax = 0
# Line 715  Line 715 
715      lRecords = ownItemDataSource.getRecords()      lRecords = ownItemDataSource.getRecords()
716      for index in range(len(lRecords)):      for index in range(len(lRecords)):
717        lRecord = lRecords[index]        lRecord = lRecords[index]
718        lQty = hack.a2f(lRecord.getField("own_product_item.qty"))        lQty = hack.a2f(lRecord.getField("own_product_item.qty"),2)
719        #print "cantidad: ",lQty        #print "cantidad: ",lQty
720        lBonus = hack.a2f(lRecord.getField("own_item.bonus"))        lBonus = hack.a2f(lRecord.getField("own_item.bonus"),2)
721        lDiscount = hack.a2f(lRecord.getField("own_item.discount"))        lDiscount = hack.a2f(lRecord.getField("own_item.discount"),2)
722        lUnitPrice = hack.a2f(lRecord.getField("own_product_item.unit_price"))        lUnitPrice = hack.a2f(lRecord.getField("own_product_item.unit_price"),2)
723        #lResultSet = priceDataSource.createResultSet({"id":lRecord.getField("own_product_item.price")})        #lResultSet = priceDataSource.createResultSet({"id":lRecord.getField("own_product_item.price")})
724        #if (lResultSet.firstRecord()):        #if (lResultSet.firstRecord()):
725        #lUnitPrice = hack.a2f(lResultSet.current.getField("unit_price"))        #lUnitPrice = hack.a2f(lResultSet.current.getField("unit_price"))
# Line 727  Line 727 
727        #  lUnitPrice = 0        #  lUnitPrice = 0
728        #print "lUnitPrice = ",lUnitPrice        #print "lUnitPrice = ",lUnitPrice
729    
730        lItemPrice = (lQty * lUnitPrice) - lBonus - lDiscount        lItemPrice = round((lQty * lUnitPrice) - lBonus - lDiscount,2)
731        lTNeto += lItemPrice        lTNeto += lItemPrice
732        lTTax += hack.a2f(lRecord.getField("own_item_tax.amount"))        lTTax += hack.a2f(lRecord.getField("own_item_tax.amount"),2)
733    
734      ownDocumentBlock.netTotalEntry = str(lTNeto)      ownDocumentBlock.netTotalEntry = str(round(lTNeto,2))
735      totalBlock.netoEntry = str(lTNeto)      totalBlock.netoEntry = str(round(lTNeto,2))
736      ownDocumentBlock.taxTotalEntry = str(lTTax)      ownDocumentBlock.taxTotalEntry = str(round(lTTax,2))
737      totalBlock.ivaEntry = str(lTTax)      totalBlock.ivaEntry = str(round(lTTax,2))
738      totalBlock.totalEntry = str(lTNeto+lTTax)      totalBlock.totalEntry = str(round(lTNeto+lTTax,2))
739      payBlock.cashEntry = str(lTNeto+lTTax)      payBlock.cashEntry = str(round(lTNeto+lTTax,2))
740      payBlock.ctaCteEntry = "0.0"      payBlock.ctaCteEntry = "0.0"
741    </trigger>    </trigger>
742    
743    <trigger type="NAMED" name="currencyWorkTrigger"><![CDATA[    <trigger type="NAMED" name="currencyWorkTrigger"><![CDATA[
744  import hack  import hack
745    
746  if hack.a2f(payBlock.cashEntry) > 0:  if hack.a2f(payBlock.cashEntry,2) > 0:
747      currencyTypeBlock.clear()      currencyTypeBlock.clear()
748      currencyDataBlock.clear()      currencyDataBlock.clear()
749    
# Line 755  if hack.a2f(payBlock.cashEntry) > 0: Line 755  if hack.a2f(payBlock.cashEntry) > 0:
755              currencyTypeBlock.newRecord()              currencyTypeBlock.newRecord()
756          currencyTypeBlock.currencyBox.idEntry = rs.current.getField("_table")          currencyTypeBlock.currencyBox.idEntry = rs.current.getField("_table")
757          currencyTypeBlock.currencyBox.nameEntry = rs.current.getField("name")          currencyTypeBlock.currencyBox.nameEntry = rs.current.getField("name")
758          currencyTypeBlock.currencyBox.rateEntry = hack.a2f(rs.current.getField("rate"))          currencyTypeBlock.currencyBox.rateEntry = hack.a2f(rs.current.getField("rate"),2)
759          monto = hack.a2f(hack.a2f(payBlock.cashEntry) / hack.a2f(rs.current.getField("rate")),2)          monto = round(hack.a2f(payBlock.cashEntry,2) / hack.a2f(rs.current.getField("rate"),2),2)
760          currencyTypeBlock.currencyBox.formatEntry = rs.current.getField("format")          currencyTypeBlock.currencyBox.formatEntry = rs.current.getField("format")
761          currencyTypeBlock.currencyBox.amountEntry = str(currencyTypeBlock.currencyBox.formatEntry) % monto          currencyTypeBlock.currencyBox.amountEntry = str(currencyTypeBlock.currencyBox.formatEntry) % monto
762          currencyTypeBlock.currencyBox.payEntry = 0.0          currencyTypeBlock.currencyBox.payEntry = 0.0
# Line 768  if hack.a2f(payBlock.cashEntry) > 0: Line 768  if hack.a2f(payBlock.cashEntry) > 0:
768      currencyDataBlock.clientRecipientBox.clientCodeEntry = str(ownDocumentBlock.clientRecipientBox.clientCodeEntry)      currencyDataBlock.clientRecipientBox.clientCodeEntry = str(ownDocumentBlock.clientRecipientBox.clientCodeEntry)
769      currencyDataBlock.clientRecipientBox.clientNameEntry = str(ownDocumentBlock.clientRecipientBox.clientNameEntry)      currencyDataBlock.clientRecipientBox.clientNameEntry = str(ownDocumentBlock.clientRecipientBox.clientNameEntry)
770      payBlock.dateEntry = str(tmpBlock.tmpDateEntry)      payBlock.dateEntry = str(tmpBlock.tmpDateEntry)
771      currencyDataBlock.clientRecipientBox.totalEntry = str(payBlock.cashEntry)      currencyDataBlock.clientRecipientBox.totalEntry = str(hack.a2f(payBlock.cashEntry,2))
772            
773      ]]></trigger>      ]]></trigger>
774    
# Line 776  if hack.a2f(payBlock.cashEntry) > 0: Line 776  if hack.a2f(payBlock.cashEntry) > 0:
776    
777  import hack  import hack
778            
779  total = hack.a2f(payBlock.cashEntry)  total = hack.a2f(payBlock.cashEntry,2)
780  rc = currencyTypeBlock.getRecordCount()  rc = currencyTypeBlock.getRecordCount()
781  for recNum in range(rc):  for recNum in range(rc):
782      currencyTypeBlock.jumpRecord(recNum)      currencyTypeBlock.jumpRecord(recNum)
783      if hack.a2f(currencyTypeBlock.currencyBox.payEntry) > 0:      if hack.a2f(currencyTypeBlock.currencyBox.payEntry,2) > 0:
784          total -= hack.a2f(hack.a2f(currencyTypeBlock.currencyBox.payEntry) * hack.a2f(currencyTypeBlock.currencyBox.rateEntry),2)          total -= round(hack.a2f(currencyTypeBlock.currencyBox.payEntry,2) * hack.a2f(currencyTypeBlock.currencyBox.rateEntry),2)
785    
786  rc = currencyTypeBlock.getRecordCount()  rc = currencyTypeBlock.getRecordCount()
787  for recNum in range(rc):  for recNum in range(rc):
788      currencyTypeBlock.jumpRecord(recNum)      currencyTypeBlock.jumpRecord(recNum)
789      if hack.a2f(currencyTypeBlock.currencyBox.rateEntry) > 0:      if hack.a2f(currencyTypeBlock.currencyBox.rateEntry,2) > 0:
790          monto = hack.a2f(total / hack.a2f(currencyTypeBlock.currencyBox.rateEntry),2)          monto = round(total / hack.a2f(currencyTypeBlock.currencyBox.rateEntry,2),2)
791          currencyTypeBlock.currencyBox.amountEntry = str(currencyTypeBlock.currencyBox.formatEntry) % monto          currencyTypeBlock.currencyBox.amountEntry = str(currencyTypeBlock.currencyBox.formatEntry) % monto
792            
793          ]]></trigger>          ]]></trigger>
# Line 799  import hack Line 799  import hack
799            
800  callTrigger('currencyTypeTrigger')  callTrigger('currencyTypeTrigger')
801    
802  total = hack.a2f(payBlock.cashEntry)  total = hack.a2f(payBlock.cashEntry,2)
803  rc = currencyTypeBlock.getRecordCount()  rc = currencyTypeBlock.getRecordCount()
804  for recNum in range(rc):  for recNum in range(rc):
805      currencyTypeBlock.jumpRecord(recNum)      currencyTypeBlock.jumpRecord(recNum)
806      if hack.a2f(currencyTypeBlock.currencyBox.rateEntry) > 0:      if hack.a2f(currencyTypeBlock.currencyBox.rateEntry,2) > 0:
807          total -= hack.a2f(hack.a2f(currencyTypeBlock.currencyBox.payEntry) * hack.a2f(currencyTypeBlock.currencyBox.rateEntry),2)          total -= round(hack.a2f(currencyTypeBlock.currencyBox.payEntry,2) * hack.a2f(currencyTypeBlock.currencyBox.rateEntry,2),2)
808    
809  if total != 0:  if total != 0:
810      genericBox("El los montos no completan el total del documento\n",['Aceptar'])      genericBox("El los montos no completan el total del documento\n",['Aceptar'])
# Line 824  else: Line 824  else:
824    <trigger name="cashEntryPreFocusout" type="NAMED">    <trigger name="cashEntryPreFocusout" type="NAMED">
825    
826      import hack      import hack
827      payBlock.ctaCteEntry = str(hack.a2f(totalBlock.totalEntry) - hack.a2f(payBlock.cashEntry))      payBlock.ctaCteEntry = str(round(hack.a2f(totalBlock.totalEntry,2) - hack.a2f(payBlock.cashEntry,2),2))
828      callTrigger('currencyTypeTrigger')      callTrigger('currencyTypeTrigger')
829                            
830    </trigger>    </trigger>
# Line 832  else: Line 832  else:
832    <trigger name="cashEntryPreFocusout" type="NAMED">    <trigger name="cashEntryPreFocusout" type="NAMED">
833                            
834      import hack      import hack
835      payBlock.cashEntry = str(hack.a2f(totalBlock.totalEntry) - hack.a2f(payBlock.ctaCteEntry))      payBlock.cashEntry = str(round(hack.a2f(totalBlock.totalEntry,2) - hack.a2f(payBlock.ctaCteEntry,2),2))
836      callTrigger('currencyTypeTrigger')      callTrigger('currencyTypeTrigger')
837                            
838    </trigger>    </trigger>
# Line 901  else: Line 901  else:
901              eq = GConditions.GCeq(tmpAnd)              eq = GConditions.GCeq(tmpAnd)
902              GConditions.GCField(eq,"_entity_data._table")              GConditions.GCField(eq,"_entity_data._table")
903              GConditions.GCConst(eq,str(ownDocumentBlock.clientRecipientBox.currentClientEntry))              GConditions.GCConst(eq,str(ownDocumentBlock.clientRecipientBox.currentClientEntry))
904              balance = hack.a2f(creditLimit1Block.balance)              balance = hack.a2f(creditLimit1Block.balance,2)
905          else:          else:
906              eq = GConditions.GCeq(condProductInvoice)              eq = GConditions.GCeq(condProductInvoice)
907              GConditions.GCField(eq,"_entity_data._table")              GConditions.GCField(eq,"_entity_data._table")
# Line 923  else: Line 923  else:
923              invoiceTotal = 0              invoiceTotal = 0
924              currOwnDoc = productInvoiceResultSet.current.getField("own_document.id")              currOwnDoc = productInvoiceResultSet.current.getField("own_document.id")
925              while productInvoiceResultSet.current.getField("own_document.id") == currOwnDoc and more:              while productInvoiceResultSet.current.getField("own_document.id") == currOwnDoc and more:
926                  lQty = hack.a2f(productInvoiceResultSet.current.getField("own_product_item.qty"))                  lQty = hack.a2f(productInvoiceResultSet.current.getField("own_product_item.qty"),2)
927                  lUnitPrice = hack.a2f(productInvoiceResultSet.current.getField("own_product_item.unit_price"))                  lUnitPrice = hack.a2f(productInvoiceResultSet.current.getField("own_product_item.unit_price"),2)
928                  lBonus = hack.a2f(productInvoiceResultSet.current.getField("own_item.bonus"))                  lBonus = hack.a2f(productInvoiceResultSet.current.getField("own_item.bonus"),2)
929                  lDiscount = hack.a2f(productInvoiceResultSet.current.getField("own_item.discount"))                  lDiscount = hack.a2f(productInvoiceResultSet.current.getField("own_item.discount"),2)
930                  item = lQty * lUnitPrice - lBonus - lDiscount                  item = round(lQty * lUnitPrice - lBonus - lDiscount,2)
931                  #print "qty %d * unit_price %d - bonus %d - discount %d = %d " % (lQty, lUnitPrice, lBonus, lDiscount, lQty * lUnitPrice - lBonus - lDiscount)                  #print "qty %d * unit_price %d - bonus %d - discount %d = %d " % (lQty, lUnitPrice, lBonus, lDiscount, lQty * lUnitPrice - lBonus - lDiscount)
932                  itemTaxTotal = 0                  itemTaxTotal = 0
933                  currItem = productInvoiceResultSet.current.getField("own_item.id")                  currItem = productInvoiceResultSet.current.getField("own_item.id")
934                  while productInvoiceResultSet.current.getField("own_item.id") == currItem and more:                  while productInvoiceResultSet.current.getField("own_item.id") == currItem and more:
935                      itemTaxTotal += hack.a2f(productInvoiceResultSet.current.getField("own_item_tax.amount"))                      itemTaxTotal += hack.a2f(productInvoiceResultSet.current.getField("own_item_tax.amount"),2)
936                      more = productInvoiceResultSet.nextRecord()                      more = productInvoiceResultSet.nextRecord()
937                  invoiceTotal += item + itemTaxTotal                  invoiceTotal += round(item + itemTaxTotal,2)
938              # Calcula los impuestos del documento en si              # Calcula los impuestos del documento en si
939              odt_rs = ownDocumentTaxTotDataSource.createResultSet({"own_document.id":currOwnDoc})              odt_rs = ownDocumentTaxTotDataSource.createResultSet({"own_document.id":currOwnDoc})
940              odt_more = odt_rs.firstRecord()              odt_more = odt_rs.firstRecord()
941              while odt_more:              while odt_more:
942                  invoiceTotal += hack.a2f(odt_rs.current.getField("own_document_tax.amount"))                  invoiceTotal += hack.a2f(odt_rs.current.getField("own_document_tax.amount"),2)
943                  odt_more = odt_rs.nextRecord()                  odt_more = odt_rs.nextRecord()
944              spentTotal += invoiceTotal              spentTotal += invoiceTotal
945    
# Line 952  else: Line 952  else:
952              creditNoteTotal = 0              creditNoteTotal = 0
953              currOwnDoc = productCreditNoteResultSet.current.getField("own_document.id")              currOwnDoc = productCreditNoteResultSet.current.getField("own_document.id")
954              while productCreditNoteResultSet.current.getField("own_document.id") == currOwnDoc and more:              while productCreditNoteResultSet.current.getField("own_document.id") == currOwnDoc and more:
955                  lQty = hack.a2f(productCreditNoteResultSet.current.getField("own_product_item.qty"))                  lQty = hack.a2f(productCreditNoteResultSet.current.getField("own_product_item.qty"),2)
956                  lUnitPrice = hack.a2f(productCreditNoteResultSet.current.getField("own_product_item.unit_price"))                  lUnitPrice = hack.a2f(productCreditNoteResultSet.current.getField("own_product_item.unit_price"),2)
957                  lBonus = hack.a2f(productCreditNoteResultSet.current.getField("own_item.bonus"))                  lBonus = hack.a2f(productCreditNoteResultSet.current.getField("own_item.bonus"),2)
958                  lDiscount = hack.a2f(productCreditNoteResultSet.current.getField("own_item.discount"))                  lDiscount = hack.a2f(productCreditNoteResultSet.current.getField("own_item.discount"),2)
959                  item = lQty * lUnitPrice - lBonus - lDiscount                  item = round(lQty * lUnitPrice - lBonus - lDiscount,2)
960                  #print "qty %d * unit_price %d - bonus %d - discount %d = %d " % (lQty, lUnitPrice, lBonus, lDiscount, lQty * lUnitPrice - lBonus - lDiscount)                  #print "qty %d * unit_price %d - bonus %d - discount %d = %d " % (lQty, lUnitPrice, lBonus, lDiscount, lQty * lUnitPrice - lBonus - lDiscount)
961                  itemTaxTotal = 0                  itemTaxTotal = 0
962                  currItem = productCreditNoteResultSet.current.getField("own_item.id")                  currItem = productCreditNoteResultSet.current.getField("own_item.id")
963                  while productCreditNoteResultSet.current.getField("own_item.id") == currItem and more:                  while productCreditNoteResultSet.current.getField("own_item.id") == currItem and more:
964                      itemTaxTotal += hack.a2f(productCreditNoteResultSet.current.getField("own_item_tax.amount"))                      itemTaxTotal += hack.a2f(productCreditNoteResultSet.current.getField("own_item_tax.amount"),2)
965                      more = productCreditNoteResultSet.nextRecord()                      more = productCreditNoteResultSet.nextRecord()
966                  creditNoteTotal += item + itemTaxTotal                  creditNoteTotal += round(item + itemTaxTotal,2)
967              # Calcula los impuestos del documento en si              # Calcula los impuestos del documento en si
968              odt_rs = ownDocumentTaxTotDataSource.createResultSet({"own_document.id":currOwnDoc})              odt_rs = ownDocumentTaxTotDataSource.createResultSet({"own_document.id":currOwnDoc})
969              odt_more = odt_rs.firstRecord()              odt_more = odt_rs.firstRecord()
970              while odt_more:              while odt_more:
971                  creditNoteTotal += hack.a2f(odt_rs.current.getField("own_document_tax.amount"))                  creditNoteTotal += hack.a2f(odt_rs.current.getField("own_document_tax.amount"),2)
972                  odt_more = odt_rs.nextRecord()                  odt_more = odt_rs.nextRecord()
973              creditTotal += creditNoteTotal              creditTotal += creditNoteTotal
974    
# Line 980  else: Line 980  else:
980          payTotal = 0          payTotal = 0
981    
982          while more:          while more:
983              payTotal += hack.a2f(paidResultSet.current.getField("own_document_proceeding.amount"))              payTotal += hack.a2f(paidResultSet.current.getField("own_document_proceeding.amount"),2)
984              more = paidResultSet.nextRecord()              more = paidResultSet.nextRecord()
985    
986          #print "invoiceTotal ", invoiceTotal          #print "invoiceTotal ", invoiceTotal
# Line 988  else: Line 988  else:
988          #print "payTotal ", payTotal          #print "payTotal ", payTotal
989          #print "creditTotal ", creditTotal          #print "creditTotal ", creditTotal
990          # Calculo del total adeudado          # Calculo del total adeudado
991          deudaTotal = spentTotal - payTotal - creditTotal - balance          deudaTotal = round(spentTotal - payTotal - creditTotal - balance,2)
992          ownDocumentBlock.clientRecipientBox.deudaEntry = deudaTotal          ownDocumentBlock.clientRecipientBox.deudaEntry = deudaTotal
993    
994          # ******** FALTA GRABAR EL BALANCE **************          # ******** FALTA GRABAR EL BALANCE **************
# Line 1347  else: Line 1347  else:
1347      ownItemBlock.prodNameSEntry = str(prodResultBlock.prodNameEntry)      ownItemBlock.prodNameSEntry = str(prodResultBlock.prodNameEntry)
1348      ownItemBlock.priceEntry = str(prodResultBlock.prodPriceEntry)      ownItemBlock.priceEntry = str(prodResultBlock.prodPriceEntry)
1349    
1350      prodResultBlock.prodUnitPriceEntry = hack.a2f(prodResultBlock.prodUnitPriceEntry) * \      prodResultBlock.prodUnitPriceEntry = round(hack.a2f(prodResultBlock.prodUnitPriceEntry,2) * \
1351                                           hack.a2f(prodResultBlock.prodCurrencyRateEntry)                                           hack.a2f(prodResultBlock.prodCurrencyRateEntry,2),2)
1352      lItemPrice = hack.a2f(prodResultBlock.prodUnitPriceEntry)*hack.a2f(ownItemBlock.qtyEntry)      lItemPrice = round(hack.a2f(prodResultBlock.prodUnitPriceEntry,2)*hack.a2f(ownItemBlock.qtyEntry,2),2)
1353      ownItemBlock.taxAmountEntry = (hack.a2f(prodResultBlock.prodIVATaxEntry)/100) * lItemPrice      ownItemBlock.taxAmountEntry = round((hack.a2f(prodResultBlock.prodIVATaxEntry,2)/100) * lItemPrice,2)
1354      ownItemBlock.ivaEntry = hack.a2f(prodResultBlock.prodIVATaxEntry)      ownItemBlock.ivaEntry = hack.a2f(prodResultBlock.prodIVATaxEntry,2)
1355      ownItemBlock.unitPriceEntry = str(prodResultBlock.prodUnitPriceEntry)      ownItemBlock.unitPriceEntry = str(prodResultBlock.prodUnitPriceEntry)
1356    
1357      callTrigger('totalCalcTrigger')      callTrigger('totalCalcTrigger')

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

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