diff --git a/src-test/org/openbravo/test/mobile/common/junit/toolbox/OBWildcardPatternSuite.java b/src-test/org/openbravo/test/mobile/common/junit/toolbox/OBWildcardPatternSuite.java
--- a/src-test/org/openbravo/test/mobile/common/junit/toolbox/OBWildcardPatternSuite.java
+++ b/src-test/org/openbravo/test/mobile/common/junit/toolbox/OBWildcardPatternSuite.java
@@ -24,6 +24,7 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.lang.reflect.Modifier;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -97,6 +98,12 @@
         final Class<?> loadedClass = classLoader.loadClass(className);
         boolean isTestToBeExecuted = true;
 
+        // ignore abstract classes, these are sometimes included here if located in
+        // a test package
+        if (Modifier.isAbstract(loadedClass.getModifiers())) {
+          continue;
+        }
+
         // if we are in high volume mode, add only compatible tests
         if (SequentialTestInfo.getHighVolumenMode()) {
           final TestClassAnnotations testClassAnnotations = loadedClass
diff --git a/src-test/org/openbravo/test/mobile/common/selenium/terminals/WebPOSTerminalHelper.java b/src-test/org/openbravo/test/mobile/common/selenium/terminals/WebPOSTerminalHelper.java
--- a/src-test/org/openbravo/test/mobile/common/selenium/terminals/WebPOSTerminalHelper.java
+++ b/src-test/org/openbravo/test/mobile/common/selenium/terminals/WebPOSTerminalHelper.java
@@ -173,7 +173,7 @@
     }
   }
 
-  private void verifyOrderIsReset() {
+  protected void verifyOrderIsReset() {
     final Boolean isOrderList = (Boolean) SeleniumHelper
         .executeScriptWithReturn("OB.MobileApp.model.orderList !== undefined");
     if (isOrderList) {
@@ -200,7 +200,7 @@
   }
 
   private void verifyIsScanTab() {
-    final String currentTab= PosterminalAPI.getLastTabShown();
+    final String currentTab = PosterminalAPI.getLastTabShown();
     assertThat("The test is finished but the selected tab is not the 'scan' tab", currentTab,
         equalTo("scan"));
   }
diff --git a/src-test/org/openbravo/test/mobile/common/selenium/utils/AllowedErrorsHelper.java b/src-test/org/openbravo/test/mobile/common/selenium/utils/AllowedErrorsHelper.java
--- a/src-test/org/openbravo/test/mobile/common/selenium/utils/AllowedErrorsHelper.java
+++ b/src-test/org/openbravo/test/mobile/common/selenium/utils/AllowedErrorsHelper.java
@@ -27,6 +27,7 @@
 
 import org.openbravo.test.mobile.common.selenium.testhelpers.SequentialTestInfo;
 import org.openbravo.test.mobile.common.selenium.testhelpers.TestLogger;
+import org.openbravo.test.mobile.retail.pack.selenium.tests.system.synchronizedtransactions.TestSynchronizedSaleWithError;
 
 public class AllowedErrorsHelper {
   private static ArrayList<String> testsAllowedToHaveTomcatErrors;
@@ -60,6 +61,7 @@
     testsAllowedToHaveTomcatErrors.add("TerminalChangeNotAllowedAfterLogout");
     testsAllowedToHaveTomcatErrors.add("SecureTerminalConfChange");
     testsAllowedToHaveTomcatErrors.add("I31062_CheckValidationForNonLayawayAllowedUsers");
+    testsAllowedToHaveTomcatErrors.add(TestSynchronizedSaleWithError.class.getSimpleName());
 
     // To handle this case:
     // WARN org.openbravo.dal.core.OBContext - The user 3073EDF96A3C42CC86C7069E379522D2 does not
@@ -67,6 +69,12 @@
     testsAllowedToHaveTomcatErrors.add("I30997_NewCustomerForReceipt");
     testsAllowedToHaveTomcatErrors.add("I31195_MultipleAddressesSearch");
     testsAllowedToHaveTomcatErrors.add("I31196_ReassignNewCustomer");
+    testsAllowedToHaveTomcatErrors.add("TestSynchronizedTransaction.testSale");
+    testsAllowedToHaveTomcatErrors.add("TestSynchronizedTransaction.testCashup");
+    testsAllowedToHaveTomcatErrors.add("TestSynchronizedTransaction.testCashManagement");
+    testsAllowedToHaveTomcatErrors.add("TestSynchronizedTransaction.testCustomerCreationComplex");
+    testsAllowedToHaveTomcatErrors.add("TestSynchronizedTransaction.testCustomerCreationSimple");
+
     return testsAllowedToHaveTomcatErrors;
   }
 
@@ -117,6 +125,7 @@
     testsAllowedToHaveJavascriptErrors.add("I32306_VerifyOrderLineNegateQtyWithPreference");
     testsAllowedToHaveJavascriptErrors.add("I32360_VerifyFamilyProductInAssortment");
     testsAllowedToHaveJavascriptErrors.add("I31158_VerifyLayawayWithReturn");
+    testsAllowedToHaveJavascriptErrors.add(TestSynchronizedSaleWithError.class.getSimpleName());
 
     // illegal allowed errors. these errors have to be fixed:
     testsAllowedToHaveJavascriptErrors.add("TerminalChangeAllowed");
@@ -124,6 +133,7 @@
     testsAllowedToHaveJavascriptErrors.add("TerminalChangeAllowedAfterCashup");
     testsAllowedToHaveJavascriptErrors.add("I31715_CheckPopupError");
     testsAllowedToHaveJavascriptErrors.add("I32016_FailToSaveManifest");
+
     return testsAllowedToHaveJavascriptErrors;
   }
 
@@ -180,11 +190,13 @@
     testsAllowedToHaveLogclientErrors.add("I32360_VerifyFamilyProductInAssortment");
     testsAllowedToHaveLogclientErrors.add("I31158_VerifyLayawayWithReturn");
     testsAllowedToHaveLogclientErrors.add("I32558_VerifiedReturnsChangeQuantityLine");
+    testsAllowedToHaveLogclientErrors.add(TestSynchronizedSaleWithError.class.getSimpleName());
 
     // illegal allowed tests:
     testsAllowedToHaveLogclientErrors.add("I27554_SwitchToERPAndBackToWebPOSDifferentAccount");
     testsAllowedToHaveLogclientErrors.add("SVBSChangePricelistInLayaway");
     testsAllowedToHaveLogclientErrors.add("I31715_CheckPopupError");
+
     return testsAllowedToHaveLogclientErrors;
   }
 
diff --git a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/sales/I31655_CreateSynchronizedSale.java b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/sales/I31655_CreateSynchronizedSale.java
deleted file mode 100644
--- a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/sales/I31655_CreateSynchronizedSale.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- *************************************************************************
- * 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) 2014 Openbravo S.L.U.
- * All Rights Reserved.
- * Contributor(s):  ______________________________________.
- ************************************************************************
- */
-
-package org.openbravo.test.mobile.retail.pack.selenium.tests.sales;
-
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.greaterThan;
-
-import org.junit.Test;
-import org.openbravo.test.mobile.common.TestAnnotations;
-import org.openbravo.test.mobile.common.selenium.SeleniumHelper;
-import org.openbravo.test.mobile.common.selenium.javascript.SynchronizationHelper;
-import org.openbravo.test.mobile.common.selenium.javascript.TestId;
-import org.openbravo.test.mobile.common.selenium.terminals.WebPOSTerminalHelper;
-
-public class I31655_CreateSynchronizedSale extends WebPOSTerminalHelper {
-
-  @Test
-  @TestAnnotations(waitFixOf = 31655)
-  public void test() {
-    final Boolean preference = (Boolean) SeleniumHelper
-        .executeScriptWithReturn("OB.MobileApp.model.get('permissions').OBPOS_SynchronizedRequestOrder;");
-
-    SeleniumHelper
-        .executeScript("OB.MobileApp.model.get('permissions').OBPOS_SynchronizedRequestOrder=true;");
-    final Long beforeTime = (Long) SeleniumHelper
-        .executeScriptWithReturn("OB.UTIL.showLoadingChangeTime");
-    tap(TestId.BUTTON_SEARCH);
-    write(TestId.FIELD_SEARCH_TEXT, TestId.BUTTON_SEARCHPRODUCT_AVALANCHETRANSCEIVER.getRowName());
-    tap(TestId.BUTTON_SEARCH_EXECUTE);
-    verifyHgvolTime(TestId.BUTTON_SEARCH_EXECUTE, 10000);
-    tap(TestId.BUTTON_SEARCHPRODUCT_AVALANCHETRANSCEIVER);
-    verify(TestId.LABEL_TOTALTOPAY, "150.50");
-    tap(TestId.BUTTON_SEARCH);
-    write(TestId.FIELD_SEARCH_TEXT, TestId.BUTTON_SEARCHPRODUCT_INSECTREPELLENT.getRowName());
-    tap(TestId.BUTTON_SEARCH_EXECUTE);
-    verifyHgvolTime(TestId.BUTTON_SEARCH_EXECUTE, 10000);
-    tap(TestId.BUTTON_SEARCHPRODUCT_INSECTREPELLENT);
-    verify(TestId.LABEL_TOTALTOPAY, "165.00");
-    tap(TestId.BUTTON_PAY);
-    tap(TestId.BUTTON_PAY_EXACT);
-    tap(TestId.BUTTON_PAY_DONE);
-    verify(TestId.LABEL_TOTALTOPAY, "0.00");
-    SynchronizationHelper.waitUntiTheApplicationHasSynchronized();
-    final Long afterTime = (Long) SeleniumHelper.executeScriptWithReturn("OB.UTIL.showLoadingChangeTime");
-    assertThat("showLoading wasn't appeared", afterTime, greaterThan(beforeTime));
-
-    SeleniumHelper
-        .executeScript("OB.MobileApp.model.get('permissions').OBPOS_SynchronizedRequestOrder=false;");
-    final Long beforeTime2 = (Long) SeleniumHelper
-        .executeScriptWithReturn("OB.UTIL.showLoadingChangeTime");
-    tap(TestId.BUTTON_SEARCH);
-    write(TestId.FIELD_SEARCH_TEXT, TestId.BUTTON_SEARCHPRODUCT_AVALANCHETRANSCEIVER.getRowName());
-    tap(TestId.BUTTON_SEARCH_EXECUTE);
-    verifyHgvolTime(TestId.BUTTON_SEARCH_EXECUTE, 10000);
-    tap(TestId.BUTTON_SEARCHPRODUCT_AVALANCHETRANSCEIVER);
-    verify(TestId.LABEL_TOTALTOPAY, "150.50");
-    tap(TestId.BUTTON_SEARCH);
-    write(TestId.FIELD_SEARCH_TEXT, TestId.BUTTON_SEARCHPRODUCT_INSECTREPELLENT.getRowName());
-    tap(TestId.BUTTON_SEARCH_EXECUTE);
-    verifyHgvolTime(TestId.BUTTON_SEARCH_EXECUTE, 10000);
-    tap(TestId.BUTTON_SEARCHPRODUCT_INSECTREPELLENT);
-    verify(TestId.LABEL_TOTALTOPAY, "165.00");
-    tap(TestId.BUTTON_PAY);
-    tap(TestId.BUTTON_PAY_EXACT);
-    tap(TestId.BUTTON_PAY_DONE);
-    verify(TestId.LABEL_TOTALTOPAY, "0.00");
-    SynchronizationHelper.waitUntiTheApplicationHasSynchronized();
-    final Long afterTime2 = (Long) SeleniumHelper
-        .executeScriptWithReturn("OB.UTIL.showLoadingChangeTime");
-    assertThat("showLoading wasn't appeared", afterTime2, equalTo(beforeTime2));
-
-    SeleniumHelper
-        .executeScript("OB.MobileApp.model.get('permissions').OBPOS_SynchronizedRequestOrder="
-            + preference + ";");
-  }
-}
diff --git a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/BaseSynchronizedTransactionTest.java b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/BaseSynchronizedTransactionTest.java
new file mode 100644
--- /dev/null
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/BaseSynchronizedTransactionTest.java
@@ -0,0 +1,137 @@
+/*
+ *************************************************************************
+ * 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):  ______________________________________.
+ ************************************************************************
+ */
+
+package org.openbravo.test.mobile.retail.pack.selenium.tests.system.synchronizedtransactions;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.greaterThan;
+
+import org.jboss.netty.handler.timeout.TimeoutException;
+import org.openbravo.test.mobile.common.selenium.SeleniumHelper;
+import org.openbravo.test.mobile.common.selenium.database.DatabaseHelperInsertUpdateOrDelete;
+import org.openbravo.test.mobile.common.selenium.terminals.WebPOSTerminalHelper;
+import org.openbravo.test.mobile.common.selenium.utils.OBUtils;
+import org.openbravo.test.mobile.common.selenium.utils.Wait;
+
+public abstract class BaseSynchronizedTransactionTest extends WebPOSTerminalHelper {
+
+  private static void setPreference() {
+    // delete as the preference can be there from previous run
+    new DatabaseHelperInsertUpdateOrDelete("Insert Preference OBMOBC_SynchronizedMode")
+        .execute(
+            "INSERT INTO ad_preference(ad_preference_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, value, property, ispropertylist, selected) "
+                + "VALUES ('D19D716CA32F486587FB5100F08D493D', '39363B0921BB4293B48383844325E84C', '0', 'Y', now(), '100', now(), '100', 'Y', 'OBMOBC_SynchronizedMode', 'Y', 'N')",
+            1);
+  }
+
+  private static void deletePreference() {
+    new DatabaseHelperInsertUpdateOrDelete("Remove existing OBMOBC_SynchronizedMode").execute(
+        "DELETE from AD_Preference WHERE ad_preference_id = 'D19D716CA32F486587FB5100F08D493D'",
+        DatabaseHelperInsertUpdateOrDelete.UNEXPECTED_AFFECTED_ROWS);
+  }
+
+  private Long beforeTime = 0l;
+  private boolean testFinishedCorrectly = false;
+  private boolean shouldSynchronizedDialogAppear = true;
+
+  @Override
+  public void before() {
+    // default
+    setShouldSynchronizedDialogAppear(true);
+
+    super.before();
+
+    // clear it, if it was there from before
+    deletePreference();
+    setPreference();
+    OBUtils.reload();
+
+    testFinishedCorrectly = false;
+
+    beforeTime = (Long) SeleniumHelper
+        .executeScriptWithReturn("OB.Data.showSynchronizedDialogChangeTime");
+
+    final boolean inSynchronizedMode = (Boolean) SeleniumHelper
+        .executeScriptWithReturn("OB.MobileApp.model.get('permissions').OBMOBC_SynchronizedMode");
+
+    assertThat("Running in synchronize mode", inSynchronizedMode, equalTo(true));
+  }
+
+  @Override
+  public void after() {
+    deletePreference();
+    if (testFinishedCorrectly) {
+      // read before reload
+      final Long afterTime = (Long) SeleniumHelper
+          .executeScriptWithReturn("OB.Data.showSynchronizedDialogChangeTime");
+
+      if (isShouldSynchronizedDialogAppear()) {
+        assertThat("Transaction Dialog hasn't appeared, it should", afterTime,
+            greaterThan(beforeTime));
+      } else {
+        // should not have appeared
+        assertThat("Transaction Dialog has appeared, it shouldn't", afterTime, equalTo(beforeTime));
+      }
+
+      OBUtils.reload();
+    }
+    boolean afterSuccessfull = false;
+    try {
+      super.after();
+      afterSuccessfull = true;
+    } finally {
+      if (testFinishedCorrectly && afterSuccessfull) {
+        OBUtils.reload();
+      }
+    }
+  }
+
+  public boolean isShouldSynchronizedDialogAppear() {
+    return shouldSynchronizedDialogAppear;
+  }
+
+  public void setShouldSynchronizedDialogAppear(boolean shouldSynchronizedDialogAppear) {
+    this.shouldSynchronizedDialogAppear = shouldSynchronizedDialogAppear;
+  }
+
+  protected void setFinishedCorrectly() {
+    testFinishedCorrectly = true;
+  }
+
+  protected void resetFinishedCorrectly() {
+    testFinishedCorrectly = false;
+  }
+
+  protected void waitForSynchronizationToReturn() {
+    new Wait() {
+      @Override
+      protected boolean until(final int currentIteration) {
+        return (Boolean) SeleniumHelper
+            .executeScriptWithReturn("OB.MobileApp.model.showSynchronizedDialog === null");
+      }
+
+      @Override
+      protected void timeout() {
+        throw new TimeoutException(
+            String.format("Synchronized Confirmation Dialog remains visible"));
+      }
+    };
+  }
+}
diff --git a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/SynchronizedCashupWithDeposit.java b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/SynchronizedCashupWithDeposit.java
new file mode 100644
--- /dev/null
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/SynchronizedCashupWithDeposit.java
@@ -0,0 +1,140 @@
+/*
+ *************************************************************************
+ * 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 RAL
+ *
+ */
+
+package org.openbravo.test.mobile.retail.pack.selenium.tests.system.synchronizedtransactions;
+
+import java.text.NumberFormat;
+import java.util.Locale;
+
+import org.junit.Test;
+import org.openbravo.test.mobile.common.selenium.javascript.TestId;
+import org.openbravo.test.mobile.common.selenium.testhelpers.WebPOSSnippet;
+
+public class SynchronizedCashupWithDeposit extends BaseSynchronizedTransactionTest {
+
+  @Test
+  public void test1() {
+    WebPOSSnippet.cleanCashup(this);
+
+    depositAmount();
+
+    verifyCashup();
+    setFinishedCorrectly();
+  }
+
+  @Test
+  public void test2() {
+    setShouldSynchronizedDialogAppear(false);
+    verifyCashup();
+    setFinishedCorrectly();
+  }
+
+  private void verifyCashup() {
+    // first cashup
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_CASHUP);
+
+    // step 1 of 4
+    verify(TestId.LABEL_CASHUP_STEP2_TITLE, "Step 1 of 4: Count Cash");
+    tap(TestId.BUTTON_CASHUP_NEXT);
+
+    // step 2 of 4
+    verify(TestId.LABEL_CASHUP_STEP3_TITLE, "Step 2 of 4: Count Cash");
+    verify(TestId.LABEL_CASHUP_CARDEXPECTED, "0.00");
+    verify(TestId.LABEL_CASHUP_CASHEXPECTED, "111.00");
+    verify(TestId.LABEL_CASHUP_CASHCOUNTED, "0.00");
+    verify(TestId.LABEL_CASHUP_CASHUSAFOREIGNEXPECTED, "(0.00 USD)");
+    verify(TestId.LABEL_CASHUP_CASHUSAEXPECTED, "0.00");
+    verify(TestId.LABEL_CASHUP_VOUCHEREXPECTED, "0.00");
+    verify(TestId.LABEL_CASHUP_TOTALEXPECTED, "111.00");
+    verify(TestId.LABEL_CASHUP_TOTALCOUNTED, "-111.00");
+    tap(TestId.BUTTON_CASHUP_CARD_OK);
+    tap(TestId.BUTTON_CASHUP_CASHUSA_OK);
+    tap(TestId.BUTTON_CASHUP_VOUCHER_OK);
+    verify(TestId.LABEL_CASHUP_CASHUSACOUNTED, "(0.00 USD)");
+    tap(TestId.BUTTON_CASHUP_NEXT);
+
+    // step 3 of 4
+    // cash
+    verify(TestId.LABEL_CASHUP_STEP4_TITLE, "Step 3 of 4: Select Cash to keep");
+    verify(TestId.LABEL_CASHUP_KEEPNOTHING, "Nothing");
+    tap(TestId.BUTTON_CASHUP_KEEPNOTHING);
+    tap(TestId.BUTTON_CASHUP_NEXT);
+    // usa cash
+    verify(TestId.LABEL_CASHUP_STEP4_TITLE, "Step 3 of 4: Select USA Cash to keep");
+    verify(TestId.LABEL_CASHUP_KEEPNOTHING, "Nothing");
+    tap(TestId.BUTTON_CASHUP_KEEPNOTHING);
+    tap(TestId.BUTTON_CASHUP_NEXT);
+    // voucher
+    verify(TestId.LABEL_CASHUP_STEP4_TITLE, "Step 3 of 4: Select Voucher to keep");
+    verify(TestId.LABEL_CASHUP_KEEPNOTHING, "Nothing");
+    tap(TestId.BUTTON_CASHUP_KEEPNOTHING);
+    tap(TestId.BUTTON_CASHUP_NEXT);
+
+    // step 4 of 4
+    verify(TestId.LABEL_CASHUP_STEP5_TITLE, "Step 4 of 4: Post, print and close");
+    verify(TestId.LABEL_CASHUP_POSTPRINTANDCLOSE, "Post, Print & Close");
+    verify(TestId.LABEL_CASHUP_NETSALES_TITLE, "Net Sales");
+    verify(TestId.LABEL_CASHUP_NETSALES_AMOUNT, "0.00");
+    verify(TestId.LABEL_CASHUP_GROSSSALES_TITLE, "Gross Sales");
+    verify(TestId.LABEL_CASHUP_GROSSSALES_AMOUNT, "0.00");
+    // verify(TestId.LABEL_CASHUP_NETSALES_TAX21TITTLE, "Entregas IVA 21%");
+    // verify(TestId.LABEL_CASHUP_NETSALES_TAX21, "0.00");
+    verify(TestId.LABEL_CASHUP_NETRETURNS_TITLE, "Net Returns");
+    verify(TestId.LABEL_CASHUP_NETRETURNS_AMOUNT, "0.00");
+    verify(TestId.LABEL_CASHUP_GROSSRETURNS_TITLE, "Gross Returns");
+    verify(TestId.LABEL_CASHUP_GROSSRETURNS_AMOUNT, "0.00");
+    verify(TestId.LABEL_CASHUP_GROSSRETURNS_TITLE, "Gross Returns");
+    verify(TestId.LABEL_CASHUP_DEPOSIT_TOTAL, "111.00");
+    verify(TestId.LABEL_CASHUP_EXPECTED_TOTAL, "111.00");
+    verify(TestId.LABEL_CASHUP_TOTALTRASACTIONS, "0.00");
+    tap(TestId.BUTTON_CASHUP_CANCEL);
+    // tap(TestId.BUTTON_CASHUP_POSTPRINTANDCLOSE);
+    //
+    // // done
+    // verify(TestId.LABEL_POPUP_TITLE, "Good job!");
+    // tap(TestId.BUTTON_POPUP_OK);
+    // verify(TestId.LABEL_TOTALTOPAY, "0.00");
+  }
+
+  private void depositAmount() {
+    final int amount = 111;
+
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_CASHMANAGEMENT);
+    verify(TestId.LABEL_CASHMANAGEMENT_TITLE, "Cash Management");
+    WebPOSSnippet.tapKeypad(this, amount);
+    tap(TestId.BUTTON_CASHMANAGEMENT_CASHDEPOSIT);
+    verify(TestId.LABEL_SELECTDEPOSIT_BACOFFICEVBS, "Backoffice transfer to VBS");
+    tap(TestId.BUTTON_SELECTDEPOSIT_BACOFFICEVBS);
+    verify(TestId.LABEL_CASHMANAGEMENT_ROW1_AMOUNT,
+        String.format("%s.00", NumberFormat.getNumberInstance(Locale.US).format(amount)));
+    verify(TestId.LABEL_CASHMANAGEMENT_ROW1_DESCRIPTION,
+        "Deposit: Cash - Backoffice transfer to VBS");
+    tap(TestId.BUTTON_CASHMANAGEMENT_DONE);
+    verify(TestId.LABEL_POPUP_TITLE, "Done");
+    tap(TestId.BUTTON_POPUP_OK);
+    verify(TestId.LABEL_TOTALTOPAY, "0.00");
+
+  }
+
+}
diff --git a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/SynchronizedCashupWithSaleAndReturn.java b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/SynchronizedCashupWithSaleAndReturn.java
new file mode 100644
--- /dev/null
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/SynchronizedCashupWithSaleAndReturn.java
@@ -0,0 +1,197 @@
+/*
+ *************************************************************************
+ * 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):
+ ************************************************************************
+ */
+
+package org.openbravo.test.mobile.retail.pack.selenium.tests.system.synchronizedtransactions;
+
+import org.junit.Test;
+import org.openbravo.test.mobile.common.TestClassAnnotations;
+import org.openbravo.test.mobile.common.selenium.javascript.TestId;
+
+@TestClassAnnotations(isHighVolumeCompatible = true)
+public class SynchronizedCashupWithSaleAndReturn extends BaseSynchronizedTransactionTest {
+
+  @Test
+  public void test() {
+    firstCashup();
+    sale();
+    secondCashup();
+    setFinishedCorrectly();
+  }
+
+  private void sale() {
+    // sale
+    tap(TestId.BUTTON_SEARCH);
+    write(TestId.FIELD_SEARCH_TEXT, TestId.BUTTON_SEARCHPRODUCT_ADHESIVEBODYWARNMERS.getRowName());
+    tap(TestId.BUTTON_SEARCH_EXECUTE);
+    verifyHgvolTime(TestId.BUTTON_SEARCH_EXECUTE, 10000);
+    tap(TestId.BUTTON_SEARCHPRODUCT_ADHESIVEBODYWARNMERS);
+    verify(TestId.LABEL_TOTALTOPAY, "3.60");
+
+    write(TestId.FIELD_SEARCH_TEXT, TestId.BUTTON_SEARCHPRODUCT_TEKTOWEL.getRowName());
+    tap(TestId.BUTTON_SEARCH_EXECUTE);
+    verifyHgvolTime(TestId.BUTTON_SEARCH_EXECUTE, 10000);
+    tap(TestId.BUTTON_SEARCHPRODUCT_TEKTOWEL);
+    verify(TestId.LABEL_TOTALTOPAY, "23.50");
+
+    write(TestId.FIELD_SEARCH_TEXT, TestId.BUTTON_SEARCHPRODUCT_ALPINESKIING.getRowName());
+    tap(TestId.BUTTON_SEARCH_EXECUTE);
+    verifyHgvolTime(TestId.BUTTON_SEARCH_EXECUTE, 10000);
+    tap(TestId.BUTTON_SEARCHPRODUCT_ALPINESKIING);
+    verify(TestId.LABEL_TOTALTOPAY, "133.40");
+
+    write(TestId.FIELD_SEARCH_TEXT, TestId.BUTTON_SEARCHPRODUCT_BABYCARRIER.getRowName());
+    tap(TestId.BUTTON_SEARCH_EXECUTE);
+    verifyHgvolTime(TestId.BUTTON_SEARCH_EXECUTE, 10000);
+    tap(TestId.BUTTON_SEARCHPRODUCT_BABYCARRIER);
+    verify(TestId.LABEL_TOTALTOPAY, "243.90");
+    tap(TestId.BUTTON_PAY);
+    tap(TestId.BUTTON_PAY_EXACT);
+    tap(TestId.BUTTON_PAY_DONE);
+    verify(TestId.LABEL_TOTALTOPAY, "0.00");
+
+    // with return
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_RETURNTHISRECEIPT);
+    verify(TestId.LABEL_RECEIPT_TYPE, "To be Returned");
+    tap(TestId.BUTTON_SEARCH);
+    write(TestId.FIELD_SEARCH_TEXT, TestId.BUTTON_SEARCHPRODUCT_BABYCARRIER.getRowName());
+    tap(TestId.BUTTON_SEARCH_EXECUTE);
+    tap(TestId.BUTTON_SEARCHPRODUCT_BABYCARRIER);
+    verify(TestId.LABEL_TOTALTOPAY, "-110.50");
+    tap(TestId.BUTTON_PAY);
+    tap(TestId.BUTTON_PAY_EXACT);
+    tap(TestId.BUTTON_PAY_DONE);
+    verify(TestId.LABEL_TOTALTOPAY, "0.00");
+
+  }
+
+  private void firstCashup() {
+    // first cashup
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_CASHUP);
+
+    // step 1 of 4
+    verify(TestId.LABEL_CASHUP_STEP2_TITLE, "Step 1 of 4: Count Cash");
+    tap(TestId.BUTTON_CASHUP_NEXT);
+
+    // step 2 of 4
+    verify(TestId.LABEL_CASHUP_STEP3_TITLE, "Step 2 of 4: Count Cash");
+    tap(TestId.BUTTON_CASHUP_CARD_OK);
+    tap(TestId.BUTTON_CASHUP_CASHUSA_OK);
+    tap(TestId.BUTTON_CASHUP_VOUCHER_OK);
+    tap(TestId.BUTTON_CASHUP_NEXT);
+
+    // step 3 of 4
+    // cash
+    verify(TestId.LABEL_CASHUP_STEP4_TITLE, "Step 3 of 4: Select Cash to keep");
+    verify(TestId.LABEL_CASHUP_KEEPNOTHING, "Nothing");
+    tap(TestId.BUTTON_CASHUP_KEEPNOTHING);
+    tap(TestId.BUTTON_CASHUP_NEXT);
+    // usa cash
+    verify(TestId.LABEL_CASHUP_STEP4_TITLE, "Step 3 of 4: Select USA Cash to keep");
+    verify(TestId.LABEL_CASHUP_KEEPNOTHING, "Nothing");
+    tap(TestId.BUTTON_CASHUP_KEEPNOTHING);
+    tap(TestId.BUTTON_CASHUP_NEXT);
+    // voucher
+    verify(TestId.LABEL_CASHUP_STEP4_TITLE, "Step 3 of 4: Select Voucher to keep");
+    verify(TestId.LABEL_CASHUP_KEEPNOTHING, "Nothing");
+    tap(TestId.BUTTON_CASHUP_KEEPNOTHING);
+    tap(TestId.BUTTON_CASHUP_NEXT);
+
+    // step 4 of 4
+    verify(TestId.LABEL_CASHUP_STEP5_TITLE, "Step 4 of 4: Post, print and close");
+    verify(TestId.LABEL_CASHUP_POSTPRINTANDCLOSE, "Post, Print & Close");
+    tap(TestId.BUTTON_CASHUP_POSTPRINTANDCLOSE);
+
+    // done
+    verify(TestId.LABEL_POPUP_TITLE, "Good job!");
+    tap(TestId.BUTTON_POPUP_OK);
+    verify(TestId.LABEL_TOTALTOPAY, "0.00");
+  }
+
+  private void secondCashup() {
+    // first cashup
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_CASHUP);
+
+    // step 1 of 4
+    verify(TestId.LABEL_CASHUP_STEP2_TITLE, "Step 1 of 4: Count Cash");
+    tap(TestId.BUTTON_CASHUP_NEXT);
+
+    // step 2 of 4
+    verify(TestId.LABEL_CASHUP_STEP3_TITLE, "Step 2 of 4: Count Cash");
+    verify(TestId.LABEL_CASHUP_CARDEXPECTED, "0.00");
+    verify(TestId.LABEL_CASHUP_CASHEXPECTED, "133.40");
+    verify(TestId.LABEL_CASHUP_CASHCOUNTED, "0.00");
+    verify(TestId.LABEL_CASHUP_CASHUSAFOREIGNEXPECTED, "(0.00 USD)");
+    verify(TestId.LABEL_CASHUP_CASHUSAEXPECTED, "0.00");
+    verify(TestId.LABEL_CASHUP_VOUCHEREXPECTED, "0.00");
+    verify(TestId.LABEL_CASHUP_TOTALEXPECTED, "133.40");
+    verify(TestId.LABEL_CASHUP_TOTALCOUNTED, "-133.40");
+    tap(TestId.BUTTON_CASHUP_CARD_OK);
+    tap(TestId.BUTTON_CASHUP_CASHUSA_OK);
+    tap(TestId.BUTTON_CASHUP_VOUCHER_OK);
+    verify(TestId.LABEL_CASHUP_CASHUSACOUNTED, "(0.00 USD)");
+    verify(TestId.LABEL_CASHUP_TOTALCOUNTED, "-133.40");
+    tap(TestId.BUTTON_CASHUP_NEXT);
+
+    // step 3 of 4
+    // cash
+    verify(TestId.LABEL_CASHUP_STEP4_TITLE, "Step 3 of 4: Select Cash to keep");
+    verify(TestId.LABEL_CASHUP_KEEPNOTHING, "Nothing");
+    tap(TestId.BUTTON_CASHUP_KEEPNOTHING);
+    tap(TestId.BUTTON_CASHUP_NEXT);
+    // usa cash
+    verify(TestId.LABEL_CASHUP_STEP4_TITLE, "Step 3 of 4: Select USA Cash to keep");
+    verify(TestId.LABEL_CASHUP_KEEPNOTHING, "Nothing");
+    tap(TestId.BUTTON_CASHUP_KEEPNOTHING);
+    tap(TestId.BUTTON_CASHUP_NEXT);
+    // voucher
+    verify(TestId.LABEL_CASHUP_STEP4_TITLE, "Step 3 of 4: Select Voucher to keep");
+    verify(TestId.LABEL_CASHUP_KEEPNOTHING, "Nothing");
+    tap(TestId.BUTTON_CASHUP_KEEPNOTHING);
+    tap(TestId.BUTTON_CASHUP_NEXT);
+
+    // step 4 of 4
+    verify(TestId.LABEL_CASHUP_STEP5_TITLE, "Step 4 of 4: Post, print and close");
+    verify(TestId.LABEL_CASHUP_POSTPRINTANDCLOSE, "Post, Print & Close");
+
+    verify(TestId.LABEL_CASHUP_NETSALES_TITLE, "Net Sales");
+    verify(TestId.LABEL_CASHUP_NETSALES_AMOUNT, "201.58");
+    verify(TestId.LABEL_CASHUP_NETSALES_2_TAX21, "42.32");
+    verify(TestId.LABEL_CASHUP_GROSSSALES_TITLE, "Gross Sales");
+    verify(TestId.LABEL_CASHUP_GROSSSALES_AMOUNT, "243.90");
+
+    verify(TestId.LABEL_CASHUP_NETRETURNS_TITLE, "Net Returns");
+    verify(TestId.LABEL_CASHUP_NETRETURNS_AMOUNT, "91.32");
+    verify(TestId.LABEL_CASHUP_NETRETURMS_TAX21, "19.18");
+    verify(TestId.LABEL_CASHUP_GROSSRETURNS_TITLE, "Gross Returns");
+    verify(TestId.LABEL_CASHUP_GROSSRETURNS_AMOUNT, "110.50");
+
+    verify(TestId.LABEL_CASHUP_TOTALTRASACTIONS, "133.40");
+
+    tap(TestId.BUTTON_CASHUP_POSTPRINTANDCLOSE);
+
+    // done
+    verify(TestId.LABEL_POPUP_TITLE, "Good job!");
+    tap(TestId.BUTTON_POPUP_OK);
+    verify(TestId.LABEL_TOTALTOPAY, "0.00");
+  }
+
+}
diff --git a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/Synchronized_I25623_VerifiedReturnsAvoidMoreThanOrdered.java b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/Synchronized_I25623_VerifiedReturnsAvoidMoreThanOrdered.java
new file mode 100644
--- /dev/null
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/Synchronized_I25623_VerifiedReturnsAvoidMoreThanOrdered.java
@@ -0,0 +1,133 @@
+/*
+ *************************************************************************
+ * 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 RAL
+ *
+ */
+
+package org.openbravo.test.mobile.retail.pack.selenium.tests.system.synchronizedtransactions;
+
+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.common.TestAnnotations;
+import org.openbravo.test.mobile.common.TestClassAnnotations;
+import org.openbravo.test.mobile.common.selenium.database.DatabaseHelperSelect;
+import org.openbravo.test.mobile.common.selenium.javascript.BackboneHelper;
+import org.openbravo.test.mobile.common.selenium.javascript.TestId;
+import org.openbravo.test.mobile.common.selenium.javascript.TestRegistryHelper;
+
+/**
+ * Verifies that we do not return more than ordered
+ *
+ * @author MDJ
+ *
+ */
+@TestClassAnnotations(isHighVolumeCompatible = true)
+public class Synchronized_I25623_VerifiedReturnsAvoidMoreThanOrdered extends
+    BaseSynchronizedTransactionTest {
+
+  @Test
+  @TestAnnotations(from = "RR15Q2", waitFixOf = 30773)
+  public void test() {
+    final String receiptNo1 = BackboneHelper.getDocumentNo();
+    final String customer = get(TestId.BUTTON_RECEIPT_CUSTOMER);
+    tap(TestId.BUTTON_SEARCH);
+    write(TestId.FIELD_SEARCH_TEXT, TestId.BUTTON_SEARCHPRODUCT_AVALANCHETRANSCEIVER.getRowName());
+    tap(TestId.BUTTON_SEARCH_EXECUTE);
+    verifyHgvolTime(TestId.BUTTON_SEARCH_EXECUTE, 5000);
+    tap(TestId.BUTTON_SEARCHPRODUCT_AVALANCHETRANSCEIVER);
+    tap(TestId.BUTTON_EDIT);
+    tap(TestId.BUTTON_KEYPAD_5);
+    tap(TestId.BUTTON_KEYPAD_QUANTITY);
+    verify(TestId.LABEL_TOTALTOPAY, "752.50");
+    tap(TestId.BUTTON_PAY);
+    tap(TestId.BUTTON_PAY_EXACT);
+    tap(TestId.BUTTON_PAY_DONE);
+    verify(TestId.LABEL_TOTALTOPAY, "0.00");
+    checkOrder(receiptNo1);
+
+    final String receiptNo2 = BackboneHelper.getDocumentNo();
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_VERIFIEDRETURN);
+    write(TestId.FIELD_SEARCH_RECEIPT, receiptNo1);
+    tap(TestId.BUTTON_VERIFIEDRETURNS_SEARCH);
+    verify(TestId.LABEL_VERIFIEDRETURNS_ROW1_TITLE, String.format("%s - %s", receiptNo1, customer));
+    tap(TestId.BUTTON_VERIFIEDRETURNS_ROW1);
+    verify(TestId.LABEL_POPUP_DOCUMENTNO, receiptNo1);
+    tap(TestId.BUTTON_VERIFIEDRETURNS_LINES_CHECKALL);
+    verify(TestId.LABEL_VERIFIEDRETURNS_LINES_PRODUCT, "Avalanche transceiver");
+    verify(TestId.LABEL_VERIFIEDRETURNS_LINES_TOTALQTY, "5");
+    verify(TestId.LABEL_VERIFIEDRETURNS_LINES_REMAININGQTY, "5");
+    write(TestId.INPUT_VERIFIEDRETURNS_LINES_QTY, "1");
+    tap(TestId.BUTTON_VERIFIEDRETURNS_LINES_QTYMINUS);
+    tap(TestId.BUTTON_VERIFIEDRETURNS_LINES_QTYPLUS);
+    tap(TestId.BUTTON_VERIFIEDRETURNS_LINES_QTYPLUS);
+    tap(TestId.BUTTON_POPUP_APPLY);
+    verify(TestId.LABEL_TOTALTOPAY, "-451.50");
+    tap(TestId.BUTTON_PAY);
+    tap(TestId.BUTTON_PAY_EXACT);
+    tap(TestId.BUTTON_PAY_DONE);
+    verify(TestId.LABEL_TOTALTOPAY, "0.00");
+    checkOrder(receiptNo2);
+
+    final String receiptNo3 = BackboneHelper.getDocumentNo();
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_VERIFIEDRETURN);
+    write(TestId.FIELD_SEARCH_RECEIPT, receiptNo1);
+    tap(TestId.BUTTON_VERIFIEDRETURNS_SEARCH);
+    verify(TestId.LABEL_VERIFIEDRETURNS_ROW1_TITLE, String.format("%s - %s", receiptNo1, customer));
+    tap(TestId.BUTTON_VERIFIEDRETURNS_ROW1);
+    verify(TestId.LABEL_POPUP_DOCUMENTNO, receiptNo1);
+
+    TestRegistryHelper.waitForPopupToUpdate();
+
+    tap(TestId.BUTTON_VERIFIEDRETURNS_LINES_CHECKALL);
+    verify(TestId.LABEL_VERIFIEDRETURNS_LINES_PRODUCT, "Avalanche transceiver");
+    verify(TestId.LABEL_VERIFIEDRETURNS_LINES_TOTALQTY, "5");
+    tap(TestId.BUTTON_VERIFIEDRETURNS_LINES_QTYMINUS);
+    tap(TestId.BUTTON_VERIFIEDRETURNS_LINES_QTYMINUS);
+    tap(TestId.BUTTON_VERIFIEDRETURNS_LINES_QTYPLUS);
+    tap(TestId.BUTTON_VERIFIEDRETURNS_LINES_QTYPLUS);
+    tap(TestId.BUTTON_POPUP_APPLY);
+    verify(TestId.LABEL_TOTALTOPAY, "-301.00");
+    tap(TestId.BUTTON_PAY);
+    tap(TestId.BUTTON_PAY_EXACT);
+    tap(TestId.BUTTON_PAY_DONE);
+    checkOrder(receiptNo3);
+    setFinishedCorrectly();
+  }
+
+  private void checkOrder(final String receiptNo) {
+    // verify that the order has been saved in the backend
+    final String sql = "select documentno from C_ORDER  " + "WHERE documentno='" + receiptNo + "'";
+
+    new DatabaseHelperSelect() {
+      @Override
+      protected void yieldResultSet(final ResultSet rs) throws SQLException {
+        final String documentno = rs.getString("documentno");
+
+        assertThat("'Expected' didn't return the expected data", documentno, equalTo(receiptNo));
+      }
+    }.execute(sql, 1);
+  }
+}
diff --git a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/Synchronized_I27476_SameDocumentNoAfterPayAndReload.java b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/Synchronized_I27476_SameDocumentNoAfterPayAndReload.java
new file mode 100644
--- /dev/null
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/Synchronized_I27476_SameDocumentNoAfterPayAndReload.java
@@ -0,0 +1,75 @@
+/*
+ *************************************************************************
+ * 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 RAL
+ *
+ */
+
+package org.openbravo.test.mobile.retail.pack.selenium.tests.system.synchronizedtransactions;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.greaterThan;
+
+import org.junit.Test;
+import org.openbravo.test.mobile.common.selenium.SeleniumHelper;
+import org.openbravo.test.mobile.common.selenium.javascript.BackboneHelper;
+import org.openbravo.test.mobile.common.selenium.javascript.TestId;
+import org.openbravo.test.mobile.common.selenium.utils.OBUtils;
+
+public class Synchronized_I27476_SameDocumentNoAfterPayAndReload extends
+    BaseSynchronizedTransactionTest {
+
+  @Test
+  public void test() {
+    // at the end the page is reloaded so then the
+    // synchronized dialog check can not be done in the after
+    // check specifically below
+    setShouldSynchronizedDialogAppear(false);
+    long beforeTime = (Long) SeleniumHelper
+        .executeScriptWithReturn("OB.Data.showSynchronizedDialogChangeTime");
+
+    final String documentNo = BackboneHelper.getDocumentNo();
+
+    tap(TestId.BUTTON_BROWSE);
+    tap(TestId.BUTTON_CATEGORY_SKI);
+    tap(TestId.BUTTON_PRODUCT_SKI_GLIDEWAX);
+    verify(TestId.LABEL_TOTALTOPAY, "12.50");
+    tap(TestId.BUTTON_PAY);
+    tap(TestId.BUTTON_PAY_EXACT);
+    tap(TestId.BUTTON_PAY_DONE);
+    verify(TestId.LABEL_TOTALTOPAY, "0.00");
+
+    final String[] documentnoHeader = documentNo.split("/");
+    final int documentNumber = Integer.parseInt(documentnoHeader[1]) + 1;
+    final String newDocumentno = String.format("%s/%07d", documentnoHeader[0], documentNumber);
+    assertThat(BackboneHelper.getDocumentNo(), equalTo(newDocumentno));
+
+    final Long afterTime = (Long) SeleniumHelper
+        .executeScriptWithReturn("OB.Data.showSynchronizedDialogChangeTime");
+
+    assertThat("Transaction Dialog hasn't appeared, it should", afterTime, greaterThan(beforeTime));
+
+    // Reload the webpage
+    OBUtils.reload();
+
+    assertThat(BackboneHelper.getDocumentNo(), equalTo(newDocumentno));
+    setFinishedCorrectly();
+  }
+
+}
diff --git a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/Synchronized_I27615_PartiallyPaidLayaway.java b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/Synchronized_I27615_PartiallyPaidLayaway.java
new file mode 100644
--- /dev/null
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/Synchronized_I27615_PartiallyPaidLayaway.java
@@ -0,0 +1,164 @@
+/*
+ *************************************************************************
+ * 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 RAL
+ *
+ */
+
+package org.openbravo.test.mobile.retail.pack.selenium.tests.system.synchronizedtransactions;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import java.util.ArrayList;
+
+import org.junit.Test;
+import org.openbravo.test.mobile.common.TestAnnotations;
+import org.openbravo.test.mobile.common.selenium.database.WebPOSDatabaseConstants;
+import org.openbravo.test.mobile.common.selenium.database.WebPOSDatabaseHelper;
+import org.openbravo.test.mobile.common.selenium.database.WebPOSDatabaseHelper.PaymentPlanDetailsOfDocumentno;
+import org.openbravo.test.mobile.common.selenium.javascript.BackboneHelper;
+import org.openbravo.test.mobile.common.selenium.javascript.TestId;
+import org.openbravo.test.mobile.common.selenium.testhelpers.TestLogger;
+import org.openbravo.test.mobile.common.selenium.testhelpers.WebPOSSnippet;
+import org.openbravo.test.mobile.common.selenium.utils.OBNumber;
+
+public class Synchronized_I27615_PartiallyPaidLayaway extends BaseSynchronizedTransactionTest {
+
+  private static final int I_28831 = 28831;
+  private static String receiptNo;
+  private static String customer;
+  private static final OBNumber _549_5F = new OBNumber(549.5f);
+  private static final OBNumber _454_13F = new OBNumber(454.13f);
+  private static final OBNumber _275 = new OBNumber(275f);
+  private static final OBNumber _274_5 = new OBNumber(274.5f);
+
+  final WebPOSDatabaseHelper dbh = new WebPOSDatabaseHelper();
+
+  @Override
+  public void afterSuccessfulTest_VerifyTerminalIsLeftAsTestStarted() {
+    if (getTestMethodName().equals("test9")) {
+      super.afterSuccessfulTest_VerifyTerminalIsLeftAsTestStarted();
+    }
+  }
+
+  @Test
+  @TestAnnotations(waitFixOf = I_28831)
+  public void test1() {
+    // create the layaway
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_LAYAWAYTHISRECEIPT);
+    verify(TestId.LABEL_RECEIPT_TYPE, "To be laid away");
+    tap(TestId.BUTTON_BROWSE);
+    tap(TestId.BUTTON_CATEGORY_BACKPACKSANDTRAVEL);
+    tap(TestId.BUTTON_PRODUCT_BACKPACKSANDTRAVEL_ALPINESKIING);
+    tap(TestId.BUTTON_PRODUCT_BACKPACKSANDTRAVEL_ALPINESKIING);
+    tap(TestId.BUTTON_PRODUCT_BACKPACKSANDTRAVEL_ALPINESKIING);
+    tap(TestId.BUTTON_PRODUCT_BACKPACKSANDTRAVEL_ALPINESKIING);
+    tap(TestId.BUTTON_PRODUCT_BACKPACKSANDTRAVEL_ALPINESKIING);
+    receiptNo = BackboneHelper.getDocumentNo();
+    customer = get(TestId.BUTTON_RECEIPT_CUSTOMER);
+    verify(TestId.LABEL_TOTALTOPAY, "549.50");
+    tap(TestId.BUTTON_PAY);
+    tap(TestId.BUTTON_LAYAWAY);
+    verify(TestId.LABEL_TOTALTOPAY, "0.00");
+
+    // partial pay
+    tap(TestId.BUTTON_MENU_LAYAWAYS);
+    write(TestId.FIELD_SEARCH_RECEIPT, receiptNo);
+    tap(TestId.BUTTON_LAYAWAYS_SEARCH);
+    tap(TestId.TABLE_RECEIPTSEARCH, String.format("%s - %s", receiptNo, customer));
+    tap(TestId.BUTTON_PAY);
+    WebPOSSnippet.tapKeypad(this, 275);
+    tap(TestId.BUTTON_CASH);
+    verify(TestId.LABEL_RECEIPT_PAY_REMAINING, "274.50€");
+    tap(TestId.BUTTON_LAYAWAY);
+    verify(TestId.LABEL_TOTALTOPAY, "0.00");
+
+    // verify the transaction in the server
+    TestLogger.getLogger().info("Verifying the Sale Payment Plan in the backend");
+    final PaymentPlanDetailsOfDocumentno pm = dbh.getPaymentPlanDetailsOf(receiptNo, 1).get(0);
+    assertThat(pm.accountName, equalTo(WebPOSDatabaseConstants.VBS1001_CASHBOOK_STORE));
+    assertThat(pm.paymentMethodName, equalTo("Cash"));
+    assertThat(pm.currency, equalTo("EUR"));
+    assertThat(pm.numberOfPayments, equalTo(new OBNumber(1f)));
+    assertThat(pm.expected, equalTo(_549_5F));
+    assertThat(pm.netAmt, equalTo(_454_13F));
+    assertThat(pm.received, equalTo(_275));
+    assertThat(pm.outstanding, equalTo(_274_5));
+    assertThat(pm.paidAmt, equalTo(_275));
+    assertThat(pm.paidConverted, equalTo(_275));
+    setFinishedCorrectly();
+  }
+
+  @Test
+  @TestAnnotations(to = "RR15Q2", waitFixOf = I_28831)
+  public void test2() {
+    tap(TestId.BUTTON_DELETERECEIPT);
+    tap(TestId.BUTTON_DELETERECEIPT_CONFIRM);
+    setFinishedCorrectly();
+  }
+
+  @Test
+  @TestAnnotations(waitFixOf = I_28831)
+  public void test3() {
+    // pay the outstanding
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_LAYAWAYS);
+    write(TestId.FIELD_SEARCH_RECEIPT, receiptNo);
+    tap(TestId.BUTTON_LAYAWAYS_SEARCH);
+    tap(TestId.TABLE_RECEIPTSEARCH, String.format("%s - %s", receiptNo, customer));
+    tap(TestId.BUTTON_PAY);
+    tap(TestId.BUTTON_PAY_EXACT);
+    tap(TestId.BUTTON_PAY_DONE);
+    verify(TestId.LABEL_RECEIPT_PAY_REMAINING, "0.00€");
+    tap(TestId.BUTTON_LAYAWAY);
+    verify(TestId.LABEL_TOTALTOPAY, "0.00");
+
+    // verify the transaction in the server
+    TestLogger.getLogger().info("Verifying the Sale Payment Plan in the backend");
+    final ArrayList<PaymentPlanDetailsOfDocumentno> pms = dbh.getPaymentPlanDetailsOf(receiptNo, 2);
+    final PaymentPlanDetailsOfDocumentno pm = pms.get(0);
+    assertThat(pm.accountName, equalTo(WebPOSDatabaseConstants.VBS1001_CASHBOOK_STORE));
+    assertThat(pm.paymentMethodName, equalTo("Cash"));
+    assertThat(pm.currency, equalTo("EUR"));
+    assertThat(pm.numberOfPayments, equalTo(new OBNumber(2f)));
+    assertThat(pm.expected, equalTo(_549_5F));
+    assertThat(pm.netAmt, equalTo(_454_13F));
+    assertThat(pm.received, equalTo(_549_5F));
+    assertThat(pm.outstanding, equalTo(OBNumber.ZERO));
+    assertThat(pm.paidAmt, equalTo(_275));
+    assertThat(pm.paidConverted, equalTo(_275));
+    final PaymentPlanDetailsOfDocumentno pm2 = pms.get(1);
+    assertThat(pm2.accountName, equalTo(WebPOSDatabaseConstants.VBS1001_CASHBOOK_STORE));
+    assertThat(pm2.paymentMethodName, equalTo("Cash"));
+    assertThat(pm2.currency, equalTo("EUR"));
+    assertThat(pm2.paidAmt, equalTo(_274_5));
+    assertThat(pm2.paidConverted, equalTo(_274_5));
+    setFinishedCorrectly();
+  }
+
+  @Test
+  @TestAnnotations(to = "RR15Q2", waitFixOf = I_28831)
+  public void test9() {
+    tap(TestId.BUTTON_DELETERECEIPT);
+    tap(TestId.BUTTON_DELETERECEIPT_CONFIRM);
+    setFinishedCorrectly();
+  }
+
+}
diff --git a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/Synchronized_I30412_QuotationsAndPromotions.java b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/Synchronized_I30412_QuotationsAndPromotions.java
new file mode 100644
--- /dev/null
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/Synchronized_I30412_QuotationsAndPromotions.java
@@ -0,0 +1,140 @@
+/*
+ *************************************************************************
+ * 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 JGA
+ *
+ */
+
+package org.openbravo.test.mobile.retail.pack.selenium.tests.system.synchronizedtransactions;
+
+import org.junit.After;
+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.utils.OBUtils;
+
+@TestClassAnnotations(isHighVolumeCompatible = true)
+public class Synchronized_I30412_QuotationsAndPromotions extends BaseSynchronizedTransactionTest {
+  String documentNo;
+
+  @Test
+  public void test() {
+    boolean isTestSuccessful = false;
+    try {
+      generatePromotion();
+      OBUtils.reload(); // Refresh the terminal to load the changes
+
+      createquotation();
+      paysalesorder();
+
+      // restore
+      removePromotion();
+      isTestSuccessful = true;
+      OBUtils.reload();
+      setFinishedCorrectly();
+    } finally {
+      if (!isTestSuccessful) {
+        removePromotion();
+      }
+    }
+  }
+
+  @Override
+  @After
+  public void after() {
+  }
+
+  private void paysalesorder() {
+    tap(TestId.BUTTON_PAY);
+    tap(TestId.BUTTON_PAY_EXACT);
+    tap(TestId.BUTTON_PAY_DONE);
+  }
+
+  private void createquotation() {
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_CREATEQUOTATION);
+    verify(TestId.LABEL_RECEIPT_TYPE, "Quotation - Draft");
+
+    tap(TestId.BUTTON_SEARCH);
+    write(TestId.FIELD_SEARCH_TEXT, TestId.BUTTON_SEARCHPRODUCT_TEKTOWEL.getRowName());
+    tap(TestId.BUTTON_SEARCH_EXECUTE);
+    verifyHgvolTime(TestId.BUTTON_SEARCH_EXECUTE, 10000);
+    tap(TestId.BUTTON_SEARCHPRODUCT_TEKTOWEL);
+    tap(TestId.BUTTON_SEARCHPRODUCT_TEKTOWEL);
+
+    verify(TestId.LABEL_TOTALTOPAY, "39.80");
+
+    tap(TestId.BUTTON_EDIT);
+    tap(TestId.BUTTON_KEYPAD_PRICE);
+    tap(TestId.BUTTON_KEYPAD_1);
+    tap(TestId.BUTTON_KEYPAD_ENTER);
+    verify(TestId.LABEL_TOTALTOPAY, "2.00");
+
+    tap(TestId.BUTTON_PAY);
+    verify(TestId.LABEL_RECEIPT_TYPE, "Quotation - Under Evaluation");
+
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_CREATEORDERFROMQUOTATION);
+    tap(TestId.BUTTON_POPUP_UPDATEPRICES);
+    tap(TestId.BUTTON_POPUP_CREATEORDER);
+    verify(TestId.LABEL_TOTALTOPAY, "39.80");
+  }
+
+  public void generatePromotion() {
+    final String insertoffer = "insert into m_offer "
+        + "(m_offer_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, name,"
+        + "addamt, discount, datefrom, bpartner_selection, bp_group_selection, product_selection,"
+        + "prod_cat_selection, pricelist_selection, m_offer_type_id, apply_next, print_name, org_selection,"
+        + "ismultiple, characteristics_selection, em_obdisc_x, em_obdisc_y, em_obdisc_distribute, em_obdisc_role_selection,"
+        + "em_obdisc_approval_required) "
+        + "VALUES "
+        + "('B305DD9172CD4C799088549E9463CFAC', '39363B0921BB4293B48383844325E84C','67839EEFA49E44AC969BD60093FCC899','Y',now(),'100',now(),'100','Issue30412Discount',"
+        + "0,0,now(),'Y','Y','N',"
+        + "'Y','Y','E08EE3C23EBA49358A881EF06C139D63','Y','Issue30412Discount','N',"
+        + "'N','Y',3,2,'N','Y','N')";
+    new DatabaseHelperInsertUpdateOrDelete().execute(insertoffer, 1);
+    final String insertofferproduct = "insert into m_offer_product "
+        + "(m_offer_product_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, m_offer_id,"
+        + "m_product_id, em_obdisc_is_gift) "
+        + "VALUES "
+        + "('A3AA02FC448841C59D93557AA6777204','39363B0921BB4293B48383844325E84C','67839EEFA49E44AC969BD60093FCC899','Y',now(),'100',now(),'100','B305DD9172CD4C799088549E9463CFAC',"
+        + "'DBC715536AEF47B18E3558FA01D6F770','N')";
+    new DatabaseHelperInsertUpdateOrDelete().execute(insertofferproduct, 1);
+    final String insertofferorg = "insert into m_offer_organization "
+        + "(m_offer_organization_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, m_offer_id) "
+        + "VALUES "
+        + "('5A3D5970463D4E5F894EEBBA7AA6EA50','39363B0921BB4293B48383844325E84C','D270A5AC50874F8BA67A88EE977F8E3B','Y',now(),'100',now(),'100','B305DD9172CD4C799088549E9463CFAC')";
+    new DatabaseHelperInsertUpdateOrDelete().execute(insertofferorg, 1);
+  }
+
+  private void removePromotion() {
+    final String deleteofferorg = "delete from m_offer_organization "
+        + "WHERE m_offer_organization_id = '5A3D5970463D4E5F894EEBBA7AA6EA50' "
+        + "AND m_offer_id = 'B305DD9172CD4C799088549E9463CFAC'";
+    new DatabaseHelperInsertUpdateOrDelete().execute(deleteofferorg, 1);
+    final String deleteofferproduct = "delete from m_offer_product "
+        + "WHERE m_offer_product_id = 'A3AA02FC448841C59D93557AA6777204' "
+        + "AND m_offer_id = 'B305DD9172CD4C799088549E9463CFAC'";
+    new DatabaseHelperInsertUpdateOrDelete().execute(deleteofferproduct, 1);
+    final String deleteoffer = "delete from m_offer "
+        + "WHERE m_offer_id = 'B305DD9172CD4C799088549E9463CFAC'";
+    new DatabaseHelperInsertUpdateOrDelete().execute(deleteoffer, 1);
+  }
+
+}
diff --git a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/Synchronized_I31323_LayawayPayOpenTicket.java b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/Synchronized_I31323_LayawayPayOpenTicket.java
new file mode 100644
--- /dev/null
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/Synchronized_I31323_LayawayPayOpenTicket.java
@@ -0,0 +1,99 @@
+/*
+ *************************************************************************
+ * 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 MCA
+ *
+ */
+
+package org.openbravo.test.mobile.retail.pack.selenium.tests.system.synchronizedtransactions;
+
+import org.junit.Test;
+import org.openbravo.test.mobile.common.selenium.javascript.BackboneHelper;
+import org.openbravo.test.mobile.common.selenium.javascript.TestId;
+import org.openbravo.test.mobile.common.selenium.utils.OBUtils;
+
+public class Synchronized_I31323_LayawayPayOpenTicket extends BaseSynchronizedTransactionTest {
+  private String customer;
+  private String documentNo1;
+  private String documentNo2;
+
+  @Test
+  public void test() {
+
+    // sometimes a previous test keeps a ticket there
+    tap(TestId.BUTTON_DELETERECEIPT);
+    tap(TestId.BUTTON_DELETERECEIPT_CONFIRM);
+
+    // Create the layaway 1
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_LAYAWAYTHISRECEIPT);
+    verify(TestId.LABEL_RECEIPT_TYPE, "To be laid away");
+    documentNo1 = BackboneHelper.getDocumentNo();
+    customer = get(TestId.BUTTON_RECEIPT_CUSTOMER);
+    tap(TestId.BUTTON_BROWSE);
+    tap(TestId.BUTTON_CATEGORY_BACKPACKSANDTRAVEL);
+    tap(TestId.BUTTON_PRODUCT_BACKPACKSANDTRAVEL_ALPINESKIING);
+    verify(TestId.LABEL_TOTALTOPAY, "109.90");
+    tap(TestId.BUTTON_PAY);
+    tap(TestId.BUTTON_LAYAWAY);
+    verify(TestId.LABEL_TOTALTOPAY, "0.00");
+
+    // Create the layaway 2
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_LAYAWAYTHISRECEIPT);
+    verify(TestId.LABEL_RECEIPT_TYPE, "To be laid away");
+    documentNo2 = BackboneHelper.getDocumentNo();
+    tap(TestId.BUTTON_BROWSE);
+    tap(TestId.BUTTON_CATEGORY_MOUNTAINEERING);
+    tap(TestId.BUTTON_PRODUCT_MOUNTAINEERING_CRAMPONS10POINT);
+    verify(TestId.LABEL_TOTALTOPAY, "39.90");
+    tap(TestId.BUTTON_PAY);
+    tap(TestId.BUTTON_LAYAWAY);
+    verify(TestId.LABEL_TOTALTOPAY, "0.00");
+
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_PAYOPENTICKETS);
+    write(TestId.FIELD_SEARCH_MULTIORDERS_TEXT, getTerminal());
+    tap(TestId.BUTTON_POPUP_OPENTICKETS_SEARCH);
+    verify(TestId.LABEL_MULTIORDERS_SEARCHRESULTS_ROW1_TOPLINE,
+        String.format("%s - %s", documentNo2, customer));
+    verify(TestId.LABEL_MULTIORDERS_SEARCHRESULTS_ROW2_TOPLINE,
+        String.format("%s - %s", documentNo1, customer));
+    tap(TestId.BUTTON_POPUP_OPENTICKETS_ROW1);
+    tap(TestId.BUTTON_POPUP_OPENTICKETS_ROW2);
+    tap(TestId.BUTTON_POPUP_OPENTICKETS_DONE);
+
+    verify(TestId.LABEL_RECEIPT_MULTIORDER_TOTALQTY, "2");
+    verify(TestId.LABEL_RECEIPT_MULTIORDER_TOTALGROSS, "149.80");
+
+    // refresh the page and verify multiorder
+    OBUtils.reload();
+    verify(TestId.LABEL_RECEIPT_MULTIORDER_TOTALQTY, "2");
+    verify(TestId.LABEL_RECEIPT_MULTIORDER_TOTALGROSS, "149.80");
+
+    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, "0.00");
+    setFinishedCorrectly();
+  }
+
+}
diff --git a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/Synchronized_I31462_VoidLayaway.java b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/Synchronized_I31462_VoidLayaway.java
new file mode 100644
--- /dev/null
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/Synchronized_I31462_VoidLayaway.java
@@ -0,0 +1,100 @@
+/*
+ *************************************************************************
+ * 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 = RAL
+ *
+ */
+
+package org.openbravo.test.mobile.retail.pack.selenium.tests.system.synchronizedtransactions;
+
+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.common.selenium.database.DatabaseHelperSelect;
+import org.openbravo.test.mobile.common.selenium.javascript.BackboneHelper;
+import org.openbravo.test.mobile.common.selenium.javascript.TestId;
+import org.openbravo.test.mobile.common.selenium.utils.OBNumber;
+
+public class Synchronized_I31462_VoidLayaway extends BaseSynchronizedTransactionTest {
+
+  @Test
+  public void test() {
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_LAYAWAYTHISRECEIPT);
+    verify(TestId.LABEL_RECEIPT_TYPE, "To be laid away");
+    tap(TestId.BUTTON_BROWSE);
+    tap(TestId.BUTTON_CATEGORY_BACKPACKSANDTRAVEL);
+    tap(TestId.BUTTON_PRODUCT_BACKPACKSANDTRAVEL_WHISTLE);
+    verify(TestId.LABEL_TOTALTOPAY, "2.90");
+    final String organizationId = BackboneHelper.getTerminalValue("organization");
+    final String clientId = BackboneHelper.getTerminalValue("client");
+    final String receiptNo = BackboneHelper.getDocumentNo();
+    final String customer = get(TestId.BUTTON_RECEIPT_CUSTOMER);
+    final String cashupId = BackboneHelper.getTerminalValue("cashUpId");
+    tap(TestId.BUTTON_PAY);
+    tap(TestId.BUTTON_LAYAWAY);
+    verify(TestId.LABEL_TOTALTOPAY, "0.00");
+
+    // retrieve the layaway
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_LAYAWAYS);
+    write(TestId.FIELD_SEARCH_RECEIPT, receiptNo);
+    tap(TestId.BUTTON_LAYAWAYS_SEARCH);
+    tap(TestId.TABLE_RECEIPTSEARCH, String.format("%s - %s", receiptNo, customer));
+    verify(TestId.LABEL_RECEIPT_TYPE, "Layaway");
+    verify(TestId.LABEL_RECEIPT_COUNTER, "1");
+    verify(TestId.LABEL_TOTALTOPAY, "2.90");
+    // void
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_VOIDLAYAWAY);
+    verify(TestId.LABEL_RECEIPT_TYPE, "Void this Layaway");
+    verify(TestId.LABEL_RECEIPT_COUNTER, "1");
+    verify(TestId.LABEL_TOTALTOPAY, "2.90");
+    isVisible(TestId.BUTTON_PAY_DONE, true);
+    isVisible(TestId.BUTTON_LAYAWAY, false);
+    tap(TestId.BUTTON_PAY_DONE);
+
+    verifyOrderStatus(receiptNo, organizationId, clientId, OBNumber.ZERO, OBNumber.ZERO, cashupId,
+        "CL");
+    setFinishedCorrectly();
+  }
+
+  public static void verifyOrderStatus(final String documentNo, final String organizationId,
+      final String clientId, final OBNumber net, final OBNumber gross, final String cashupId,
+      final String status) {
+    final String c_order = String
+        .format(
+            "SELECT c_order_id, ad_client_id, ad_org_id,  totallines, grandtotal, em_obpos_app_cashup_id, docstatus FROM c_order WHERE documentno='%s'",
+            documentNo);
+    new DatabaseHelperSelect() {
+      @Override
+      protected void yieldResultSet(final ResultSet rs) throws SQLException {
+        assertThat(rs.getString("ad_org_id"), equalTo(organizationId));
+        assertThat(rs.getString("ad_client_id"), equalTo(clientId));
+        assertThat(new OBNumber(rs.getBigDecimal("totallines")), equalTo(net));
+        assertThat(new OBNumber(rs.getBigDecimal("grandtotal")), equalTo(gross));
+        assertThat(rs.getString("em_obpos_app_cashup_id"), equalTo(cashupId));
+        assertThat(rs.getString("docstatus"), equalTo(status));
+      }
+    }.execute(c_order, 1);
+  }
+}
diff --git a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/Synchronized_I31892_VoidLayawayAndCashUp.java b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/Synchronized_I31892_VoidLayawayAndCashUp.java
new file mode 100644
--- /dev/null
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/Synchronized_I31892_VoidLayawayAndCashUp.java
@@ -0,0 +1,344 @@
+/*
+ *************************************************************************
+ * 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 JGA
+ *
+ */
+
+package org.openbravo.test.mobile.retail.pack.selenium.tests.system.synchronizedtransactions;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+import org.junit.Test;
+import org.openbravo.test.mobile.common.selenium.database.DatabaseHelperSelect;
+import org.openbravo.test.mobile.common.selenium.javascript.BackboneHelper;
+import org.openbravo.test.mobile.common.selenium.javascript.TestId;
+import org.openbravo.test.mobile.common.selenium.testhelpers.WebPOSSnippet;
+
+public class Synchronized_I31892_VoidLayawayAndCashUp extends BaseSynchronizedTransactionTest {
+  private String layawayDocumentNo;
+  private String salesDocumentNo;
+
+  @Test
+  public void test() {
+    WebPOSSnippet.cleanCashup(this);
+
+    createSalesWithCard();
+
+    createLayaway();
+
+    partialyPaidLayaway();
+
+    voidLayawayWithOverpayment();
+
+    checkPaymentsBeforeCashup();
+
+    doCashup();
+
+    checkReconciliations();
+
+    setFinishedCorrectly();
+  }
+
+  private void checkReconciliations() {
+    String sql = String
+        .format(
+            "SELECT fft.status AS status, fft.paymentamt AS paymentamt, fft.depositamt AS depositamt, fft.fin_reconciliation_id AS reconciliation, co.documentNo AS documentNo "
+                + "FROM c_order co "
+                + "LEFT JOIN fin_finacc_transaction fft ON co.em_obpos_app_cashup_id = fft.em_obpos_app_cashup_id "
+                + "WHERE co.documentno in ('%s', '%s') "
+                + "AND co.em_obpos_applications_id = '%s' "
+                + "ORDER BY co.documentno, fft.paymentamt, fft.depositamt, fft.fin_reconciliation_id ",
+            layawayDocumentNo, salesDocumentNo, "12FA7864FBDE4FCC8D6E3891A936D61F");
+    new DatabaseHelperSelect() {
+      int recordNo = 1;
+
+      @Override
+      protected void yieldResultSet(ResultSet rs) throws SQLException {
+        final String status = rs.getString("status");
+        final Long paymentamt = rs.getLong("paymentamt");
+        final Long depositamt = rs.getLong("depositamt");
+        final String reconciliation = rs.getString("reconciliation");
+        final String documentNo = rs.getString("documentNo");
+        System.err.println(">>>>>>>>>>>");
+        System.err.println(status);
+        System.err.println(paymentamt);
+        System.err.println(depositamt);
+        System.err.println(reconciliation);
+        System.err.println(documentNo);
+        System.err.println(recordNo++);
+        if (true) {
+          return;
+        }
+        switch (recordNo) {
+        case 1:
+          assertEquals(salesDocumentNo, documentNo);
+          assertEquals(0.00, paymentamt, 0.1);
+          assertEquals(50.00, depositamt, 0.1);
+          assertNotNull(reconciliation);
+          assertEquals("RPPC", status);
+          break;
+        case 2:
+          assertEquals(salesDocumentNo, documentNo);
+          assertEquals(0.00, paymentamt, 0.1);
+          assertEquals(50.00, depositamt, 0.1);
+          assertEquals(null, reconciliation);
+          assertEquals("RDNC", status);
+          break;
+        case 3:
+          assertEquals(salesDocumentNo, documentNo);
+          assertEquals(0.00, paymentamt, 0.1);
+          assertEquals(161.00, depositamt, 0.1);
+          assertEquals(null, reconciliation);
+          assertEquals("RDNC", status);
+          break;
+        case 4:
+          assertEquals(salesDocumentNo, documentNo);
+          assertEquals(0.00, paymentamt, 0.1);
+          assertEquals(221.00, depositamt, 0.1);
+          assertNotNull(reconciliation);
+          assertEquals("RPPC", status);
+          break;
+        case 5:
+          assertEquals(salesDocumentNo, documentNo);
+          assertEquals(50.00, paymentamt, 0.1);
+          assertEquals(0.00, depositamt, 0.1);
+          assertNotNull(reconciliation);
+          assertEquals("RPPC", status);
+          break;
+        case 6:
+          assertEquals(salesDocumentNo, documentNo);
+          assertEquals(60.00, paymentamt, 0.1);
+          assertEquals(0.00, depositamt, 0.1);
+          assertNotNull(reconciliation);
+          assertEquals("RPPC", status);
+          break;
+        case 7:
+          assertEquals(salesDocumentNo, documentNo);
+          assertEquals(161.00, paymentamt, 0.1);
+          assertEquals(0.00, depositamt, 0.1);
+          assertNotNull(reconciliation);
+          assertEquals("RPPC", status);
+          break;
+        case 8:
+          assertEquals(layawayDocumentNo, documentNo);
+          assertEquals(0.00, paymentamt, 0.1);
+          assertEquals(50.00, depositamt, 0.1);
+          assertNotNull(reconciliation);
+          assertEquals("RPPC", status);
+          break;
+        case 9:
+          assertEquals(layawayDocumentNo, documentNo);
+          assertEquals(0.00, paymentamt, 0.1);
+          assertEquals(50.00, depositamt, 0.1);
+          assertEquals(null, reconciliation);
+          assertEquals("RDNC", status);
+          break;
+        case 10:
+          assertEquals(layawayDocumentNo, documentNo);
+          assertEquals(0.00, paymentamt, 0.1);
+          assertEquals(161.00, depositamt, 0.1);
+          assertEquals(null, reconciliation);
+          assertEquals("RDNC", status);
+          break;
+        case 11:
+          assertEquals(layawayDocumentNo, documentNo);
+          assertEquals(0.00, paymentamt, 0.1);
+          assertEquals(221.00, depositamt, 0.1);
+          assertNotNull(reconciliation);
+          assertEquals("RPPC", status);
+          break;
+        case 12:
+          assertEquals(layawayDocumentNo, documentNo);
+          assertEquals(50.00, paymentamt, 0.1);
+          assertEquals(0.00, depositamt, 0.1);
+          assertNotNull(reconciliation);
+          assertEquals("RPPC", status);
+          break;
+        case 13:
+          assertEquals(layawayDocumentNo, documentNo);
+          assertEquals(60.00, paymentamt, 0.1);
+          assertEquals(0.00, depositamt, 0.1);
+          assertNotNull(reconciliation);
+          assertEquals("RPPC", status);
+          break;
+        case 14:
+          assertEquals(layawayDocumentNo, documentNo);
+          assertEquals(161.00, paymentamt, 0.1);
+          assertEquals(0.00, depositamt, 0.1);
+          assertNotNull(reconciliation);
+          assertEquals("RPPC", status);
+          break;
+        }
+        recordNo++;
+      }
+    }.execute(sql, 14);
+
+  }
+
+  private void doCashup() {
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_CASHUP);
+    // Step 1 of 4
+    tap(TestId.BUTTON_CASHUP_COUNTCASH_50);
+    tap(TestId.BUTTON_CASHUP_NEXT);
+    // Step 2 of 4
+    tap(TestId.BUTTON_CASHUP_CARD_OK);
+    tap(TestId.BUTTON_CASHUP_CASHUSA_OK);
+    tap(TestId.BUTTON_CASHUP_VOUCHER_OK);
+    tap(TestId.BUTTON_CASHUP_NEXT);
+    // Step 3 of 4
+    tap(TestId.BUTTON_CASHUP_KEEPNOTHING);
+    tap(TestId.BUTTON_CASHUP_NEXT);
+    tap(TestId.BUTTON_CASHUP_KEEPNOTHING);
+    tap(TestId.BUTTON_CASHUP_NEXT);
+    tap(TestId.BUTTON_CASHUP_KEEPNOTHING);
+    tap(TestId.BUTTON_CASHUP_NEXT);
+    // Step 4 of 4
+    tap(TestId.BUTTON_CASHUP_POSTPRINTANDCLOSE);
+    verify(TestId.LABEL_POPUP_CONFIRMATION_TITLE, "The Cash Up process was completed successfully.");
+    tap(TestId.BUTTON_POPUP_OK);
+    verify(TestId.LABEL_TOTALTOPAY, "0.00");
+  }
+
+  private void checkPaymentsBeforeCashup() {
+    String sql = String
+        .format(
+            "SELECT fft.status AS status, fft.paymentamt AS paymentamt, fft.depositamt AS depositamt, fft.fin_reconciliation_id AS reconciliation, co.documentNo AS documentNo "
+                + "FROM c_order co "
+                + "LEFT JOIN fin_finacc_transaction fft ON co.em_obpos_app_cashup_id = fft.em_obpos_app_cashup_id "
+                + "WHERE co.documentno in ('%s', '%s') "
+                + "AND co.em_obpos_applications_id = '%s' "
+                + "ORDER BY co.documentno, fft.paymentamt, fft.depositamt, fft.fin_reconciliation_id",
+            layawayDocumentNo, salesDocumentNo, "12FA7864FBDE4FCC8D6E3891A936D61F");
+    new DatabaseHelperSelect() {
+      int recordNo = 1;
+
+      @Override
+      protected void yieldResultSet(ResultSet rs) throws SQLException {
+        final String status = rs.getString("status");
+        final Long paymentamt = rs.getLong("paymentamt");
+        final Long depositamt = rs.getLong("depositamt");
+        final String reconciliation = rs.getString("reconciliation");
+        final String documentNo = rs.getString("documentNo");
+        switch (recordNo) {
+        case 1:
+          assertEquals(salesDocumentNo, documentNo);
+          assertEquals(0.00, paymentamt, 0.1);
+          assertEquals(50.00, depositamt, 0.1);
+          assertEquals(null, reconciliation);
+          assertEquals("RDNC", status);
+          break;
+        case 2:
+          assertEquals(salesDocumentNo, documentNo);
+          assertEquals(0.00, paymentamt, 0.1);
+          assertEquals(221.00, depositamt, 0.1);
+          assertEquals(null, reconciliation);
+          assertEquals("RDNC", status);
+          break;
+        case 3:
+          assertEquals(salesDocumentNo, documentNo);
+          assertEquals(60.00, paymentamt, 0.1);
+          assertEquals(0.00, depositamt, 0.1);
+          assertEquals(null, reconciliation);
+          assertEquals("RDNC", status);
+          break;
+        case 4:
+          assertEquals(layawayDocumentNo, documentNo);
+          assertEquals(0.00, paymentamt, 0.1);
+          assertEquals(50.00, depositamt, 0.1);
+          assertEquals(null, reconciliation);
+          assertEquals("RDNC", status);
+          break;
+        case 5:
+          assertEquals(layawayDocumentNo, documentNo);
+          assertEquals(0.00, paymentamt, 0.1);
+          assertEquals(221.00, depositamt, 0.1);
+          assertEquals(null, reconciliation);
+          assertEquals("RDNC", status);
+          break;
+        case 6:
+          assertEquals(layawayDocumentNo, documentNo);
+          assertEquals(60.00, paymentamt, 0.1);
+          assertEquals(0.00, depositamt, 0.1);
+          assertEquals(null, reconciliation);
+          assertEquals("RDNC", status);
+          break;
+        }
+        recordNo++;
+      }
+    }.execute(sql, 6);
+  }
+
+  private void voidLayawayWithOverpayment() {
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_LAYAWAYS);
+    write(TestId.FIELD_SEARCH_RECEIPT, layawayDocumentNo);
+    tap(TestId.BUTTON_LAYAWAYS_SEARCH);
+    tap(TestId.BUTTON_LAYAWAYS_ROW1);
+    verify(TestId.LABEL_TOTALTOPAY, "150.50");
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_VOIDLAYAWAY);
+    verify(TestId.LABEL_RECEIPT_TYPE, "Void this Layaway");
+    tap(TestId.BUTTON_CARD);
+    write(TestId.INPUT_POINTOFSALE, "60");
+    tap(TestId.BUTTON_KEYPAD_ENTER);
+    tap(TestId.BUTTON_PAY_DONE);
+    verify(TestId.LABEL_POPUP_TITLE, "Overpayment");
+    tap(TestId.BUTTON_POPUP_OK);
+    verify(TestId.LABEL_TOTALTOPAY, "0.00");
+  }
+
+  private void partialyPaidLayaway() {
+    layawayDocumentNo = BackboneHelper.getDocumentNo();
+    tap(TestId.BUTTON_PAY);
+    tap(TestId.BUTTON_PAY_CASH_50);
+    verify(TestId.LABEL_RECEIPT_PAYMENT_ROW1_AMOUNT, "50.00");
+    isDisabled(TestId.BUTTON_LAYAWAY, false);
+    tap(TestId.BUTTON_LAYAWAY);
+    verify(TestId.LABEL_TOTALTOPAY, "0.00");
+  }
+
+  private void createLayaway() {
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_LAYAWAYTHISRECEIPT);
+    tap(TestId.BUTTON_BROWSE);
+    tap(TestId.BUTTON_CATEGORY_BESTSELLERS);
+    tap(TestId.BUTTON_PRODUCT_BESTSELLERS_AVALANCHETRANSCEIVER);
+    verify(TestId.LABEL_TOTALTOPAY, "150.50");
+  }
+
+  private void createSalesWithCard() {
+    tap(TestId.BUTTON_BROWSE);
+    tap(TestId.BUTTON_CATEGORY_BACKPACKSANDTRAVEL);
+    tap(TestId.BUTTON_PRODUCT_BACKPACKSANDTRAVEL_BABYCARRIER);
+    tap(TestId.BUTTON_PRODUCT_BACKPACKSANDTRAVEL_BABYCARRIER);
+    verify(TestId.LABEL_TOTALTOPAY, "221.00");
+    salesDocumentNo = BackboneHelper.getDocumentNo();
+    tap(TestId.BUTTON_PAY);
+    tap(TestId.BUTTON_PAYMENT_CARD);
+    tap(TestId.BUTTON_PAY_EXACT);
+    verify(TestId.LABEL_RECEIPT_PAYMENT_ROW1_AMOUNT, "221.00");
+    tap(TestId.BUTTON_PAY_DONE);
+    verify(TestId.LABEL_TOTALTOPAY, "0.00");
+  }
+}
diff --git a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/Synchronized_RejectQuotations.java b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/Synchronized_RejectQuotations.java
new file mode 100644
--- /dev/null
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/Synchronized_RejectQuotations.java
@@ -0,0 +1,116 @@
+/*
+ *************************************************************************
+ * 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 EBE
+ *
+ */
+
+package org.openbravo.test.mobile.retail.pack.selenium.tests.system.synchronizedtransactions;
+
+import static org.hamcrest.CoreMatchers.containsString;
+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.common.selenium.database.DatabaseHelperSelect;
+import org.openbravo.test.mobile.common.selenium.javascript.BackboneHelper;
+import org.openbravo.test.mobile.common.selenium.javascript.TestId;
+
+public class Synchronized_RejectQuotations extends BaseSynchronizedTransactionTest {
+
+  @Test
+  public void test() {
+    // create 2 quotations
+    createQuotation();
+    final String documentNo1 = BackboneHelper.getDocumentNo();
+    assertThat(documentNo1, containsString("QT"));
+    tap(TestId.BUTTON_DELETERECEIPT);
+    verify(TestId.LABEL_TOTALTOPAY, "0.00");
+
+    // reject quotation 1
+    loadQuotation(documentNo1);
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_REJECTQUOTATIONS);
+    TestId.SELECT_QUOTATIONS_REJECT_REASON.enyoNode().executeExtension(".setSelected(0)");
+    verify(TestId.SELECT_QUOTATIONS_REJECT_REASON_OPTION1, "BE8B7D78615D48BFBC27FF1F0C9789C7");
+    tap(TestId.BUTTON_QUOTATIONS_REJECT_OK);
+    verifyRejected(documentNo1, "REJECT_1");
+
+    createQuotation();
+    final String documentNo2 = BackboneHelper.getDocumentNo();
+    assertThat(documentNo2, containsString("QT"));
+    tap(TestId.BUTTON_DELETERECEIPT);
+    verify(TestId.LABEL_TOTALTOPAY, "0.00");
+
+    // reject quotation 2
+    loadQuotation(documentNo2);
+    logger.info("Reject quotation 2");
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_REJECTQUOTATIONS);
+    TestId.SELECT_QUOTATIONS_REJECT_REASON.enyoNode().executeExtension(".setSelected(1)");
+    verify(TestId.SELECT_QUOTATIONS_REJECT_REASON_OPTION2, "7B53AE732A31416E8879F5849F45F7DC");
+    tap(TestId.BUTTON_QUOTATIONS_REJECT_OK);
+    verifyRejected(documentNo2, "REJECT_2");
+    setFinishedCorrectly();
+  }
+
+  private void createQuotation() {
+    // create quotation
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_CREATEQUOTATION);
+
+    // add a product
+    tap(TestId.BUTTON_CATEGORY_BACKPACKSANDTRAVEL);
+    tap(TestId.BUTTON_PRODUCT_BACKPACKSANDTRAVEL_WHISTLE);
+    isDisabled(TestId.BUTTON_PAY, false);
+
+    // Tap pay
+    tap(TestId.BUTTON_PAY);
+
+    // Verify Label Under Evaluation
+    verify(TestId.LABEL_RECEIPT_TYPE, "Quotation - Under Evaluation");
+  }
+
+  private void loadQuotation(final String documentNo) {
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_QUOTATIONS);
+    write(TestId.FIELD_SEARCH_RECEIPT, documentNo);
+    tap(TestId.BUTTON_QUOTATIONS_SEARCH);
+    tap(TestId.BUTTON_QUOTATIONS_ROW1);
+  }
+
+  private void verifyRejected(final String documentNo, final String rejectReason) {
+    final String sql = "SELECT R.value" //
+        + " FROM C_Order C" //
+        + " LEFT JOIN C_Reject_Reason R ON C.c_reject_reason_id = R.c_reject_reason_id" //
+        + " WHERE C.documentno = '" + documentNo + "' AND C.docstatus = 'CJ'";
+    new DatabaseHelperSelect() {
+      @Override
+      protected void yieldResultSet(final ResultSet rs) throws SQLException {
+        logger.info("Verifying rejected quotation in the backend");
+        final String value = rs.getString("value");
+
+        assertThat(rejectReason, equalTo(value));
+      }
+    }.execute(sql, 1);
+
+  }
+}
diff --git a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/TestNonSynchronizedSale.java b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/TestNonSynchronizedSale.java
new file mode 100644
--- /dev/null
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/TestNonSynchronizedSale.java
@@ -0,0 +1,75 @@
+/*
+ *************************************************************************
+ * 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):  ______________________________________.
+ ************************************************************************
+ */
+
+package org.openbravo.test.mobile.retail.pack.selenium.tests.system.synchronizedtransactions;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import org.junit.Test;
+import org.openbravo.test.mobile.common.TestClassAnnotations;
+import org.openbravo.test.mobile.common.selenium.SeleniumHelper;
+import org.openbravo.test.mobile.common.selenium.database.DatabaseHelperInsertUpdateOrDelete;
+import org.openbravo.test.mobile.common.selenium.javascript.SynchronizationHelper;
+import org.openbravo.test.mobile.common.selenium.javascript.TestId;
+import org.openbravo.test.mobile.common.selenium.terminals.WebPOSTerminalHelper;
+
+@TestClassAnnotations(isHighVolumeCompatible = true)
+public class TestNonSynchronizedSale extends WebPOSTerminalHelper {
+
+  public void before() {
+    // delete any preference which maybe has been left over from before.
+    new DatabaseHelperInsertUpdateOrDelete("Remove existing OBMOBC_SynchronizedMode").execute(
+        "DELETE from AD_Preference WHERE ad_preference_id = 'D19D716CA32F486587FB5100F08D493D'",
+        DatabaseHelperInsertUpdateOrDelete.UNEXPECTED_AFFECTED_ROWS);
+    super.before();
+  }
+
+  @Test
+  // @TestAnnotations(waitFixOf = 31655)
+  public void test() {
+    final boolean inSynchronizedMode = (Boolean) SeleniumHelper
+        .executeScriptWithReturn("OB.MobileApp.model.get('permissions').OBMOBC_SynchronizedMode");
+
+    assertThat("Running in synchronize mode", inSynchronizedMode, equalTo(false));
+
+    final Long beforeTime2 = (Long) SeleniumHelper
+        .executeScriptWithReturn("OB.Data.showSynchronizedDialogChangeTime");
+    tap(TestId.BUTTON_SEARCH);
+    write(TestId.FIELD_SEARCH_TEXT, TestId.BUTTON_SEARCHPRODUCT_AVALANCHETRANSCEIVER.getRowName());
+    tap(TestId.BUTTON_SEARCH_EXECUTE);
+    verifyHgvolTime(TestId.BUTTON_SEARCH_EXECUTE, 10000);
+    tap(TestId.BUTTON_SEARCHPRODUCT_AVALANCHETRANSCEIVER);
+    verify(TestId.LABEL_TOTALTOPAY, "150.50");
+    tap(TestId.BUTTON_SEARCH);
+    write(TestId.FIELD_SEARCH_TEXT, TestId.BUTTON_SEARCHPRODUCT_INSECTREPELLENT.getRowName());
+    tap(TestId.BUTTON_SEARCH_EXECUTE);
+    verifyHgvolTime(TestId.BUTTON_SEARCH_EXECUTE, 10000);
+    tap(TestId.BUTTON_SEARCHPRODUCT_INSECTREPELLENT);
+    verify(TestId.LABEL_TOTALTOPAY, "165.00");
+    tap(TestId.BUTTON_PAY);
+    tap(TestId.BUTTON_PAY_EXACT);
+    tap(TestId.BUTTON_PAY_DONE);
+    verify(TestId.LABEL_TOTALTOPAY, "0.00");
+    SynchronizationHelper.waitUntiTheApplicationHasSynchronized();
+    final Long afterTime2 = (Long) SeleniumHelper
+        .executeScriptWithReturn("OB.Data.showSynchronizedDialogChangeTime");
+    assertThat("Transaction Dialog has appeared, it shouldn't", afterTime2, equalTo(beforeTime2));
+  }
+}
diff --git a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/TestSynchronizedSaleWithError.java b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/TestSynchronizedSaleWithError.java
new file mode 100644
--- /dev/null
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/TestSynchronizedSaleWithError.java
@@ -0,0 +1,91 @@
+/*
+ *************************************************************************
+ * 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):  ______________________________________.
+ ************************************************************************
+ */
+
+package org.openbravo.test.mobile.retail.pack.selenium.tests.system.synchronizedtransactions;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import org.junit.Test;
+import org.openbravo.test.mobile.common.TestClassAnnotations;
+import org.openbravo.test.mobile.common.selenium.SeleniumHelper;
+import org.openbravo.test.mobile.common.selenium.javascript.BackboneHelper;
+import org.openbravo.test.mobile.common.selenium.javascript.SynchronizationHelper;
+import org.openbravo.test.mobile.common.selenium.javascript.TestId;
+import org.openbravo.test.mobile.common.selenium.testhelpers.WebPOSSnippet;
+
+@TestClassAnnotations(isHighVolumeCompatible = true)
+public class TestSynchronizedSaleWithError extends BaseSynchronizedTransactionTest {
+
+  private String documentNo1;
+  private String documentNo2;
+
+  @Test
+  // @TestAnnotations(waitFixOf = 31655)
+  public void test() {
+    try {
+      WebPOSSnippet.cleanCashup(this);
+
+      documentNo1 = BackboneHelper.getDocumentNo();
+
+      tap(TestId.BUTTON_SEARCH);
+      write(TestId.FIELD_SEARCH_TEXT, TestId.BUTTON_SEARCHPRODUCT_AVALANCHETRANSCEIVER.getRowName());
+      tap(TestId.BUTTON_SEARCH_EXECUTE);
+      verifyHgvolTime(TestId.BUTTON_SEARCH_EXECUTE, 10000);
+      tap(TestId.BUTTON_SEARCHPRODUCT_AVALANCHETRANSCEIVER);
+      verify(TestId.LABEL_TOTALTOPAY, "150.50");
+      tap(TestId.BUTTON_SEARCH);
+      write(TestId.FIELD_SEARCH_TEXT, TestId.BUTTON_SEARCHPRODUCT_INSECTREPELLENT.getRowName());
+      tap(TestId.BUTTON_SEARCH_EXECUTE);
+      verifyHgvolTime(TestId.BUTTON_SEARCH_EXECUTE, 10000);
+      tap(TestId.BUTTON_SEARCHPRODUCT_INSECTREPELLENT);
+      verify(TestId.LABEL_TOTALTOPAY, "165.00");
+      tap(TestId.BUTTON_PAY);
+      tap(TestId.BUTTON_PAY_EXACT);
+
+      // force an error in the order loader
+      SeleniumHelper.executeScript("OB.MobileApp.model.get('terminal').id=undefined");
+
+      tap(TestId.BUTTON_PAY_DONE);
+
+      verify(TestId.LABEL_TOTALTOPAY, "165.00");
+
+      documentNo2 = BackboneHelper.getDocumentNo();
+      assertThat("Document has been incremented", documentNo1, equalTo(documentNo2));
+
+      final Long currentCash = (Long) SeleniumHelper
+          .executeScriptWithReturn("OB.MobileApp.model.paymentnames['OBPOS_payment.cash'].currentCash");
+      assertThat("Current cash has been incremented, it shouldn't after an error", currentCash,
+          equalTo(new Long("0")));
+
+      final String linesInReceipt = BackboneHelper.getOrderAtributeValue("lines.length");
+      assertThat("There should be 2 lines in the receipt", linesInReceipt, equalTo("2"));
+
+      // delete the ticket, to clean it up
+      tap(TestId.BUTTON_DELETERECEIPT);
+      tap(TestId.BUTTON_DELETERECEIPT_CONFIRM);
+
+      SynchronizationHelper.waitUntiTheApplicationHasSynchronized();
+      setFinishedCorrectly();
+    } catch (Throwable e) {
+      e.printStackTrace(System.err);
+      throw new RuntimeException(e);
+    }
+  }
+}
diff --git a/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/TestSynchronizedTransaction.java b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/TestSynchronizedTransaction.java
new file mode 100644
--- /dev/null
+++ b/src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/synchronizedtransactions/TestSynchronizedTransaction.java
@@ -0,0 +1,338 @@
+/*
+ *************************************************************************
+ * 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):  ______________________________________.
+ ************************************************************************
+ */
+
+package org.openbravo.test.mobile.retail.pack.selenium.tests.system.synchronizedtransactions;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.closeTo;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.text.NumberFormat;
+import java.util.Locale;
+import java.util.Random;
+
+import org.junit.Test;
+import org.openbravo.test.mobile.common.TestClassAnnotations;
+import org.openbravo.test.mobile.common.selenium.database.ConnectionHelper;
+import org.openbravo.test.mobile.common.selenium.database.DatabaseHelperSelect;
+import org.openbravo.test.mobile.common.selenium.database.WebPOSDatabaseConstants;
+import org.openbravo.test.mobile.common.selenium.database.WebPOSDatabaseHelper;
+import org.openbravo.test.mobile.common.selenium.javascript.BackboneHelper;
+import org.openbravo.test.mobile.common.selenium.javascript.SynchronizationHelper;
+import org.openbravo.test.mobile.common.selenium.javascript.TestId;
+import org.openbravo.test.mobile.common.selenium.testhelpers.WebPOSSnippet;
+
+@TestClassAnnotations(isHighVolumeCompatible = true)
+public class TestSynchronizedTransaction extends BaseSynchronizedTransactionTest {
+
+  @Test
+  // @TestAnnotations(waitFixOf = 31655)
+  public void testSale() {
+    WebPOSSnippet.cleanCashup(this);
+
+    tap(TestId.BUTTON_DELETERECEIPT);
+    tap(TestId.BUTTON_DELETERECEIPT_CONFIRM);
+
+    tap(TestId.BUTTON_SEARCH);
+    write(TestId.FIELD_SEARCH_TEXT, TestId.BUTTON_SEARCHPRODUCT_AVALANCHETRANSCEIVER.getRowName());
+    tap(TestId.BUTTON_SEARCH_EXECUTE);
+    verifyHgvolTime(TestId.BUTTON_SEARCH_EXECUTE, 10000);
+    tap(TestId.BUTTON_SEARCHPRODUCT_AVALANCHETRANSCEIVER);
+    verify(TestId.LABEL_TOTALTOPAY, "150.50");
+    tap(TestId.BUTTON_SEARCH);
+    write(TestId.FIELD_SEARCH_TEXT, TestId.BUTTON_SEARCHPRODUCT_INSECTREPELLENT.getRowName());
+    tap(TestId.BUTTON_SEARCH_EXECUTE);
+    verifyHgvolTime(TestId.BUTTON_SEARCH_EXECUTE, 10000);
+    tap(TestId.BUTTON_SEARCHPRODUCT_INSECTREPELLENT);
+    verify(TestId.LABEL_TOTALTOPAY, "165.00");
+    tap(TestId.BUTTON_PAY);
+    tap(TestId.BUTTON_PAY_EXACT);
+    tap(TestId.BUTTON_PAY_DONE);
+
+    waitForSynchronizationToReturn();
+
+    verify(TestId.LABEL_TOTALTOPAY, "0.00");
+    SynchronizationHelper.waitUntiTheApplicationHasSynchronized();
+    setFinishedCorrectly();
+  }
+
+  @Test
+  public void testCashup() {
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_CASHUP);
+
+    // step 1 of 4
+    verify(TestId.LABEL_CASHUP_STEP2_TITLE, "Step 1 of 4: Count Cash");
+    tap(TestId.BUTTON_CASHUP_NEXT);
+
+    // step 2 of 4
+    verify(TestId.LABEL_CASHUP_STEP3_TITLE, "Step 2 of 4: Count Cash");
+    tap(TestId.BUTTON_CASHUP_CARD_OK);
+    tap(TestId.BUTTON_CASHUP_CASHUSA_OK);
+    tap(TestId.BUTTON_CASHUP_VOUCHER_OK);
+    tap(TestId.BUTTON_CASHUP_NEXT);
+
+    // step 3 of 4
+    // cash
+    verify(TestId.LABEL_CASHUP_STEP4_TITLE, "Step 3 of 4: Select Cash to keep");
+    verify(TestId.LABEL_CASHUP_KEEPNOTHING, "Nothing");
+    tap(TestId.BUTTON_CASHUP_KEEPNOTHING);
+    tap(TestId.BUTTON_CASHUP_NEXT);
+    // usa cash
+    verify(TestId.LABEL_CASHUP_STEP4_TITLE, "Step 3 of 4: Select USA Cash to keep");
+    verify(TestId.LABEL_CASHUP_KEEPNOTHING, "Nothing");
+    tap(TestId.BUTTON_CASHUP_KEEPNOTHING);
+    tap(TestId.BUTTON_CASHUP_NEXT);
+    // voucher
+    verify(TestId.LABEL_CASHUP_STEP4_TITLE, "Step 3 of 4: Select Voucher to keep");
+    verify(TestId.LABEL_CASHUP_KEEPNOTHING, "Nothing");
+    tap(TestId.BUTTON_CASHUP_KEEPNOTHING);
+    tap(TestId.BUTTON_CASHUP_NEXT);
+
+    // step 4 of 4
+    verify(TestId.LABEL_CASHUP_STEP5_TITLE, "Step 4 of 4: Post, print and close");
+    verify(TestId.LABEL_CASHUP_POSTPRINTANDCLOSE, "Post, Print & Close");
+    tap(TestId.BUTTON_CASHUP_POSTPRINTANDCLOSE);
+
+    waitForSynchronizationToReturn();
+
+    // done
+    verify(TestId.LABEL_POPUP_TITLE, "Good job!");
+    tap(TestId.BUTTON_POPUP_OK);
+    verify(TestId.LABEL_TOTALTOPAY, "0.00");
+    setFinishedCorrectly();
+  }
+
+  @Test
+  public void testCashManagement() {
+    final int importCount = WebPOSDatabaseHelper.countProcessedImportEntries();
+
+    WebPOSSnippet.cleanCashup(this);
+
+    final Random random = new Random();
+    final int max = 200;
+    final int min = 50;
+    // one way to know if the transaction in the backend will be this one, its being sure that is
+    // the only one in the fin_finacc_transaction table
+    final int randomNumber = random.nextInt(max - min) + min;
+
+    tap(TestId.BUTTON_MENU);
+    tap(TestId.BUTTON_MENU_CASHMANAGEMENT);
+    verify(TestId.LABEL_CASHMANAGEMENT_TITLE, "Cash Management");
+    WebPOSSnippet.tapKeypad(this, randomNumber);
+    tap(TestId.BUTTON_CASHMANAGEMENT_CASHDEPOSIT);
+    verify(TestId.LABEL_SELECTDEPOSIT_BACOFFICEVBS, "Backoffice transfer to VBS");
+    tap(TestId.BUTTON_SELECTDEPOSIT_BACOFFICEVBS);
+    verify(TestId.LABEL_CASHMANAGEMENT_ROW1_AMOUNT,
+        String.format("%s.00", NumberFormat.getNumberInstance(Locale.US).format(randomNumber)));
+    verify(TestId.LABEL_CASHMANAGEMENT_ROW1_DESCRIPTION,
+        "Deposit: Cash - Backoffice transfer to VBS");
+    tap(TestId.BUTTON_CASHMANAGEMENT_DONE);
+    verify(TestId.LABEL_POPUP_TITLE, "Done");
+
+    waitForSynchronizationToReturn();
+
+    tap(TestId.BUTTON_POPUP_OK);
+    verify(TestId.LABEL_TOTALTOPAY, "0.00");
+
+    // verify that the two transcactions has been made to the backend
+    logger.info("Verifying that the backend has received the transaction (1/2). Amount = '"
+        + randomNumber + "'");
+    new DatabaseHelperSelect() {
+      @Override
+      protected void yieldResultSet(final ResultSet rs) throws SQLException {
+        final double paymentamt = rs.getDouble("paymentamt");
+        final double depositamt = rs.getDouble("depositamt");
+        assertThat("Cash deposit transaction was not found in the backend", paymentamt,
+            closeTo(randomNumber, 10));
+        assertThat("Cash deposit transaction was not found in the backend", depositamt,
+            closeTo(0, 10));
+      }
+    }.execute(
+        ConnectionHelper.getTOP(
+            String
+                .format(
+                    "SELECT paymentamt, depositamt FROM fin_finacc_transaction where fin_financial_account_id='%s' AND description='Cash - Backoffice transfer to VBS' AND paymentamt=%s ORDER BY created DESC",
+                    WebPOSDatabaseConstants.VBS_CASHBOOK_BACKOFFICE_FIN_ACCOUNT_ID, randomNumber),
+            1), 1);
+
+    logger.info("Verifying that the backend has received the transaction (2/2). Amount = '"
+        + randomNumber + "'");
+    new DatabaseHelperSelect() {
+      @Override
+      protected void yieldResultSet(final ResultSet rs) throws SQLException {
+        final double paymentamt = rs.getDouble("paymentamt");
+        final double depositamt = rs.getDouble("depositamt");
+        assertThat("Cash deposit transaction was not found in the backend", paymentamt,
+            closeTo(0, 10));
+        assertThat("Cash deposit transaction was not found in the backend", depositamt,
+            closeTo(randomNumber, 10));
+      }
+    }.execute(
+        ConnectionHelper.getTOP(
+            String
+                .format(
+                    "SELECT paymentamt, depositamt FROM fin_finacc_transaction where fin_financial_account_id='%s' AND description='Cash - Backoffice transfer to VBS' AND depositamt=%s ORDER BY created DESC",
+                    WebPOSDatabaseConstants.VBS1001_CASHBOOK_STORE_CASH_FIN_ACCOUNT_ID,
+                    randomNumber), 1), 1);
+
+    WebPOSDatabaseHelper.verifyProcessedImportEntries(importCount + 6);
+    setFinishedCorrectly();
+  }
+
+  @Test
+  public void testCustomerCreationSimple() {
+    tap(TestId.BUTTON_RECEIPT_CUSTOMER);
+    tap(TestId.BUTTON_CUSTOMER_NEW);
+    write(TestId.FIELD_CUSTOMER_NAME, "John");
+    write(TestId.FIELD_CUSTOMER_LASTNAME, "Doe");
+    write(TestId.FIELD_CUSTOMER_ADDRES, "St Johns Wood road, 32");
+    tap(TestId.BUTTON_CUSTOMER_SAVE);
+
+    waitForSynchronizationToReturn();
+
+    tap(TestId.BUTTON_CUSTOMER_ASSIGNTOCUSTOMER);
+    setFinishedCorrectly();
+  }
+
+  @Test
+  public void testCustomerCreationComplex() {
+    // https://issues.openbravo.com/view.php?id=31206
+    for (int i = 0; i < 5; i++) {
+      final String customerName = "John" + System.currentTimeMillis();
+      final String lastName = "Doe";
+      final String addressName = "My Address " + System.currentTimeMillis();
+      tap(TestId.BUTTON_RECEIPT_CUSTOMER);
+      tap(TestId.BUTTON_CUSTOMER_NEW);
+      write(TestId.FIELD_CUSTOMER_NAME, customerName);
+      write(TestId.FIELD_CUSTOMER_LASTNAME, lastName);
+      write(TestId.FIELD_CUSTOMER_ADDRES, addressName);
+      tap(TestId.BUTTON_CUSTOMER_SAVE);
+
+      waitForSynchronizationToReturn();
+
+      tap(TestId.BUTTON_CUSTOMER_ASSIGNTOCUSTOMER);
+    }
+
+    final String customerName = "John" + System.currentTimeMillis();
+    final String lastName = "Doe";
+    final String expectedBPName = customerName + " " + lastName;
+    final String addressName = "My Address " + System.currentTimeMillis();
+    tap(TestId.BUTTON_RECEIPT_CUSTOMER);
+    tap(TestId.BUTTON_CUSTOMER_NEW);
+    write(TestId.FIELD_CUSTOMER_NAME, customerName);
+    write(TestId.FIELD_CUSTOMER_LASTNAME, lastName);
+    write(TestId.FIELD_CUSTOMER_ADDRES, addressName);
+    tap(TestId.BUTTON_CUSTOMER_SAVE);
+
+    waitForSynchronizationToReturn();
+
+    tap(TestId.BUTTON_CUSTOMER_ASSIGNTOCUSTOMER);
+
+    tap(TestId.BUTTON_SEARCH);
+    write(TestId.FIELD_SEARCH_TEXT, TestId.BUTTON_SEARCHPRODUCT_ADHESIVEBODYWARNMERS.getRowName());
+    tap(TestId.BUTTON_SEARCH_EXECUTE);
+    verifyHgvolTime(TestId.BUTTON_SEARCH_EXECUTE, 10000);
+    tap(TestId.BUTTON_SEARCHPRODUCT_ADHESIVEBODYWARNMERS);
+
+    verify(TestId.LABEL_TOTALTOPAY, "3.60");
+    tap(TestId.BUTTON_SCAN);
+    // 'Basecamp lantern' 772EE3421FE84D768A674840C2EB855B
+    write(TestId.INPUT_POINTOFSALE, "0000001688191");
+    tap(TestId.BUTTON_KEYPAD_ENTER);
+    verify(TestId.LABEL_TOTALTOPAY, "59.10");
+
+    final String receiptNo = BackboneHelper.getDocumentNo();
+    tap(TestId.BUTTON_PAY);
+    tap(TestId.BUTTON_PAY_EXACT);
+    tap(TestId.BUTTON_PAY_DONE);
+
+    waitForSynchronizationToReturn();
+
+    verify(TestId.LABEL_TOTALTOPAY, "0.00");
+
+    // check bp
+    final String bpSql = "SELECT name FROM c_bpartner WHERE c_bpartner_id IN (SELECT c_bpartner_id FROM c_order WHERE documentno = '"
+        + receiptNo + "')";
+    new DatabaseHelperSelect() {
+
+      @Override
+      protected void yieldResultSet(final ResultSet rs) throws SQLException {
+        final String foundName = rs.getString("name");
+
+        logger.info(String.format("Verifying that the database record %s is the expected %s",
+            foundName, customerName));
+        assertThat("The bp name is not the expected", foundName, equalTo(expectedBPName));
+      }
+    }.execute(bpSql, 1);
+
+    // check address
+    final String bpLocationSql = "SELECT name FROM c_bpartner_location WHERE c_bpartner_location_id IN (SELECT c_bpartner_location_id FROM c_order WHERE documentno = '"
+        + receiptNo + "')";
+    new DatabaseHelperSelect() {
+
+      @Override
+      protected void yieldResultSet(final ResultSet rs) throws SQLException {
+        final String foundName = rs.getString("name");
+
+        logger.info(String.format("Verifying that the database record %s is the expected %s",
+            foundName, customerName));
+        assertThat("The address name is not the expected", foundName, equalTo(addressName));
+      }
+    }.execute(bpLocationSql, 1);
+
+    // check products
+    final String sql = "SELECT m_product_id, name FROM m_product WHERE m_product_id IN (SELECT m_product_id FROM c_orderline WHERE c_order_id IN (SELECT c_order_id FROM c_order WHERE documentno = '"
+        + receiptNo + "')) ORDER BY name";
+    new DatabaseHelperSelect() {
+      int count = 0;
+
+      @Override
+      protected void yieldResultSet(final ResultSet rs) throws SQLException {
+        count++;
+        final String productId = rs.getString("m_product_id");
+        final String productName = rs.getString("name");
+
+        logger.info(String.format(
+            "Verifying that the database record (%s) '%s' is one of the expected", productId,
+            productName));
+        switch (count) {
+        case 1:
+          assertThat("The product name is not one of the expected", productName,
+              equalTo("Adhesive body warmers"));
+          assertThat("The 'productId' is not one of the expected", productId,
+              equalTo("AC79520FEB4743B3AAA379BF70B9B7DA"));
+          break;
+        case 2:
+          assertThat("The product name is not one of the expected", productName,
+              equalTo("Basecamp lantern"));
+          assertThat("The 'productId' is not one of the expected", productId,
+              equalTo("772EE3421FE84D768A674840C2EB855B"));
+          break;
+        default:
+          throw new IllegalArgumentException("The returned resulset is missing the assertions");
+        }
+      }
+    }.execute(sql, 2);
+    setFinishedCorrectly();
+  }
+
+}
