Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||||||
ID | ||||||||||||
0046266 | ||||||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||||||
defect | [Retail Modules] Web POS | minor | always | 2021-04-14 15:21 | 2021-04-14 15:21 | |||||||
Reporter | dmiguelez | View Status | public | |||||||||
Assigned To | Retail | |||||||||||
Priority | normal | Resolution | open | Fixed in Version | ||||||||
Status | new | 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 | |||||||||||
Review Assigned To | ||||||||||||
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; } }); | |||||||||||
Tags | No tags attached. | |||||||||||
Attached Files | ||||||||||||
Relationships [ Relation Graph ] [ Dependency Graph ] | |
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 |
Copyright © 2000 - 2009 MantisBT Group |