Openbravo Issue Tracking System - Retail Modules | ||||||||||||
View Issue Details | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||||
0032562 | Retail Modules | Web POS | public | 2016-03-31 09:43 | 2016-11-16 17:48 | |||||||
Reporter | aaroncalero | |||||||||||
Assigned To | ranjith_qualiantech_com | |||||||||||
Priority | normal | Severity | major | Reproducibility | always | |||||||
Status | closed | Resolution | fixed | |||||||||
Platform | OS | 5 | OS Version | |||||||||
Product Version | ||||||||||||
Target Version | Fixed in Version | |||||||||||
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> <% } %> | |||||||||||
Additional Information | ||||||||||||
Tags | No tags attached. | |||||||||||
Relationships |
| |||||||||||
Attached Files | ||||||||||||
Issue History | ||||||||||||
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 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|