Attached Files | issue_29269_surname.diff [^] (10,149 bytes) 2015-03-20 10:40 [Show Content] [Hide Content]diff --git a/src-db/database/model/modifiedTables/AD_ORG.xml b/src-db/database/model/modifiedTables/AD_ORG.xml
--- a/src-db/database/model/modifiedTables/AD_ORG.xml
+++ b/src-db/database/model/modifiedTables/AD_ORG.xml
@@ -57,6 +57,9 @@
<foreign-key foreignTable="OBPOS_PRINT_TEMPLATE" name="EM_OBPOS_ORG_LAYAWAYTEMP">
<reference local="EM_OBPOS_LAYAWAY_TEMPLATE_ID" foreign="OBPOS_PRINT_TEMPLATE_ID"/>
</foreign-key>
+ <foreign-key foreignTable="OBPOS_PRINT_TEMPLATE" name="EM_OBPOS_ORG_QUOTTEMP">
+ <reference local="EM_OBPOS_QUOT_TEMPLATE_ID" foreign="OBPOS_PRINT_TEMPLATE_ID"/>
+ </foreign-key>
<foreign-key foreignTable="OBPOS_PRINT_TEMPLATE" name="EM_OBPOS_ORG_RETINVTEMP">
<reference local="EM_OBPOS_RET_INV_TEMPLATE_ID" foreign="OBPOS_PRINT_TEMPLATE_ID"/>
</foreign-key>
@@ -66,9 +69,6 @@
<foreign-key foreignTable="OBPOS_PRINT_TEMPLATE" name="EM_OBPOS_ORG_TICKETTEMP">
<reference local="EM_OBPOS_TICKET_TEMPLATE_ID" foreign="OBPOS_PRINT_TEMPLATE_ID"/>
</foreign-key>
- <foreign-key foreignTable="OBPOS_PRINT_TEMPLATE" name="EM_OBPOS_ORG_QUOTTEMP">
- <reference local="EM_OBPOS_QUOT_TEMPLATE_ID" foreign="OBPOS_PRINT_TEMPLATE_ID"/>
- </foreign-key>
<check name="EM_OBPOS_ORG_FORMAT"><![CDATA[((EM_OBPOS_FORMAT_DECIMAL IS NULL) AND (EM_OBPOS_FORMAT_GROUP IS NULL)) OR ((EM_OBPOS_FORMAT_DECIMAL IS NOT NULL) AND (EM_OBPOS_FORMAT_GROUP IS NOT NULL))]]></check>
</table>
</database>
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
@@ -3687,6 +3687,18 @@
<!--A97BB10EFB924F6491284AD555E55C36--> <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
<!--A97BB10EFB924F6491284AD555E55C36--></AD_MESSAGE>
+<!--AA1EC0BF56CC4468A7FC5C8BDE7D6E7B--><AD_MESSAGE>
+<!--AA1EC0BF56CC4468A7FC5C8BDE7D6E7B--> <AD_MESSAGE_ID><![CDATA[AA1EC0BF56CC4468A7FC5C8BDE7D6E7B]]></AD_MESSAGE_ID>
+<!--AA1EC0BF56CC4468A7FC5C8BDE7D6E7B--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AA1EC0BF56CC4468A7FC5C8BDE7D6E7B--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AA1EC0BF56CC4468A7FC5C8BDE7D6E7B--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AA1EC0BF56CC4468A7FC5C8BDE7D6E7B--> <VALUE><![CDATA[OBPOS_LblLastName]]></VALUE>
+<!--AA1EC0BF56CC4468A7FC5C8BDE7D6E7B--> <MSGTEXT><![CDATA[Last name]]></MSGTEXT>
+<!--AA1EC0BF56CC4468A7FC5C8BDE7D6E7B--> <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--AA1EC0BF56CC4468A7FC5C8BDE7D6E7B--> <AD_MODULE_ID><![CDATA[FF808181326CC34901326D53DBCF0018]]></AD_MODULE_ID>
+<!--AA1EC0BF56CC4468A7FC5C8BDE7D6E7B--> <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--AA1EC0BF56CC4468A7FC5C8BDE7D6E7B--></AD_MESSAGE>
+
<!--AA8DDF05D0F147018F60AE22287F556E--><AD_MESSAGE>
<!--AA8DDF05D0F147018F60AE22287F556E--> <AD_MESSAGE_ID><![CDATA[AA8DDF05D0F147018F60AE22287F556E]]></AD_MESSAGE_ID>
<!--AA8DDF05D0F147018F60AE22287F556E--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff --git a/src/org/openbravo/retail/posterminal/CustomerLoader.java b/src/org/openbravo/retail/posterminal/CustomerLoader.java
--- a/src/org/openbravo/retail/posterminal/CustomerLoader.java
+++ b/src/org/openbravo/retail/posterminal/CustomerLoader.java
@@ -182,7 +182,7 @@
if (name.length() > 60) {
name = name.substring(0, 60);
}
- user.setFirstName(name);
+ user.setName(name);
// Contact exist > modify it. The username is not modified
OBDal.getInstance().save(user);
@@ -233,7 +233,7 @@
if (name.length() > 60) {
name = name.substring(0, 60);
}
- usr.setFirstName(name);
+ usr.setName(name);
usr.setBusinessPartner(customer);
diff --git a/src/org/openbravo/retail/posterminal/master/BusinessPartnerProperties.java b/src/org/openbravo/retail/posterminal/master/BusinessPartnerProperties.java
--- a/src/org/openbravo/retail/posterminal/master/BusinessPartnerProperties.java
+++ b/src/org/openbravo/retail/posterminal/master/BusinessPartnerProperties.java
@@ -34,6 +34,8 @@
add(new HQLProperty("ulist.email", "email"));
add(new HQLProperty("ulist.id", "contactId"));
add(new HQLProperty("ulist.phone", "phone"));
+ add(new HQLProperty("ulist.firstName", "firstName"));
+ add(new HQLProperty("ulist.lastName", "lastName"));
add(new HQLProperty("bpl.locationAddress.cityName", "cityName"));
add(new HQLProperty("bpl.locationAddress.country.name", "countryName"));
add(new HQLProperty("bpl.locationAddress.postalCode", "postalCode"));
diff --git a/web/org.openbravo.retail.posterminal/js/model/businesspartner.js b/web/org.openbravo.retail.posterminal/js/model/businesspartner.js
--- a/web/org.openbravo.retail.posterminal/js/model/businesspartner.js
+++ b/web/org.openbravo.retail.posterminal/js/model/businesspartner.js
@@ -83,6 +83,8 @@
this.set('id', null);
this.set('searchKey', null);
this.set('name', null);
+ this.set('firstName', null);
+ this.set('lastName', null);
this.set('description', null);
this.set('taxID', null);
this.set('taxCategory', null);
@@ -167,6 +169,14 @@
column: 'name',
type: 'TEXT'
}, {
+ name: 'firstName',
+ column: 'first_name',
+ type: 'TEXT'
+ }, {
+ name: 'lastName',
+ column: 'last_name',
+ type: 'TEXT'
+ }, {
name: 'description',
column: 'description',
type: 'TEXT'
diff --git a/web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customers/components/sharedcomponents.js b/web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customers/components/sharedcomponents.js
--- a/web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customers/components/sharedcomponents.js
+++ b/web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customers/components/sharedcomponents.js
@@ -109,7 +109,7 @@
},
dataReadyFunction: function (data, inEvent) {
var index = 0,
- result = null;
+ result = null;
if (data) {
this.collection.reset(data.models);
} else {
@@ -195,7 +195,7 @@
},
saveCustomer: function (inSender, inEvent) {
var me = this,
- sw = me.subWindow;
+ sw = me.subWindow;
function getCustomerValues(params) {
me.waterfall('onSaveChange', {
@@ -232,6 +232,7 @@
this.waterfall('onSaveChange', {
customer: this.model.get('customer')
});
+ this.adjustNames(this.model.get('customer'));
var success = this.model.get('customer').saveCustomer();
if (success) {
goToViewWindow(sw, {
@@ -239,10 +240,12 @@
});
}
} else {
+ var that = this;
this.model.get('customer').loadById(this.customer.get('id'), function (customer) {
getCustomerValues({
customer: customer
});
+ that.adjustNames(customer);
var success = customer.saveCustomer();
if (success) {
goToViewWindow(sw, {
@@ -252,6 +255,19 @@
});
}
},
+ adjustNames: function (customer) {
+ var firstName = customer.get('firstName'),
+ lastName = customer.get('lastName');
+ if (firstName) {
+ firstName = firstName.trim();
+ }
+ if (lastName) {
+ lastName = lastName.trim();
+ }
+ customer.set('firstName', firstName);
+ customer.set('lastName', lastName);
+ customer.set('name', firstName + (lastName ? ' ' + lastName : ''));
+ },
initComponents: function () {
this.inherited(arguments);
this.$.bodyheader.createComponent({
@@ -260,7 +276,7 @@
this.attributeContainer = this.$.customerAttributes;
enyo.forEach(this.newAttributes, function (natt) {
var resultDisplay = true,
- undf;
+ undf;
if (natt.displayLogic !== undf && natt.displayLogic !== null) {
if (enyo.isFunction(natt.displayLogic)) {
resultDisplay = natt.displayLogic(this);
diff --git a/web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customers/customerdetailview.js b/web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customers/customerdetailview.js
--- a/web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customers/customerdetailview.js
+++ b/web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customers/customerdetailview.js
@@ -191,11 +191,17 @@
newAttributes: [{
kind: 'OB.UI.CustomerTextProperty',
name: 'customerName',
- modelProperty: 'name',
+ modelProperty: 'firstName',
i18nLabel: 'OBPOS_LblName',
readOnly: true
}, {
kind: 'OB.UI.CustomerTextProperty',
+ name: 'lastName',
+ modelProperty: 'lastName',
+ i18nLabel: 'OBPOS_LblLastName',
+ readOnly: true
+ }, {
+ kind: 'OB.UI.CustomerTextProperty',
name: 'customerBpCat',
modelProperty: 'businessPartnerCategory_name',
i18nLabel: 'OBPOS_BPCategory',
diff --git a/web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customers/editcreatecustomerform.js b/web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customers/editcreatecustomerform.js
--- a/web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customers/editcreatecustomerform.js
+++ b/web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customers/editcreatecustomerform.js
@@ -137,12 +137,19 @@
windowHeader: 'OB.OBPOSPointOfSale.UI.customers.subwindowNewCustomer_bodyheader',
newAttributes: [{
kind: 'OB.UI.CustomerTextProperty',
- name: 'customerName',
- modelProperty: 'name',
+ name: 'firstName',
+ modelProperty: 'firstName',
isFirstFocus: true,
i18nLabel: 'OBPOS_LblName',
maxlength: 60
}, {
+ kind: 'OB.UI.CustomerTextProperty',
+ name: 'lastName',
+ modelProperty: 'lastName',
+ isFirstFocus: true,
+ i18nLabel: 'OBPOS_LblLastName',
+ maxlength: 60
+ }, {
kind: 'OB.UI.CustomerComboProperty',
name: 'customerCategory',
modelProperty: 'businessPartnerCategory',
|