Openbravo Issue Tracking System - Java Client POS
View Issue Details
0017888Java Client POS(No Category)public2011-07-05 11:292014-04-02 09:04
adrianromero 
adrianromero 
normalminoralways
closedfixed 
5
 
2.40 
0017888: Taxes are calculated only when closing the receipt
Taxes must be calculated not only when closing the receipt but also when printing the receipt preview or other general actions in the receipt.
* Edit the template Printer.TicketPreview and add:

#foreach ($taxinfo in $taxes)
#set( $taxline = $ticket.getTaxLine($taxinfo))
<line>
<text align ="left" length="18">${taxline.getTaxInfo()}</text>
<text align ="right" length="12">${taxline.printSubTotal()}</text>
<text align ="right" length="12">${taxline.printTax()}</text>
</line>
#end


* Restart the application
* Go to the sales panel and press the button "Print"
* It appears the following error because taxes has not been calculated yet:

com.openbravo.pos.scripting.ScriptException:
Invocation of method 'getTaxLine' in class com.openbravo.pos.ticket.TicketInfo threw
exception java.lang.NullPointerException @ log[115,34]

org.apache.velocity.exception.MethodInvocationException:
Invocation of method 'getTaxLine' in class com.openbravo.pos.ticket.TicketInfo threw
exception java.lang.NullPointerException @ log[115,34]

java.lang.NullPointerException:
null
call in JPanelTicket the function that calculates taxes also when executing scripting actions
No tags attached.
Issue History
2011-07-05 11:29adrianromeroNew Issue
2011-07-05 11:29adrianromeroAssigned To => adrianromero
2011-07-18 18:56hgbotCheckin
2011-07-18 18:56hgbotNote Added: 0039195
2011-07-18 18:56hgbotStatusnew => resolved
2011-07-18 18:56hgbotResolutionopen => fixed
2011-07-18 18:56hgbotFixed in SCM revision => http://code.openbravo.com/pos/devel/pi/rev/f24c6f2c173f05faccfdc5dbc5e70aceb42f28d7 [^]
2011-07-18 18:59adrianromeroNote Added: 0039196
2011-10-11 05:24thesubmitterNote Added: 0041578
2012-11-07 09:40priyamCategory01 - General => (No Category)
2014-04-02 09:04plujanNote Added: 0066030
2014-04-02 09:04plujanStatusresolved => closed

Notes
(0039195)
hgbot   
2011-07-18 18:56   
Repository: pos/devel/pi
Changeset: f24c6f2c173f05faccfdc5dbc5e70aceb42f28d7
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Mon Jul 18 18:56:19 2011 +0200
URL: http://code.openbravo.com/pos/devel/pi/rev/f24c6f2c173f05faccfdc5dbc5e70aceb42f28d7 [^]

Fixes issue 0017888: Taxes are calculated only when closing the receipt
It has been modified the business logic to invoke the taxes calculation also when pressing button actions like printing the ticket preview

---
M src-pos/com/openbravo/pos/sales/JPanelTicket.form
M src-pos/com/openbravo/pos/sales/JPanelTicket.java
---
(0039196)
adrianromero   
2011-07-18 18:59   
* Testing the issue

Kindly follow the steps to test and verify that now when printing the ticket preview no error is raised and the taxes are properly calculated and displayed in the ticket preview.

* Other areas affected

It has only been modified the moment when calculating taxes in the sales panel. No other areas affected.
(0041578)
thesubmitter   
2011-10-11 05:24   
Not sure if this is the same bug but I noticed in 2.30_2 stable the preview doesn't print out the individual taxes. I tried to backport this code the stable version and still had no luck.
(0066030)
plujan   
2014-04-02 09:04   
Closed as it was in Resolved for too long