Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0046266
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Web POSminoralways2021-04-14 15:212021-04-14 15:21
ReporterdmiguelezView Statuspublic 
Assigned ToRetail 
PrioritynormalResolutionopenFixed in Version
StatusnewFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0046266: Reject Quotations State Action should be complete

DescriptionThe 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 ReproduceIn 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 Solutiondiff --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;
     }
   });
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
There are no notes attached to this issue.

- 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
Powered by Mantis Bugtracker