Parcourir la source

npd mobile 1.99
Fix offline sync failure
Fix crash after offline order submission

Ray Zhang il y a 3 ans
Parent
commit
05096a8285

+ 2 - 2
RedAnt ERP Mobile/HMLG Scan Order.xcodeproj/project.pbxproj

@@ -2520,7 +2520,7 @@
 				CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = NO;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 52654;
+				CURRENT_PROJECT_VERSION = 52890;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -2569,7 +2569,7 @@
 				CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = NO;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 52654;
+				CURRENT_PROJECT_VERSION = 52890;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",

+ 1 - 1
RedAnt ERP Mobile/HMLG Scan Order.xcodeproj/xcuserdata/ruizhang.xcuserdatad/xcschemes/xcschememanagement.plist

@@ -7,7 +7,7 @@
 		<key>HMLG Scan Order.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>1</integer>
+			<integer>2</integer>
 		</dict>
 	</dict>
 </dict>

+ 8 - 8
RedAnt ERP Mobile/common/Functions/cart/CartViewController.m

@@ -851,14 +851,14 @@
         appDelegate=(AppDelegate*)[[UIApplication sharedApplication] delegate];
     });
 //    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
-#ifndef SCANNER_ORDER
+//#ifndef SCANNER_ORDER
     
     //扫码订单允许后建订单
     if (appDelegate.order_code == nil || appDelegate.order_code.length == 0) {
         [self clearContent];
         return;
     }
-#endif
+//#endif
     
     __weak typeof(self) weakself = self;
     dispatch_async(dispatch_get_main_queue(), ^{
@@ -901,7 +901,7 @@
                             
 #ifdef BUILD_CONTRAST
 
-                            weakself.orderdiscount = [cart_json[@"discount"] doubleValue];
+                            weakself.orderdiscount = [cart_json[@"order_discount"] doubleValue];
 #endif
       
                             
@@ -3218,10 +3218,10 @@
     
 #ifdef BUILD_CONTRAST
 
-//    if(self.orderdiscount==0)
-//        self.labelDiscount.text = @"N/A";
-//    else
-        self.labelDiscount.text = [NSString stringWithFormat:@"%.2f%% off",self.orderdiscount*100];
+    if(self.orderdiscount==0)
+        self.labelDiscount.text = @"None";
+    else
+        self.labelDiscount.text = [NSString stringWithFormat:@"%d%% off",(int)self.orderdiscount];
 #endif
     
     
@@ -3299,7 +3299,7 @@
     
 #ifdef BUILD_CONTRAST
 
-    self.total= self.total* (1-self.orderdiscount);
+    self.total= self.total* (1-(self.orderdiscount/100.0));
 #endif
     NSString* subtotal = [RAConvertor currencyNumber:self.total];//[NSString stringWithFormat:@"$%@",];
     NSString* subcuft = [NSString stringWithFormat:@"%.2f",self.total_cuft];

+ 7 - 0
RedAnt ERP Mobile/common/Functions/cart/OrderDiscountViewController.m

@@ -7,6 +7,7 @@
 //
 
 #import "OrderDiscountViewController.h"
+#import "RAUtils.h"
 #define NUMBERS @"0123456789\n"
 
 @interface OrderDiscountViewController ()
@@ -30,6 +31,12 @@
 }
 */
 - (IBAction)onUpdate:(id)sender {
+    
+    if([self.textfieldDiscount.text intValue]>100)
+    {
+        [RAUtils message_alert:@"Illegal input" title:@"Warrning" controller:self];
+        return;
+    }
     [self dismissViewControllerAnimated:NO
                              completion:^{
                                  if(self.onSetValue)

Fichier diff supprimé car celui-ci est trop grand
+ 5 - 1
RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m


+ 2 - 1
RedAnt ERP Mobile/common/data_provider/iSalesDB.m

@@ -701,7 +701,7 @@ void decryptfield (sqlite3_context *context, int argc, sqlite3_value **argv) {
     
     NSString* create_offline_login=@"CREATE TABLE IF NOT EXISTS offline_login ( _id INTEGER PRIMARY KEY, username VARCHAR(40),password VARCHAR(40), can_show_price integer ,can_see_price integer,contact_id VARCHAR(20),user_type integer,can_cancel_order integer,can_set_cart_price integer,can_create_portfolio integer, can_delete_order integer,can_submit_order integer,can_set_tearsheet_price integer,can_create_order integer, can_update_contact_info integer, mode VARCHAR(20), default_price text, price text, user_id integer,sales_code text,first_name text,last_name text);";
     
-    NSString* create_offline_order=@"CREATE TABLE IF NOT EXISTS offline_order ( _id INTEGER PRIMARY KEY,so_id text, order_id text ,status integer, submit_as integer,general_notes TEXT ,internal_notes text,sales_rep TEXT,create_by TEXT, total_price float, erpOrderStatus integer, logist text, lift_gate integer, logistic_note text, paymentType text, credit_card_first_name text, credit_card_last_name text, credit_card_address1 text, credit_card_address2 text, credit_card_zipcode text, credit_card_type text, credit_card_number text, credit_card_security_code text, credit_card_expiration_month text , credit_card_expiration_year text,credit_card_city text, credit_card_state text,customer_cid text,customer_contact text,customer_email text,customer_phone text,customer_fax text,receive_cid text,receive_name text,receive_ext text,receive_contact text, receive_phone text,receive_fax text,receive_email text,sender_cid text,sender_name text,sender_ext text,sender_contact text, sender_phone text,sender_fax text,sender_email text,shipping_billto_cid text,shipping_billto_name text,shipping_billto_ext text,shipping_billto_contact text, shipping_billto_phone text,shipping_billto_fax text,shipping_billto_email text,billing_cid text,billing_name text,billing_ext text,billing_contact text, billing_phone text,billing_fax text,billing_email text,returnto_cid text,returnto_name text,returnto_ext text,returnto_contact text, returnto_phone text,returnto_fax text,returnto_email text, must_call int,poNumber text,comments text,comments_ext text,paymentsAndCredits float,shipping float,lift_gate_value float,handling_fee_value float,sign_picpath text,sync_data text,ship_via text,create_time TIMESTAMP default (datetime('now', 'localtime')),modify_time TIMESTAMP default (datetime('now', 'localtime')),schedule_date TIMESTAMP,vendor_no char,warehouse_name char,terms char,etd TIMESTAMP,carrier char ,sales_terms char,port_destination char);";
+    NSString* create_offline_order=@"CREATE TABLE IF NOT EXISTS offline_order ( _id INTEGER PRIMARY KEY,so_id text, order_id text ,status integer, submit_as integer,general_notes TEXT ,internal_notes text,sales_rep TEXT,create_by TEXT, total_price float, erpOrderStatus integer, logist text, lift_gate integer, logistic_note text, paymentType text, credit_card_first_name text, credit_card_last_name text, credit_card_address1 text, credit_card_address2 text, credit_card_zipcode text, credit_card_type text, credit_card_number text, credit_card_security_code text, credit_card_expiration_month text , credit_card_expiration_year text,credit_card_city text, credit_card_state text,customer_cid text,customer_contact text,customer_email text,customer_phone text,customer_fax text,receive_cid text,receive_name text,receive_ext text,receive_contact text, receive_phone text,receive_fax text,receive_email text,sender_cid text,sender_name text,sender_ext text,sender_contact text, sender_phone text,sender_fax text,sender_email text,shipping_billto_cid text,shipping_billto_name text,shipping_billto_ext text,shipping_billto_contact text, shipping_billto_phone text,shipping_billto_fax text,shipping_billto_email text,billing_cid text,billing_name text,billing_ext text,billing_contact text, billing_phone text,billing_fax text,billing_email text,returnto_cid text,returnto_name text,returnto_ext text,returnto_contact text, returnto_phone text,returnto_fax text,returnto_email text, must_call int,poNumber text,comments text,comments_ext text,paymentsAndCredits float,shipping float,lift_gate_value float,handling_fee_value float,sign_picpath text,sync_data text,ship_via text,create_time TIMESTAMP default (datetime('now', 'localtime')),modify_time TIMESTAMP default (datetime('now', 'localtime')),schedule_date TIMESTAMP,vendor_no char,warehouse_name char,terms char,etd TIMESTAMP,carrier char ,sales_terms char,port_destination char, discount float);";
     
     
     
@@ -832,6 +832,7 @@ void decryptfield (sqlite3_context *context, int argc, sqlite3_value **argv) {
     [self alterTable:@"offline_order" columns:@"modify_time TIMESTAMP;schedule_date TIMESTAMP" rename:NO db:db];
     [self alterTable:@"offline_order" columns:@"ship_via text" rename:NO db:db];
     [self alterTable:@"offline_order" columns:@"vendor_no char;warehouse_name  char;terms char;etd TIMESTAMP;carrier char;sales_terms char;port_destination char" rename:NO db:db];
+    [self alterTable:@"offline_order" columns:@"discount float" rename:NO db:db];
     
     [self alterTable:@"offline_cart" columns:@"client_reference char" rename:NO db:db];
     

+ 1 - 1
RedAnt ERP Mobile/iSales-CONTRAST.xcodeproj/xcuserdata/ruizhang.xcuserdatad/xcschemes/xcschememanagement.plist

@@ -7,7 +7,7 @@
 		<key>iSales-CONTRAST.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>3</integer>
+			<integer>1</integer>
 		</dict>
 		<key>iSales-USAI.xcscheme_^#shared#^_</key>
 		<dict>

+ 1 - 1
RedAnt ERP Mobile/iSales-CONTRAST/config.h

@@ -20,7 +20,7 @@
 #define RA_NOTIFICATION
 
 # ifdef DEBUG
-#define test_server
+
 # endif
 
 #define exception_switch 1

+ 4 - 4
RedAnt ERP Mobile/iSales-NPD.xcodeproj/project.pbxproj

@@ -2521,7 +2521,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 220316;
+				CURRENT_PROJECT_VERSION = 230309;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -2538,7 +2538,7 @@
 					"$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib",
 					"$(PROJECT_DIR)/GoogleAnalytics/GoogleAnalytics/Libraries",
 				);
-				MARKETING_VERSION = 1.98;
+				MARKETING_VERSION = 1.99;
 				OTHER_LDFLAGS = (
 					"$(inherited)",
 					"-ObjC",
@@ -2565,7 +2565,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 220316;
+				CURRENT_PROJECT_VERSION = 230309;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -2582,7 +2582,7 @@
 					"$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib",
 					"$(PROJECT_DIR)/GoogleAnalytics/GoogleAnalytics/Libraries",
 				);
-				MARKETING_VERSION = 1.98;
+				MARKETING_VERSION = 1.99;
 				OTHER_LDFLAGS = (
 					"$(inherited)",
 					"-ObjC",

+ 2 - 2
common/RAConvertor.h

@@ -23,7 +23,7 @@
 +(NSDictionary*) data2dict:(NSData*) data;
 +(NSDictionary*) string2dict:(NSString*) str;
 +(NSString*) dict2string:(id) dict;
-+(NSString*) currencyNumber:(float) num;
-+(NSString*) separateNumber:(float) num;
++(NSString*) currencyNumber:(double) num;
++(NSString*) separateNumber:(double) num;
 
 @end

+ 4 - 4
common/RAConvertor.m

@@ -119,7 +119,7 @@ begin:
     NSArray *array = [NSKeyedUnarchiver unarchiveObjectWithData:data];
     return array;
 }
-+(NSString*) separateNumber:(float) num
++(NSString*) separateNumber:(double) num
 {
     NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
     [formatter setNumberStyle:NSNumberFormatterDecimalStyle];
@@ -131,11 +131,11 @@ begin:
     [formatter setUsesGroupingSeparator:YES];
 
     
-    NSString *formattedString = [formatter stringFromNumber:[NSNumber numberWithFloat:num]];
+    NSString *formattedString = [formatter stringFromNumber:[NSNumber numberWithDouble:num]];
     return formattedString;
 }
 
-+(NSString*) currencyNumber:(float) num
++(NSString*) currencyNumber:(double) num
 {
     
     
@@ -151,7 +151,7 @@ begin:
     [formatter setUsesGroupingSeparator:YES];
 
     
-    NSString *formattedString = [formatter stringFromNumber:[NSNumber numberWithFloat:num]];
+    NSString *formattedString = [formatter stringFromNumber:[NSNumber numberWithDouble:num]];
     return formattedString;
     
 

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff