diff --git a/src-db/database/model/tables/OBPOS_ORDER_APPROVAL.xml b/src-db/database/model/tables/OBPOS_ORDER_APPROVAL.xml
--- a/src-db/database/model/tables/OBPOS_ORDER_APPROVAL.xml
+++ b/src-db/database/model/tables/OBPOS_ORDER_APPROVAL.xml
@@ -45,6 +45,10 @@
+
+
+
+
diff --git a/src-db/database/sourcedata/AD_COLUMN.xml b/src-db/database/sourcedata/AD_COLUMN.xml
--- a/src-db/database/sourcedata/AD_COLUMN.xml
+++ b/src-db/database/sourcedata/AD_COLUMN.xml
@@ -6077,6 +6077,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src-db/database/sourcedata/AD_FIELD.xml b/src-db/database/sourcedata/AD_FIELD.xml
--- a/src-db/database/sourcedata/AD_FIELD.xml
+++ b/src-db/database/sourcedata/AD_FIELD.xml
@@ -735,6 +735,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/web/org.openbravo.retail.posterminal/js/components/obpos-approval.js b/web/org.openbravo.retail.posterminal/js/components/obpos-approval.js
--- a/web/org.openbravo.retail.posterminal/js/components/obpos-approval.js
+++ b/web/org.openbravo.retail.posterminal/js/components/obpos-approval.js
@@ -1,6 +1,6 @@
/*
************************************************************************************
- * Copyright (C) 2013 Openbravo S.L.U.
+ * Copyright (C) 2013-2014 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.
@@ -54,7 +54,9 @@
i18nHeader: 'OBPOS_ApprovalRequiredTitle',
bodyContent: {
components: [{
- name: 'explainApprovalTxt'
+ name: 'explainApprovalTxt',
+ allowHtml: true,
+ style: 'text-align: left; padding-left: 0.5em;'
}, {
classes: 'login-header-row',
style: 'color:black; line-height: 20px;',
@@ -115,18 +117,23 @@
},
initComponents: function () {
- var msg = '';
+ var msg = '',
+ i;
this.inherited(arguments);
this.$.bodyContent.$.username.attributes.placeholder = OB.I18N.getLabel('OBMOBC_LoginUserInput');
this.$.bodyContent.$.password.attributes.placeholder = OB.I18N.getLabel('OBMOBC_LoginPasswordInput');
if (!Array.isArray(this.approvalType)) {
this.approvalType = [this.approvalType];
}
- _.each(this.approvalType, function (approval) {
- msg = msg + ' ' + (OB.I18N.labels[approval] || OB.I18N.getLabel('OBPOS_ApprovalTextHeader'));
- });
+ for (i = 0; i < this.approvalType.length; i++) {
+ if (this.approvalType[i] instanceof Object) {
+ msg = msg + (OB.I18N.getLabel(this.approvalType[i].message, this.approvalType[i].params) || OB.I18N.getLabel('OBPOS_ApprovalTextHeader'));
+ } else {
+ msg = msg + (OB.I18N.labels[this.approvalType[i]] || OB.I18N.getLabel('OBPOS_ApprovalTextHeader')) + '
';
+ }
+ }
+
this.$.bodyContent.$.explainApprovalTxt.setContent(msg);
-
this.postRenderActions();
},
@@ -178,11 +185,16 @@
},
postRenderActions: function () {
+ var approvalList = [];
+ this.approvalType.forEach(function (approvalType) {
+ approvalList.push(typeof (approvalType) === 'object' ? approvalType.approval : approvalType);
+ });
+
var params = OB.MobileApp.model.get('loginUtilsParams') || {};
params.appName = OB.MobileApp.model.get('appName');
params.command = 'userImages';
- params.approvalType = JSON.stringify(this.approvalType);
+ params.approvalType = JSON.stringify(approvalList);
new OB.OBPOSLogin.UI.LoginRequest({
url: OB.MobileApp.model.get('loginUtilsUrl')
}).response(this, 'setUserImages').go(params);
diff --git a/web/org.openbravo.retail.posterminal/js/data/dataordersave.js b/web/org.openbravo.retail.posterminal/js/data/dataordersave.js
--- a/web/org.openbravo.retail.posterminal/js/data/dataordersave.js
+++ b/web/org.openbravo.retail.posterminal/js/data/dataordersave.js
@@ -61,6 +61,13 @@
auxReceipt = new OB.Model.Order(),
currentDocNo = receipt.get('documentNo') || docno;
+ receipt.get("approvals").forEach(function (approval) {
+ if (typeof (approval.approvalType) === 'object') {
+ approval.approvalMessage = OB.I18N.getLabel(approval.approvalType.message, approval.approvalType.params);
+ approval.approvalType = approval.approvalType.approval;
+ }
+ });
+
receipt.set('obposAppCashup', OB.MobileApp.model.get('terminal').cashUpId);
// convert returns
if (receipt.get('gross') < 0) {
@@ -205,4 +212,4 @@
}, this);
};
-}());
+}());
\ No newline at end of file
diff --git a/web/org.openbravo.retail.posterminal/js/model/terminal-model.js b/web/org.openbravo.retail.posterminal/js/model/terminal-model.js
--- a/web/org.openbravo.retail.posterminal/js/model/terminal-model.js
+++ b/web/org.openbravo.retail.posterminal/js/model/terminal-model.js
@@ -32,10 +32,15 @@
*/
checkApproval: function (approvalType, username, password, callback) {
OB.Dal.initCache(OB.Model.Supervisor, [], null, null);
+ var approvalList = [];
+ approvalType.forEach(function (approvalType) {
+ approvalList.push(typeof (approvalType) === 'object' ? approvalType.approval : approvalType);
+ });
+
new OB.DS.Process('org.openbravo.retail.posterminal.utility.CheckApproval').exec({
u: username,
p: password,
- approvalType: JSON.stringify(approvalType)
+ approvalType: JSON.stringify(approvalList)
}, enyo.bind(this, function (response, message) {
var approved = false;
if (response.exception) {