Explorar o código

161010
fix: upload offline wishlist issue caused by time error.
Add: unlock function.
Add: sync will check current account & offline account.

Ray Zhang %!s(int64=9) %!d(string=hai) anos
pai
achega
8b0910a927

BIN=BIN
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/Ray.xcuserdatad/UserInterfaceState.xcuserstate


+ 35 - 19
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/Ray.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -627,27 +627,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "common/data_provider/iSalesDB.m"
-            timestampString = "497696089.532886"
+            timestampString = "497770983.031467"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "775"
-            endingLineNumber = "775"
-            landmarkName = "+initializeDb"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "No"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "common/data_provider/iSalesDB.m"
-            timestampString = "497696089.532886"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "859"
-            endingLineNumber = "859"
+            startingLineNumber = "865"
+            endingLineNumber = "865"
             landmarkName = "+execSql:db:"
             landmarkType = "7">
          </BreakpointContent>
@@ -732,5 +716,37 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/data_provider/iSalesDB.m"
+            timestampString = "497770983.031467"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "778"
+            endingLineNumber = "778"
+            landmarkName = "+initializeDb"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/data_provider/iSalesDB.m"
+            timestampString = "497770983.031467"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "801"
+            endingLineNumber = "801"
+            landmarkName = "+initializeDb"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 1 - 1
RedAnt ERP Mobile/common/Functions/offline/OfflineSettingViewController.m

@@ -321,7 +321,7 @@
         NSString*  ver = [defaults stringForKey:@"OfflineVer"] ;
         
         
-        if(offline_user_iscurrent==0)
+        if(offline_user_iscurrent==0 && ver!=nil)
         {
             if(!self.bunlock)
             {

+ 12 - 6
RedAnt ERP Mobile/common/data_provider/iSalesDB.m

@@ -731,7 +731,7 @@ void decryptfield (sqlite3_context *context, int argc, sqlite3_value **argv) {
     NSString* create_cart_trigger=@"CREATE TRIGGER  if not exists offline_cart_insert after insert on offline_cart BEGIN select offline_dirty(); UPDATE offline_cart SET modify_time= datetime('now', 'localtime') WHERE _id=new._id;  END;CREATE TRIGGER  if not exists offline_cart_update after update on offline_cart BEGIN select offline_dirty(); UPDATE offline_cart SET modify_time= datetime('now', 'localtime') WHERE _id=new._id;  END;CREATE TRIGGER  if not exists offline_cart_delete after delete on offline_cart BEGIN select offline_dirty();  END;";
     
     
-    NSString* create_wishlist_trigger=@"CREATE TRIGGER  if not exists wishlist_insert after insert on wishlist BEGIN select offline_dirty();  UPDATE wishlist SET modify_time= datetime('now', 'localtime') WHERE _id=new._id;END;CREATE TRIGGER  if not exists wishlist_update after update on wishlist BEGIN select offline_dirty();  UPDATE wishlist SET modify_time= datetime('now', 'localtime'), is_ditry = 1 WHERE _id=new._id; END;CREATE TRIGGER if not exists wishlist_delete after DELETE ON wishlist BEGIN select offline_dirty(); END;";
+    NSString* create_wishlist_trigger=@"drop trigger if exists wishlist_insert;drop trigger if exists wishlist_update;drop trigger if exists wishlist_delete;CREATE TRIGGER  if not exists wishlist_insert after insert on wishlist BEGIN select offline_dirty();  UPDATE wishlist SET modify_time= datetime('now', 'localtime') WHERE _id=new._id;END;CREATE TRIGGER  if not exists wishlist_update after update on wishlist BEGIN select offline_dirty();  UPDATE wishlist SET modify_time= datetime('now', 'localtime'), is_dirty = 1 WHERE _id=new._id; END;CREATE TRIGGER if not exists wishlist_delete after DELETE ON wishlist BEGIN select offline_dirty(); END;";
     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     
     //if(appDelegate.offline_mode)
@@ -769,11 +769,7 @@ void decryptfield (sqlite3_context *context, int argc, sqlite3_value **argv) {
         [self execSql:create_bundle db:db];
         [self execSql:create_catalog db:db];
         [self execSql:create_errlog db:db];
-        [self execSql:create_order_trigger db:db];
-        [self execSql:create_contact_trigger db:db];
-        [self execSql:create_cart_trigger db:db];
-        [self execSql:create_wishlist_trigger db:db];
-        
+
         
         
         
@@ -806,6 +802,16 @@ void decryptfield (sqlite3_context *context, int argc, sqlite3_value **argv) {
     
     [self alterTable:@"offline_order" columns:@"modify_time TIMESTAMP" rename:NO db:db];
     [self alterTable:@"offline_order" columns:@"ship_via text" rename:NO db:db];
+    
+    
+    
+    
+    [self execSql:create_order_trigger db:db];
+    [self execSql:create_contact_trigger db:db];
+    [self execSql:create_cart_trigger db:db];
+    [self execSql:create_wishlist_trigger db:db];
+    
+    
 //    NSString *rename_model_to_product = @"alter model rename to product";
 //    [self execSql:rename_model_to_product db:db];
 //    

+ 2 - 2
RedAnt ERP Mobile/iSales-NPD/iSales-NPD-Info.plist

@@ -17,11 +17,11 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>1.5</string>
+	<string>1.51</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>161010</string>
+	<string>161011</string>
 	<key>LSRequiresIPhoneOS</key>
 	<true/>
 	<key>NSAppTransportSecurity</key>