Attached Files | LoadOpenTickets.diff [^] (6,427 bytes) 2016-04-26 15:21 [Show Content] [Hide Content]diff --git a/src-db/database/sourcedata/AD_PREFERENCE.xml b/src-db/database/sourcedata/AD_PREFERENCE.xml
--- a/src-db/database/sourcedata/AD_PREFERENCE.xml
+++ b/src-db/database/sourcedata/AD_PREFERENCE.xml
@@ -110,6 +110,17 @@
<!--155D5B41652A4129A390BB395B32B29A--> <AD_MODULE_ID><![CDATA[FF808181326CC34901326D53DBCF0018]]></AD_MODULE_ID>
<!--155D5B41652A4129A390BB395B32B29A--></AD_PREFERENCE>
+<!--15B06EEF1F0D4A19938F8DAF57450784--><AD_PREFERENCE>
+<!--15B06EEF1F0D4A19938F8DAF57450784--> <AD_PREFERENCE_ID><![CDATA[15B06EEF1F0D4A19938F8DAF57450784]]></AD_PREFERENCE_ID>
+<!--15B06EEF1F0D4A19938F8DAF57450784--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--15B06EEF1F0D4A19938F8DAF57450784--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--15B06EEF1F0D4A19938F8DAF57450784--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--15B06EEF1F0D4A19938F8DAF57450784--> <VALUE><![CDATA[N]]></VALUE>
+<!--15B06EEF1F0D4A19938F8DAF57450784--> <PROPERTY><![CDATA[OBPOS_SelectCurrentTicketsOnPaidOpen]]></PROPERTY>
+<!--15B06EEF1F0D4A19938F8DAF57450784--> <ISPROPERTYLIST><![CDATA[Y]]></ISPROPERTYLIST>
+<!--15B06EEF1F0D4A19938F8DAF57450784--> <AD_MODULE_ID><![CDATA[FF808181326CC34901326D53DBCF0018]]></AD_MODULE_ID>
+<!--15B06EEF1F0D4A19938F8DAF57450784--></AD_PREFERENCE>
+
<!--16D197BA16AB45899C7003E4698420CE--><AD_PREFERENCE>
<!--16D197BA16AB45899C7003E4698420CE--> <AD_PREFERENCE_ID><![CDATA[16D197BA16AB45899C7003E4698420CE]]></AD_PREFERENCE_ID>
<!--16D197BA16AB45899C7003E4698420CE--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff --git a/src-db/database/sourcedata/AD_REF_LIST.xml b/src-db/database/sourcedata/AD_REF_LIST.xml
--- a/src-db/database/sourcedata/AD_REF_LIST.xml
+++ b/src-db/database/sourcedata/AD_REF_LIST.xml
@@ -546,6 +546,17 @@
<!--6602A06C570044EE99A3C3C4117F0340--> <SEQNO><![CDATA[2]]></SEQNO>
<!--6602A06C570044EE99A3C3C4117F0340--></AD_REF_LIST>
+<!--66BE161D3E9142AC956965BD390A22A4--><AD_REF_LIST>
+<!--66BE161D3E9142AC956965BD390A22A4--> <AD_REF_LIST_ID><![CDATA[66BE161D3E9142AC956965BD390A22A4]]></AD_REF_LIST_ID>
+<!--66BE161D3E9142AC956965BD390A22A4--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--66BE161D3E9142AC956965BD390A22A4--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--66BE161D3E9142AC956965BD390A22A4--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--66BE161D3E9142AC956965BD390A22A4--> <VALUE><![CDATA[OBPOS_SelectCurrentTicketsOnPaidOpen]]></VALUE>
+<!--66BE161D3E9142AC956965BD390A22A4--> <NAME><![CDATA[WebPOS Select Current Receipts on Pay Open Tickets]]></NAME>
+<!--66BE161D3E9142AC956965BD390A22A4--> <AD_REFERENCE_ID><![CDATA[A26BA480E2014707B47257024C3CBFF7]]></AD_REFERENCE_ID>
+<!--66BE161D3E9142AC956965BD390A22A4--> <AD_MODULE_ID><![CDATA[FF808181326CC34901326D53DBCF0018]]></AD_MODULE_ID>
+<!--66BE161D3E9142AC956965BD390A22A4--></AD_REF_LIST>
+
<!--69866AA7260440C0A81D4ADF7BC84EBC--><AD_REF_LIST>
<!--69866AA7260440C0A81D4ADF7BC84EBC--> <AD_REF_LIST_ID><![CDATA[69866AA7260440C0A81D4ADF7BC84EBC]]></AD_REF_LIST_ID>
<!--69866AA7260440C0A81D4ADF7BC84EBC--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff --git a/web/org.openbravo.retail.posterminal/js/components/modalmultiorders.js b/web/org.openbravo.retail.posterminal/js/components/modalmultiorders.js
--- a/web/org.openbravo.retail.posterminal/js/components/modalmultiorders.js
+++ b/web/org.openbravo.retail.posterminal/js/components/modalmultiorders.js
@@ -1,6 +1,6 @@
/*
************************************************************************************
- * Copyright (C) 2013-2015 Openbravo S.L.U.
+ * Copyright (C) 2013-2016 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.
@@ -238,14 +238,14 @@
if (iter.get('lines') && iter.get('lines').length > 0) {
re = new RegExp(me.filters.filterText, 'gi');
toMatch = iter.get('documentNo').match(re) + iter.get('bp').get('_identifier').match(re);
- if ((me.filters.filterText === "" || toMatch !== 0) && (iter.get('orderType') === 0 || iter.get('orderType') === 2) && !iter.get('isPaid') && !iter.get('isQuotation') && iter.get('gross') >= 0) {
+ if ((me.filters.filterText === '' || toMatch !== 0) && (iter.get('orderType') === 0 || iter.get('orderType') === 2) && !iter.get('isPaid') && !iter.get('isQuotation') && iter.get('gross') >= 0) {
actualDate = new Date().setHours(0, 0, 0, 0);
- if (me.filters.endDate === "" || new Date(me.filters.endDate) >= actualDate) {
+ if (me.filters.endDate === '' || new Date(me.filters.endDate) >= actualDate) {
for (i = 0; i < me.filters.documentType.length; i++) {
if (me.filters.documentType[i] === iter.get('documentType')) {
if (!_.isNull(iter.id) && !_.isUndefined(iter.id)) {
if (me.cleanFilter) {
- iter.unset("checked");
+ iter.unset('checked');
}
me.multiOrdersList.add(iter);
break;
@@ -402,10 +402,26 @@
this.$.body.$.listMultiOrders.$.multiorderslistitemprinter.$.theader.$.modalMultiOrdersHeader.clearAction();
},
executeOnShow: function () {
- var i, j;
+ var me = this,
+ i, j;
this.$.header.$.modalMultiOrdersTopHeader.$.title.setContent(OB.I18N.getLabel('OBPOS_LblMultiOrders'));
this.$.body.$.listMultiOrders.cleanFilter = true;
this.$.header.$.modalMultiOrdersTopHeader.disableDoneButton(true);
+
+ if (OB.MobileApp.model.hasPermission('OBPOS_SelectCurrentTicketsOnPaidOpen', true)) {
+ _.each(me.model.get('orderList').models, function (iter) {
+ if (iter.get('lines') && iter.get('lines').length > 0) {
+ if ((iter.get('orderType') === 0 || iter.get('orderType') === 2) && !iter.get('isPaid') && !iter.get('isQuotation') && iter.get('gross') >= 0) {
+ if (!_.isNull(iter.id) && !_.isUndefined(iter.id)) {
+ iter.set('checked', true);
+ me.$.body.$.listMultiOrders.multiOrdersList.add(iter);
+ }
+ }
+ }
+ });
+ me.$.header.$.modalMultiOrdersTopHeader.disableDoneButton(false);
+ me.$.body.$.listMultiOrders.cleanFilter = false;
+ }
},
i18nHeader: '',
body: {
tests.diff [^] (4,435 bytes) 2016-04-26 16:33 [Show Content] [Hide Content]diff --git a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/sales/SelectAllLoadedReceiptsOnPayOpenTickets.java b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/sales/SelectAllLoadedReceiptsOnPayOpenTickets.java
new file mode 100644
--- /dev/null
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/sales/SelectAllLoadedReceiptsOnPayOpenTickets.java
@@ -0,0 +1,87 @@
+/*
+ *************************************************************************
+ * 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) 2016 Openbravo S.L.U.
+ * All Rights Reserved.
+ * Contributor(s):
+ ************************************************************************
+ *
+ * @author GIG
+ *
+ */
+
+package org.openbravo.test.mobile.retail.pack.selenium.tests.sales;
+
+import org.junit.Test;
+import org.openbravo.test.mobile.common.TestClassAnnotations;
+import org.openbravo.test.mobile.common.selenium.database.DatabaseHelperInsertUpdateOrDelete;
+import org.openbravo.test.mobile.common.selenium.javascript.TestId;
+import org.openbravo.test.mobile.common.selenium.terminals.WebPOSTerminalHelper;
+
+@TestClassAnnotations(isHighVolumeCompatible = false)
+public class SelectAllLoadedReceiptsOnPayOpenTickets extends WebPOSTerminalHelper {
+
+ @Test
+ public void test() {
+ try {
+ setPreference();
+ updateTerminalAfterDatabaseChange();
+ tap(TestId.BUTTON_BROWSE);
+ tap(TestId.BUTTON_PRODUCT_BESTSELLERS_AVALANCHETRANSCEIVER);
+ tap(TestId.BUTTON_NEWRECEIPT);
+ tap(TestId.BUTTON_BROWSE);
+ tap(TestId.BUTTON_PRODUCT_BESTSELLERS_AVALANCHETRANSCEIVER);
+ tap(TestId.BUTTON_NEWRECEIPT);
+ tap(TestId.BUTTON_MENU);
+ tap(TestId.BUTTON_MENU_LAYAWAYTHISRECEIPT);
+ tap(TestId.BUTTON_PRODUCT_BESTSELLERS_AVALANCHETRANSCEIVER);
+ tap(TestId.BUTTON_MENU);
+ tap(TestId.BUTTON_MENU_CREATEQUOTATION);
+ tap(TestId.BUTTON_PRODUCT_BESTSELLERS_AVALANCHETRANSCEIVER);
+ tap(TestId.BUTTON_MENU);
+ tap(TestId.BUTTON_MENU_PAYOPENTICKETS);
+ tap(TestId.BUTTON_POPUP_OPENTICKETS_DONE);
+ verify(TestId.LABEL_RECEIPT_MULTIORDER_TOTALQTY, "3");
+ verify(TestId.LABEL_RECEIPT_MULTIORDER_TOTALGROSS, "451.50");
+ tap(TestId.BUTTON_PAY_EXACT);
+ tap(TestId.BUTTON_PAY_DONE);
+ verify(TestId.LABEL_TOTALTOPAY, "0.00");
+ tap(TestId.BUTTON_DELETERECEIPT);
+ tap(TestId.BUTTON_DELETERECEIPT_CONFIRM);
+ verify(TestId.LABEL_TOTALTOPAY, "150.50");
+ tap(TestId.BUTTON_DELETERECEIPT);
+ tap(TestId.BUTTON_DELETERECEIPT_CONFIRM);
+ verify(TestId.LABEL_TOTALTOPAY, "0.00");
+ } finally {
+ resetPreference();
+ updateTerminalAfterDatabaseChange();
+ }
+ }
+
+ private void setPreference() {
+ // Verifying OBPOS_SelectCurrentTicketsOnPaidOpen have been set to Y for VallBlanca User
+ new DatabaseHelperInsertUpdateOrDelete(
+ "Insert Preference OBPOS_SelectCurrentTicketsOnPaidOpen for VallBlanca User")
+ .execute(
+ "INSERT INTO ad_preference(ad_preference_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, ad_user_id, value, property, ispropertylist, selected) "
+ + "VALUES ('0A179A12A3DE4023BF20A0881FE7DDDA', '39363B0921BB4293B48383844325E84C', '0', 'Y', now(), '100', now(), '100', '3073EDF96A3C42CC86C7069E379522D2', 'Y', 'OBPOS_SelectCurrentTicketsOnPaidOpen', 'Y', 'Y')",
+ 1);
+ }
+
+ private void resetPreference() {
+ new DatabaseHelperInsertUpdateOrDelete(
+ "Remove existing OBPOS_SelectCurrentTicketsOnPaidOpen for VallBlanca User").execute(
+ "DELETE from AD_Preference WHERE ad_preference_id = '0A179A12A3DE4023BF20A0881FE7DDDA'", 1);
+ }
+
+}
|