Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0046267 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
defect | [Retail Modules] Web POS | minor | always | 2021-04-14 15:22 | 2021-04-15 14:52 | |||
Reporter | dmiguelez | View Status | public | |||||
Assigned To | Retail | |||||||
Priority | normal | Resolution | fixed | Fixed in Version | RR21Q3 | |||
Status | closed | Fix in branch | Fixed in SCM revision | |||||
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 | approved | |||||||
Review Assigned To | ||||||||
OBNetwork customer | No | |||||||
Support ticket | ||||||||
Regression level | ||||||||
Regression date | ||||||||
Regression introduced in release | ||||||||
Regression introduced by commit | ||||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0046267: Reject Quotations State Action should be complete | |||||||
Description | The implementation of Reject Quotation Action as a State Action is not complete: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/a03f9f24187c745ab8c0806a30d4967595a5eaf8 [^] The action is executed from order.js rejectQuotation: function(rejectReasonId, scope, callback) { OB.App.State.Global.rejectQuotation({ rejectReasonId }).then(() => { if (callback) { callback.call(scope, true); } }); }, After the action is executed, in pointofsale.js, the action deleteCurrentOrder is executed (this action is defined in order.js): rejectQuotation: function(inSender, inEvent) { this.model .get('order') .rejectQuotation(inEvent.rejectReason, this, function(success) { if (success) { this.deleteCurrentOrder(inSender, inEvent); } }); return true; }, The action to delete the Current Order updates the state of the TicketList to remove the Quotation that has been rejected. This logic should be implemented in the RejectQuotation State Action and also, in general, State Actions should not be called from within State Actions in order to ensure the proper behavior as pure functions. | |||||||
Steps To Reproduce | In the POS, log in as Vallblanca. From the Menu click on Create Sales Quotation. Add a product to the Ticket and complete the Quotation by clicking on Checkout From the Menu click on Reject Quotation, select a Reject Reason and Confirm The UI Changes to a new Ticket | |||||||
Proposed Solution | diff --git a/web/org.openbravo.retail.posterminal/app/model/business-object/ticket/actions/RejectQuotation.js b/web/org.openbravo.retail.posterminal/app/model/business-object/ticket/actions/RejectQuotation.js index c30273bb2..78be40f1a 100644 --- a/web/org.openbravo.retail.posterminal/app/model/business-object/ticket/actions/RejectQuotation.js +++ b/web/org.openbravo.retail.posterminal/app/model/business-object/ticket/actions/RejectQuotation.js @@ -11,6 +11,8 @@ rejectQuotation(state, payload) { const newState = { ...state }; const { rejectReasonId } = payload; + let newTicketList = [...newState.TicketList]; + let newTicket = { ...newState.Ticket }; const rejectQuotationMessage = OB.App.State.Messages.Utils.createNewMessage( 'OBPOS_Order', @@ -26,6 +28,19 @@ } ); newState.Messages = [...newState.Messages, rejectQuotationMessage]; + + // TicketList update + ({ + ticketList: newTicketList, + ticket: newTicket + } = OB.App.State.TicketList.Utils.removeTicket( + newTicketList, + newTicket, + payload + )); + + newState.TicketList = newTicketList; + newState.Ticket = newTicket; return newState; } }); | |||||||
Tags | No tags attached. | |||||||
Attached Files | ||||||||
![]() |
|
![]() |
|
(0127276) hgbot (developer) 2021-04-14 18:39 |
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/379 [^] |
(0127293) hgbot (developer) 2021-04-15 14:52 |
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/379 [^] |
(0127294) hgbot (developer) 2021-04-15 14:52 |
Directly closing issue as related merge request is already approved. Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^] Changeset: e7e2ba11520a85ca186b14cfcfa25f6a61a6b2f4 Author: David Miguelez <david.miguelez@openbravo.com> Date: 2021-04-14T18:33:17+02:00 URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/e7e2ba11520a85ca186b14cfcfa25f6a61a6b2f4 [^] Fixes ISSUE-46267. Completes Reject Quotation State Action All the related logic should be executed within this State Action. This includes closing the current Ticket and opening a new one in the UI --- M web/org.openbravo.retail.posterminal/app/model/business-object/ticket/actions/RejectQuotation.js M web/org.openbravo.retail.posterminal/js/model/order.js M web/org.openbravo.retail.posterminal/js/pointofsale/view/pointofsale.js --- |
(0127295) hgbot (developer) 2021-04-15 14:52 |
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^] Changeset: 23136ac23a3a633812f11b2568b120dd4fdf62ca Author: David Miguelez <david.miguelez@openbravo.com> Date: 2021-04-15T11:39:24+02:00 URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/23136ac23a3a633812f11b2568b120dd4fdf62ca [^] Related to ISSUE-46267: Code Review Changes * Send the rejectReasonId directly to the method that creates the payload * Change the tab of the new ticket to scan --- M web/org.openbravo.retail.posterminal/js/model/order.js --- |
![]() |
|||
Date Modified | Username | Field | Change |
2021-04-14 15:22 | dmiguelez | New Issue | |
2021-04-14 15:22 | dmiguelez | Assigned To | => Retail |
2021-04-14 15:22 | dmiguelez | OBNetwork customer | => No |
2021-04-14 15:22 | dmiguelez | Triggers an Emergency Pack | => No |
2021-04-14 18:39 | hgbot | Merge Request Status | => open |
2021-04-14 18:39 | hgbot | Note Added: 0127276 | |
2021-04-15 09:51 | hgbot | Merge Request Status | open => approved |
2021-04-15 14:52 | hgbot | Resolution | open => fixed |
2021-04-15 14:52 | hgbot | Status | new => closed |
2021-04-15 14:52 | hgbot | Note Added: 0127293 | |
2021-04-15 14:52 | hgbot | Fixed in Version | => RR21Q3 |
2021-04-15 14:52 | hgbot | Note Added: 0127294 | |
2021-04-15 14:52 | hgbot | Note Added: 0127295 |
Copyright © 2000 - 2009 MantisBT Group |