Prechádzať zdrojové kódy

HMLG scan order 1.36 release

fix setting UI does not refresh after user login
Fix crash cause by a system bug
Ray Zhang 3 rokov pred
rodič
commit
a69cea91d2

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

@@ -2546,7 +2546,7 @@
 				CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = NO;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 53288;
+				CURRENT_PROJECT_VERSION = 53305;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -2595,7 +2595,7 @@
 				CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = NO;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 53288;
+				CURRENT_PROJECT_VERSION = 53305;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",

+ 18 - 1
RedAnt ERP Mobile/HMLG Scan Order/ScanListCell.m

@@ -164,9 +164,26 @@
 //        self.labelPrice3.text = price_group[@"price_4"][@"display"];
 //    }
 //
+  
+#ifdef DEBUG
+    
+    NSLog([RAConvertor dict2string:modelJson]);
     
+#endif
+//    NSString* s=[RAConvertor dict2string:modelJson];
+//    @try {
+//
+////        NSLog( s);
+//
+//        NSLog([RAConvertor dict2string:modelJson]);
+//
+//    }
+//    @catch (NSException * e) {
+//       NSLog(@"Exception: %@", e);
+//        [RAUtils message_box:@"exception" message:[NSString stringWithFormat:@"%@ %@",e,modelJson] completion:nil];
+//    }
+
     
-    NSLog( [RAConvertor dict2string:modelJson]);
     
     NSString * port=_modelJson[@"port"];
     if(port.length==0)

+ 6 - 0
RedAnt ERP Mobile/HMLG Scan Order/ServerSettingViewController.m

@@ -225,6 +225,12 @@
 //
     
     self.labelStock.text = [RADataProvider queryStockUpdateTime];
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+
+    if(appDelegate.user==nil)
+        self.btnSetPriceGroup.hidden =true;
+    else
+        self.btnSetPriceGroup.hidden =false;
     
 }
 

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m


+ 2 - 1
RedAnt ERP Mobile/common/Functions/order/RAOrderEditorViewController.m

@@ -818,11 +818,12 @@ static const int totalPage = 3;
     if([name isEqualToString:@"shipping"]|| [name isEqualToString:@"handling_fee_value"]||[name isEqualToString:@"lift_gate_value"]||[name isEqualToString:@"tax_percentage"])
     {
         float shipping = [self getprice:@"shipping" section:indexPath.section];
+        float order_discount =[self getprice:@"order_discount" section:indexPath.section];
         float paymentsAndCredits = [self getprice:@"paymentsAndCredits" section:indexPath.section];
         float handling_fee_value = [self getprice:@"handling_fee_value" section:indexPath.section];
         float lift_gate =[self getprice:@"lift_gate_value" section:indexPath.section];
         float tax = [self getprice:@"tax_percentage" section:indexPath.section]/100.0*paymentsAndCredits;
-        float totalprice=shipping+paymentsAndCredits+handling_fee_value+lift_gate+tax;
+        float totalprice=shipping+paymentsAndCredits+handling_fee_value+lift_gate+tax-order_discount;
         
         section_json = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%ld",(long)indexPath.section ]] mutableCopy];
         int count=0;

+ 1 - 1
RedAnt ERP Mobile/common/Functions/sidemenu/LoginViewController.m

@@ -350,7 +350,7 @@
                     
         [ActiveViewController Notify:@"ScanOrderListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
                         
-        [ActiveViewController Notify:@"ScanSearchViewController,ScanHistoryViewController" Message:RA_NOTIFICATION_REFRESH_UI];
+        [ActiveViewController Notify:@"ScanSearchViewController,ScanHistoryViewController,ServerSettingViewController" Message:RA_NOTIFICATION_REFRESH_UI];
                     
 #endif
                         

+ 1 - 48
RedAnt ERP Mobile/common/data_provider/RADataProvider.m

@@ -471,42 +471,7 @@ NSDate * ddate =[dateFormatter dateFromString:@"2023-4-18"];
     NSString* str = [NSString stringWithContentsOfFile:templatefile encoding:NSUTF8StringEncoding error:nil];
     NSString * str3 = [AESCrypt AES128Decrypt:str key:@"usai2010"];
     NSMutableDictionary* of = [[RAConvertor string2dict:str3] mutableCopy];
-//    NSData *filedata = [NSData dataWithContentsOfFile:path];
-//    if(filedata == nil)
-//        return nil;
-//    NSError *error = nil;
-//    NSDictionary *string2dic = [NSJSONSerialization JSONObjectWithData: filedata
-//                                                               options: NSJSONReadingMutableContainers
-//                                                                 error: &error];
-    // DebugLog(@"%@",string2dic);
-    
-//    NSString* str =@"";
-//    NSMutableDictionary* item = [@{
-//        @"product_id": @"114",
-//        @"model": @"1420K-1EK*",
-//        @"description": @"Eastern King Platform Bed with Footboard Storage",
-//        @"dimension": @"82 x 91.5 x 59.5H",
-//        @"stockUom": @"1",
-//        @"unit_cuft": @"34.602",
-//        @"port": @"VIET",
-//        @"origin": @"VCGS",
-//        @"available": @"Apr",
-//        @"Fremont_DDP": @"289",
-//        @"Fremont_WHSE": @"429"
-//    } mutableCopy];
-//    NSMutableDictionary* of = [NSMutableDictionary new];
-//    for(int i=0;i<4000;i++)
-//    {
-//        item[@"product_id"]=[NSString stringWithFormat:@"pid_%d",i];
-//        of[[NSString stringWithFormat:@"model_%d",i]]=item;
-//    }
-//
-//    NSString* strof=[RAConvertor dict2string:of];
-//
-//
-//           NSString* str2 = [AESCrypt encrypt:strof password:@"usai2010"];
-//            NSString * str3 = [AESCrypt decrypt:str2 password:@"usai2010"];
-    
+
     
     NSArray* keysort=[self sortedDictionary:of];
     
@@ -517,18 +482,6 @@ NSDate * ddate =[dateFormatter dateFromString:@"2023-4-18"];
     appDelegate.scan_model = of;
     appDelegate.scan_model_key=keysort;
     
-//    NSString* templatefile1 = [unZipTo stringByAppendingPathComponent:@"price_name.json"];
-//    
-//    NSString* str1 = [NSString stringWithContentsOfFile:templatefile1 encoding:NSUTF8StringEncoding error:nil];
-//  
-//    NSMutableDictionary* pn = [[RAConvertor string2dict:str1] mutableCopy];
-//    
-//    appDelegate.price0_name=pn[@"price_0"];
-//    appDelegate.price1_name=pn[@"price_1"];
-//    appDelegate.price2_name=pn[@"price_2"];
-//    appDelegate.price3_name=pn[@"price_3"];
-    
-    
 }
 
 +(NSMutableDictionary*)all_price_group

+ 1 - 474
RedAnt ERP Mobile/common/data_provider/RANetwork.m

@@ -304,278 +304,7 @@ NSString *const ScreenCodeOfflineSync = @"Offline Sync Screen";
     [ERPUtils googleAnalyticsSendRequestString:url WithScreen:screenName Action:userAction Extra:extra];
 #endif
     return [self get_json:url parameters:params file:nil];
-    //    {
-    //    int retry = 0;
-    //
-    //    __block AppDelegate *appDelegate = nil;
-    //
-    //    dispatch_sync(dispatch_get_main_queue(), ^{
-    //        //some UI methods ej
-    //        appDelegate=(AppDelegate*)[[UIApplication sharedApplication] delegate];
-    //    });
-    //    if(appDelegate.user!=nil)
-    //        [params setValue:appDelegate.user forKey:@"user"];
-    //    if(appDelegate.password!=nil)
-    //        [params setValue:appDelegate.password forKey:@"password"];
-    //
-    //
-    //    if(appDelegate.ipad_perm!=nil)
-    //        [params setValue:appDelegate.ipad_perm forKey:@"ipad_perm"];
-    //
-    //    [params setValue:appDelegate.build forKey:@"app_ver"];
-    //
-    //    NSDictionary* infoDict =[[NSBundle mainBundle] infoDictionary];
-    //    NSString* short_version =[infoDict objectForKey:@"CFBundleShortVersionString"];
-    //    [params setValue:short_version forKey:@"app_short_ver"];
-    //
-    //    UIDevice * dev = [UIDevice currentDevice];
-    //    NSUUID* uuid =dev.identifierForVendor;
-    //#if TARGET_IPHONE_SIMULATOR//模拟器
-    //    [params setValue:@"simulator_uuid" forKey:@"idfv"];
-    //#elif TARGET_OS_IPHONE//真机
-    //    [params setValue:uuid.UUIDString forKey:@"idfv"];
-    //#endif
-    //
-    ////    NSString *screenName = [params valueForKey:kScreenName];
-    ////    NSString *userAction = [params valueForKey:kAction];
-    ////    NSMutableDictionary *extra = [[params valueForKey:kExtra] mutableCopy];
-    ////    if ([userAction isEqualToString:@"Login"]) {
-    ////        if (!extra) {
-    ////            extra = [NSMutableDictionary dictionary];
-    ////        }
-    ////        [extra setObject:[params objectForKey:@"user"] forKey:@"user"];
-    ////    }
-    //
-    //repeat:
-    //    {
-    //
-    //        //    return [self fake_json:url];
-    //
-    //        //    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-    //        //分界线的标识符
-    //        NSString *TWITTERFON_FORM_BOUNDARY = @"AaB03x";
-    //        //根据url初始化request
-    //        NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url]
-    //                                                               cachePolicy:NSURLRequestReloadIgnoringLocalCacheData
-    //                                                           timeoutInterval:JSON_TIMEOUT];
-    //        //分界线 --AaB03x
-    //        NSString *MPboundary=[[NSString alloc]initWithFormat:@"--%@",TWITTERFON_FORM_BOUNDARY];
-    //        //结束符 AaB03x--
-    //        NSString *endMPboundary=[[NSString alloc]initWithFormat:@"%@--",MPboundary];
-    //        //要上传的图片
-    //        //    UIImage *image=[params objectForKey:@"pic"];
-    //        //得到图片的data
-    //        //    NSData* data = UIImagePNGRepresentation(image);
-    //        //http body的字符串
-    //        NSMutableString *body=[[NSMutableString alloc]init];
-    //
-    //        //    NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
-    //        //     [params setValue:@"handset_login" forKey:@"action"];
-    //        //    [headers setValue:[NSString stringWithFormat:@"%d",dataLength] forKey:@"Content-Length"];
-    //
-    //        //    [params setValue:appDelegate.sessionid forKey:@"sessionid"];
-    //        //   [params setValue:password forKey:@"password"];
-    //        //    [params setValue:[NSString stringWithFormat:@"%d",ver]  forKey:@"auth_ver"];
-    //
-    //
-    //
-    //        //    [headers setValue:headQuerlString forKey:@"param"];
-    //
-    //        //参数的集合的所有key的集合
-    //        NSArray *keys= [params allKeys];
-    //        DebugLog(@"================parms==================");
-    //        //遍历keys
-    //        for(int i=0;i<[keys count];i++)
-    //        {
-    //            //得到当前key
-    //            NSString *key=[keys objectAtIndex:i];
-    //            //如果key不是pic,说明value是字符类型,比如name:Boris
-    //            if(![key isEqualToString:@"pic"])
-    //            {
-    //                //添加分界线,换行
-    //                [body appendFormat:@"%@\r\n",MPboundary];
-    //                //添加字段名称,换2行
-    //                [body appendFormat:@"Content-Disposition: form-data; name=\"%@\"\r\n\r\n",key];
-    //                //添加字段的值
-    //                [body appendFormat:@"%@\r\n",[params objectForKey:key]];
-    //                DebugLog(@"parameter: key=%@   value=%@",key,[params objectForKey:key]);
-    //            }
-    //        }
-    //        DebugLog(@"================parms==================");
-    //        ////添加分界线,换行
-    //        [body appendFormat:@"%@\r\n",MPboundary];
-    //        //声明pic字段,文件名为boris.png
-    //        [body appendFormat:@"Content-Disposition: form-data; name=\"pic\"; filename=\"boris.png\"\r\n"];
-    //        //声明上传文件的格式
-    //        [body appendFormat:@"Content-Type: image/png\r\n\r\n"];
-    //
-    //        //声明结束符:--AaB03x--
-    //        NSString *end=[[NSString alloc]initWithFormat:@"\r\n%@",endMPboundary];
-    //        //声明myRequestData,用来放入http body
-    //        NSMutableData *myRequestData=[NSMutableData data];
-    //        //将body字符串转化为UTF8格式的二进制
-    //        [myRequestData appendData:[body dataUsingEncoding:NSUTF8StringEncoding]];
-    //        //将image的data加入
-    //        //    [myRequestData appendData:data];
-    //        //加入结束符--AaB03x--
-    //        [myRequestData appendData:[end dataUsingEncoding:NSUTF8StringEncoding]];
-    //
-    //        //设置HTTPHeader中Content-Type的值
-    //        NSString *content=[[NSString alloc]initWithFormat:@"multipart/form-data; boundary=%@",TWITTERFON_FORM_BOUNDARY];
-    //        //设置HTTPHeader
-    //        [request setValue:content forHTTPHeaderField:@"Content-Type"];
-    //
-    //        // 关闭keep alive
-    //        [request setValue:@"close" forHTTPHeaderField:@"Connection"];
-    //        //设置Content-Length
-    //        [request setValue:[NSString stringWithFormat:@"%lu", (unsigned long)[myRequestData length]] forHTTPHeaderField:@"Content-Length"];
-    //        //设置http body
-    //        [request setHTTPBody:myRequestData];
-    //        //http method
-    //        [request setHTTPMethod:@"POST"];
-    //
-    //
-    //        NSHTTPURLResponse* urlResponse = nil;
-    //
-    //        NSError *error = nil;
-    //
-    //        NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&urlResponse error:&error];
-    //
-    //
-    //        DebugLog(@"url: %@",url);
-    //
-    //        DebugLog(@"response: %@",[NSHTTPURLResponse localizedStringForStatusCode:urlResponse.statusCode]);
-    //
-    //        if (responseData==nil) {
-    //
-    ////            DebugLog(@"response error:%@", [error localizedDescription]);
-    //
-    //
-    //            NSMutableDictionary* ret = [[NSMutableDictionary alloc] init];
-    //            //#define RESULT_FALSE 0
-    //            //#define RESULT_TRUE		 2
-    //            //#define RESULT_NET_ERROR			 -3
-    //            //#define RESULT_NET_NOTAVAILABLE		  -4
-    //            //#define RESULT_ERROR				 -5
-    //            //#define RESULT_LOCALFILE_ERROR			 -7
-    //            //#define RESULT_USERAUTH_ERROR			 -9
-    //            //#define RESULT_UPDATE_USERAUTH_ERROR	 -11
-    //            //#define RESULT_SESSION_EXPIRED			  -13
-    //            //#define RESULT_VER_LOW
-    //
-    //            //     NSString * moreinfo = error.description ;
-    //
-    //            NSString* err_msg = [error localizedDescription];
-    //
-    //
-    //            //-----------------retry 3 times for error code -1005------------------------
-    //            if(error.code==-1005&&retry<3)
-    //            {
-    //                retry++;
-    //                goto repeat;
-    //
-    //            }
-    //            //-----------------end retry 3 times for error code -1005------------------------
-    //
-    //            NSDictionary* error_json = [RAUtils error_dict:error];
-    //            [ret setObject:error_json forKey:@"err_obj"];
-    //            NSString* resp_msg= nil;
-    //
-    //            if(err_msg.length==0)
-    //            {
-    //                err_msg =[NSHTTPURLResponse localizedStringForStatusCode:urlResponse.statusCode];
-    //                resp_msg = err_msg;
-    //            }
-    //            [ret setValue:[NSString stringWithFormat:@"%d",RESULT_NET_ERROR] forKey:@"result"];
-    //            [ret setValue:err_msg forKey:@"err_msg"];
-    //            [ret setValue:resp_msg forKey:@"resp_msg"];
-    //            [ret setValue:[NSString stringWithFormat:@"%ld",(long)urlResponse.statusCode] forKey:@"resp_code"];
-    //
-    //
-    //            NSData *jsonData = [NSJSONSerialization dataWithJSONObject:ret
-    //                                                               options:0
-    //                                                                 error:nil];
-    //            if(![url isEqualToString:URL_ERR_LOG])
-    //            {
-    //                [RANetwork err_log:[RAUtils base64en:[RAConvertor dict2string:params]] result:[RAUtils base64en:[RAConvertor dict2string:ret]] module:url code:RESULT_NET_ERROR];
-    //            }
-    //#if defined(BUILD_NPD)// || defined(BUILD_USAI) || defined(BUILD_UWAVER)
-    //            [ERPUtils googleAnalyticsSendRequestString:url WithScreen:screenName Action:userAction Extra:extra];
-    //#endif
-    //            return jsonData;
-    //
-    //        }
-    //        else
-    //        {
-    //                        NSString* err_msg = [error localizedDescription];
-    //            NSMutableString *str = [[NSMutableString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
-    //
-    //            DebugLog(@"data string: %@",str);
-    //            NSError *error1 = nil;
-    //
-    //            NSMutableDictionary* jsobj = [[NSJSONSerialization JSONObjectWithData:responseData options:NSJSONReadingMutableContainers error:&error1] mutableCopy];
-    //
-    //            if(jsobj==nil)// 服务器返回不是json
-    //            {
-    //
-    //                jsobj=[[NSMutableDictionary alloc] init];
-    //                [jsobj setValue:@"1" forKey:@"result"];
-    //
-    //            }
-    //
-    //            int result=[[jsobj valueForKey:@"result"] intValue];
-    //            UIApplication * app = [UIApplication sharedApplication];
-    //            AppDelegate *appDelegate = (AppDelegate *)[app delegate];
-    //            NSString* mode =[jsobj valueForKey:@"mode"];
-    //            [appDelegate SetMode:mode];
-    //            switch (result) {
-    //                case 0:
-    //                    [jsobj setValue:MSG_USERAUTH_ERROR forKey:@"err_msg"];
-    //                    break;
-    //                case 1:
-    //                    [jsobj setValue:MSG_ERROR forKey:@"err_msg"];
-    //                    break;
-    //                case 2:
-    //                    [jsobj setValue:MSG_SUCCESS forKey:@"err_msg"];
-    //                    break;
-    //                case 8:
-    //                    [jsobj setValue:[jsobj valueForKey:@"msg"] forKey:@"err_msg"];
-    //                    break;
-    //                case 9:
-    //                    [jsobj setValue:[jsobj valueForKey:@"msg"] forKey:@"err_msg"];
-    //                    break;
-    //                case 99:
-    //                    [jsobj setValue:MSG_TIMEOUT forKey:@"err_msg"];
-    //                    break;
-    //                default:
-    //                    [jsobj setValue:MSG_ERROR forKey:@"err_msg"];
-    //                    break;
-    //            }
-    //
-    //
-    //            if([appDelegate.build intValue]< [[jsobj valueForKey:@"min_ver"]intValue])
-    //            {
-    //                [jsobj setValue:@"9" forKey:@"result"];
-    //                [jsobj setValue:MSG_VER_LOW forKey:@"err_msg"];
-    //            }
-    //
-    //            if(![url isEqualToString:URL_ERR_LOG]&&![url isEqualToString:URL_DOWNLOAD_OFFLINE]/*&&result!=-3*/&&result!=2&&result!=99)
-    //            {
-    //                [RANetwork err_log:[RAUtils base64en:[RAConvertor dict2string:params]] result:[RAUtils base64en:str] module:url code:result];
-    //            }
-    //            NSData *jsonData = [NSJSONSerialization dataWithJSONObject:jsobj
-    //                                                               options:0
-    //                                                                 error:nil];
-    //#if defined(BUILD_NPD) || defined(BUILD_USAI) || defined(BUILD_UWAVER)
-    //            [ERPUtils googleAnalyticsSendRequestString:url WithScreen:screenName Action:userAction Extra:extra];
-    //#endif
-    //            return jsonData;
-    //
-    //        }
-    //
-    //        return responseData;
-    //    }
-    //}
+
 }
 
 //+(NSDictionary*)request_Editor:(NSString*) sourceid editor:(NSString*)editor
@@ -1903,208 +1632,6 @@ NSString *const ScreenCodeOfflineSync = @"Offline Sync Screen";
     return jsobj;
     
 }
-//+(NSString*) create_portfolio:(NSMutableDictionary*)params
-//{
-//    __block AppDelegate *appDelegate = nil;
-//
-//    dispatch_sync(dispatch_get_main_queue(), ^{
-//        //some UI methods ej
-//        appDelegate=(AppDelegate*)[[UIApplication sharedApplication] delegate];
-//    });
-//        if(appDelegate.offline_mode)
-//        {
-//
-//
-//            NSData*json = [OLDataProvider offline_direct_save_TearSheet:params];
-//            if(json==nil)
-//                return nil;
-//            NSError *error=nil;
-//            NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
-//
-//            return jsobj[@"pdf_path"];
-//        }
-//        else
-//        {
-//            return nil;
-//        }
-//}
-//+(NSDictionary*)direct_save_TearSheet:(NSMutableDictionary*)params//(NSString*) request_url name:(NSString*)name delete:(NSString* )ids note:(NSString* )saveNote modelIds:(NSDictionary *)modelIds
-//{
-//    NSMutableDictionary* off_params = [params mutableCopy];;
-//
-//    params[@"off_params"]=[RAConvertor dict2string:off_params];;
-//    __block AppDelegate *appDelegate = nil;
-//
-//    dispatch_sync(dispatch_get_main_queue(), ^{
-//        //some UI methods ej
-//        appDelegate=(AppDelegate*)[[UIApplication sharedApplication] delegate];
-//    });
-//    if(appDelegate.user!=nil)
-//        [params setValue:appDelegate.user forKey:@"user"];
-//    if(appDelegate.contact_id!=nil)
-//        [params setValue:appDelegate.contact_id forKey:@"contactId"];
-//    if(appDelegate.password!=nil)
-//        [params setValue:appDelegate.password forKey:@"password"];
-//
-//    [params setObject:ScreenCodeCreatePortfolio forKey:kScreenName];
-//
-//    /*
-//     [params setValue:request_url forKey:@"pdfUrl"];
-//     [params setValue:name forKey:@"pdfName"];
-//     [params setValue:ids forKey:@"itemIds"];
-//     [params setValue:saveNote forKey:@"pdfNote"];
-//     [params setValue:[modelIds objectForKey:@"product_ids"] forKey:@"product_ids"];
-//     [params setValue:[modelIds objectForKey:@"item_ids"] forKey:@"item_ids"];
-//     [params setValue:[modelIds objectForKey:@"remove_item"] forKey:@"remove_item"];
-//     */
-//    NSData* json= nil;
-//
-//    if(appDelegate.offline_mode)
-//    {
-//        json = [OLDataProvider offline_direct_save_TearSheet:params];
-//    }
-//    else
-//    {
-//        if(![self IsNetworkAvailable])
-//            return [RAUtils error_json:RESULT_NET_NOTAVAILABLE err_msg:nil];
-//
-//        json=[self get_json:URL_REQUEST_DM parameters:params];
-//
-//        NSError *error=nil;
-//
-//        NSString * uuid= [[NSUUID UUID] UUIDString];
-//        params[@"resultSerial"]=uuid;
-//
-//        for(int i=0;i<150;i++)
-//        {
-//            //           NSMutableDictionary* result_params = [[NSMutableDictionary alloc]init];
-//            //            result_params[@"resultSerial"]=uuid;
-//            json=[self get_json:URL_REQUEST_DM parameters:params];
-//            if(json!=nil)
-//            {
-//
-//                NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
-//                if([jsobj[@"result"] intValue]==2)
-//                {
-//                    break;
-//                }
-//            }
-//            sleep(5);
-//        }
-//
-//    }
-//    if(json==nil)
-//        return nil;
-//    NSError *error=nil;
-//    NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
-//    return jsobj;
-//}
-//+(NSDictionary*)request_TearSheet:(NSMutableDictionary*)params//(NSString*) request_url
-//{
-//    //    NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
-//    __block AppDelegate *appDelegate = nil;
-//
-//    dispatch_sync(dispatch_get_main_queue(), ^{
-//        //some UI methods ej
-//        appDelegate=(AppDelegate*)[[UIApplication sharedApplication] delegate];
-//    });
-//    if(appDelegate.user!=nil)
-//        [params setValue:appDelegate.user forKey:@"user"];
-//    if(appDelegate.contact_id!=nil)
-//        [params setValue:appDelegate.contact_id forKey:@"contactId"];
-//    if(appDelegate.password!=nil)
-//        [params setValue:appDelegate.password forKey:@"password"];
-//
-//    [params setObject:ScreenCodeCreatePortfolio forKey:kScreenName];
-//
-//    //    [params setValue:request_url forKey:@"pdfUrl"];
-//    NSData* json= nil;
-//    if(appDelegate.offline_mode)
-//    {
-//        json= [OLDataProvider offline_request_tearsheet:params];
-//    }
-//    else
-//    {
-//        if(![self IsNetworkAvailable])
-//            return [RAUtils error_json:RESULT_NET_NOTAVAILABLE err_msg:nil];
-//
-//        NSError *error=nil;
-//
-//        NSString * uuid= [[NSUUID UUID] UUIDString];
-//        params[@"resultSerial"]=uuid;
-//
-//        for(int i=0;i<150;i++)
-//        {
-//            //           NSMutableDictionary* result_params = [[NSMutableDictionary alloc]init];
-//            //            result_params[@"resultSerial"]=uuid;
-//            json=[self get_json:URL_REQUEST_DM parameters:params];
-//            if(json!=nil)
-//            {
-//
-//                NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
-//                if([jsobj[@"result"] intValue]==2)
-//                {
-//                    break;
-//                }
-//            }
-//            sleep(5);
-//        }
-//    }
-//    if(json==nil)
-//        return nil;
-//    NSError *error=nil;
-//    NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
-//    return jsobj;
-//}
-//+(NSDictionary*)save_TearSheet:(NSMutableDictionary *)params//(NSString*) path name:(NSString*)name delete:(NSString* )ids note:(NSString*)note configureParams:(NSString *)configureParams modelIds:(NSDictionary *)modelIds
-//{
-//
-//
-//    NSMutableDictionary* off_params = [params mutableCopy];;
-//
-//    params[@"off_params"]=[RAConvertor dict2string:off_params];
-//    //  NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
-//    __block AppDelegate *appDelegate = nil;
-//
-//    dispatch_sync(dispatch_get_main_queue(), ^{
-//        //some UI methods ej
-//        appDelegate=(AppDelegate*)[[UIApplication sharedApplication] delegate];
-//    });
-//    if(appDelegate.user!=nil)
-//        [params setValue:appDelegate.user forKey:@"user"];
-//    if(appDelegate.contact_id!=nil)
-//        [params setValue:appDelegate.contact_id forKey:@"contactId"];
-//    if(appDelegate.password!=nil)
-//        [params setValue:appDelegate.password forKey:@"password"];
-//
-//    [params setObject:ScreenCodeCreatePortfolio forKey:kScreenName];
-//
-//    /*
-//     [params setValue:path forKey:@"pdfPath"];
-//     [params setValue:name forKey:@"pdfName"];
-//     [params setValue:note forKey:@"pdfNote"];
-//     [params setValue:ids forKey:@"itemIds"];
-//     [params setValue:configureParams forKey:@"configureParams"];
-//     [params setValue:[modelIds objectForKey:@"product_ids"] forKey:@"product_ids"];
-//     [params setValue:[modelIds objectForKey:@"item_ids"] forKey:@"item_ids"];
-//     [params setValue:[modelIds objectForKey:@"remove_item"] forKey:@"remove_item"];
-//     */
-//    NSData* json = nil;
-//    if(appDelegate.offline_mode)
-//    {
-//        json = [OLDataProvider offline_save_TearSheet:params];
-//    } else {
-//        if(![self IsNetworkAvailable])
-//            return [RAUtils error_json:RESULT_NET_NOTAVAILABLE err_msg:nil];
-//
-//        json=[self get_json:URL_SAVE_DM parameters:params];
-//    }
-//    if(json==nil)
-//        return nil;
-//    NSError *error=nil;
-//    NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
-//    return jsobj;
-//}
 +(NSDictionary*)err_log:(NSString*) up_params result:(NSString*)result module:(NSString*) module code:(int) code//device:(NSString*) device
 {
     return nil;

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

@@ -58,138 +58,138 @@
 #ifdef test_server
 
 //------------------- chen server-----------------------
-#define  URL_BACK_ORDER_PREVIEW  @"http://192.168.0.161:80/pjHmlg/isales/cartDeliveryBackOrderReview.htm"
-#define  URL_MOVE_TO_BACK_ORDER @"http://192.168.0.161:80/pjHmlg/isales/moveToBackOrder.htm"
+#define  URL_BACK_ORDER_PREVIEW  @"http://192.168.0.161:8083/pjHmlg2//isales/cartDeliveryBackOrderReview.htm"
+#define  URL_MOVE_TO_BACK_ORDER @"http://192.168.0.161:8083/pjHmlg2//isales/moveToBackOrder.htm"
 #define URL_PRIVACY @"https://uwa.united-us.net/site/isales_uwa/privacyPolicy.htm"
 
-#define  URL_UPDATE_AUTH  @"http://192.168.0.161:80/pjHmlg/isales/login.htm"
-#define  URL_LOGOUT  @"http://192.168.0.161:80/pjHmlg/isales/loginOut.htm"
-#define  URL_RETRIEVE_PASS  @"http://192.168.0.161:80/pjHmlg/isales/forgotPassword.htm"
+#define  URL_UPDATE_AUTH  @"http://192.168.0.161:8083/pjHmlg2//isales/login.htm"
+#define  URL_LOGOUT  @"http://192.168.0.161:8083/pjHmlg2//isales/loginOut.htm"
+#define  URL_RETRIEVE_PASS  @"http://192.168.0.161:8083/pjHmlg2//isales/forgotPassword.htm"
 
-#define  URL_REQUEST_CATMENU  @"http://192.168.0.161:80/pjHmlg/isales/menu.htm"
-#define  URL_LOAD_HOME  @"http://192.168.0.161:80/pjHmlg/isales/homePage.htm"
-#define  URL_CATEGORY @"http://192.168.0.161:80/pjHmlg/isales/distinctCategory.htm"
-#define  URL_SEARCH  @"http://192.168.0.161:80/pjHmlg/isales/search.htm"
-#define  URL_ITEM_SEARCH  @"http://192.168.0.161:80/pjHmlg/isales/itemSearch.htm"
-#define  URL_CATEGORY_LOADMORE  @"http://192.168.0.161:80/pjHmlg/isales/categoryMore.htm"
-#define  URL_CUSTOMER_ADV_SEARCH @"http://192.168.0.161:80/pjHmlg/isales/getContactAdvance.htm"
+#define  URL_REQUEST_CATMENU  @"http://192.168.0.161:8083/pjHmlg2//isales/menu.htm"
+#define  URL_LOAD_HOME  @"http://192.168.0.161:8083/pjHmlg2//isales/homePage.htm"
+#define  URL_CATEGORY @"http://192.168.0.161:8083/pjHmlg2//isales/distinctCategory.htm"
+#define  URL_SEARCH  @"http://192.168.0.161:8083/pjHmlg2//isales/search.htm"
+#define  URL_ITEM_SEARCH  @"http://192.168.0.161:8083/pjHmlg2//isales/itemSearch.htm"
+#define  URL_CATEGORY_LOADMORE  @"http://192.168.0.161:8083/pjHmlg2//isales/categoryMore.htm"
+#define  URL_CUSTOMER_ADV_SEARCH @"http://192.168.0.161:8083/pjHmlg2//isales/getContactAdvance.htm"
 
 
-#define  URL_ORDER_LIST  @"http://192.168.0.161:80/pjHmlg/isales/orderList.htm"
-#define  URL_ORDER_DETAIL  @"http://192.168.0.161:80/pjHmlg/isales/orderDetail.htm"
-#define URL_COMMIT_ORDER @"http://192.168.0.161:80/pjHmlg/isales/createOrder.htm"
-#define URL_COPY_ORDER @"http://192.168.0.161:80/pjHmlg/isales/copyOrder.htm"
-#define URL_SIGN_ORDER @"http://192.168.0.161:80/pjHmlg/isales/updateOrderSign.htm"
-#define URL_SAVE_ORDER @"http://192.168.0.161:80/pjHmlg/isales/saveOrder.htm"
-#define URL_UPDATE_ORDERCUSTOMER @"http://192.168.0.161:80/pjHmlg/isales/updateOrderCustomerInfo.htm"
-#define  URL_NEW_ORDER  @"http://192.168.0.161:80/pjHmlg/isales/createNewOrder.htm"
-#define  URL_OPEN_ORDER  @"http://192.168.0.161:80/pjHmlg/isales/openOrder.htm"
-#define  URL_RELEASE_ORDER  @"http://192.168.0.161:80/pjHmlg/isales/closeOrder.htm"
-#define  URL_DELETE_ORDER  @"http://192.168.0.161:80/pjHmlg/isales/deleteOrder.htm"
-#define  URL_CANCEL_ORDER  @"http://192.168.0.161:80/pjHmlg/isales/cancelOrder.htm"
+#define  URL_ORDER_LIST  @"http://192.168.0.161:8083/pjHmlg2//isales/orderList.htm"
+#define  URL_ORDER_DETAIL  @"http://192.168.0.161:8083/pjHmlg2//isales/orderDetail.htm"
+#define URL_COMMIT_ORDER @"http://192.168.0.161:8083/pjHmlg2//isales/createOrder.htm"
+#define URL_COPY_ORDER @"http://192.168.0.161:8083/pjHmlg2//isales/copyOrder.htm"
+#define URL_SIGN_ORDER @"http://192.168.0.161:8083/pjHmlg2//isales/updateOrderSign.htm"
+#define URL_SAVE_ORDER @"http://192.168.0.161:8083/pjHmlg2//isales/saveOrder.htm"
+#define URL_UPDATE_ORDERCUSTOMER @"http://192.168.0.161:8083/pjHmlg2//isales/updateOrderCustomerInfo.htm"
+#define  URL_NEW_ORDER  @"http://192.168.0.161:8083/pjHmlg2//isales/createNewOrder.htm"
+#define  URL_OPEN_ORDER  @"http://192.168.0.161:8083/pjHmlg2//isales/openOrder.htm"
+#define  URL_RELEASE_ORDER  @"http://192.168.0.161:8083/pjHmlg2//isales/closeOrder.htm"
+#define  URL_DELETE_ORDER  @"http://192.168.0.161:8083/pjHmlg2//isales/deleteOrder.htm"
+#define  URL_CANCEL_ORDER  @"http://192.168.0.161:8083/pjHmlg2//isales/cancelOrder.htm"
 
 
-#define  URL_CART_SET_PRICE  @"http://192.168.0.161:80/pjHmlg/isales/setPrice.htm"
-#define  URL_CART_ITEM_NOTES  @"http://192.168.0.161:80/pjHmlg/isales/setItemNotes.htm"
-#define  URL_CART_GENERAL_NOTES  @"http://192.168.0.161:80/pjHmlg/isales/updateGeneralNote.htm"
+#define  URL_CART_SET_PRICE  @"http://192.168.0.161:8083/pjHmlg2//isales/setPrice.htm"
+#define  URL_CART_ITEM_NOTES  @"http://192.168.0.161:8083/pjHmlg2//isales/setItemNotes.htm"
+#define  URL_CART_GENERAL_NOTES  @"http://192.168.0.161:8083/pjHmlg2//isales/updateGeneralNote.htm"
 
-#define  URL_CART_INCRESEMENT  @"http://192.168.0.161:80/pjHmlg/isales/increment.htm"
-#define  URL_CART  @"http://192.168.0.161:80/pjHmlg/isales/cartDtail.htm"
-#define  URL_CARTDELIVERY  @"http://192.168.0.161:80/pjHmlg/isales/cartDelivery.htm"
-#define  URL_ADD_TO_CART  @"http://192.168.0.161:80/pjHmlg/isales/addToCart.htm"
-#define  URL_CART_REMOVE  @"http://192.168.0.161:80/pjHmlg/isales/deleteToCart.htm"
-#define  URL_CART_CHECK  @"http://192.168.0.161:80/pjHmlg/isales/checkCartItem.htm"
-#define  URL_CART2WISH  @"http://192.168.0.161:80/pjHmlg/isales/cartRemoveToWishlist.htm"
-#define  URL_WISH2CART  @"http://192.168.0.161:80/pjHmlg/isales/wishlistRemoveToCart.htm"
+#define  URL_CART_INCRESEMENT  @"http://192.168.0.161:8083/pjHmlg2//isales/increment.htm"
+#define  URL_CART  @"http://192.168.0.161:8083/pjHmlg2//isales/cartDtail.htm"
+#define  URL_CARTDELIVERY  @"http://192.168.0.161:8083/pjHmlg2//isales/cartDelivery.htm"
+#define  URL_ADD_TO_CART  @"http://192.168.0.161:8083/pjHmlg2//isales/addToCart.htm"
+#define  URL_CART_REMOVE  @"http://192.168.0.161:8083/pjHmlg2//isales/deleteToCart.htm"
+#define  URL_CART_CHECK  @"http://192.168.0.161:8083/pjHmlg2//isales/checkCartItem.htm"
+#define  URL_CART2WISH  @"http://192.168.0.161:8083/pjHmlg2//isales/cartRemoveToWishlist.htm"
+#define  URL_WISH2CART  @"http://192.168.0.161:8083/pjHmlg2//isales/wishlistRemoveToCart.htm"
 
 
 
 
-#define  URL_CATEGORYADDALL  @"http://192.168.0.161:80/pjHmlg/isales/categoryAddAllTo.htm"
-#define  URL_SEARCHADDALL  @"http://192.168.0.161:80/pjHmlg/isales/searchAddAllTo.htm"
-#define  URL_ITEMSEARCHADDALL @"http://192.168.0.161:80/pjHmlg/isales/itemSearchAddAllTo.htm"
+#define  URL_CATEGORYADDALL  @"http://192.168.0.161:8083/pjHmlg2//isales/categoryAddAllTo.htm"
+#define  URL_SEARCHADDALL  @"http://192.168.0.161:8083/pjHmlg2//isales/searchAddAllTo.htm"
+#define  URL_ITEMSEARCHADDALL @"http://192.168.0.161:8083/pjHmlg2//isales/itemSearchAddAllTo.htm"
 
 
-#define  URL_ITEM_DETAIL  @"http://192.168.0.161:80/pjHmlg/isales/modelDetail.htm"
+#define  URL_ITEM_DETAIL  @"http://192.168.0.161:8083/pjHmlg2//isales/modelDetail.htm"
 
-#define  URL_ADD_TO_WATCHLIST  @"http://192.168.0.161:80/pjHmlg/isales/addToWishList.htm"
-#define  URL_WATCHLIST  @"http://192.168.0.161:80/pjHmlg/isales/wishList.htm"
-#define  URL_WATCHLIST_REMOVE  @"http://192.168.0.161:80/pjHmlg/isales/deleteToWishList.htm"
+#define  URL_ADD_TO_WATCHLIST  @"http://192.168.0.161:8083/pjHmlg2//isales/addToWishList.htm"
+#define  URL_WATCHLIST  @"http://192.168.0.161:8083/pjHmlg2//isales/wishList.htm"
+#define  URL_WATCHLIST_REMOVE  @"http://192.168.0.161:8083/pjHmlg2//isales/deleteToWishList.htm"
 
 
 
-#define  URL_ADD_TO_PORTFOLIO @"http://192.168.0.161:80/pjHmlg/isales/addToPortfolio.htm"
-#define  URL_PORTFOLIO_REMOVE  @"http://192.168.0.161:80/pjHmlg/isales/deleteToPortfolio.htm"
-#define  URL_PORTFOLIOLIST_REMOVE  @"http://192.168.0.161:80/pjHmlg/isales/deleteTearSheetPdf.htm"
-#define  URL_PORTFOLIO  @"http://192.168.0.161:80/pjHmlg/isales/portfolios.htm"
-#define  URL_PORTFOLIO_SET_PRICE  @"http://192.168.0.161:80/pjHmlg/isales/setTearSheetPrice.htm"
-#define  URL_DM_PARAMS @"http://192.168.0.161:80/pjHmlg/isales/selectTearSheetParam.htm"
-#define  URL_REQUEST_DM @"http://192.168.0.161:80/pjHmlg/isales/getTearSheetPdf.htm"
-#define  URL_SAVE_DM_DIRECT @"http://192.168.0.161:80/pjHmlg/isales/getTearSheetPdf.htm"
-#define  URL_SAVE_DM @"http://192.168.0.161:80/pjHmlg/isales/saveTearSheetPdf.htm"
-#define  URL_DM_LIST @"http://192.168.0.161:80/pjHmlg/isales/tearSheetPdfList.htm"
-//#define  URL_DM_SET_QTY @"http://192.168.0.161:80/pjHmlg/isales/setTearSheetAvailableQty.htm"
-#define  URL_REQUEST_MODEL_QTY @"http://192.168.0.161:80/pjHmlg/isales/getTearSheetAvailableQty.htm"
+#define  URL_ADD_TO_PORTFOLIO @"http://192.168.0.161:8083/pjHmlg2//isales/addToPortfolio.htm"
+#define  URL_PORTFOLIO_REMOVE  @"http://192.168.0.161:8083/pjHmlg2//isales/deleteToPortfolio.htm"
+#define  URL_PORTFOLIOLIST_REMOVE  @"http://192.168.0.161:8083/pjHmlg2//isales/deleteTearSheetPdf.htm"
+#define  URL_PORTFOLIO  @"http://192.168.0.161:8083/pjHmlg2//isales/portfolios.htm"
+#define  URL_PORTFOLIO_SET_PRICE  @"http://192.168.0.161:8083/pjHmlg2//isales/setTearSheetPrice.htm"
+#define  URL_DM_PARAMS @"http://192.168.0.161:8083/pjHmlg2//isales/selectTearSheetParam.htm"
+#define  URL_REQUEST_DM @"http://192.168.0.161:8083/pjHmlg2//isales/getTearSheetPdf.htm"
+#define  URL_SAVE_DM_DIRECT @"http://192.168.0.161:8083/pjHmlg2//isales/getTearSheetPdf.htm"
+#define  URL_SAVE_DM @"http://192.168.0.161:8083/pjHmlg2//isales/saveTearSheetPdf.htm"
+#define  URL_DM_LIST @"http://192.168.0.161:8083/pjHmlg2//isales/tearSheetPdfList.htm"
+//#define  URL_DM_SET_QTY @"http://192.168.0.161:8083/pjHmlg2//isales/setTearSheetAvailableQty.htm"
+#define  URL_REQUEST_MODEL_QTY @"http://192.168.0.161:8083/pjHmlg2//isales/getTearSheetAvailableQty.htm"
 
-#define  URL_CONTACT_LIST  @"http://192.168.0.161:80/pjHmlg/isales/getAllContact.htm"
-#define  URL_SHIPTO_LIST  @"http://192.168.0.161:80/pjHmlg/isales/getShipToContact.htm"
+#define  URL_CONTACT_LIST  @"http://192.168.0.161:8083/pjHmlg2//isales/getAllContact.htm"
+#define  URL_SHIPTO_LIST  @"http://192.168.0.161:8083/pjHmlg2//isales/getShipToContact.htm"
 
-#define  URL_ADDRESS_EDOTOR  @"http://192.168.0.161:80/pjHmlg/isales/getAddAddress.htm"
-#define  URL_ADDRESS_SAVE  @"http://192.168.0.161:80/pjHmlg/isales/saveAddress.htm"
+#define  URL_ADDRESS_EDOTOR  @"http://192.168.0.161:8083/pjHmlg2//isales/getAddAddress.htm"
+#define  URL_ADDRESS_SAVE  @"http://192.168.0.161:8083/pjHmlg2//isales/saveAddress.htm"
 
 
-#define  URL_CREDITCARD_EDOTOR  @"http://192.168.0.161:80/pjHmlg/isales/creditCard.htm"
-#define  URL_CREDITCARD_SAVE  @"http://192.168.0.161:80/pjHmlg/isales/saveAddress.htm"
+#define  URL_CREDITCARD_EDOTOR  @"http://192.168.0.161:8083/pjHmlg2//isales/creditCard.htm"
+#define  URL_CREDITCARD_SAVE  @"http://192.168.0.161:8083/pjHmlg2//isales/saveAddress.htm"
 
 
 
-#define  URL_CUSTOMER_INFO  @"http://192.168.0.161:80/pjHmlg/isales/getCustomerInfoByContact.htm"
-#define  URL_CUSTOMER_PENDINGORDER  @"http://192.168.0.161:80/pjHmlg/isales/hasPendingOrderByContact.htm"
-#define  URL_NEW_CUSTOMER  @"http://192.168.0.161:80/pjHmlg/isales/getAddCustomer.htm"
-#define  URL_EDIT_CUSTOMER  @"http://192.168.0.161:80/pjHmlg/isales/getUpdateCustomerInfoByContact.htm"
-#define  URL_CUSTOMER_SAVE  @"http://192.168.0.161:80/pjHmlg/isales/saveCustomer.htm"
-#define  URL_CUSTOMER_UPDATE  @"http://192.168.0.161:80/pjHmlg/isales/updateCustomer.htm"
-#define  URL_UPDATE_CUSTOMER_BCARD  @"http://192.168.0.161:80/pjHmlg/isales/updateCustomerBusiCard.htm"
+#define  URL_CUSTOMER_INFO  @"http://192.168.0.161:8083/pjHmlg2//isales/getCustomerInfoByContact.htm"
+#define  URL_CUSTOMER_PENDINGORDER  @"http://192.168.0.161:8083/pjHmlg2//isales/hasPendingOrderByContact.htm"
+#define  URL_NEW_CUSTOMER  @"http://192.168.0.161:8083/pjHmlg2//isales/getAddCustomer.htm"
+#define  URL_EDIT_CUSTOMER  @"http://192.168.0.161:8083/pjHmlg2//isales/getUpdateCustomerInfoByContact.htm"
+#define  URL_CUSTOMER_SAVE  @"http://192.168.0.161:8083/pjHmlg2//isales/saveCustomer.htm"
+#define  URL_CUSTOMER_UPDATE  @"http://192.168.0.161:8083/pjHmlg2//isales/updateCustomer.htm"
+#define  URL_UPDATE_CUSTOMER_BCARD  @"http://192.168.0.161:8083/pjHmlg2//isales/updateCustomerBusiCard.htm"
 
 #define URL_CHANGE_PASSWORD @""
 #define URL_SIGN_UP @""
 
-//#define  URL_ORDER_DISCOUNT  @"http://192.168.0.161:80/pjHmlg/isales/setOrderItemDiscount.htm"
-#define  URL_ORDER_DISCOUNT  @"http://192.168.0.161:80/pjHmlg/isales/setOrderDiscount.htm"
+//#define  URL_ORDER_DISCOUNT  @"http://192.168.0.161:8083/pjHmlg2//isales/setOrderItemDiscount.htm"
+#define  URL_ORDER_DISCOUNT  @"http://192.168.0.161:8083/pjHmlg2//isales/setOrderDiscount.htm"
 
-#define  URL_ERR_LOG  @"http://192.168.0.161:80/pjHmlg/isales/er_log.htm"
+#define  URL_ERR_LOG  @"http://192.168.0.161:8083/pjHmlg2//isales/er_log.htm"
 
-#define  URL_UPLOAD_IMG  @"http://192.168.0.161:80/pjHmlg/isales/uploadImg.htm"
+#define  URL_UPLOAD_IMG  @"http://192.168.0.161:8083/pjHmlg2//isales/uploadImg.htm"
 
 
-#define  URL_NPD_POLICY  @"http://192.168.0.161:80/pjHmlg/isales/generalPolicy.htm"
+#define  URL_NPD_POLICY  @"http://192.168.0.161:8083/pjHmlg2//isales/generalPolicy.htm"
 
 
-#define  URL_CHECK_OFFLINE  @"http://192.168.0.161:80/pjHmlg/offline/initDatas.htm"
-#define  URL_UPLOAD_OFFLINE  @"http://192.168.0.161:80/pjHmlg/offline/uploadOfflineData.htm"
+#define  URL_CHECK_OFFLINE  @"http://192.168.0.161:8083/pjHmlg2//offline/initDatas.htm"
+#define  URL_UPLOAD_OFFLINE  @"http://192.168.0.161:8083/pjHmlg2//offline/uploadOfflineData.htm"
 
 
-#define  URL_DOWNLOAD_OFFLINE  @"http://192.168.0.161:80/pjHmlg/offline/downloadDatas.htm"
-#define  URL_FINISH_DOWNLOAD_OFFLINE  @"http://192.168.0.161:80/pjHmlg/offline/confirmVersion.htm"
+#define  URL_DOWNLOAD_OFFLINE  @"http://192.168.0.161:8083/pjHmlg2//offline/downloadDatas.htm"
+#define  URL_FINISH_DOWNLOAD_OFFLINE  @"http://192.168.0.161:8083/pjHmlg2//offline/confirmVersion.htm"
 
 
-#define  URL_GET_RESULT  @"http://192.168.0.161:80/pjHmlg/offline/getResultBySerial.htm"
+#define  URL_GET_RESULT  @"http://192.168.0.161:8083/pjHmlg2//offline/getResultBySerial.htm"
 
-#define URL_SET_PRICE_TYPE @"http://192.168.0.161:80/pjHmlg/isales/setSeePriceType.htm"
+#define URL_SET_PRICE_TYPE @"http://192.168.0.161:8083/pjHmlg2//isales/setSeePriceType.htm"
 
-#define URL_GET_CIVEN_PRICE @"http://192.168.0.161:80/pjHmlg/isales/getSeeGivenPrice.htm"
+#define URL_GET_CIVEN_PRICE @"http://192.168.0.161:8083/pjHmlg2//isales/getSeeGivenPrice.htm"
 
-#define URL_SET_GIVEN_PRICE @"http://192.168.0.161:80/pjHmlg/isales/setSeeGivenPrice.htm"
+#define URL_SET_GIVEN_PRICE @"http://192.168.0.161:8083/pjHmlg2//isales/setSeeGivenPrice.htm"
 
-#define URL_SET_MERGE_ORDER @"http://192.168.0.161:80/pjHmlg/isales/mergeOrder.htm"
+#define URL_SET_MERGE_ORDER @"http://192.168.0.161:8083/pjHmlg2//isales/mergeOrder.htm"
 
-#define URL_REQUEST_LOGIN @"http://192.168.0.161:80/pjHmlg/isales/requestLogin.htm"
+#define URL_REQUEST_LOGIN @"http://192.168.0.161:8083/pjHmlg2//isales/requestLogin.htm"
 
-#define URL_EMAIL_CART @"http://192.168.0.161:80/pjHmlg/isales/sendCartEmail.htm"
+#define URL_EMAIL_CART @"http://192.168.0.161:8083/pjHmlg2//isales/sendCartEmail.htm"
 
-#define URL_NOTIFY_ME @"http://192.168.0.161:80/pjHmlg/isales/notifyMeEmail.htm"
+#define URL_NOTIFY_ME @"http://192.168.0.161:8083/pjHmlg2//isales/notifyMeEmail.htm"
 
-#define URL_EMAIL_WISHLIST @"http://192.168.0.161:80/pjHmlg/isales/sendWishListEmail.htm"
+#define URL_EMAIL_WISHLIST @"http://192.168.0.161:8083/pjHmlg2//isales/sendWishListEmail.htm"
 
 #define URL_BLOG @"http://12.196.120.217/blog"
 #define  URL_DELETE_ACCOUNT @""

+ 1 - 1
RedAnt ERP Mobile/iSales-NPD/so.json

@@ -894,7 +894,7 @@
                                                0,
                                                0,
                                                0
-                                               ],
+                                               ]
                             },
                             "item_4": {
                                 "type": "text",

+ 1 - 1
RedAnt ERP Mobile/iSales-NPD/so_thumb.json

@@ -894,7 +894,7 @@
                                                0,
                                                0,
                                                0
-                                               ],
+                                               ]
                             },
                             "item_4": {
                                 "type": "text",

+ 0 - 110
common/NetworkUtils.m

@@ -883,116 +883,6 @@ repeat:
          
          
         
-//
-//
-//        NSHTTPURLResponse* urlResponse = nil;
-//
-//        NSError *error = nil;
-//        NSLog(@"begin request %@",url);
-//
-//        NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&urlResponse error:&error];
-//
-//
-//        DebugLog(@"url: %@",url);
-//
-//        DebugLog(@"response: %@",[NSHTTPURLResponse localizedStringForStatusCode:urlResponse.statusCode]);
-//
-//
-//        NSLog(@"get response");
-//        if (responseData==nil) {
-//
-//            //            DebugLog(@"response error:%@", [error localizedDescription]);
-//
-//
-//            NSMutableDictionary* ret = [[NSMutableDictionary alloc] init];
-//            //#define RESULT_FALSE 0
-//            //#define RESULT_TRUE         2
-//            //#define RESULT_NET_ERROR             -3
-//            //#define RESULT_NET_NOTAVAILABLE          -4
-//            //#define RESULT_ERROR                 -5
-//            //#define RESULT_LOCALFILE_ERROR             -7
-//            //#define RESULT_USERAUTH_ERROR             -9
-//            //#define RESULT_UPDATE_USERAUTH_ERROR     -11
-//            //#define RESULT_SESSION_EXPIRED              -13
-//            //#define RESULT_VER_LOW
-//
-//            //     NSString * moreinfo = error.description ;
-//
-//            NSString* err_msg = [error localizedDescription];
-//
-//
-//            //-----------------retry 3 times for error code -1005------------------------
-//            if(error.code==-1005&&retry<3)
-//            {
-//                retry++;
-//                goto repeat;
-//
-//            }
-//            //-----------------end retry 3 times for error code -1005------------------------
-//
-//            NSDictionary* error_json = [RAUtils error_dict:error];
-//            [ret setObject:error_json forKey:@"err_obj"];
-//            NSString* resp_msg= nil;
-//
-//            if(err_msg.length==0)
-//            {
-//                err_msg =[NSHTTPURLResponse localizedStringForStatusCode:urlResponse.statusCode];
-//                resp_msg = err_msg;
-//            }
-//            [ret setValue:[NSString stringWithFormat:@"%d",RESULT_NET_ERROR] forKey:@"result"];
-//            [ret setValue:err_msg forKey:@"err_msg"];
-//            [ret setValue:resp_msg forKey:@"resp_msg"];
-//            [ret setValue:[NSString stringWithFormat:@"%ld",(long)urlResponse.statusCode] forKey:@"resp_code"];
-//
-//
-//            NSData *jsonData = [NSJSONSerialization dataWithJSONObject:ret
-//                                                               options:0
-//                                                                 error:nil];
-//            if(![url isEqualToString:recorder_url])
-//            {
-//                [self err_log:[RAUtils base64en:[RAConvertor dict2string:params]] result:[RAUtils base64en:[RAConvertor dict2string:ret]] module:url code:RESULT_NET_ERROR];
-//            }
-//            return jsonData;
-//
-//        }
-//        else
-//        {
-//          //  NSString* err_msg = [error localizedDescription];
-//            NSMutableString *str = [[NSMutableString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
-//
-//            DebugLog(@"data string: %@",str);
-//            NSError *error1 = nil;
-//
-//            NSMutableDictionary* jsobj = [[NSJSONSerialization JSONObjectWithData:responseData options:NSJSONReadingMutableContainers error:&error1] mutableCopy];
-//
-//            if(jsobj==nil)// 服务器返回不是json
-//            {
-//
-//                jsobj=[[NSMutableDictionary alloc] init];
-//                [jsobj setValue:[NSNumber numberWithInt:RESULT_NO_RESPONSE] forKey:@"result"];
-//
-//            }
-////            if([jsobj[@"encrypt"] boolValue]==true)
-////            {
-////                jsobj = decryptBlock(jsobj);
-////            }
-////            if (resultBlock) {
-////                jsobj = resultBlock(jsobj);
-////            }
-//
-//            int result=[[jsobj valueForKey:@"result"] intValue];
-//            if(![url isEqualToString:recorder_url]&&/*![url isEqualToString:URL_DOWNLOAD_OFFLINE]&&*/result!=2&&result!=99)
-//            {
-//                [self err_log:[RAUtils base64en:[RAConvertor dict2string:params]] result:[RAUtils base64en:str] module:url code:result];
-//            }
-//            NSData *jsonData = [NSJSONSerialization dataWithJSONObject:jsobj
-//                                                               options:0
-//                                                                 error:nil];
-//            return jsonData;
-//
-//        }
-//        return responseData;
-//    }
 }
 
 

+ 6 - 1
common/RAConvertor.m

@@ -184,12 +184,17 @@ begin:
     if(dict==nil)
         return nil;
     
+    
+    
+    NSError * err1;
     // 将NSDictionary转化为NSData
-    NSData *data = [NSJSONSerialization dataWithJSONObject:dict options:kNilOptions error:nil];
+    NSData *data = [NSJSONSerialization dataWithJSONObject:dict options:kNilOptions error:&err1];
     
     // 再将NSData转为字符串
     NSString *jsonStr = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
     
+    NSAssert(jsonStr!=nil, @"convert failed");
+    
     return jsonStr;
 }
 

+ 28 - 86
common/customUI/commoneditor/CommonEditorViewController.m

@@ -427,7 +427,14 @@
         PopWaitAlert* pop = [RAUtils waiting_pop:self.loading_title completion:nil];
             [RADataProvider request_editor:self.request_url params:self.params completionHandler:^(NSMutableDictionary *result) {
                 NSMutableDictionary* editor_json = result;
+                
+                
+#ifdef DEBUG
+    
                 DebugLog(@"data string: %@",[RAConvertor dict2string:editor_json] );
+    
+#endif
+                
                 
                 
                     
@@ -913,91 +920,11 @@
              if([itemjson valueForKey:@"max_value"]!=nil && ![[itemjson valueForKey:@"max_value"]isEqualToString:@""])
                  valjson[@"max"] = itemjson[@"max_value"];
                     
+                    
+                    
+                    
                     NSString* val=[RAConvertor dict2string:valjson];
-//                    NSString *keyboard_type = [itemjson objectForKey:@"keyboard"];
-//                    BOOL check_max = [itemjson objectForKey:@"max_type"] != nil ? YES : NO;
-//                    BOOL check_min = [itemjson objectForKey:@"min_type"] != nil ? YES : NO;
-//                    if ([keyboard_type isEqualToString:@"number"] && (check_max || check_min)) {
-//                        // 检查最大值最小值
-//                        int max_type = [[itemjson objectForKey:@"max_type"] intValue];
-//                        int min_type = [[itemjson objectForKey:@"min_type"] intValue];
-//
-//                        float max_value = MAXFLOAT;
-//                        float min_value = 0;
-//
-//                        NSString *mfield = nil;
-////                        float f_value = [check_len_val floatValue];
-////
-////                        if (check_max) {
-////
-////                            if (max_type > 0) {
-////                                // key
-////                                NSString *max_key = [itemjson objectForKey:@"max"];
-////                                id max_obj = [self downloadValueForKey:max_key];
-////                                if (max_obj) {
-////                                    max_value = [max_obj floatValue];
-////                                }
-////
-////                            } else {
-////                                // value
-////                                id max_obj = [itemjson objectForKey:@"max"];
-////                                if (max_obj != nil) {
-////                                    max_value = [max_obj floatValue];
-////                                }
-////
-////                            }
-////
-////                            if (max_value < f_value) {
-////                                mfield =[NSString stringWithFormat:@"%ld. the value of %@ must be not larger than %.2f",fields.count+1,itemjson[@"aname"],max_value];
-////                            }
-////                        }
-//
-////                        if (check_min) {
-////
-////                            if (min_type > 0) {
-////                                // key
-////                                NSString *min_key = [itemjson objectForKey:@"min"];
-////                                id min_obj = [self downloadValueForKey:min_key];
-////                                if (min_obj) {
-////                                    min_value = [min_obj floatValue];
-////                                }
-////                            } else {
-////                                // value
-////                                id min_obj = [itemjson objectForKey:@"min"];
-////                                if (min_obj != nil) {
-////                                    min_value = [min_obj floatValue];
-////                                }
-////                            }
-////
-////                            if (min_value > f_value) {
-////                                mfield =[NSString stringWithFormat:@"%ld. the value of %@ must be not smaller than %.2f",fields.count+1,itemjson[@"aname"],min_value];
-////                            }
-////                        }
-//
-//
-////                        if (check_min && check_max) {
-////                            if (f_value < min_value || f_value > max_value) {
-////                                mfield =[NSString stringWithFormat:@"%ld. the value of %@ must between %.2f and %.2f",fields.count+1,itemjson[@"aname"],min_value,max_value];
-////                            }
-////                        }
-//
-//                        if (mfield != nil) {
-//                            self.cancommit = false;
-//                            [fields addObject:mfield];
-//                            NSIndexPath* indexpath =[self get_indexpath1:[itemjson valueForKey:@"name"]];
-//                            if(alert)
-//                                [self unhide_section:(int)indexpath.section];
-//                            if(fields.count==1)
-//                            {
-//                                self.first_miss_pos =  indexpath;
-//
-//                            }
-//                        } else {
-//                            [upparams setValue:[itemjson valueForKey:@"value"] forKey:[itemjson valueForKey:@"name"]];
-//                        }
-//
-//                    } else
-//                    {
+
                         [upparams setValue:val forKey:[itemjson valueForKey:@"name"]];
 //                    }
                     
@@ -1418,7 +1345,14 @@
         PopWaitAlert* pop = [RAUtils waiting_pop:self.loading_title completion:nil];
             [RADataProvider request_editor:self.request_url params:self.params completionHandler:^(NSMutableDictionary *result) {
                 NSMutableDictionary* editor_json = result;
+                
+                
+#ifdef DEBUG
+    
                 DebugLog(@"data string: %@",[RAConvertor dict2string:editor_json] );
+    
+#endif
+                
                 
 //                [waitalert dismissViewControllerAnimated:YES completion:^{
                 [pop hide];
@@ -2547,8 +2481,16 @@
     
     val = [val stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
     
-        DebugLog(@"endedit %d_%d",indexPath.section,indexPath.row);
-    DebugLog(@"endedit %@",[RAConvertor dict2string:self.content_data_control]);
+    
+    
+#ifdef DEBUG
+    
+    DebugLog(@"endedit %d_%d",indexPath.section,indexPath.row);
+DebugLog(@"endedit %@",[RAConvertor dict2string:self.content_data_control]);
+    
+#endif
+    
+
     NSMutableDictionary* item_json =[((NSMutableArray*)self.content_data_control[indexPath.section])[indexPath.row] mutableCopy];
     
     NSString* subid=[item_json valueForKey:@"subid"];

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov