Openbravo Issue Tracking System - Retail Modules
View Issue Details
0051815Retail ModulesWeb POSpublic2023-03-08 19:312023-03-20 13:57
william_vermersch 
radhakrishnan 
normalmajoralways
closedfixed 
5
 
RR23Q2 
No
0051815: Maximum limit message displayed then removed instantly
When inputting an amount superior to the max limit amount of the payment, the message is displayed and removed instantly when doing specific workflow.
Set a maximum limit amount of 1000€ for a payment method in the touchpoint type screen (payment method tab). (Cash for example)
Go on the POS and do a ticket with a total amount superior to 1000€
Select a payment method (not the one configured) (Not Cash for example)
Input an amount superior to 1000€ (1100€)
Click on the payment method that you configured (Cash for example)

=> The message is displayed then removed
It seems that the method maxLimitAmountError is called multiple time (first time the inEvent.show is true, then it is false, so it is erasing the error message):

maxLimitAmountError: function(inSender, inEvent) {
    if (inEvent.show) {
      this.$.errorMaxlimitamount.setContent(
        OB.I18N.getLabel('OBPOS_PaymentMaxLimitAmount', [
          OB.I18N.formatCurrencyWithSymbol(
            inEvent.maxLimitAmount,
            inEvent.currency,
            inEvent.symbolAtRight
          )
        ])
      );
      this.$.errorMaxlimitamount.show();
    } else {
      this.$.errorMaxlimitamount.setContent('');
      this.$.errorMaxlimitamount.hide();
    }
    this.alignErrorMessages();
  },

It seems to be called in the second and third time by this part of code :

// Clear limit amount error when click on PaymentMethod button
      if (OB.POS.terminal.terminal.paymentnames[inEvent.value.status]) {
        this.bubble('onMaxLimitAmountError', {
          show: false,
          maxLimitAmount: 0,
          currency: '',
          symbolAtRight: true
        });
      }

But the message should be kept (either by displaying it again or make it persistent).
No tags attached.
Issue History
2023-03-08 19:31william_vermerschNew Issue
2023-03-08 19:31william_vermerschAssigned To => Retail
2023-03-08 19:31william_vermerschTriggers an Emergency Pack => No
2023-03-08 19:39william_vermerschProposed Solution updated
2023-03-08 19:42william_vermerschProposed Solution updated
2023-03-09 07:31radhakrishnanAssigned ToRetail => radhakrishnan
2023-03-09 07:31radhakrishnanStatusnew => scheduled
2023-03-15 12:57hgbotNote Added: 0147539
2023-03-20 13:57hgbotResolutionopen => fixed
2023-03-20 13:57hgbotStatusscheduled => closed
2023-03-20 13:57hgbotNote Added: 0147710
2023-03-20 13:57hgbotFixed in Version => RR23Q2
2023-03-20 13:57hgbotNote Added: 0147711

Notes
(0147539)
hgbot   
2023-03-15 12:57   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/1101 [^]
(0147710)
hgbot   
2023-03-20 13:57   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/1101 [^]
(0147711)
hgbot   
2023-03-20 13:57   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: 7529e1226453ce54ae45a1b3f7b951eac334b85f
Author: Radhakrishnan Seeman <radhakrishnan@qualiantech.com>
Date: 20-03-2023 12:57:32
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/7529e1226453ce54ae45a1b3f7b951eac334b85f [^]

Fixed ISSUE-51815: onMaxLimitAmountError should wait for button status change
* When we click payment button(ex: cash) which has the Max amount limit
there is methods executed asynchronously
    they are,
        1.button status change
        2.pay
In button status change we are hide the maximum amount limit error message
and in the pay option we are display that error message
and these two events are happened asynchronously
so that the second one executed firstly then the first one executed
Due to this we can't see the error message
For rectifying this, setTimeout used

---
M web/org.openbravo.retail.posterminal/js/pointofsale/view/keyboard-toolbars.js
---