Openbravo Issue Tracking System - Retail Modules
View Issue Details
0047433Retail ModulesWeb POSpublic2021-07-21 20:542021-08-16 07:38
lbressan 
prakashmurugesan88 
highmajoralways
closedfixed 
5
 
RR21Q4 
adrianromero
2021-08-10
No
0047433: Invoice reprint error on lines with discount
When a ticket whit a discount is completed and reopened to reprint the invoice, it has ZERO in the price and total.
Before start following the steps, it's needed to apply this patch:

https://issues.openbravo.com/view.php?id=47216 [^]
Steps:
1- Apply the patch: https://issues.openbravo.com/view.php?id=47216 [^]
2- Make a Sales order.
3- Add a line with a discount with the same price as the product.
4- Mark it to invoice.
5- Complete it.
6- Open the last ticket.
7- Reprint the invoice.
8- Check the prices between the original print and the duplicated.

No tags attached.
related to defect 0045866 closed ranjith_qualiantech_com Print error when completing a ticket loaded from backoffice 
jpeg WhatsApp Image 2021-07-15 at 17.42.34 (2).jpeg (228,535) 2021-07-21 20:54
https://issues.openbravo.com/file_download.php?file_id=16028&type=bug
jpeg
Issue History
2021-07-21 20:54lbressanNew Issue
2021-07-21 20:54lbressanAssigned To => Retail
2021-07-21 20:54lbressanFile Added: WhatsApp Image 2021-07-15 at 17.42.34 (2).jpeg
2021-07-21 20:54lbressanRegression date => 2021-08-10
2021-07-21 20:54lbressanTriggers an Emergency Pack => No
2021-07-21 20:58lbressanDescription Updatedbug_revision_view_page.php?rev_id=22913#r22913
2021-07-21 20:58lbressanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=22915#r22915
2021-07-21 21:53PracticsIssue Monitored: Practics
2021-08-06 11:00adrianromeroResolution time => 1628805600
2021-08-06 11:25adrianromeroStatusnew => acknowledged
2021-08-06 12:02adrianromeroStatusacknowledged => scheduled
2021-08-06 12:02adrianromeroAssigned ToRetail => prakashmurugesan88
2021-08-06 12:20adrianromeroRelationship addedrelated to 0047510
2021-08-06 12:25adrianromeroRelationship deletedrelated to 0047510
2021-08-10 14:30adrianromeroRelationship addedrelated to 0045866
2021-08-10 14:35adrianromeroReview Assigned To => adrianromero
2021-08-10 14:35adrianromeroNote Added: 0131055
2021-08-10 14:35adrianromeroStatusscheduled => closed
2021-08-10 14:35adrianromeroResolutionopen => no change required
2021-08-10 16:53PracticsNote Added: 0131056
2021-08-12 08:16marvintmStatusclosed => new
2021-08-12 08:16marvintmResolutionno change required => open
2021-08-12 14:14prakashmurugesan88Statusnew => scheduled
2021-08-13 14:12hgbotNote Added: 0131119
2021-08-16 07:37hgbotResolutionopen => fixed
2021-08-16 07:37hgbotStatusscheduled => closed
2021-08-16 07:37hgbotNote Added: 0131126
2021-08-16 07:37hgbotFixed in Version => RR21Q4
2021-08-16 07:37hgbotNote Added: 0131127
2021-08-16 07:38marvintmNote Added: 0131128

Notes
(0131055)
adrianromero   
2021-08-10 14:35   
This invoice template is a legacy template that must be migrated to the new templates engine.

Details how to migrate legacy templates is documented here: http://wiki.openbravo.com/wiki/Retail:Developers_Guide/New_Javascript_template_engine_for_receipt_printer_and_customer_displays_documents#Migrating_legacy_templates [^]

Related issue 0045866 fix can be used as example on how to migrate legacy templates.
(0131056)
Practics   
2021-08-10 16:53   
This solution it's not correct, our problem is that netUnitPrice it's not the same when reprint the invoice

View video
https://youtu.be/p28FfH6ceug [^]
(0131119)
hgbot   
2021-08-13 14:12   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/542 [^]
(0131126)
hgbot   
2021-08-16 07:37   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/542 [^]
(0131127)
hgbot   
2021-08-16 07:37   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: b65695c111a9ca5bac59a69196035860c215e331
Author: Prakash M <prakash@qualiantech.com>
Date: 2021-08-16T05:36:33+00:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/b65695c111a9ca5bac59a69196035860c215e331 [^]

Fixed BUG-47433: Fixes following calculation issue of following properties in invoice reprint
Without Tax - netUnitPrice, grossUnitPrice
With Tax - netUnitAmount, netUnitPrice

---
M src/org/openbravo/retail/posterminal/InvoiceLinesProperties.java
M web/org.openbravo.retail.posterminal/js/data/dataordertaxes.js
---
(0131128)
marvintm   
2021-08-16 07:38   
With our last change, both the netUnitPrice and the netUnitAmount should be correct even when reprinting the invoice.

It's important to note that these values should be used if you want to show the amounts with discounts applied. If you want to display amounts without the discounts (so that you show the discounts in a separate line, for example), then you should use "base*" properties (baseNetAmount, baseGrossAmount, ...)