Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0032562 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
defect | [Retail Modules] Web POS | major | always | 2016-03-31 09:43 | 2016-11-16 17:48 | |||
Reporter | aaroncalero | View Status | public | |||||
Assigned To | ranjith_qualiantech_com | |||||||
Priority | normal | Resolution | fixed | Fixed in Version | ||||
Status | closed | Fix in branch | Fixed in SCM revision | b3a31c7166d1 | ||||
Projection | none | ETA | none | Target Version | ||||
OS | Any | Database | Any | Java version | ||||
OS Version | Database version | Ant version | ||||||
Product Version | SCM revision | |||||||
Merge Request Status | ||||||||
Review Assigned To | migueldejuana | |||||||
OBNetwork customer | No | |||||||
Support ticket | ||||||||
Regression level | ||||||||
Regression date | ||||||||
Regression introduced in release | ||||||||
Regression introduced by commit | ||||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0032562: Wrong template used for returns under specific circumstances | |||||||
Description | A ticket in Web POS is considered a return ticket if all of its lines are negative. All these tickets should be printed using the same template. However the return template is used only if the receipt has been flagged for return in web pos (using the Return this receipt menu option). If the ticket is composed by lines of a verified return (Menu > Verified Returns), or lines returned manually (Select line > EDIT > Return Line) the standard receipt template is used. It happens both if the receipt is flagged to be invoiced or not. | |||||||
Steps To Reproduce | Look at the if/else block on pointofsale-print.js around line 168 (https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/file/410127cfc57e/web/org.openbravo.retail.posterminal/js/pointofsale/model/pointofsale-print.js#l168 [^]) The decision to choose the return template is based on the order type. However only the receipts flagged as Return Receipt have their type changed to 1. ------------ Create a new ticket in web pos Add an avalanche transceiver, select the line, go to the EDIT tab and click on Return line. Verify that the Invoice this receipt flag is NOT checked. Click on the total amount button and complete the receipt Verify that on the following piece of code: if (receipt.get('orderType') === 1) { args.template = me.templatereturn; } else if (receipt.get('orderType') === 2 || receipt.get('isLayaway') || receipt.get('orderType') === 3) { args.template = me.templatelayaway; } else if (receipt.get('isQuotation')) { args.template = me.templatequotation; } else { args.template = me.templatereceipt; } The selected template is me.templatereceipt (even if the ticket is a return ticket). Repeat the above steps with a ticket where its only line is a line from a verified return. The result is the same, the templatereceipt is selected. Repeat the above steps marking the receipt as Return This Receipt (instead of returning the line manually). This time the templatereturn is used. | |||||||
Proposed Solution | The decision to pick the template return should be based on the receipt lines, not on the order type. The standard receipt even does that[1][2] to trick the users when the application selects the wrong template [1] negativeLines = _.filter(order.get('lines').models, function (line) { return line.get('qty') < 0; }).length; if (negativeLines === 0) { title = OB.UTIL.encodeXMLComponent(OB.I18N.getLabel('OBPOS_ReceiptRpt_Title')); } else { title = OB.UTIL.encodeXMLComponent(OB.I18N.getLabel('OBPOS_ReceiptWithReturnRpt_Title')) } [2] <% if (order.getGross() < 0){ %> <text align="center" length="42"><%= OB.UTIL.encodeXMLComponent(OB.I18N.getLabel('OBPOS_paidReturn')) %></text> <% } else { %> <text align="center" length="42"><%= OB.UTIL.encodeXMLComponent(OB.I18N.getLabel('OBPOS_tckfooter_line1')) %></text> <% } %> | |||||||
Tags | No tags attached. | |||||||
Attached Files | ||||||||
![]() |
||||||||
|
![]() |
|
(0085740) hgbot (developer) 2016-04-19 10:57 |
Repository: erp/pmods/org.openbravo.retail.posterminal Changeset: a7ece2260214dc89aeeecd39e1aa8b98130930af Author: Ranjith S R <ranjith <at> qualiantech.com> Date: Tue Apr 19 14:25:59 2016 +0530 URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/a7ece2260214dc89aeeecd39e1aa8b98130930af [^] Fixes issue 32562 : Changes in Print template based on receipt lines Receipt print template should be loaded based on receipt line negative qty count --- M web/org.openbravo.retail.posterminal/js/pointofsale/model/pointofsale-print.js --- |
(0085778) migueldejuana (viewer) 2016-04-20 14:33 |
Tested and reviewed |
(0090585) marvintm (viewer) 2016-10-14 11:53 |
There is a problem with this part of the code: .length === receipt.get('lines').models It should compare the length of the filtered collection to the length of the full collection, instead of comparing it to the array itself, so it should be like this: .length === receipt.get('lines').size() |
(0090600) hgbot (developer) 2016-10-17 06:37 |
Repository: erp/pmods/org.openbravo.retail.posterminal Changeset: b3a31c7166d14a898f592b68c5f6e81cf03c3383 Author: Ranjith S R <ranjith <at> qualiantech.com> Date: Sat Oct 15 12:50:03 2016 +0530 URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/b3a31c7166d14a898f592b68c5f6e81cf03c3383 [^] Fixes issue 32562 : Changes in Print template based on receipt lines - Check Receipt negative line length with receipt all line length --- M web/org.openbravo.retail.posterminal/js/pointofsale/model/pointofsale-print.js --- |
(0091611) migueldejuana (viewer) 2016-11-16 17:48 |
Tested and reviewed in 795a217b6a23 |
![]() |
|||
Date Modified | Username | Field | Change |
2016-03-31 09:43 | aaroncalero | New Issue | |
2016-03-31 09:43 | aaroncalero | Assigned To | => Retail |
2016-03-31 09:43 | aaroncalero | OBNetwork customer | => No |
2016-03-31 09:43 | aaroncalero | Triggers an Emergency Pack | => No |
2016-04-12 13:13 | ranjith_qualiantech_com | Assigned To | Retail => ranjith_qualiantech_com |
2016-04-12 13:28 | ranjith_qualiantech_com | Status | new => scheduled |
2016-04-19 10:57 | hgbot | Checkin | |
2016-04-19 10:57 | hgbot | Note Added: 0085740 | |
2016-04-19 10:57 | hgbot | Status | scheduled => resolved |
2016-04-19 10:57 | hgbot | Resolution | open => fixed |
2016-04-19 10:57 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/a7ece2260214dc89aeeecd39e1aa8b98130930af [^] |
2016-04-20 14:33 | migueldejuana | Review Assigned To | => migueldejuana |
2016-04-20 14:33 | migueldejuana | Note Added: 0085778 | |
2016-04-20 14:33 | migueldejuana | Status | resolved => closed |
2016-10-14 11:53 | marvintm | Note Added: 0090585 | |
2016-10-14 11:53 | marvintm | Status | closed => new |
2016-10-14 11:53 | marvintm | Resolution | fixed => open |
2016-10-14 11:53 | marvintm | Status | new => scheduled |
2016-10-17 06:37 | hgbot | Checkin | |
2016-10-17 06:37 | hgbot | Note Added: 0090600 | |
2016-10-17 06:37 | hgbot | Status | scheduled => resolved |
2016-10-17 06:37 | hgbot | Resolution | open => fixed |
2016-10-17 06:37 | hgbot | Fixed in SCM revision | http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/a7ece2260214dc89aeeecd39e1aa8b98130930af [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/b3a31c7166d14a898f592b68c5f6e81cf03c3383 [^] |
2016-11-16 17:48 | migueldejuana | Note Added: 0091611 | |
2016-11-16 17:48 | migueldejuana | Status | resolved => closed |
2017-03-21 10:58 | marvintm | Relationship added | has duplicate 0035562 |
Copyright © 2000 - 2009 MantisBT Group |