Openbravo Issue Tracking System - Retail Modules | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0046266 | Retail Modules | Web POS | public | 2021-04-14 15:21 | 2021-04-14 15:21 |
Reporter | dmiguelez | ||||
Assigned To | Retail | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | new | Resolution | open | ||
Platform | OS | 5 | OS Version | ||
Product Version | |||||
Target Version | Fixed in Version | ||||
Merge Request Status | |||||
Review Assigned To | |||||
OBNetwork customer | |||||
Support ticket | |||||
Regression level | |||||
Regression date | |||||
Regression introduced in release | |||||
Regression introduced by commit | |||||
Triggers an Emergency Pack | No | ||||
Summary | 0046266: 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; } }); | ||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2021-04-14 15:21 | dmiguelez | New Issue | |||
2021-04-14 15:21 | dmiguelez | Assigned To | => Retail | ||
2021-04-14 15:21 | dmiguelez | Triggers an Emergency Pack | => No |
There are no notes attached to this issue. |