# HG changeset patch
# User Rafa Alonso <ral@openbravo.com>
# Date 1438683229 -7200
#      Tue Aug 04 12:13:49 2015 +0200
# Node ID c3cb2e06388ead65d96b9ab15c2c84463f84c396
# Parent  80a83ac322e88a300535e5ab9c90fe2eca0db210
Related to issue 30472: Correct order in the actions executed when the ticket is closed

diff -r 80a83ac322e8 -r c3cb2e06388e web/org.openbravo.retail.posterminal/js/data/dataordersave.js
--- a/web/org.openbravo.retail.posterminal/js/data/dataordersave.js	Mon Aug 03 21:00:51 2015 +0200
+++ b/web/org.openbravo.retail.posterminal/js/data/dataordersave.js	Tue Aug 04 12:13:49 2015 +0200
@@ -197,12 +197,13 @@
             OB.trace('Execution Sync process.');
 
             //If there are no elements in the hook, we can execute the callback asynchronusly with the synchronization process
-            OB.MobileApp.model.runSyncProcess(function () {
-              successCallback(model);
-            });
+            successCallback(model);
             if (eventParams && eventParams.callback) {
               eventParams.callback();
             }
+            OB.MobileApp.model.runSyncProcess(function () {
+              OB.debug("Ticket closed: runSyncProcess executed");
+            });
           }
         });
       });
