Attached Files | posterminal.diff [^] (5,260 bytes) 2018-10-03 11:12 [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
@@ -10014,6 +10014,18 @@
<!--F1366DBECBB1478585C0D6D56007C145--> <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
<!--F1366DBECBB1478585C0D6D56007C145--></AD_MESSAGE>
+<!--F172370055B64172AF9E4E7C6F034DC8--><AD_MESSAGE>
+<!--F172370055B64172AF9E4E7C6F034DC8--> <AD_MESSAGE_ID><![CDATA[F172370055B64172AF9E4E7C6F034DC8]]></AD_MESSAGE_ID>
+<!--F172370055B64172AF9E4E7C6F034DC8--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--F172370055B64172AF9E4E7C6F034DC8--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--F172370055B64172AF9E4E7C6F034DC8--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--F172370055B64172AF9E4E7C6F034DC8--> <VALUE><![CDATA[OBPOS_LblAlternativePhone]]></VALUE>
+<!--F172370055B64172AF9E4E7C6F034DC8--> <MSGTEXT><![CDATA[Alternative Phone]]></MSGTEXT>
+<!--F172370055B64172AF9E4E7C6F034DC8--> <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--F172370055B64172AF9E4E7C6F034DC8--> <AD_MODULE_ID><![CDATA[FF808181326CC34901326D53DBCF0018]]></AD_MODULE_ID>
+<!--F172370055B64172AF9E4E7C6F034DC8--> <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--F172370055B64172AF9E4E7C6F034DC8--></AD_MESSAGE>
+
<!--F19A602439D841B59F62FB500316572D--><AD_MESSAGE>
<!--F19A602439D841B59F62FB500316572D--> <AD_MESSAGE_ID><![CDATA[F19A602439D841B59F62FB500316572D]]></AD_MESSAGE_ID>
<!--F19A602439D841B59F62FB500316572D--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
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
@@ -1,6 +1,6 @@
/*
************************************************************************************
- * Copyright (C) 2015-2017 Openbravo S.L.U.
+ * Copyright (C) 2015-2018 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.
@@ -40,6 +40,7 @@
add(new HQLProperty("ulist.email", "email"));
add(new HQLProperty("ulist.id", "contactId"));
add(new HQLProperty("ulist.phone", "phone"));
+ add(new HQLProperty("ulist.alternativePhone", "alternativePhone"));
add(new HQLProperty("ulist.firstName", "firstName"));
add(new HQLProperty("ulist.lastName", "lastName"));
add(new HQLProperty("plist.priceIncludesTax", "priceIncludesTax"));
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
@@ -393,6 +393,10 @@
skipremote: true,
type: 'TEXT'
}, {
+ name: 'alternativePhone',
+ column: 'alternativePhone',
+ type: 'TEXT'
+ }, {
name: 'email',
column: 'email',
filter: true,
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
@@ -1,6 +1,6 @@
/*
************************************************************************************
- * Copyright (C) 2012-2017 Openbravo S.L.U.
+ * Copyright (C) 2012-2018 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.
@@ -281,6 +281,12 @@
readOnly: true
}, {
kind: 'OB.UI.CustomerTextProperty',
+ name: 'alternativePhone',
+ modelProperty: 'alternativePhone',
+ i18nLabel: 'OBPOS_LblAlternativePhone',
+ readOnly: true
+ }, {
+ kind: 'OB.UI.CustomerTextProperty',
name: 'customerEmail',
modelProperty: 'email',
i18nLabel: 'OBPOS_LblEmail',
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
@@ -264,6 +264,12 @@
maxlength: 40
}, {
kind: 'OB.UI.CustomerTextProperty',
+ name: 'alternativePhone',
+ modelProperty: 'alternativePhone',
+ i18nLabel: 'OBPOS_LblAlternativePhone',
+ maxlength: 40
+ }, {
+ kind: 'OB.UI.CustomerTextProperty',
name: 'customerEmail',
modelProperty: 'email',
i18nLabel: 'OBPOS_LblEmail',
test-suite.diff [^] (7,937 bytes) 2018-10-05 09:17 [Show Content] [Hide Content]diff --git a/src-test/org/openbravo/test/mobile/core/utils/AllowedErrorsHelper.java b/src-test/org/openbravo/test/mobile/core/utils/AllowedErrorsHelper.java
--- a/src-test/org/openbravo/test/mobile/core/utils/AllowedErrorsHelper.java
+++ b/src-test/org/openbravo/test/mobile/core/utils/AllowedErrorsHelper.java
@@ -109,6 +109,7 @@
testsAllowedToHaveTomcatErrors.add("CustomerAddressNavigation.testReceiptProperties");
testsAllowedToHaveTomcatErrors.add("CustomerManageAddress");
testsAllowedToHaveTomcatErrors.add("NewCustomerWithAddress");
+ testsAllowedToHaveTomcatErrors.add("NewCustomerWithAlternativePhone");
testsAllowedToHaveTomcatErrors.add("SelectBothAddress");
testsAllowedToHaveTomcatErrors.add("I34927_VerifyCustomerAddressesNagivationPath");
testsAllowedToHaveTomcatErrors.add("I35248_VerifyUpdateCustomerOnLayaway");
diff --git a/src-test/org/openbravo/test/mobile/retail/pack/selenium/TestIdPack.java b/src-test/org/openbravo/test/mobile/retail/pack/selenium/TestIdPack.java
--- a/src-test/org/openbravo/test/mobile/retail/pack/selenium/TestIdPack.java
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/TestIdPack.java
@@ -806,6 +806,8 @@
"customerCategory_customerCombo"); //
public static TestIdConstructor FIELD_CUSTOMER_STATICNAME = new TestIdConstructor(
"newAttribute_customerName"); //
+ public static TestIdConstructor FIELD_CUSTOMER_ALT_PHONE = new TestIdConstructor(
+ "newAttribute_alternativePhone"); //
public static TestIdConstructor FIELD_CUSTOMER_ADDRESS_INV_NAME = new TestIdConstructor(
"newAttribute_customerInvLocName"); //
public static TestIdConstructor FIELD_CUSTOMER_ADDRESS_INV_POSTALCODE = new TestIdConstructor(
diff --git a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/customercreation/CustomerCreationHelper.java b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/customercreation/CustomerCreationHelper.java
--- a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/customercreation/CustomerCreationHelper.java
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/customercreation/CustomerCreationHelper.java
@@ -11,7 +11,7 @@
* under the License.
* The Original Code is Openbravo ERP.
* The Initial Developer of the Original Code is Openbravo S.L.U.
- * All portions are Copyright (C) 2016 Openbravo S.L.U.
+ * All portions are Copyright (C) 2016-2018 Openbravo S.L.U.
* All Rights Reserved.
* Contributor(s): ______________________________________.
************************************************************************
@@ -35,11 +35,18 @@
public class CustomerCreationHelper extends WebPOSTerminalHelper {
protected void createCustomer(final String customerName) {
+ createCustomer(customerName, null);
+ }
+
+ protected void createCustomer(final String customerName, final String alternativePhone) {
tap(TestIdPack.BUTTON_RECEIPT_CUSTOMER);
tap(TestIdPack.BUTTON_CUSTOMER_NEW);
-
+ if (alternativePhone != null) {
+ write(TestIdPack.FIELD_CUSTOMER_ALT_PHONE, alternativePhone);
+ }
write(TestIdPack.FIELD_CUSTOMER_NAME, customerName);
write(TestIdPack.FIELD_CUSTOMER_ADDRESS_INV_NAME, customerName + " Addr");
+ verify(TestIdPack.FIELD_CUSTOMER_CUSTOMER_COUNTRY_VIEW, "106");
write(TestIdPack.FIELD_CUSTOMER_ADDRESS_INV_POSTALCODE, "31000");
write(TestIdPack.FIELD_CUSTOMER_ADDRESS_INV_CITY, "Pamplona");
tap(TestIdPack.BUTTON_CUSTOMER_SAVE);
diff --git a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/customercreation/NewCustomerWithAlternativePhone.java b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/customercreation/NewCustomerWithAlternativePhone.java
new file mode 100644
--- /dev/null
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/customercreation/NewCustomerWithAlternativePhone.java
@@ -0,0 +1,88 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo Public License
+ * Version 1.0 (the "License"), being the Mozilla Public License
+ * Version 1.1 with a permitted attribution clause; you may not use this
+ * file except in compliance with the License. You may obtain a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo S.L.U.
+ * All portions are Copyright (C) 2018 Openbravo S.L.U.
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________.
+ ************************************************************************
+ */
+
+package org.openbravo.test.mobile.retail.pack.selenium.tests.customercreation;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+import org.junit.Test;
+import org.openbravo.test.mobile.retail.mobilecore.annotations.TestClassAnnotations;
+import org.openbravo.test.mobile.retail.mobilecore.database.DatabaseHelperSelect;
+import org.openbravo.test.mobile.retail.mobilecore.javascript.BackboneHelper;
+import org.openbravo.test.mobile.retail.pack.selenium.TestIdPack;
+
+/**
+ * Create a new customer with address in a receipt
+ */
+
+@TestClassAnnotations(isHighVolumeCompatible = true)
+public class NewCustomerWithAlternativePhone extends CustomerCreationHelper {
+ @Test
+ public void test() {
+ final String customerName = "CCIa140 " + System.currentTimeMillis();
+ final String secondaryPhone = "666666666";
+ final String editSecondaryPhone = "666666677";
+
+ reload();
+ createCustomer(customerName, secondaryPhone);
+ verifyFlagsAddress(customerName);
+ verifyBPSecondaryPhoneinBackend(customerName, secondaryPhone);
+ tap(TestIdPack.BUTTON_DELETERECEIPT);
+ tap(TestIdPack.BUTTON_DELETERECEIPT_CONFIRM);
+ verify(TestIdPack.LABEL_TOTALTOPAY, "0.00");
+
+ // edit secondary or alternate phone no.
+ reload();
+
+ tap(TestIdPack.BUTTON_MENU);
+ tap(TestIdPack.BUTTON_MENU_CUSTOMERS);
+ write(TestIdPack.FIELD_CUSTOMER_MODAL, customerName);
+ tap(TestIdPack.BUTTON_CUSTOMER_MODAL_SEARCH);
+ tap(TestIdPack.BUTTON_POPUP_CUSTOMER_3DOTS);
+ tap(TestIdPack.BUTTON_POPUP_CUSTOMER_3DOTS_EDIT);
+ verify(TestIdPack.FIELD_VIEW_CUSTOMER_EDIT, "Edit Customer");
+ verify(TestIdPack.FIELD_CUSTOMER_ALT_PHONE, secondaryPhone);
+ write(TestIdPack.FIELD_CUSTOMER_ALT_PHONE, editSecondaryPhone);
+ tap(TestIdPack.BUTTON_CUSTOMER_SAVE);
+ verify(TestIdPack.FIELD_VIEW_CUSTOMER_DETAILS, "Customer details");
+ tap(TestIdPack.BUTTON_CUSTOMER_DETAILS_CLOSE);
+ verify(TestIdPack.LABEL_CUSTOMER_ASSIGN_TITLE, "Assign a customer");
+ tap(TestIdPack.BUTTON_CUSTOMER_SELECTOR_CLOSE);
+ verifyBPSecondaryPhoneinBackend(customerName, editSecondaryPhone);
+ }
+
+ public static void verifyBPSecondaryPhoneinBackend(final String BPname,
+ final String BPSecondaryPhone) {
+ final String clientId = BackboneHelper.getTerminalValue("client");
+ final String query = String
+ .format("SELECT phone2 from ad_user where c_bpartner_id = (select c_bpartner_id from c_bpartner where name = '"
+ + BPname + "' and ad_client_id = '" + clientId + "')");
+ new DatabaseHelperSelect() {
+ @Override
+ protected void yieldResultSet(final ResultSet rs) throws SQLException {
+ assertThat("Secondary or Alternate phone of the BPartner is not the expected",
+ rs.getString("phone2"), equalTo(BPSecondaryPhone));
+ }
+ }.execute(query, 1);
+ }
+}
|