Attached Files | issue36660Posterminal17Q11.diff [^] (8,770 bytes) 2017-09-05 11:33 [Show Content] [Hide Content]diff --git a/src-db/database/sourcedata/AD_MESSAGE.xml b/src-db/database/sourcedata/AD_MESSAGE.xml
--- a/src-db/database/sourcedata/AD_MESSAGE.xml
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml
@@ -1718,6 +1718,18 @@
<!--32D8FA0EB5B941BFB3DCEFCF78436063--> <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
<!--32D8FA0EB5B941BFB3DCEFCF78436063--></AD_MESSAGE>
+<!--33BC881E38AE4E32A02012BD208D9363--><AD_MESSAGE>
+<!--33BC881E38AE4E32A02012BD208D9363--> <AD_MESSAGE_ID><![CDATA[33BC881E38AE4E32A02012BD208D9363]]></AD_MESSAGE_ID>
+<!--33BC881E38AE4E32A02012BD208D9363--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--33BC881E38AE4E32A02012BD208D9363--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--33BC881E38AE4E32A02012BD208D9363--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--33BC881E38AE4E32A02012BD208D9363--> <VALUE><![CDATA[OBPOS_NoBillingAddrHeader]]></VALUE>
+<!--33BC881E38AE4E32A02012BD208D9363--> <MSGTEXT><![CDATA[There is no invoicing address defined]]></MSGTEXT>
+<!--33BC881E38AE4E32A02012BD208D9363--> <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--33BC881E38AE4E32A02012BD208D9363--> <AD_MODULE_ID><![CDATA[FF808181326CC34901326D53DBCF0018]]></AD_MODULE_ID>
+<!--33BC881E38AE4E32A02012BD208D9363--> <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--33BC881E38AE4E32A02012BD208D9363--></AD_MESSAGE>
+
<!--33EB3C24BDFF4ED5B6CE71744DAD1B98--><AD_MESSAGE>
<!--33EB3C24BDFF4ED5B6CE71744DAD1B98--> <AD_MESSAGE_ID><![CDATA[33EB3C24BDFF4ED5B6CE71744DAD1B98]]></AD_MESSAGE_ID>
<!--33EB3C24BDFF4ED5B6CE71744DAD1B98--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -5693,6 +5705,18 @@
<!--A4D36CD407EE42EC9DB97A7A1BBE48F7--> <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
<!--A4D36CD407EE42EC9DB97A7A1BBE48F7--></AD_MESSAGE>
+<!--A4DD653F121E4DDD8088DFF1DC9E085F--><AD_MESSAGE>
+<!--A4DD653F121E4DDD8088DFF1DC9E085F--> <AD_MESSAGE_ID><![CDATA[A4DD653F121E4DDD8088DFF1DC9E085F]]></AD_MESSAGE_ID>
+<!--A4DD653F121E4DDD8088DFF1DC9E085F--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--A4DD653F121E4DDD8088DFF1DC9E085F--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--A4DD653F121E4DDD8088DFF1DC9E085F--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--A4DD653F121E4DDD8088DFF1DC9E085F--> <VALUE><![CDATA[OBPOS_NoBillingAddrBody]]></VALUE>
+<!--A4DD653F121E4DDD8088DFF1DC9E085F--> <MSGTEXT><![CDATA[At least one invoicing address should be defined for %0. Set a new one before change %1 address]]></MSGTEXT>
+<!--A4DD653F121E4DDD8088DFF1DC9E085F--> <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--A4DD653F121E4DDD8088DFF1DC9E085F--> <AD_MODULE_ID><![CDATA[FF808181326CC34901326D53DBCF0018]]></AD_MODULE_ID>
+<!--A4DD653F121E4DDD8088DFF1DC9E085F--> <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--A4DD653F121E4DDD8088DFF1DC9E085F--></AD_MESSAGE>
+
<!--A502AFE7B0D8403295CD2BB6F8E23321--><AD_MESSAGE>
<!--A502AFE7B0D8403295CD2BB6F8E23321--> <AD_MESSAGE_ID><![CDATA[A502AFE7B0D8403295CD2BB6F8E23321]]></AD_MESSAGE_ID>
<!--A502AFE7B0D8403295CD2BB6F8E23321--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff --git a/web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customeraddress/components/sharedcomponents.js b/web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customeraddress/components/sharedcomponents.js
--- a/web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customeraddress/components/sharedcomponents.js
+++ b/web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customeraddress/components/sharedcomponents.js
@@ -254,56 +254,59 @@
getCustomerAddrValues({
customerAddr: customerAddr
});
-
- if (validateForm(me)) {
- if (OB.MobileApp.model.receipt.get('lines').length > 0 && OB.MobileApp.model.receipt.get('bp').get('shipLocId') === customerAddr.get('id') && !customerAddr.get('isShipTo')) {
- OB.UTIL.showConfirmation.display(OB.I18N.getLabel('OBPOS_InformationTitle'), OB.I18N.getLabel('OBPOS_UncheckShipToText'), [{
- label: OB.I18N.getLabel('OBPOS_LblOk'),
- isConfirmButton: true,
- action: function () {
- OB.UTIL.HookManager.executeHooks('OBPOS_BeforeCustomerAddrSave', {
- customerAddr: me.model.get('customerAddr'),
- isNew: true
- }, function (args) {
- var receipt = OB.MobileApp.model.receipt,
- orderlines = [];
- if (args && args.cancellation && args.cancellation === true) {
- return true;
- }
- receipt.set('skipCalculateReceipt', true);
- receipt.set('preventServicesUpdate', true);
- receipt.set('deleting', true);
- _.each(receipt.get('lines').models, function (line) {
- orderlines.push(line);
+ if (!me.model.get('customerAddr').get('isBillTo')) {
+ OB.UTIL.showConfirmation.display(OB.I18N.getLabel('OBPOS_NoBillingAddrHeader'), OB.I18N.getLabel('OBPOS_NoBillingAddrBody', [me.model.get('customerAddr').get('customerName'), me.model.get('customerAddr').get('name')]));
+ } else {
+ if (validateForm(me)) {
+ if (OB.MobileApp.model.receipt.get('lines').length > 0 && OB.MobileApp.model.receipt.get('bp').get('shipLocId') === customerAddr.get('id') && !customerAddr.get('isShipTo')) {
+ OB.UTIL.showConfirmation.display(OB.I18N.getLabel('OBPOS_InformationTitle'), OB.I18N.getLabel('OBPOS_UncheckShipToText'), [{
+ label: OB.I18N.getLabel('OBPOS_LblOk'),
+ isConfirmButton: true,
+ action: function () {
+ OB.UTIL.HookManager.executeHooks('OBPOS_BeforeCustomerAddrSave', {
+ customerAddr: me.model.get('customerAddr'),
+ isNew: true
+ }, function (args) {
+ var receipt = OB.MobileApp.model.receipt,
+ orderlines = [];
+ if (args && args.cancellation && args.cancellation === true) {
+ return true;
+ }
+ receipt.set('skipCalculateReceipt', true);
+ receipt.set('preventServicesUpdate', true);
+ receipt.set('deleting', true);
+ _.each(receipt.get('lines').models, function (line) {
+ orderlines.push(line);
+ });
+ _.each(orderlines, function (line) {
+ receipt.deleteLine(line, true);
+ });
+ receipt.unset('preventServicesUpdate');
+ receipt.unset('deleting');
+ receipt.calculateGross();
+ args.customerAddr.saveCustomerAddr(callback);
+ receipt.set('skipCalculateReceipt', false);
});
- _.each(orderlines, function (line) {
- receipt.deleteLine(line, true);
- });
- receipt.unset('preventServicesUpdate');
- receipt.unset('deleting');
- receipt.calculateGross();
- args.customerAddr.saveCustomerAddr(callback);
- receipt.set('skipCalculateReceipt', false);
- });
- }
- }, {
- label: OB.I18N.getLabel('OBMOBC_LblCancel')
- }], {
- autoDismiss: false,
- onHideFunction: function () {
- return;
- }
- });
- } else {
- OB.UTIL.HookManager.executeHooks('OBPOS_BeforeCustomerAddrSave', {
- customerAddr: me.model.get('customerAddr'),
- isNew: true
- }, function (args) {
- if (args && args.cancellation && args.cancellation === true) {
- return true;
- }
- args.customerAddr.saveCustomerAddr(callback);
- });
+ }
+ }, {
+ label: OB.I18N.getLabel('OBMOBC_LblCancel')
+ }], {
+ autoDismiss: false,
+ onHideFunction: function () {
+ return;
+ }
+ });
+ } else {
+ OB.UTIL.HookManager.executeHooks('OBPOS_BeforeCustomerAddrSave', {
+ customerAddr: me.model.get('customerAddr'),
+ isNew: true
+ }, function (args) {
+ if (args && args.cancellation && args.cancellation === true) {
+ return true;
+ }
+ args.customerAddr.saveCustomerAddr(callback);
+ });
+ }
}
}
});
|