Project: 	
  | View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||||||
| ID | ||||||||||||
| 0047486 | ||||||||||||
| Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||||||
| feature request | [Retail Modules] Web POS | major | have not tried | 2021-08-02 14:55 | 2021-08-02 16:24 | |||||||
| Reporter | sebastien_liron | View Status | public | |||||||||
| Assigned To | Retail | |||||||||||
| Priority | urgent | Resolution | open | Fixed in Version | ||||||||
| Status | new | Fix in branch | Fixed in SCM revision | |||||||||
| Projection | none | ETA | none | Target Version | pi | |||||||
| OS | Any | Database | Any | Java version | ||||||||
| OS Version | Database version | Ant version | ||||||||||
| Product Version | pi | SCM revision | ||||||||||
| Merge Request Status | ||||||||||||
| Review Assigned To | ||||||||||||
| OBNetwork customer | OBPS | |||||||||||
| Support ticket | ||||||||||||
| Regression level | ||||||||||||
| Regression date | ||||||||||||
| Regression introduced in release | ||||||||||||
| Regression introduced by commit | ||||||||||||
| Triggers an Emergency Pack | No | |||||||||||
| Summary | 0047486: Add hook/preference in mobile.core to extend Quick Cashup | |||||||||||
| Description | he functionality in development for Automatic Cashup requires a change to the Quick Cashup by adding : - a hook for update cahsup - a New preferences : Popup “Do you want to Close Store?”: don’t display the popup to avoid an extra click with default value “OK”. Make this new behavior configurable by Preference “Disable Close store Cash Up popup” with default value = N. A patch is provided for reference.  | |||||||||||
| Steps To Reproduce |  Feature request - use of the module org.openbravo.retail.quickcashup ( in OBFR ) - end session in the POS -> a quick cahsup shoud occur  | |||||||||||
| Proposed Solution | Use the patches provided ( be careful, these patches are 20q3 version ) | |||||||||||
| Tags | NOR | |||||||||||
| Attached Files | diff --git a/src/org/openbravo/retail/posterminal/UpdateCashup.java b/src/org/openbravo/retail/posterminal/UpdateCashup.java
index c3e316451d2b1871825279e0af0181251f6ded07..b5d582b12d4f8a3db167e13c728a618cc9865977 100644
--- a/src/org/openbravo/retail/posterminal/UpdateCashup.java
+++ b/src/org/openbravo/retail/posterminal/UpdateCashup.java
@@ -13,6 +13,10 @@ import java.sql.SQLException;
 import java.util.Date;
 import java.util.List;
 
+import javax.enterprise.inject.Any;
+import javax.enterprise.inject.Instance;
+import javax.inject.Inject;
+
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.codehaus.jettison.json.JSONArray;
@@ -24,6 +28,7 @@ import org.hibernate.criterion.Restrictions;
 import org.hibernate.query.Query;
 import org.openbravo.base.exception.OBException;
 import org.openbravo.base.provider.OBProvider;
+import org.openbravo.base.weld.WeldUtils;
 import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.dal.service.OBQuery;
@@ -37,6 +42,10 @@ public class UpdateCashup {
 
   private static final Logger log = LogManager.getLogger();
 
+  @Inject
+  @Any
+  private Instance<UpdateCashupHook> updates;
+
   /**
    * Get and update a cashup. If cashup not exist it's created, otherwise update the cashup data
    * into database.
@@ -149,6 +158,13 @@ public class UpdateCashup {
         || (posTerminal.getMasterterminal() != null && cashUp.getObposParentCashup() == null)) {
       associateMasterSlave(cashUp, posTerminal);
     }
+
+    try {
+      executeUpdateCashupHook(cashUp, jsonCashup);
+    } catch (Exception e) {
+      throw new OBException(e);
+    }
+
     // If synchronize mode is active, there is no way to process two cashups with the same id at
     // the same time.
     OBDal.getInstance().flush();
@@ -482,4 +498,11 @@ public class UpdateCashup {
     }
 
   }
+
+  private static void executeUpdateCashupHook(OBPOSAppCashup cashUp, JSONObject jsonCashup)
+      throws Exception {
+    for (UpdateCashupHook hook : WeldUtils.getInstances(UpdateCashupHook.class)) {
+      hook.exec(cashUp, jsonCashup);
+    }
+  }
 }
diff --git a/src/org/openbravo/retail/posterminal/UpdateCashupHook.java b/src/org/openbravo/retail/posterminal/UpdateCashupHook.java
new file mode 100644
index 0000000000000000000000000000000000000000..12025941affd5c68750ab457a843063405c1a995
--- /dev/null
+++ b/src/org/openbravo/retail/posterminal/UpdateCashupHook.java
@@ -0,0 +1,16 @@
+/*
+ ************************************************************************************
+ * Copyright (C) 2020 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.
+ ************************************************************************************
+ */
+package org.openbravo.retail.posterminal;
+
+import org.codehaus.jettison.json.JSONObject;
+
+public interface UpdateCashupHook {
+
+  public void exec(OBPOSAppCashup cashUp, JSONObject jsonCashup) throws Exception;
+}
diff --git a/src/org/openbravo/retail/posterminal/ad_reports/CashUpReport.jrxml b/src/org/openbravo/retail/posterminal/ad_reports/CashUpReport.jrxml
index 28142bdcb86b9f2afb88e5c2e78669d428ccf0c0..7571ff4826061ec49246feb5d4b06ea48b9c5b69 100644
--- a/src/org/openbravo/retail/posterminal/ad_reports/CashUpReport.jrxml
+++ b/src/org/openbravo/retail/posterminal/ad_reports/CashUpReport.jrxml
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Created with Jaspersoft Studio version 6.5.0.final using JasperReports Library version 6.5.0  -->
+<!-- Created with Jaspersoft Studio version 6.3.1.final using JasperReports Library version 6.0.0  -->
+<!-- 2020-10-08T22:51:13 -->
 <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="CashUpReport" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="d48670b9-e50a-4c6e-a8ce-076369e29634">
 	<property name="ireport.zoom" value="1.0"/>
 	<property name="ireport.x" value="0"/>
@@ -30,6 +31,9 @@
 	<parameter name="NUMBERFORMAT" class="java.text.DecimalFormat" isForPrompting="false">
 		<defaultValueExpression><![CDATA[new DecimalFormat("###,##0.00", new DecimalFormatSymbols())]]></defaultValueExpression>
 	</parameter>
+	<parameter name="OBQCU_IS_QUICK_CASHUP" class="java.lang.String">
+		<defaultValueExpression><![CDATA[""]]></defaultValueExpression>
+	</parameter>
 	<field name="LABEL" class="java.lang.String"/>
 	<field name="VALUE" class="java.lang.String"/>
 	<field name="GROUPFIELD" class="java.lang.String"/>
@@ -98,13 +102,14 @@
 		<band splitType="Stretch"/>
 	</background>
 	<title>
-		<band height="369" splitType="Stretch">
+		<band height="380" splitType="Stretch">
+			<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
 			<image>
 				<reportElement x="210" y="14" width="100" height="50" uuid="904c52ff-6c99-493e-b9c3-cc0c5f95c751"/>
 				<imageExpression><![CDATA[org.openbravo.erpCommon.utility.Utility.showImageLogo("yourcompanydoc", $P{TERMINAL_ORGANIZATION})]]></imageExpression>
 			</image>
 			<textField>
-				<reportElement positionType="Float" x="30" y="169" width="367" height="20" uuid="67a89959-d787-4cf0-8ceb-767e3027a966"/>
+				<reportElement positionType="Float" x="30" y="191" width="367" height="20" uuid="67a89959-d787-4cf0-8ceb-767e3027a966"/>
 				<box leftPadding="5" rightPadding="5">
 					<pen lineWidth="1.0" lineColor="#867D7D"/>
 					<topPen lineWidth="1.0" lineColor="#867D7D"/>
@@ -116,7 +121,7 @@
 				<textFieldExpression><![CDATA[$P{NET_SALES_LABEL}]]></textFieldExpression>
 			</textField>
 			<textField>
-				<reportElement positionType="Float" x="397" y="169" width="111" height="20" uuid="0fa96316-07c7-4d2d-9519-78dc36d40835"/>
+				<reportElement positionType="Float" x="397" y="191" width="111" height="20" uuid="0fa96316-07c7-4d2d-9519-78dc36d40835"/>
 				<box leftPadding="5" rightPadding="5">
 					<pen lineWidth="1.0" lineColor="#867D7D"/>
 					<topPen lineColor="#867D7D"/>
@@ -128,7 +133,7 @@
 				<textFieldExpression><![CDATA[$P{NUMBERFORMAT}.format(new BigDecimal($P{NET_SALES_VALUE}))]]></textFieldExpression>
 			</textField>
 			<textField>
-				<reportElement positionType="Float" x="397" y="209" width="111" height="20" uuid="02a7507b-b2cf-4272-aff8-9f6c130b020a"/>
+				<reportElement positionType="Float" x="397" y="231" width="111" height="20" uuid="02a7507b-b2cf-4272-aff8-9f6c130b020a"/>
 				<box leftPadding="5" rightPadding="5">
 					<pen lineWidth="1.0" lineColor="#867D7D"/>
 					<topPen lineColor="#867D7D"/>
@@ -142,7 +147,7 @@
 				<textFieldExpression><![CDATA[$P{NUMBERFORMAT}.format(new BigDecimal($P{GROSS_SALES_VALUE}))]]></textFieldExpression>
 			</textField>
 			<textField>
-				<reportElement positionType="Float" x="30" y="209" width="367" height="20" uuid="9caa2f75-c4d3-439f-8540-c701a3899892"/>
+				<reportElement positionType="Float" x="30" y="231" width="367" height="20" uuid="9caa2f75-c4d3-439f-8540-c701a3899892"/>
 				<box leftPadding="5" rightPadding="5">
 					<pen lineWidth="1.0" lineColor="#867D7D"/>
 					<topPen lineWidth="1.0" lineColor="#867D7D"/>
@@ -156,7 +161,7 @@
 				<textFieldExpression><![CDATA[$P{GROSS_SALES_LABEL}]]></textFieldExpression>
 			</textField>
 			<subreport>
-				<reportElement positionType="Float" x="0" y="263" width="555" height="20" isRemoveLineWhenBlank="true" uuid="47425024-9914-4b21-90f5-251dcef7f034"/>
+				<reportElement positionType="Float" x="0" y="285" width="555" height="20" isRemoveLineWhenBlank="true" uuid="47425024-9914-4b21-90f5-251dcef7f034"/>
 				<subreportParameter name="NUMBERFORMAT">
 					<subreportParameterExpression><![CDATA[$P{NUMBERFORMAT}]]></subreportParameterExpression>
 				</subreportParameter>
@@ -164,7 +169,7 @@
 				<subreportExpression><![CDATA[$P{SUBREP_CashUpSubreport}]]></subreportExpression>
 			</subreport>
 			<subreport runToBottom="false">
-				<reportElement positionType="Float" mode="Transparent" x="0" y="189" width="555" height="20" isRemoveLineWhenBlank="true" uuid="6a30967c-fb74-419d-b0d1-7d46176e6c7e"/>
+				<reportElement positionType="Float" mode="Transparent" x="0" y="211" width="555" height="20" isRemoveLineWhenBlank="true" uuid="6a30967c-fb74-419d-b0d1-7d46176e6c7e"/>
 				<subreportParameter name="NUMBERFORMAT">
 					<subreportParameterExpression><![CDATA[$P{NUMBERFORMAT}]]></subreportParameterExpression>
 				</subreportParameter>
@@ -172,7 +177,7 @@
 				<subreportExpression><![CDATA[$P{SUBREP_CashUpSubreport}]]></subreportExpression>
 			</subreport>
 			<textField>
-				<reportElement positionType="Float" x="397" y="243" width="111" height="20" uuid="e63eda87-ff45-4c29-8018-0d0b56d58641"/>
+				<reportElement positionType="Float" x="397" y="265" width="111" height="20" uuid="e63eda87-ff45-4c29-8018-0d0b56d58641"/>
 				<box leftPadding="5" rightPadding="5">
 					<pen lineWidth="1.0" lineColor="#867D7D"/>
 					<topPen lineColor="#867D7D"/>
@@ -184,7 +189,7 @@
 				<textFieldExpression><![CDATA[$P{NUMBERFORMAT}.format(new BigDecimal($P{NET_RETURNS_VALUE}))]]></textFieldExpression>
 			</textField>
 			<textField>
-				<reportElement positionType="Float" x="30" y="243" width="367" height="20" uuid="d6ee0c26-8957-44f6-8b67-0ec824dae47a"/>
+				<reportElement positionType="Float" x="30" y="265" width="367" height="20" uuid="d6ee0c26-8957-44f6-8b67-0ec824dae47a"/>
 				<box leftPadding="5" rightPadding="5">
 					<pen lineWidth="1.0" lineColor="#867D7D"/>
 					<topPen lineWidth="1.0" lineColor="#867D7D"/>
@@ -196,7 +201,7 @@
 				<textFieldExpression><![CDATA[$P{NET_RETURNS_LABEL}]]></textFieldExpression>
 			</textField>
 			<textField>
-				<reportElement positionType="Float" x="30" y="283" width="367" height="20" uuid="962ee5ea-43be-4133-92de-5bcba5b01d76"/>
+				<reportElement positionType="Float" x="30" y="305" width="367" height="20" uuid="962ee5ea-43be-4133-92de-5bcba5b01d76"/>
 				<box leftPadding="5" rightPadding="5">
 					<pen lineWidth="1.0" lineColor="#867D7D"/>
 					<topPen lineWidth="1.0" lineColor="#867D7D"/>
@@ -210,7 +215,7 @@
 				<textFieldExpression><![CDATA[$P{GROSS_RETURNS_LABEL}]]></textFieldExpression>
 			</textField>
 			<textField>
-				<reportElement positionType="Float" x="397" y="283" width="111" height="20" uuid="f7f95008-5a50-468a-9dea-273f1404d093"/>
+				<reportElement positionType="Float" x="397" y="305" width="111" height="20" uuid="f7f95008-5a50-468a-9dea-273f1404d093"/>
 				<box leftPadding="5" rightPadding="5">
 					<pen lineWidth="1.0" lineColor="#867D7D"/>
 					<topPen lineColor="#867D7D"/>
@@ -224,7 +229,7 @@
 				<textFieldExpression><![CDATA[$P{NUMBERFORMAT}.format(new BigDecimal($P{GROSS_RETURNS_VALUE}))]]></textFieldExpression>
 			</textField>
 			<textField>
-				<reportElement positionType="Float" x="30" y="320" width="367" height="20" uuid="8d035685-698d-4988-8e25-5a25fcde9d6b"/>
+				<reportElement positionType="Float" x="30" y="342" width="367" height="20" uuid="8d035685-698d-4988-8e25-5a25fcde9d6b"/>
 				<box leftPadding="5" rightPadding="5">
 					<pen lineWidth="1.0" lineColor="#867D7D"/>
 					<topPen lineWidth="1.0" lineColor="#867D7D"/>
@@ -236,7 +241,7 @@
 				<textFieldExpression><![CDATA[$P{TOTAL_RETAIL_TRANS_LABEL}]]></textFieldExpression>
 			</textField>
 			<textField>
-				<reportElement positionType="Float" x="397" y="320" width="111" height="20" uuid="3e60d075-10e2-4b0d-bcdf-6fdf2ebbeba4"/>
+				<reportElement positionType="Float" x="397" y="342" width="111" height="20" uuid="3e60d075-10e2-4b0d-bcdf-6fdf2ebbeba4"/>
 				<box leftPadding="5" rightPadding="5">
 					<pen lineWidth="1.0" lineColor="#867D7D"/>
 					<topPen lineColor="#867D7D"/>
@@ -267,6 +272,13 @@
 				<textElement textAlignment="Center"/>
 				<textFieldExpression><![CDATA[$P{TIME}]]></textFieldExpression>
 			</textField>
+			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
+				<reportElement x="80" y="160" width="400" height="20" uuid="86b526d7-2d7b-489e-ac60-5f70cc4251f4">
+					<printWhenExpression><![CDATA[$P{OBQCU_IS_QUICK_CASHUP}.length() > 0]]></printWhenExpression>
+				</reportElement>
+				<textElement textAlignment="Center"/>
+				<textFieldExpression><![CDATA[$P{OBQCU_IS_QUICK_CASHUP}]]></textFieldExpression>
+			</textField>
 		</band>
 	</title>
 	<detail>
diff --git a/src-db/database/sourcedata/AD_PREFERENCE.xml b/src-db/database/sourcedata/AD_PREFERENCE.xml
index 58e3c1fa14f4bb5e118f2f5696024656f7319100..72fba857e9f4f425742c1be3c663b05ff2681c38 100644
--- a/src-db/database/sourcedata/AD_PREFERENCE.xml
+++ b/src-db/database/sourcedata/AD_PREFERENCE.xml
@@ -759,6 +759,17 @@
 <!--551621C5C1774DBB96DF89E52C8D385A-->  <AD_MODULE_ID><![CDATA[FF808181326CC34901326D53DBCF0018]]></AD_MODULE_ID>
 <!--551621C5C1774DBB96DF89E52C8D385A--></AD_PREFERENCE>
 
+<!--556E57D3021441D4B4210806F1F9958E--><AD_PREFERENCE>
+<!--556E57D3021441D4B4210806F1F9958E-->  <AD_PREFERENCE_ID><![CDATA[556E57D3021441D4B4210806F1F9958E]]></AD_PREFERENCE_ID>
+<!--556E57D3021441D4B4210806F1F9958E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--556E57D3021441D4B4210806F1F9958E-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--556E57D3021441D4B4210806F1F9958E-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--556E57D3021441D4B4210806F1F9958E-->  <VALUE><![CDATA[N]]></VALUE>
+<!--556E57D3021441D4B4210806F1F9958E-->  <PROPERTY><![CDATA[OBPOS_DisableCashupSuccessPopup]]></PROPERTY>
+<!--556E57D3021441D4B4210806F1F9958E-->  <ISPROPERTYLIST><![CDATA[Y]]></ISPROPERTYLIST>
+<!--556E57D3021441D4B4210806F1F9958E-->  <AD_MODULE_ID><![CDATA[FF808181326CC34901326D53DBCF0018]]></AD_MODULE_ID>
+<!--556E57D3021441D4B4210806F1F9958E--></AD_PREFERENCE>
+
 <!--55D0246248BB4C178BACB36A743AE884--><AD_PREFERENCE>
 <!--55D0246248BB4C178BACB36A743AE884-->  <AD_PREFERENCE_ID><![CDATA[55D0246248BB4C178BACB36A743AE884]]></AD_PREFERENCE_ID>
 <!--55D0246248BB4C178BACB36A743AE884-->  <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
index 2190e7342e88889cc57363fc7f884c97f358df4c..c9451b5c99ac5c66876f2b1bf5d028ccbb386d28 100644
--- a/src-db/database/sourcedata/AD_REF_LIST.xml
+++ b/src-db/database/sourcedata/AD_REF_LIST.xml
@@ -1240,6 +1240,18 @@
 <!--5548479CBE0A4A168868AA7A7ABC7C92-->  <AD_MODULE_ID><![CDATA[FF808181326CC34901326D53DBCF0018]]></AD_MODULE_ID>
 <!--5548479CBE0A4A168868AA7A7ABC7C92--></AD_REF_LIST>
 
+<!--55AB7F82AA8E4A4399D1910A972433A6--><AD_REF_LIST>
+<!--55AB7F82AA8E4A4399D1910A972433A6-->  <AD_REF_LIST_ID><![CDATA[55AB7F82AA8E4A4399D1910A972433A6]]></AD_REF_LIST_ID>
+<!--55AB7F82AA8E4A4399D1910A972433A6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--55AB7F82AA8E4A4399D1910A972433A6-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--55AB7F82AA8E4A4399D1910A972433A6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--55AB7F82AA8E4A4399D1910A972433A6-->  <VALUE><![CDATA[OBPOS_DisableCashupSuccessPopup]]></VALUE>
+<!--55AB7F82AA8E4A4399D1910A972433A6-->  <NAME><![CDATA[Disable Cash Up success popup]]></NAME>
+<!--55AB7F82AA8E4A4399D1910A972433A6-->  <DESCRIPTION><![CDATA[Disable Cash Up success popup. This popup is shown by default.]]></DESCRIPTION>
+<!--55AB7F82AA8E4A4399D1910A972433A6-->  <AD_REFERENCE_ID><![CDATA[A26BA480E2014707B47257024C3CBFF7]]></AD_REFERENCE_ID>
+<!--55AB7F82AA8E4A4399D1910A972433A6-->  <AD_MODULE_ID><![CDATA[FF808181326CC34901326D53DBCF0018]]></AD_MODULE_ID>
+<!--55AB7F82AA8E4A4399D1910A972433A6--></AD_REF_LIST>
+
 <!--55D40DCFE3FE49C39AAB6E0607094A6C--><AD_REF_LIST>
 <!--55D40DCFE3FE49C39AAB6E0607094A6C-->  <AD_REF_LIST_ID><![CDATA[55D40DCFE3FE49C39AAB6E0607094A6C]]></AD_REF_LIST_ID>
 <!--55D40DCFE3FE49C39AAB6E0607094A6C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff --git a/web/org.openbravo.retail.posterminal/js/closecash/view/closecash.js b/web/org.openbravo.retail.posterminal/js/closecash/view/closecash.js
index 55ce1e90a5c2f08812c78d1b26e12a6dcd4d03ae..81f1c17e0df12e1aa28446f49716e8d5146d42f0 100644
--- a/web/org.openbravo.retail.posterminal/js/closecash/view/closecash.js
+++ b/web/org.openbravo.retail.posterminal/js/closecash/view/closecash.js
@@ -449,27 +449,37 @@ enyo.kind({
             'openedPopup'
           ) !== OB.I18N.getLabel('OBPOS_MsgPrintAgainCashUp')
         ) {
-          // Only display the good job message if there are no components displayed
-          OB.UTIL.showConfirmation.display(
-            OB.I18N.getLabel('OBPOS_LblGoodjob'),
-            content,
-            [
+          // Only display the good job message if preference allow it and there are no components displayed.
+          var tapOkButton = () => {
+            this.finalAction();
+            return true;
+          };
+          if (
+            OB.MobileApp.model.hasPermission(
+              'OBPOS_DisableCashupSuccessPopup',
+              true
+            )
+          ) {
+            tapOkButton();
+          } else {
+            OB.UTIL.showConfirmation.display(
+              OB.I18N.getLabel('OBPOS_LblGoodjob'),
+              content,
+              [
+                {
+                  label: OB.I18N.getLabel('OBMOBC_LblOk'),
+                  isConfirmButton: true,
+                  action: tapOkButton
+                }
+              ],
               {
-                label: OB.I18N.getLabel('OBMOBC_LblOk'),
-                isConfirmButton: true,
-                action: () => {
+                autoDismiss: false,
+                onHideFunction: () => {
                   this.finalAction();
-                  return true;
                 }
               }
-            ],
-            {
-              autoDismiss: false,
-              onHideFunction: () => {
-                this.finalAction();
-              }
-            }
-          );
+            );
+          }
         }
       });
     });
diff --git a/web/org.openbravo.retail.posterminal/js/closecash/view/closecash.js b/web/org.openbravo.retail.posterminal/js/closecash/view/closecash.js
index 81f1c17e0df12e1aa28446f49716e8d5146d42f0..b75651e088389286cc81cf3555aebc981b35ad13 100644
--- a/web/org.openbravo.retail.posterminal/js/closecash/view/closecash.js
+++ b/web/org.openbravo.retail.posterminal/js/closecash/view/closecash.js
@@ -601,10 +601,28 @@ enyo.kind({
       OB.I18N.getLabel(nextButtonI18NLabel)
     );
   },
+  doCashKeepStep: function() {
+    return this.model.get('paymentList').find(payment => {
+      return payment.get('counted') && payment.get('counted') !== 0;
+    });
+  },
   changeStep: function(inSender, inEvent) {
     const direction = inEvent.originator.stepCount;
-
     if (direction > 0) {
+      // Skip cash to keep step if counted is zero
+      const currentstep = this.model.get('step') - 1;
+      if (currentstep === this.model.stepIndex('OB.CloseCash.PaymentMethods')) {
+        if (!this.doCashKeepStep()) {
+          this.model.stepsDefinition[
+            this.model.stepIndex('OB.CloseCash.CashToKeep')
+          ].active = false;
+        } else {
+          this.model.stepsDefinition[
+            this.model.stepIndex('OB.CloseCash.CashToKeep')
+          ].active = true;
+        }
+      }
+
       // Check with the step if can go next.
       this.model.verifyStep(
         this.$.closeCashMultiColumn.$.leftPanel.$.closeCashLeftPanel.$,
 | |||||||||||
		  Relationships		[ Relation Graph ] 
		[ Dependency Graph ] 
			 | 
|
  Issue History	 | 
|||
| Date Modified | Username | Field | Change | 
| 2021-08-02 14:55 | sebastien_liron | New Issue | |
| 2021-08-02 14:55 | sebastien_liron | Assigned To | => Retail | 
| 2021-08-02 14:55 | sebastien_liron | File Added: ad5caf76f47b370cd93747cd218d40d184a9b77c.diff | |
| 2021-08-02 14:55 | sebastien_liron | OBNetwork customer | => OBPS | 
| 2021-08-02 14:55 | sebastien_liron | Resolution time | => 1629410400 | 
| 2021-08-02 14:55 | sebastien_liron | Triggers an Emergency Pack | => No | 
| 2021-08-02 14:56 | sebastien_liron | File Added: 89d9093833ce377eef4161da4e133921763eabfa.diff | |
| 2021-08-02 14:56 | sebastien_liron | File Added: 654e9d1f5c69fb942fb0dd304be5086db3f24c93.diff | |
| 2021-08-02 15:01 | sebastien_liron | Description Updated | View Revisions | 
| 2021-08-02 16:24 | rafaroda | Tag Attached: NOR | |
| Copyright © 2000 - 2009 MantisBT Group | 

