|
@@ -3207,7 +3207,7 @@
|
|
|
[sync_dic setValue:contact_id forKey:@"contact_id"];
|
|
[sync_dic setValue:contact_id forKey:@"contact_id"];
|
|
|
sync_data = [RAUtils dict2string:sync_dic];
|
|
sync_data = [RAUtils dict2string:sync_dic];
|
|
|
|
|
|
|
|
- sql = [NSString stringWithFormat:@"update offline_contact set company_name = '%@',addr_1 = '%@',addr_2 = '%@',addr_3 = '%@',addr_4 = '%@',country = '%@',state = '%@',city = '%@',zipcode = '%@',first_name = '%@',last_name = '%@',phone = '%@',fax = '%@',email = '%@',notes = '%@',price_type = '%@',sales_rep = '%@',img_0 = '%@',img_1 = '%@',img_2 = '%@' where contact_id = '%@',sync_data = '%@';",companyName,addr1,addr2,addr3,addr4,country,state,city,zipcode,fistName,lastName,phone,fax,email,notes,price,salesRep,img_0,img_1,img_2,contact_id,sync_data];
|
|
|
|
|
|
|
+ sql = [NSString stringWithFormat:@"update offline_contact set company_name = '%@',addr_1 = '%@',addr_2 = '%@',addr_3 = '%@',addr_4 = '%@',country = '%@',state = '%@',city = '%@',zipcode = '%@',first_name = '%@',last_name = '%@',phone = '%@',fax = '%@',email = '%@',notes = '%@',price_type = '%@',sales_rep = '%@',img_0 = '%@',img_1 = '%@',img_2 = '%@',sync_data = '%@' where contact_id = '%@';",companyName,addr1,addr2,addr3,addr4,country,state,city,zipcode,fistName,lastName,phone,fax,email,notes,price,salesRep,img_0,img_1,img_2,sync_data,contact_id];
|
|
|
} else {
|
|
} else {
|
|
|
|
|
|
|
|
[sync_dic setValue:contact_id forKey:@"contact_id"];
|
|
[sync_dic setValue:contact_id forKey:@"contact_id"];
|
|
@@ -3550,7 +3550,7 @@
|
|
|
price_min = [[priceArray objectAtIndex:0] doubleValue];
|
|
price_min = [[priceArray objectAtIndex:0] doubleValue];
|
|
|
price_max = [[priceArray objectAtIndex:1] doubleValue];
|
|
price_max = [[priceArray objectAtIndex:1] doubleValue];
|
|
|
}
|
|
}
|
|
|
- NSLog(@"1、min~max:%lf ~ %lf",price_min,price_max);
|
|
|
|
|
|
|
+ DebugLog(@"1、min~max:%lf ~ %lf",price_min,price_max);
|
|
|
|
|
|
|
|
// sold_by_qty : Sold in quantities of %@
|
|
// sold_by_qty : Sold in quantities of %@
|
|
|
[self check:params[@"sold_by_qty"] valueKey:@"qty" inDictionary:filter];
|
|
[self check:params[@"sold_by_qty"] valueKey:@"qty" inDictionary:filter];
|
|
@@ -3588,8 +3588,8 @@
|
|
|
{
|
|
{
|
|
|
NSMutableDictionary* item = [[NSMutableDictionary alloc] init];
|
|
NSMutableDictionary* item = [[NSMutableDictionary alloc] init];
|
|
|
|
|
|
|
|
- // char *name = (char*)sqlite3_column_text(statement, 1);
|
|
|
|
|
- // NSString *nsNameStr = [[NSString alloc]initWithUTF8String:name];
|
|
|
|
|
|
|
+// char *name = (char*)sqlite3_column_text(statement, 1);
|
|
|
|
|
+// NSString *nsNameStr = [[NSString alloc]initWithUTF8String:name];
|
|
|
|
|
|
|
|
char *name = (char*)sqlite3_column_text(statement, 0);
|
|
char *name = (char*)sqlite3_column_text(statement, 0);
|
|
|
if(name==nil)
|
|
if(name==nil)
|
|
@@ -3634,20 +3634,23 @@
|
|
|
[item setValue:nsdescription forKey:@"description"];
|
|
[item setValue:nsdescription forKey:@"description"];
|
|
|
[item setValue:[NSString stringWithFormat:@"%d",product_id] forKey:@"product_id"];
|
|
[item setValue:[NSString stringWithFormat:@"%d",product_id] forKey:@"product_id"];
|
|
|
|
|
|
|
|
- NSLog(@"2、min~max:%lf ~ %lf",price_min,price_max);
|
|
|
|
|
|
|
+ DebugLog(@"2、min~max:%lf ~ %lf",price_min,price_max);
|
|
|
if (price_min == 0 && price_max == 0) {
|
|
if (price_min == 0 && price_max == 0) {
|
|
|
- NSLog(@"min && max == 0");
|
|
|
|
|
|
|
+
|
|
|
|
|
+ DebugLog(@"min && max == 0");
|
|
|
[items setObject:item forKey:[NSString stringWithFormat:@"item_%d",i]];
|
|
[items setObject:item forKey:[NSString stringWithFormat:@"item_%d",i]];
|
|
|
i++;
|
|
i++;
|
|
|
|
|
+
|
|
|
} else {
|
|
} else {
|
|
|
|
|
|
|
|
NSString *enscrypt_price = [NSString stringWithFormat:@"%s",(char *)sqlite3_column_text(statement, 5)];
|
|
NSString *enscrypt_price = [NSString stringWithFormat:@"%s",(char *)sqlite3_column_text(statement, 5)];
|
|
|
double price = [[AESCrypt fastdecrypt:enscrypt_price] doubleValue];
|
|
double price = [[AESCrypt fastdecrypt:enscrypt_price] doubleValue];
|
|
|
- NSLog(@"product price:%lf",price);
|
|
|
|
|
|
|
+ DebugLog(@"product price:%lf",price);
|
|
|
|
|
|
|
|
if (price >= price_min && price <= price_max) {
|
|
if (price >= price_min && price <= price_max) {
|
|
|
[items setObject:item forKey:[NSString stringWithFormat:@"item_%d",i]];
|
|
[items setObject:item forKey:[NSString stringWithFormat:@"item_%d",i]];
|
|
|
i++;
|
|
i++;
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -3657,9 +3660,9 @@
|
|
|
[ret setObject:items forKey:@"items"];
|
|
[ret setObject:items forKey:@"items"];
|
|
|
sqlite3_finalize(statement);
|
|
sqlite3_finalize(statement);
|
|
|
} else {
|
|
} else {
|
|
|
- NSLog(@"nothing...");
|
|
|
|
|
|
|
+ DebugLog(@"nothing...");
|
|
|
}
|
|
}
|
|
|
- NSLog(@"count:%d",count);
|
|
|
|
|
|
|
+ DebugLog(@"count:%d",count);
|
|
|
|
|
|
|
|
|
|
|
|
|
[iSalesDB close_db:db];
|
|
[iSalesDB close_db:db];
|