Attached Files | permitirConsumirPuntosParciales.diff [^] (5,619 bytes) 2022-09-22 16:50 [Show Content] [Hide Content]diff -ru Original/obrlpgc.css Modificado/obrlpgc.css
--- a/modules/org.openbravo.retail.loyalty.burn.giftcertificate/web/org.openbravo.retail.loyalty.burn.giftcertificate/css/obrlpgc.css
+++ b/modules/org.openbravo.retail.loyalty.burn.giftcertificate/web/org.openbravo.retail.loyalty.burn.giftcertificate/css/obrlpgc.css
@@ -1,6 +1,6 @@
/*
************************************************************************************
- * Copyright (C) 2019 Openbravo S.L.U.
+ * Copyright (C) 2019-2022 Openbravo S.L.U.
* Licensed under the Openbravo Commercial License version 1.0
* You may obtain a copy of the License at http://www.openbravo.com/legal/obcl.html
* or in the legal folder of this module distribution.
@@ -24,3 +24,13 @@
margin-top: 1em;
color: yellow;
}
+
+.obrlpgcAmtText {
+ margin-left: 10px;
+ width: 40%;
+ float: left;
+}
+
+.obrlpgcAmtText_withColor {
+ background-color: #FF5454;
+}
diff -ru Original/simplifyBurnGiftCertificateDialog.js Modificado/simplifyBurnGiftCertificateDialog.js
--- a/modules/org.openbravo.retail.loyalty.burn.giftcertificate/web/org.openbravo.retail.loyalty.burn.giftcertificate/js/component/simplifyBurnGiftCertificateDialog.js
+++ b/modules/org.openbravo.retail.loyalty.burn.giftcertificate/web/org.openbravo.retail.loyalty.burn.giftcertificate/js/component/simplifyBurnGiftCertificateDialog.js
@@ -1,6 +1,6 @@
/*
************************************************************************************
- * Copyright (C) 2019 Openbravo S.L.U.
+ * Copyright (C) 2019-2022 Openbravo S.L.U.
* Licensed under the Openbravo Commercial License version 1.0
* You may obtain a copy of the License at http://www.openbravo.com/legal/obcl.html
* or in the legal folder of this module distribution.
@@ -19,18 +18,25 @@
onHideThisPopup: ''
},
bodyContent: {
- components: [
- {
+ components: [{
name: 'bodymessage'
},
{
name: 'secondaryMessage'
+ },
+ {
+ name: 'amtLbl',
+ style: 'float: left; text-align: center; margin-top: 5px;'
+ },
+ {
+ name: 'amtText',
+ kind: 'OB.UI.SearchInputAutoFilter',
+ classes: 'obrlpgcAmtText'
}
]
},
bodyButtons: {
- components: [
- {
+ components: [{
kind: 'OBRLPGC.UI.RedeemButton'
},
{
@@ -39,12 +45,43 @@
}
]
},
+ validateAmt: function() {
+ try {
+ if (
+ !this.$.bodyContent.$.amtText.getValue() ||
+ !this.$.bodyContent.$.amtText.getValue().length > 0
+ ) {
+ this.$.bodyContent.$.amtText.addClass('obrlpgcAmtText_withColor');
+ }
+ var w = OB.DEC.toNumber(OB.DEC.toBigDecimal(this.$.bodyContent.$.amtText.getValue()));
+ var sideButton = this.args.sideButton;
+ var amount = OB.DEC.number(
+ OB.I18N.parseNumber(sideButton.conversionFromPointsToPrice)
+ );
+ if (w > 0 && w <= amount) {
+ return true;
+ } else {
+ this.$.bodyContent.$.amtText.addClass('obrlpgcAmtText_withColor');
+ return false;
+ }
+ } catch (e) {
+ this.$.bodyContent.$.amtText.addClass('obrlpgcAmtText_withColor');
+ return false;
+ }
+ },
executeOnShow: function() {
this.$.header.setContent(
this.args.header ||
- OB.I18N.getLabel('OBRLPGC_LblLoyaltyPointAvailableHeader')
+ OB.I18N.getLabel('OBRLPGC_LblLoyaltyPointAvailableHeader')
);
this.$.bodyContent.$.bodymessage.setContent(this.args.message);
+ this.$.bodyContent.$.amtLbl.setContent(OB.I18N.getLabel('OBPOS_AmountOfCash'));
+ var sideButton = this.args.sideButton;
+ var amount = OB.DEC.number(
+ OB.I18N.parseNumber(sideButton.conversionFromPointsToPrice)
+ );
+ this.$.bodyContent.$.amtText.setValue(amount);
+ this.$.bodyContent.$.amtText.removeClass('obrlpgcAmtText_withColor');
this.$.bodyContent.$.secondaryMessage.setContent(
OB.I18N.getLabel('OBRLPGC_LblDoYouWantToRedeemThem')
);
@@ -63,25 +100,26 @@
var dialog = this.owner.owner;
var keyboard = OB.UI.GiftCertificateUtils.getKeyboard();
var sideButton = dialog.args.sideButton;
- var amount = OB.DEC.number(
- OB.I18N.parseNumber(sideButton.conversionFromPointsToPrice)
- );
- var pending = keyboard.receipt.getPending();
- amount = amount < pending ? amount : pending;
+ if (dialog.validateAmt()) {
+ var pending = keyboard.receipt.getPending();
+ var amount = OB.DEC.number(
+ OB.I18N.parseNumber(dialog.$.bodyContent.$.amtText.getValue()));
+ amount = amount < pending ? amount : pending;
- OB.UI.GiftCertificateUtils.consumeGiftCertificateAmount(
- keyboard,
- keyboard.receipt,
- sideButton,
- amount,
- keyboard.receipt.get('priceIncludesTax'),
- function() {
- dialog.doHideThisPopup();
- },
- function() {
- OB.error('Consume Fail executed');
- }
- );
+ OB.UI.GiftCertificateUtils.consumeGiftCertificateAmount(
+ keyboard,
+ keyboard.receipt,
+ sideButton,
+ amount,
+ keyboard.receipt.get('priceIncludesTax'),
+ function() {
+ dialog.doHideThisPopup();
+ },
+ function() {
+ OB.error('Consume Fail executed');
+ }
+ );
+ }
},
initComponents: function() {
this.inherited(arguments);
image.png [^] (940,494 bytes) 2022-09-22 16:52 |