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

Diff of /papo/forms/payOrder.neb

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

revision 1.8 by charlie, Thu May 29 21:33:37 2003 UTC revision 1.9 by charlie, Fri May 30 21:32:44 2003 UTC
# Line 234  if provider: Line 234  if provider:
234          tmpInvToPayedBlock.numberEntry = str(productInvoiceResultSet.current.getField("alien_document.number"))          tmpInvToPayedBlock.numberEntry = str(productInvoiceResultSet.current.getField("alien_document.number"))
235          tmpInvToPayedBlock.dateEntry = str(productInvoiceResultSet.current.getField("alien_document.date"))          tmpInvToPayedBlock.dateEntry = str(productInvoiceResultSet.current.getField("alien_document.date"))
236          while productInvoiceResultSet.current.getField("alien_document.id") == currAlienDoc and more:          while productInvoiceResultSet.current.getField("alien_document.id") == currAlienDoc and more:
237              lQty = hack.a2f(productInvoiceResultSet.current.getField("alien_product_item.qty"))              lQty = hack.a2f(productInvoiceResultSet.current.getField("alien_product_item.qty"),2)
238              lUnitPrice = hack.a2f(productInvoiceResultSet.current.getField("alien_product_item.unit_price"))              lUnitPrice = hack.a2f(productInvoiceResultSet.current.getField("alien_product_item.unit_price"),2)
239              lBonus = hack.a2f(productInvoiceResultSet.current.getField("alien_item.bonus"))              lBonus = hack.a2f(productInvoiceResultSet.current.getField("alien_item.bonus"),2)
240              lDiscount = hack.a2f(productInvoiceResultSet.current.getField("alien_item.discount"))              lDiscount = hack.a2f(productInvoiceResultSet.current.getField("alien_item.discount"),2)
241              item = lQty * lUnitPrice - lBonus - lDiscount              item = round(lQty * lUnitPrice - lBonus - lDiscount,2)
242              itemTaxTotal = 0                      itemTaxTotal = 0        
243              currItem = productInvoiceResultSet.current.getField("alien_item.id")              currItem = productInvoiceResultSet.current.getField("alien_item.id")
244              while productInvoiceResultSet.current.getField("alien_item.id") == currItem and more:              while productInvoiceResultSet.current.getField("alien_item.id") == currItem and more:
245                  itemTaxTotal += hack.a2f(productInvoiceResultSet.current.getField("alien_item_tax.amount"))                  itemTaxTotal += hack.a2f(productInvoiceResultSet.current.getField("alien_item_tax.amount"),2)
246                  more = productInvoiceResultSet.nextRecord()                  more = productInvoiceResultSet.nextRecord()
247              invoiceTotal += item + itemTaxTotal              invoiceTotal += round(item + itemTaxTotal,2)
248          odt_rs = invTaxTotDataSource.createResultSet({"alien_document.id":currAlienDoc})          odt_rs = invTaxTotDataSource.createResultSet({"alien_document.id":currAlienDoc})
249          odt_more = odt_rs.firstRecord()          odt_more = odt_rs.firstRecord()
250          while odt_more:          while odt_more:
251              invoiceTotal += hack.a2f(odt_rs.current.getField("alien_document_tax.amount"))              invoiceTotal += hack.a2f(odt_rs.current.getField("alien_document_tax.amount"),2)
252              odt_more = odt_rs.nextRecord()              odt_more = odt_rs.nextRecord()
253                                    
254          tmpInvToPayedBlock.amountEntry = str(invoiceTotal)          tmpInvToPayedBlock.amountEntry = str(invoiceTotal)
# Line 261  if provider: Line 261  if provider:
261          rc = tmpInvToPayedBlock.getRecordCount()          rc = tmpInvToPayedBlock.getRecordCount()
262          for recNum in range(rc):          for recNum in range(rc):
263              tmpInvToPayedBlock.jumpRecord(recNum)              tmpInvToPayedBlock.jumpRecord(recNum)
264              if hack.a2f(tmpInvToPayedBlock.idEntry) == hack.a2f(rs.current.getField("alien_document_proceeding.alien_document")):              if hack.a2f(tmpInvToPayedBlock.idEntry,2) == hack.a2f(rs.current.getField("alien_document_proceeding.alien_document"),2):
265                  tmpInvToPayedBlock.payedEntry = str(                  tmpInvToPayedBlock.payedEntry = str(round(
266                      hack.a2f(tmpInvToPayedBlock.payedEntry) + \                      hack.a2f(tmpInvToPayedBlock.payedEntry,2) + \
267                      hack.a2f(rs.current.getField("alien_document_proceeding.amount") ) )                      hack.a2f(rs.current.getField("alien_document_proceeding.amount"),2),2))
268          more = rs.nextRecord()          more = rs.nextRecord()
269    
270      rc = tmpInvToPayedBlock.getRecordCount()      rc = tmpInvToPayedBlock.getRecordCount()
271      for recNum in range(rc):      for recNum in range(rc):
272          tmpInvToPayedBlock.jumpRecord(recNum)          tmpInvToPayedBlock.jumpRecord(recNum)
273          if hack.a2f(tmpInvToPayedBlock.payedEntry) < hack.a2f(tmpInvToPayedBlock.amountEntry):          if hack.a2f(tmpInvToPayedBlock.payedEntry,2) < hack.a2f(tmpInvToPayedBlock.amountEntry,2):
274              if not invoiceToPayBlock.getCurrentRecord().isEmpty():              if not invoiceToPayBlock.getCurrentRecord().isEmpty():
275                  invoiceToPayBlock.newRecord()                  invoiceToPayBlock.newRecord()
276              invoiceToPayBlock.invoiceBox.idEntry = str(tmpInvToPayedBlock.idEntry)              invoiceToPayBlock.invoiceBox.idEntry = str(tmpInvToPayedBlock.idEntry)
# Line 278  if provider: Line 278  if provider:
278              invoiceToPayBlock.invoiceBox.dateEntry = str(tmpInvToPayedBlock.dateEntry)              invoiceToPayBlock.invoiceBox.dateEntry = str(tmpInvToPayedBlock.dateEntry)
279              invoiceToPayBlock.invoiceBox.amountEntry = str(tmpInvToPayedBlock.amountEntry)              invoiceToPayBlock.invoiceBox.amountEntry = str(tmpInvToPayedBlock.amountEntry)
280              invoiceToPayBlock.invoiceBox.payedEntry = str(tmpInvToPayedBlock.payedEntry)              invoiceToPayBlock.invoiceBox.payedEntry = str(tmpInvToPayedBlock.payedEntry)
281              invoiceToPayBlock.invoiceBox.payEntry = str(              invoiceToPayBlock.invoiceBox.payEntry = str(round(
282                  hack.a2f(tmpInvToPayedBlock.amountEntry) - \                  hack.a2f(tmpInvToPayedBlock.amountEntry,2) - \
283                  hack.a2f(tmpInvToPayedBlock.payedEntry))                  hack.a2f(tmpInvToPayedBlock.payedEntry,2),2))
284              total += hack.a2f(invoiceToPayBlock.invoiceBox.payEntry)              total += hack.a2f(invoiceToPayBlock.invoiceBox.payEntry,2)
285    
286  invoiceToPayBlock.invoiceBox.totalEntry = str(total)  invoiceToPayBlock.invoiceBox.totalEntry = str(round(total,2))
287            
288    ]]></trigger>    ]]></trigger>
289    
# Line 295  total = 0.0 Line 295  total = 0.0
295    
296  for recNum in range(rc):  for recNum in range(rc):
297      invoiceToPayBlock.jumpRecord(recNum)      invoiceToPayBlock.jumpRecord(recNum)
298      total += hack.a2f(invoiceToPayBlock.invoiceBox.payEntry)      total += hack.a2f(invoiceToPayBlock.invoiceBox.payEntry,2)
299    
300  invoiceToPayBlock.invoiceBox.totalEntry = str(total)  invoiceToPayBlock.invoiceBox.totalEntry = str(round(total,2))
301                            
302      ]]></trigger>      ]]></trigger>
303        
# Line 326  try: Line 326  try:
326      rc = currencyTypeBlock.getRecordCount()      rc = currencyTypeBlock.getRecordCount()
327      for recNum in range(rc):      for recNum in range(rc):
328          currencyTypeBlock.jumpRecord(recNum)          currencyTypeBlock.jumpRecord(recNum)
329          if hack.a2f(currencyTypeBlock.currencyBox.payEntry) > 0:          if hack.a2f(currencyTypeBlock.currencyBox.payEntry,2) > 0:
330              if not currencyMovementBlock.getCurrentRecord().isEmpty():              if not currencyMovementBlock.getCurrentRecord().isEmpty():
331                  currencyMovementBlock.newRecord()                  currencyMovementBlock.newRecord()
332              currencyMovementBlock.proceedingEntry = str(proceedingBlock.idEntry)              currencyMovementBlock.proceedingEntry = str(proceedingBlock.idEntry)
333              currencyMovementBlock.movementTypeEntry = "" # Revisar com queda esto              currencyMovementBlock.movementTypeEntry = "" # Revisar com queda esto
334              currencyMovementBlock.currencyTypeEntry = str(currencyTypeBlock.currencyBox.idEntry)              currencyMovementBlock.currencyTypeEntry = str(currencyTypeBlock.currencyBox.idEntry)
335              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))
336      currencyMovementBlock.postChanges()      currencyMovementBlock.postChanges()
337      error += 1      error += 1
338      rc = invoiceToPayBlock.getRecordCount()      rc = invoiceToPayBlock.getRecordCount()
339      for recNum in range(rc):      for recNum in range(rc):
340          invoiceToPayBlock.jumpRecord(recNum)          invoiceToPayBlock.jumpRecord(recNum)
341          if hack.a2f(invoiceToPayBlock.invoiceBox.payEntry) > 0:          if hack.a2f(invoiceToPayBlock.invoiceBox.payEntry,2) > 0:
342              if not alienDocumentProceedingBlock.getCurrentRecord().isEmpty():              if not alienDocumentProceedingBlock.getCurrentRecord().isEmpty():
343                  alienDocumentProceedingBlock.newRecord()                  alienDocumentProceedingBlock.newRecord()
344              alienDocumentProceedingBlock.proceedingEntry = str(proceedingBlock.idEntry)              alienDocumentProceedingBlock.proceedingEntry = str(proceedingBlock.idEntry)
# Line 372  try: Line 372  try:
372      rc = invoiceToPayBlock.getRecordCount()      rc = invoiceToPayBlock.getRecordCount()
373      for recNum in range(rc):      for recNum in range(rc):
374          invoiceToPayBlock.jumpRecord(recNum)          invoiceToPayBlock.jumpRecord(recNum)
375          if hack.a2f(invoiceToPayBlock.invoiceBox.payEntry) > 0:          if hack.a2f(invoiceToPayBlock.invoiceBox.payEntry,2) > 0:
376              line = "| "              line = "| "
377              line += printing.printField(invoiceToPayBlock.invoiceBox.numberEntry,14,'r') + " | "              line += printing.printField(invoiceToPayBlock.invoiceBox.numberEntry,14,'r') + " | "
378              line += printing.printField(invoiceToPayBlock.invoiceBox.dateEntry,20,'r') + " | "              line += printing.printField(invoiceToPayBlock.invoiceBox.dateEntry,20,'r') + " | "
# Line 438  callTrigger('searchNextPayOrderNumber') Line 438  callTrigger('searchNextPayOrderNumber')
438  import hack  import hack
439    
440  callTrigger('totalTrigger')  callTrigger('totalTrigger')
441  if hack.a2f(invoiceToPayBlock.invoiceBox.totalEntry) > 0:  if hack.a2f(invoiceToPayBlock.invoiceBox.totalEntry,2) > 0:
442      currencyTypeBlock.clear()      currencyTypeBlock.clear()
443      currencyDataBlock.clear()      currencyDataBlock.clear()
444    
# Line 450  if hack.a2f(invoiceToPayBlock.invoiceBox Line 450  if hack.a2f(invoiceToPayBlock.invoiceBox
450              currencyTypeBlock.newRecord()              currencyTypeBlock.newRecord()
451          currencyTypeBlock.currencyBox.idEntry = rs.current.getField("_table")          currencyTypeBlock.currencyBox.idEntry = rs.current.getField("_table")
452          currencyTypeBlock.currencyBox.nameEntry = rs.current.getField("name")          currencyTypeBlock.currencyBox.nameEntry = rs.current.getField("name")
453          currencyTypeBlock.currencyBox.rateEntry = hack.a2f(rs.current.getField("rate"))          currencyTypeBlock.currencyBox.rateEntry = hack.a2f(rs.current.getField("rate"),2)
454          monto = hack.a2f(hack.a2f(invoiceToPayBlock.invoiceBox.totalEntry) / hack.a2f(rs.current.getField("rate")),2)          monto = round(hack.a2f(invoiceToPayBlock.invoiceBox.totalEntry,2) / hack.a2f(rs.current.getField("rate"),2),2)
455          currencyTypeBlock.currencyBox.formatEntry = rs.current.getField("format")          currencyTypeBlock.currencyBox.formatEntry = rs.current.getField("format")
456          currencyTypeBlock.currencyBox.amountEntry = str(currencyTypeBlock.currencyBox.formatEntry) % monto          currencyTypeBlock.currencyBox.amountEntry = str(currencyTypeBlock.currencyBox.formatEntry) % monto
457          currencyTypeBlock.currencyBox.payEntry = 0.0          currencyTypeBlock.currencyBox.payEntry = 0.0
# Line 473  if hack.a2f(invoiceToPayBlock.invoiceBox Line 473  if hack.a2f(invoiceToPayBlock.invoiceBox
473      <![CDATA[      <![CDATA[
474  import hack  import hack
475            
476  total = hack.a2f(invoiceToPayBlock.invoiceBox.totalEntry)  total = hack.a2f(invoiceToPayBlock.invoiceBox.totalEntry,2)
477  rc = currencyTypeBlock.getRecordCount()  rc = currencyTypeBlock.getRecordCount()
478  for recNum in range(rc):  for recNum in range(rc):
479      currencyTypeBlock.jumpRecord(recNum)      currencyTypeBlock.jumpRecord(recNum)
480      if hack.a2f(currencyTypeBlock.currencyBox.payEntry) > 0:      if hack.a2f(currencyTypeBlock.currencyBox.payEntry,2) > 0:
481          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)
482    
483  rc = currencyTypeBlock.getRecordCount()  rc = currencyTypeBlock.getRecordCount()
484  for recNum in range(rc):  for recNum in range(rc):
485      currencyTypeBlock.jumpRecord(recNum)      currencyTypeBlock.jumpRecord(recNum)
486      if hack.a2f(currencyTypeBlock.currencyBox.rateEntry) > 0:      if hack.a2f(currencyTypeBlock.currencyBox.rateEntry,2) > 0:
487          monto = hack.a2f(total / hack.a2f(currencyTypeBlock.currencyBox.rateEntry),2)          monto = round(total / hack.a2f(currencyTypeBlock.currencyBox.rateEntry,2),2)
488          currencyTypeBlock.currencyBox.amountEntry = str(currencyTypeBlock.currencyBox.formatEntry) % monto          currencyTypeBlock.currencyBox.amountEntry = str(currencyTypeBlock.currencyBox.formatEntry) % monto
489            
490      ]]>      ]]>
# Line 497  import hack Line 497  import hack
497            
498  callTrigger('currencyTypeTrigger')  callTrigger('currencyTypeTrigger')
499    
500  total = hack.a2f(invoiceToPayBlock.invoiceBox.totalEntry)  total = hack.a2f(invoiceToPayBlock.invoiceBox.totalEntry,2)
501  rc = currencyTypeBlock.getRecordCount()  rc = currencyTypeBlock.getRecordCount()
502  for recNum in range(rc):  for recNum in range(rc):
503      currencyTypeBlock.jumpRecord(recNum)      currencyTypeBlock.jumpRecord(recNum)
504      if hack.a2f(currencyTypeBlock.currencyBox.rateEntry) > 0:      if hack.a2f(currencyTypeBlock.currencyBox.rateEntry,2) > 0:
505          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)
506    
507  if total != 0:  if total != 0:
508      genericBox("La Orden de pago no esta totalmente pagada\n",['Aceptar'])      genericBox("La Orden de pago no esta totalmente pagada\n",['Aceptar'])

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

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