|
@@ -176,7 +176,8 @@
|
|
|
AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
|
|
|
|
|
|
sqlite3 *db = [iSalesDB get_db];
|
|
sqlite3 *db = [iSalesDB get_db];
|
|
|
- NSDictionary *resultDic = [iSalesDB jk_query:sql db:db close:NO completion:^(sqlite3_stmt *stmt, NSMutableDictionary *container, long *count) {
|
|
|
|
|
|
|
+// NSDictionary *resultDic =
|
|
|
|
|
+ [iSalesDB jk_query:sql db:db close:NO completion:^(sqlite3_stmt *stmt, NSMutableDictionary *container, long *count) {
|
|
|
|
|
|
|
|
// [dic setValue:[NSNumber numberWithInteger:RESULT_TRUE] forKey:@"result"];
|
|
// [dic setValue:[NSNumber numberWithInteger:RESULT_TRUE] forKey:@"result"];
|
|
|
|
|
|
|
@@ -557,37 +558,37 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- int can_show_price = sqlite3_column_int(statement, 0);
|
|
|
|
|
- int can_see_price = sqlite3_column_int(statement, 1);
|
|
|
|
|
|
|
+// int can_show_price = sqlite3_column_int(statement, 0);
|
|
|
|
|
+// int can_see_price = sqlite3_column_int(statement, 1);
|
|
|
|
|
|
|
|
- char *contact_id = (char*)sqlite3_column_text(statement, 2);
|
|
|
|
|
- if(contact_id==nil)
|
|
|
|
|
- contact_id="";
|
|
|
|
|
- NSString *nscontact_id= [[NSString alloc]initWithUTF8String:contact_id];
|
|
|
|
|
|
|
+// char *contact_id = (char*)sqlite3_column_text(statement, 2);
|
|
|
|
|
+// if(contact_id==nil)
|
|
|
|
|
+// contact_id="";
|
|
|
|
|
+// NSString *nscontact_id= [[NSString alloc]initWithUTF8String:contact_id];
|
|
|
|
|
|
|
|
- int user_type = sqlite3_column_int(statement, 3);
|
|
|
|
|
|
|
+// int user_type = sqlite3_column_int(statement, 3);
|
|
|
|
|
|
|
|
- int can_cancel_order = sqlite3_column_int(statement, 4);
|
|
|
|
|
- int can_set_cart_price = sqlite3_column_int(statement, 5);
|
|
|
|
|
- int can_create_portfolio = sqlite3_column_int(statement, 6);
|
|
|
|
|
- int can_delete_order = sqlite3_column_int(statement, 7);
|
|
|
|
|
- int can_submit_order = sqlite3_column_int(statement, 8);
|
|
|
|
|
- int can_set_tearsheet_price = sqlite3_column_int(statement, 9);
|
|
|
|
|
- int can_create_order = sqlite3_column_int(statement, 10);
|
|
|
|
|
|
|
+// int can_cancel_order = sqlite3_column_int(statement, 4);
|
|
|
|
|
+// int can_set_cart_price = sqlite3_column_int(statement, 5);
|
|
|
|
|
+// int can_create_portfolio = sqlite3_column_int(statement, 6);
|
|
|
|
|
+// int can_delete_order = sqlite3_column_int(statement, 7);
|
|
|
|
|
+// int can_submit_order = sqlite3_column_int(statement, 8);
|
|
|
|
|
+// int can_set_tearsheet_price = sqlite3_column_int(statement, 9);
|
|
|
|
|
+// int can_create_order = sqlite3_column_int(statement, 10);
|
|
|
|
|
|
|
|
|
|
|
|
|
- char *mode = (char*)sqlite3_column_text(statement, 11);
|
|
|
|
|
- if(mode==nil)
|
|
|
|
|
- mode="";
|
|
|
|
|
- NSString *nsmode= [[NSString alloc]initWithUTF8String:mode];
|
|
|
|
|
|
|
+// char *mode = (char*)sqlite3_column_text(statement, 11);
|
|
|
|
|
+// if(mode==nil)
|
|
|
|
|
+// mode="";
|
|
|
|
|
+// NSString *nsmode= [[NSString alloc]initWithUTF8String:mode];
|
|
|
|
|
|
|
|
|
|
|
|
|
- char *username = (char*)sqlite3_column_text(statement, 12);
|
|
|
|
|
- if(username==nil)
|
|
|
|
|
- username="";
|
|
|
|
|
- NSString *nsusername= [[NSString alloc]initWithUTF8String:username];
|
|
|
|
|
|
|
+// char *username = (char*)sqlite3_column_text(statement, 12);
|
|
|
|
|
+// if(username==nil)
|
|
|
|
|
+// username="";
|
|
|
|
|
+// NSString *nsusername= [[NSString alloc]initWithUTF8String:username];
|
|
|
|
|
|
|
|
- int can_update_contact_info = sqlite3_column_int(statement, 13);
|
|
|
|
|
|
|
+// int can_update_contact_info = sqlite3_column_int(statement, 13);
|
|
|
|
|
|
|
|
|
|
|
|
|
char *first_name = (char*)sqlite3_column_text(statement, 14);
|
|
char *first_name = (char*)sqlite3_column_text(statement, 14);
|
|
@@ -671,7 +672,8 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
NSString* filename =[NSString stringWithFormat:@"%@.png", [[NSUUID UUID] UUIDString]];
|
|
NSString* filename =[NSString stringWithFormat:@"%@.png", [[NSUUID UUID] UUIDString]];
|
|
|
NSString* qrpath=[temp stringByAppendingPathComponent:filename];
|
|
NSString* qrpath=[temp stringByAppendingPathComponent:filename];
|
|
|
UIImage* qrimg=[ImageUtils generateBarCode:order_code width:480 height:44];//[QRCodeGenerator qrImageForString:order_code imageSize:240];
|
|
UIImage* qrimg=[ImageUtils generateBarCode:order_code width:480 height:44];//[QRCodeGenerator qrImageForString:order_code imageSize:240];
|
|
|
- bool bwrite=[UIImagePNGRepresentation(qrimg)writeToFile: qrpath atomically:YES];
|
|
|
|
|
|
|
+// bool bwrite=
|
|
|
|
|
+ [UIImagePNGRepresentation(qrimg)writeToFile: qrpath atomically:YES];
|
|
|
data[@"img_barcode"]=qrpath;
|
|
data[@"img_barcode"]=qrpath;
|
|
|
data[@"so_id"]=order_code;
|
|
data[@"so_id"]=order_code;
|
|
|
data[@"company"]=COMPANY_FULL_NAME;
|
|
data[@"company"]=COMPANY_FULL_NAME;
|
|
@@ -899,7 +901,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
// NSDate *date1 = [NSDate date];
|
|
// NSDate *date1 = [NSDate date];
|
|
|
|
|
|
|
|
int count=0;
|
|
int count=0;
|
|
|
- int cart_count=0;
|
|
|
|
|
|
|
+// int cart_count=0;
|
|
|
float credits=0;
|
|
float credits=0;
|
|
|
int dbresult=sqlite3_prepare_v2(db, [sql_cart UTF8String], -1, &statement_cart, nil);
|
|
int dbresult=sqlite3_prepare_v2(db, [sql_cart UTF8String], -1, &statement_cart, nil);
|
|
|
if ( dbresult== SQLITE_OK)
|
|
if ( dbresult== SQLITE_OK)
|
|
@@ -909,7 +911,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
|
|
|
|
|
while (sqlite3_step(statement_cart) == SQLITE_ROW)
|
|
while (sqlite3_step(statement_cart) == SQLITE_ROW)
|
|
|
{
|
|
{
|
|
|
- NSDate *row_date = [NSDate date];
|
|
|
|
|
|
|
+// NSDate *row_date = [NSDate date];
|
|
|
|
|
|
|
|
|
|
|
|
|
NSMutableDictionary* itemjson = [[NSMutableDictionary alloc] init];
|
|
NSMutableDictionary* itemjson = [[NSMutableDictionary alloc] init];
|
|
@@ -1778,7 +1780,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
//
|
|
//
|
|
|
//
|
|
//
|
|
|
// }
|
|
// }
|
|
|
-// // [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
|
|
|
|
|
|
|
+// // [waitalert dismissViewControllerAnimated:YES completion:nil];
|
|
|
// }];
|
|
// }];
|
|
|
//
|
|
//
|
|
|
//
|
|
//
|
|
@@ -1988,8 +1990,8 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
+(NSMutableDictionary*) preparecart:(NSString* ) orderCode db:(sqlite3*)db
|
|
+(NSMutableDictionary*) preparecart:(NSString* ) orderCode db:(sqlite3*)db
|
|
|
{
|
|
{
|
|
|
NSMutableDictionary* ret = [[NSMutableDictionary alloc] init];
|
|
NSMutableDictionary* ret = [[NSMutableDictionary alloc] init];
|
|
|
- UIApplication * app = [UIApplication sharedApplication];
|
|
|
|
|
- AppDelegate *appDelegate = (AppDelegate *)[app delegate];
|
|
|
|
|
|
|
+// UIApplication * app = [UIApplication sharedApplication];
|
|
|
|
|
+// AppDelegate *appDelegate = (AppDelegate *)[app delegate];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -2298,7 +2300,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
}
|
|
}
|
|
|
+(bool) check_offlinedata
|
|
+(bool) check_offlinedata
|
|
|
{
|
|
{
|
|
|
- UIApplication * app = [UIApplication sharedApplication];
|
|
|
|
|
|
|
+// UIApplication * app = [UIApplication sharedApplication];
|
|
|
// AppDelegate *appDelegate = (AppDelegate *)[app delegate];
|
|
// AppDelegate *appDelegate = (AppDelegate *)[app delegate];
|
|
|
sqlite3 *db = [iSalesDB get_db];
|
|
sqlite3 *db = [iSalesDB get_db];
|
|
|
NSString * where=@"1=1";
|
|
NSString * where=@"1=1";
|
|
@@ -2418,7 +2420,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- NSString* user = appDelegate.user;
|
|
|
|
|
|
|
+// NSString* user = appDelegate.user;
|
|
|
|
|
|
|
|
sqlite3 *db = [iSalesDB get_db];
|
|
sqlite3 *db = [iSalesDB get_db];
|
|
|
|
|
|
|
@@ -2431,7 +2433,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
sqlite3_stmt * statement;
|
|
sqlite3_stmt * statement;
|
|
|
|
|
|
|
|
NSDate *date1 = [NSDate date];
|
|
NSDate *date1 = [NSDate date];
|
|
|
- NSDate *date2 = nil;
|
|
|
|
|
|
|
+// NSDate *date2 = nil;
|
|
|
|
|
|
|
|
NSMutableDictionary* ret=[[NSMutableDictionary alloc]init];
|
|
NSMutableDictionary* ret=[[NSMutableDictionary alloc]init];
|
|
|
int count=0;
|
|
int count=0;
|
|
@@ -3241,10 +3243,10 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
load_ability="";
|
|
load_ability="";
|
|
|
NSString *nsload_ability = [[NSString alloc]initWithUTF8String:load_ability];
|
|
NSString *nsload_ability = [[NSString alloc]initWithUTF8String:load_ability];
|
|
|
|
|
|
|
|
- char *default_category = (char*)sqlite3_column_text(statement, 15);
|
|
|
|
|
- if(default_category==nil)
|
|
|
|
|
- default_category="";
|
|
|
|
|
- NSString *nsdefault_category = [[NSString alloc]initWithUTF8String:default_category];
|
|
|
|
|
|
|
+// char *default_category = (char*)sqlite3_column_text(statement, 15);
|
|
|
|
|
+// if(default_category==nil)
|
|
|
|
|
+// default_category="";
|
|
|
|
|
+// NSString *nsdefault_category = [[NSString alloc]initWithUTF8String:default_category];
|
|
|
|
|
|
|
|
|
|
|
|
|
char *fabric_content = (char*)sqlite3_column_text(statement, 16);
|
|
char *fabric_content = (char*)sqlite3_column_text(statement, 16);
|
|
@@ -3455,7 +3457,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ (NSDictionary *) search:(NSMutableDictionary *)params limited:(BOOL)limited {
|
|
+ (NSDictionary *) search:(NSMutableDictionary *)params limited:(BOOL)limited {
|
|
|
- NSString* orderCode = [params valueForKey:@"orderCode"];
|
|
|
|
|
|
|
+// NSString* orderCode = [params valueForKey:@"orderCode"];
|
|
|
|
|
|
|
|
NSString* keyword = [params valueForKey:@"keyword"];
|
|
NSString* keyword = [params valueForKey:@"keyword"];
|
|
|
keyword=keyword.lowercaseString;
|
|
keyword=keyword.lowercaseString;
|
|
@@ -4140,12 +4142,12 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
double iwidth = sqlite3_column_double(statement, 9);
|
|
double iwidth = sqlite3_column_double(statement, 9);
|
|
|
double iheight = sqlite3_column_double(statement, 10);
|
|
double iheight = sqlite3_column_double(statement, 10);
|
|
|
double iweight = sqlite3_column_double(statement, 11);
|
|
double iweight = sqlite3_column_double(statement, 11);
|
|
|
- int pcs = sqlite3_column_int(statement,12);
|
|
|
|
|
|
|
+// int pcs = sqlite3_column_int(statement,12);
|
|
|
int mpack = sqlite3_column_int(statement, 13);
|
|
int mpack = sqlite3_column_int(statement, 13);
|
|
|
int ipack = sqlite3_column_int(statement, 14);
|
|
int ipack = sqlite3_column_int(statement, 14);
|
|
|
double ucbf = sqlite3_column_double(statement, 15);
|
|
double ucbf = sqlite3_column_double(statement, 15);
|
|
|
- double icbf = sqlite3_column_double(statement, 16);
|
|
|
|
|
- double mcbf = sqlite3_column_double(statement, 17);
|
|
|
|
|
|
|
+// double icbf = sqlite3_column_double(statement, 16);
|
|
|
|
|
+// double mcbf = sqlite3_column_double(statement, 17);
|
|
|
|
|
|
|
|
if(ipack==0)
|
|
if(ipack==0)
|
|
|
{
|
|
{
|
|
@@ -4720,10 +4722,10 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
nsphone= [[NSString alloc]initWithUTF8String:phone];
|
|
nsphone= [[NSString alloc]initWithUTF8String:phone];
|
|
|
|
|
|
|
|
|
|
|
|
|
- char *contact_id = (char*)sqlite3_column_text(statement, 9);
|
|
|
|
|
- if(contact_id==nil)
|
|
|
|
|
- contact_id="";
|
|
|
|
|
- NSString *nscontact_id= [[NSString alloc]initWithUTF8String:contact_id];
|
|
|
|
|
|
|
+// char *contact_id = (char*)sqlite3_column_text(statement, 9);
|
|
|
|
|
+// if(contact_id==nil)
|
|
|
|
|
+// contact_id="";
|
|
|
|
|
+// NSString *nscontact_id= [[NSString alloc]initWithUTF8String:contact_id];
|
|
|
|
|
|
|
|
char *addr_1 = (char*)sqlite3_column_text(statement, 10);
|
|
char *addr_1 = (char*)sqlite3_column_text(statement, 10);
|
|
|
if(addr_1==nil)
|
|
if(addr_1==nil)
|
|
@@ -5521,7 +5523,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
|
|
|
|
|
NSString *model_set = [self textAtColumn:0 statement:stmt];
|
|
NSString *model_set = [self textAtColumn:0 statement:stmt];
|
|
|
NSArray *model_set_components = [model_set componentsSeparatedByString:@" "];
|
|
NSArray *model_set_components = [model_set componentsSeparatedByString:@" "];
|
|
|
- cart_count = [[model_set_components lastObject] integerValue];
|
|
|
|
|
|
|
+ cart_count = [[model_set_components lastObject] intValue];
|
|
|
|
|
|
|
|
}];
|
|
}];
|
|
|
}
|
|
}
|
|
@@ -5533,9 +5535,9 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
|
|
|
|
|
sqlite3_stmt *stmt;
|
|
sqlite3_stmt *stmt;
|
|
|
sqlite3_prepare_v2(db, [sqlQuery UTF8String], -1, &stmt, nil);
|
|
sqlite3_prepare_v2(db, [sqlQuery UTF8String], -1, &stmt, nil);
|
|
|
- sqlite3_bind_text(stmt,1,[arr[i] UTF8String],[arr[i] length],NULL);
|
|
|
|
|
|
|
+ sqlite3_bind_text(stmt,1,[arr[i] UTF8String],(int)[arr[i] length],NULL);
|
|
|
if (item_count_arr) {
|
|
if (item_count_arr) {
|
|
|
- sqlite3_bind_int(stmt,2,[item_count_arr[i] integerValue]);
|
|
|
|
|
|
|
+ sqlite3_bind_int(stmt,2,[item_count_arr[i] intValue]);
|
|
|
} else {
|
|
} else {
|
|
|
sqlite3_bind_int(stmt,2,cart_count);
|
|
sqlite3_bind_int(stmt,2,cart_count);
|
|
|
}
|
|
}
|
|
@@ -5551,7 +5553,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
} else {
|
|
} else {
|
|
|
int qty = 0;
|
|
int qty = 0;
|
|
|
if (item_count_arr) {
|
|
if (item_count_arr) {
|
|
|
- qty = [item_count_arr[i] integerValue];
|
|
|
|
|
|
|
+ qty = [item_count_arr[i] intValue];
|
|
|
} else {
|
|
} else {
|
|
|
qty = cart_count;
|
|
qty = cart_count;
|
|
|
}
|
|
}
|
|
@@ -5724,7 +5726,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
[container setValue:countryDic forKey:key];
|
|
[container setValue:countryDic forKey:key];
|
|
|
}] mutableCopy];
|
|
}] mutableCopy];
|
|
|
|
|
|
|
|
- [ret setValue:[NSNumber numberWithInt:ret.allKeys.count] forKey:@"count"];
|
|
|
|
|
|
|
+ [ret setValue:[NSNumber numberWithLong:ret.allKeys.count] forKey:@"count"];
|
|
|
return ret;
|
|
return ret;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -5790,7 +5792,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
[ret setValue:stateDic forKey:key];
|
|
[ret setValue:stateDic forKey:key];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- [ret setValue:[NSNumber numberWithInt:ret.allKeys.count] forKey:@"count"];
|
|
|
|
|
|
|
+ [ret setValue:[NSNumber numberWithLong:ret.allKeys.count] forKey:@"count"];
|
|
|
|
|
|
|
|
return ret;
|
|
return ret;
|
|
|
}
|
|
}
|
|
@@ -5825,7 +5827,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
[container setValue:stateDic forKey:key];
|
|
[container setValue:stateDic forKey:key];
|
|
|
}] mutableCopy];
|
|
}] mutableCopy];
|
|
|
[ret removeObjectForKey:@"result"];
|
|
[ret removeObjectForKey:@"result"];
|
|
|
- [ret setValue:[NSNumber numberWithInt:ret.allKeys.count] forKey:@"count"];
|
|
|
|
|
|
|
+ [ret setValue:[NSNumber numberWithLong:ret.allKeys.count] forKey:@"count"];
|
|
|
|
|
|
|
|
return ret;
|
|
return ret;
|
|
|
}
|
|
}
|
|
@@ -5859,7 +5861,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
|
|
|
|
|
}] mutableCopy];
|
|
}] mutableCopy];
|
|
|
|
|
|
|
|
- [ret setValue:[NSNumber numberWithInt:ret.allKeys.count] forKey:@"count"];
|
|
|
|
|
|
|
+ [ret setValue:[NSNumber numberWithLong:ret.allKeys.count] forKey:@"count"];
|
|
|
|
|
|
|
|
return ret;
|
|
return ret;
|
|
|
}
|
|
}
|
|
@@ -5871,7 +5873,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
|
|
|
|
|
[iSalesDB jk_query:sql completion:^(sqlite3_stmt *stmt, NSMutableDictionary *container, long *count) {
|
|
[iSalesDB jk_query:sql completion:^(sqlite3_stmt *stmt, NSMutableDictionary *container, long *count) {
|
|
|
|
|
|
|
|
- int _id = sqlite3_column_int(stmt, 0);
|
|
|
|
|
|
|
+// int _id = sqlite3_column_int(stmt, 0);
|
|
|
NSString *name = [self textAtColumn:1 statement:stmt];
|
|
NSString *name = [self textAtColumn:1 statement:stmt];
|
|
|
|
|
|
|
|
NSDictionary *typeDic = @{
|
|
NSDictionary *typeDic = @{
|
|
@@ -5881,7 +5883,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
[ret setValue:typeDic forKey:[NSString stringWithFormat:@"val_%ld",*count]];
|
|
[ret setValue:typeDic forKey:[NSString stringWithFormat:@"val_%ld",*count]];
|
|
|
- [ret setValue:[NSNumber numberWithInt:++(*count)] forKey:@"count"];
|
|
|
|
|
|
|
+ [ret setValue:[NSNumber numberWithLong:++(*count)] forKey:@"count"];
|
|
|
|
|
|
|
|
} failure:^(NSMutableDictionary *container, NSString *err_msg) {
|
|
} failure:^(NSMutableDictionary *container, NSString *err_msg) {
|
|
|
|
|
|
|
@@ -5937,7 +5939,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
|
|
|
|
|
}] mutableCopy];
|
|
}] mutableCopy];
|
|
|
|
|
|
|
|
- [ret setValue:[NSNumber numberWithInt:ret.allKeys.count] forKey:@"count"];
|
|
|
|
|
|
|
+ [ret setValue:[NSNumber numberWithLong:ret.allKeys.count] forKey:@"count"];
|
|
|
|
|
|
|
|
return ret;
|
|
return ret;
|
|
|
}
|
|
}
|
|
@@ -8048,7 +8050,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
if (sqlite3_step(statement) == SQLITE_ROW)
|
|
if (sqlite3_step(statement) == SQLITE_ROW)
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
- int order_id = sqlite3_column_int(statement, 0);
|
|
|
|
|
|
|
+// int order_id = sqlite3_column_int(statement, 0);
|
|
|
|
|
|
|
|
NSString *sign_url = [self textAtColumn:51 statement:statement];
|
|
NSString *sign_url = [self textAtColumn:51 statement:statement];
|
|
|
// ret[@"sign_url"] = sign_url;
|
|
// ret[@"sign_url"] = sign_url;
|
|
@@ -8277,7 +8279,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
} else {
|
|
} else {
|
|
|
card_number = @"";
|
|
card_number = @"";
|
|
|
}
|
|
}
|
|
|
- NSString *card_security_code = [self textAtColumn:44 statement:statement];
|
|
|
|
|
|
|
+// NSString *card_security_code = [self textAtColumn:44 statement:statement];
|
|
|
NSString *card_expiration_month = [self textAtColumn:45 statement:statement];
|
|
NSString *card_expiration_month = [self textAtColumn:45 statement:statement];
|
|
|
NSString *card_expiration_year = [self textAtColumn:50 statement:statement];
|
|
NSString *card_expiration_year = [self textAtColumn:50 statement:statement];
|
|
|
NSString *card_expiration = [NSString stringWithFormat:@"%@/%@",card_expiration_month,card_expiration_year];
|
|
NSString *card_expiration = [NSString stringWithFormat:@"%@/%@",card_expiration_month,card_expiration_year];
|
|
@@ -8861,7 +8863,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
if (orderStatus.length > 0) {
|
|
if (orderStatus.length > 0) {
|
|
|
NSArray *order_status_array = [orderStatus componentsSeparatedByString:@","];
|
|
NSArray *order_status_array = [orderStatus componentsSeparatedByString:@","];
|
|
|
if (order_status_array.count == 1) {
|
|
if (order_status_array.count == 1) {
|
|
|
- int status_value = [[order_status_array firstObject] integerValue];
|
|
|
|
|
|
|
+ int status_value = [[order_status_array firstObject] intValue];
|
|
|
if (status_value <= 1 || status_value == 3 || status_value == 15) {
|
|
if (status_value <= 1 || status_value == 3 || status_value == 15) {
|
|
|
|
|
|
|
|
if (status_value == 15 || status_value == 3) {
|
|
if (status_value == 15 || status_value == 3) {
|
|
@@ -8883,7 +8885,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
}
|
|
}
|
|
|
// where = [where stringByAppendingString:[NSString stringWithFormat:@"%@ o.status = %@",condition,status]];
|
|
// where = [where stringByAppendingString:[NSString stringWithFormat:@"%@ o.status = %@",condition,status]];
|
|
|
|
|
|
|
|
- int status_value = [status integerValue];
|
|
|
|
|
|
|
+ int status_value = [status intValue];
|
|
|
if (status_value <= 1 || status_value == 3 || status_value == 15) {
|
|
if (status_value <= 1 || status_value == 3 || status_value == 15) {
|
|
|
|
|
|
|
|
if (status_value == 15 || status_value == 3) {
|
|
if (status_value == 15 || status_value == 3) {
|
|
@@ -10185,7 +10187,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
|
|
|
|
|
NSString *poNumber = [self textAtColumn:0 statement:stmt];
|
|
NSString *poNumber = [self textAtColumn:0 statement:stmt];
|
|
|
int mustCall = sqlite3_column_int(stmt, 1);
|
|
int mustCall = sqlite3_column_int(stmt, 1);
|
|
|
- NSString *internalNotes = [self textAtColumn:2 statement:stmt];
|
|
|
|
|
|
|
+// NSString *internalNotes = [self textAtColumn:2 statement:stmt];
|
|
|
NSString *generalNotes = [self textAtColumn:3 statement:stmt];
|
|
NSString *generalNotes = [self textAtColumn:3 statement:stmt];
|
|
|
|
|
|
|
|
NSDictionary *po_dic = @{
|
|
NSDictionary *po_dic = @{
|
|
@@ -10210,13 +10212,13 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
@"value" : generalNotes
|
|
@"value" : generalNotes
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- NSDictionary *internal_notes_dic = @{
|
|
|
|
|
- @"aname" : @"Internal notes",
|
|
|
|
|
- @"control" : @"text_view",
|
|
|
|
|
- @"keyboard" : @"text",
|
|
|
|
|
- @"name" : @"internal_notes",
|
|
|
|
|
- @"value" : internalNotes
|
|
|
|
|
- };
|
|
|
|
|
|
|
+// NSDictionary *internal_notes_dic = @{
|
|
|
|
|
+// @"aname" : @"Internal notes",
|
|
|
|
|
+// @"control" : @"text_view",
|
|
|
|
|
+// @"keyboard" : @"text",
|
|
|
|
|
+// @"name" : @"internal_notes",
|
|
|
|
|
+// @"value" : internalNotes
|
|
|
|
|
+// };
|
|
|
|
|
|
|
|
[dic setValue:po_dic forKey:@"item_0"];
|
|
[dic setValue:po_dic forKey:@"item_0"];
|
|
|
[dic setValue:must_call_dic forKey:@"item_1"];
|
|
[dic setValue:must_call_dic forKey:@"item_1"];
|
|
@@ -10692,7 +10694,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
[ret setValue:stateDic forKey:key];
|
|
[ret setValue:stateDic forKey:key];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- [ret setValue:[NSNumber numberWithInt:ret.allKeys.count] forKey:@"count"];
|
|
|
|
|
|
|
+ [ret setValue:[NSNumber numberWithLong:ret.allKeys.count] forKey:@"count"];
|
|
|
|
|
|
|
|
return ret;
|
|
return ret;
|
|
|
|
|
|
|
@@ -12343,7 +12345,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
NSMutableDictionary *resultDictionary = [NSMutableDictionary dictionary];
|
|
NSMutableDictionary *resultDictionary = [NSMutableDictionary dictionary];
|
|
|
[resultDictionary setObject:@"Regular Mode" forKey:@"mode"];
|
|
[resultDictionary setObject:@"Regular Mode" forKey:@"mode"];
|
|
|
|
|
|
|
|
- NSMutableDictionary * values = params[@"replaceValue"];
|
|
|
|
|
|
|
+// NSMutableDictionary * values = params[@"replaceValue"];
|
|
|
NSNumber *tear_sheet_id = [params objectForKey:@"tearsheetsId"]; // _id
|
|
NSNumber *tear_sheet_id = [params objectForKey:@"tearsheetsId"]; // _id
|
|
|
|
|
|
|
|
NSString *tear_name = [self valueInParams:params key:@"pdfName"];
|
|
NSString *tear_name = [self valueInParams:params key:@"pdfName"];
|
|
@@ -12406,7 +12408,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
[product_ids_string appendFormat:@"%@,",product_id_string];
|
|
[product_ids_string appendFormat:@"%@,",product_id_string];
|
|
|
|
|
|
|
|
// Regular Price
|
|
// Regular Price
|
|
|
- int regular_price = [[params objectForKey:@"regular_price"] integerValue];
|
|
|
|
|
|
|
+ int regular_price = [[params objectForKey:@"regular_price"] intValue];
|
|
|
NSString *regular_price_str = [self get_portfolio_price:appDelegate.contact_id item_id:item_id price:regular_price db:db];
|
|
NSString *regular_price_str = [self get_portfolio_price:appDelegate.contact_id item_id:item_id price:regular_price db:db];
|
|
|
|
|
|
|
|
// QTY
|
|
// QTY
|
|
@@ -12526,7 +12528,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
NSString *save_pdf_sql = [NSString stringWithFormat:@"insert into offline_pdf (pdf_path,create_user,tear_note,tear_name,model_info,configureParams,is_local,off_params) values ('%@','%@','%@','%@','%@','%@',1,'%@');",pdf_path,create_user,tear_note,tear_name,model_info,configureParams,off_params];
|
|
NSString *save_pdf_sql = [NSString stringWithFormat:@"insert into offline_pdf (pdf_path,create_user,tear_note,tear_name,model_info,configureParams,is_local,off_params) values ('%@','%@','%@','%@','%@','%@',1,'%@');",pdf_path,create_user,tear_note,tear_name,model_info,configureParams,off_params];
|
|
|
|
|
|
|
|
if (tear_sheet_id) {
|
|
if (tear_sheet_id) {
|
|
|
- int _id = [tear_sheet_id integerValue];
|
|
|
|
|
|
|
+ int _id = [tear_sheet_id intValue];
|
|
|
save_pdf_sql = [NSString stringWithFormat:@"update offline_pdf set pdf_path = '%@' where _id = %d;",pdf_path,_id];
|
|
save_pdf_sql = [NSString stringWithFormat:@"update offline_pdf set pdf_path = '%@' where _id = %d;",pdf_path,_id];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -12555,8 +12557,8 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
|
|
|
|
|
+ (NSData *)offline_pdfList:(NSMutableDictionary *)params {
|
|
+ (NSData *)offline_pdfList:(NSMutableDictionary *)params {
|
|
|
|
|
|
|
|
- int offset = [[params valueForKey:@"offset"] integerValue];
|
|
|
|
|
- int limit = [[params valueForKey:@"limit"] integerValue];
|
|
|
|
|
|
|
+ int offset = [[params valueForKey:@"offset"] intValue];
|
|
|
|
|
+ int limit = [[params valueForKey:@"limit"] intValue];
|
|
|
NSString *keyword = [params valueForKey:@"keyWord"];
|
|
NSString *keyword = [params valueForKey:@"keyWord"];
|
|
|
|
|
|
|
|
NSString *where = @"where is_delete is null or is_delete = 0";
|
|
NSString *where = @"where is_delete is null or is_delete = 0";
|
|
@@ -12884,7 +12886,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
NSInteger tearsheetsId = [[params objectForKey:@"tearsheetsId"] integerValue];
|
|
NSInteger tearsheetsId = [[params objectForKey:@"tearsheetsId"] integerValue];
|
|
|
NSString *user = [params objectForKey:@"user"];
|
|
NSString *user = [params objectForKey:@"user"];
|
|
|
|
|
|
|
|
- NSString *create_user = [iSalesDB jk_queryText:[NSString stringWithFormat:@"select create_user from offline_pdf where _id = %d;",tearsheetsId]]; // tearsheets_id ---> _id
|
|
|
|
|
|
|
+ NSString *create_user = [iSalesDB jk_queryText:[NSString stringWithFormat:@"select create_user from offline_pdf where _id = %ld;",(long)tearsheetsId]]; // tearsheets_id ---> _id
|
|
|
if (![create_user isEqualToString:user]) {
|
|
if (![create_user isEqualToString:user]) {
|
|
|
[dic setObject:[NSNumber numberWithInt:RESULT_FALSE] forKey:@"result"];
|
|
[dic setObject:[NSNumber numberWithInt:RESULT_FALSE] forKey:@"result"];
|
|
|
[dic setObject:@"Regular Mode" forKey:@"mode"];
|
|
[dic setObject:@"Regular Mode" forKey:@"mode"];
|
|
@@ -12892,7 +12894,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
return [RAConvertor dict2data:dic];
|
|
return [RAConvertor dict2data:dic];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- NSString *is_local_sql = [NSString stringWithFormat:@"select is_local,pdf_path from offline_pdf where _id = %d and create_user = '%@';",tearsheetsId,[self translateSingleQuote:user]];
|
|
|
|
|
|
|
+ NSString *is_local_sql = [NSString stringWithFormat:@"select is_local,pdf_path from offline_pdf where _id = %ld and create_user = '%@';",(long)tearsheetsId,[self translateSingleQuote:user]];
|
|
|
|
|
|
|
|
__block int is_local = 0;
|
|
__block int is_local = 0;
|
|
|
__block NSString *path = @"";
|
|
__block NSString *path = @"";
|
|
@@ -12902,10 +12904,10 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
path = [self textAtColumn:1 statement:stmt];
|
|
path = [self textAtColumn:1 statement:stmt];
|
|
|
}];
|
|
}];
|
|
|
|
|
|
|
|
- NSString *sql = [NSString stringWithFormat:@"update offline_pdf set is_delete = 1 where _id = %d and create_user = '%@';",tearsheetsId,[self translateSingleQuote:user]];
|
|
|
|
|
|
|
+ NSString *sql = [NSString stringWithFormat:@"update offline_pdf set is_delete = 1 where _id = %ld and create_user = '%@';",(long)tearsheetsId,[self translateSingleQuote:user]];
|
|
|
|
|
|
|
|
if (is_local == 1) {
|
|
if (is_local == 1) {
|
|
|
- sql = [NSString stringWithFormat:@"delete from offline_pdf where _id = %d and create_user = '%@';",tearsheetsId,[self translateSingleQuote:user]];
|
|
|
|
|
|
|
+ sql = [NSString stringWithFormat:@"delete from offline_pdf where _id = %ld and create_user = '%@';",(long)tearsheetsId,[self translateSingleQuote:user]];
|
|
|
|
|
|
|
|
// 删除文件
|
|
// 删除文件
|
|
|
[self offline_removePDFWithName:path];
|
|
[self offline_removePDFWithName:path];
|