# HG changeset patch
# User Adrián Romero <adrianromero@openbravo.com>
# Date 1444306024 -7200
#      Thu Oct 08 14:07:04 2015 +0200
# Node ID 7166f0794846719cf509568d46474675b60bee01
# Parent  5c5d1f2807a67b49f5540527deba7d466f85fa22
Fixes issue 0030979: The document sequence is inconsistent when there is more than 1 empty receipt opened
* Removing logic in synchronizeCurrentOrder() because with the new document no management is no longer needed

diff --git a/web/org.openbravo.retail.posterminal/js/model/order.js b/web/org.openbravo.retail.posterminal/js/model/order.js
--- a/web/org.openbravo.retail.posterminal/js/model/order.js
+++ b/web/org.openbravo.retail.posterminal/js/model/order.js
@@ -2862,19 +2862,9 @@
       }
     },
     synchronizeCurrentOrder: function () {
-      // If for whatever reason the maxSuffix is not the current order suffix (most likely, the server returning a higher docno value)
-      // 1. if there are current orders
-      // 2. and have no lines (no product added, etc)
-      // 3. if the order suffix is lower than the minNumbers
-      // 4. delete the orders
-      var orderlist = this;
-      if (orderlist && orderlist.models.length === 1 && orderlist.current) {
-        if (orderlist.current.get('lines') && orderlist.current.get('lines').length === 0) {
-          if (orderlist.current.get('documentnoSuffix') <= OB.MobileApp.model.documentnoThreshold || OB.MobileApp.model.documentnoThreshold === 0) {
-            orderlist.deleteCurrent(true);
-          }
-        }
-      }
+      // NOTE: No need to execute any business logic here 
+      // The new functionality of loading document no, makes this function obsolete.
+      // The function is not removed to avoid api changes
     }
 
   });
