|
|
@@ -3444,7 +3444,7 @@
|
|
|
|
|
|
NSMutableDictionary* ret = [[NSMutableDictionary alloc] init];
|
|
|
|
|
|
- NSString *where = [NSString stringWithFormat:@" %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ ",contactType,contact_name,customer_phone,customer_fax,customer_zipcode,customer_sales_rep,customer_state,customer_name,customer_country,customer_cid,customer_city,customer_address,customer_email,price_name];
|
|
|
+ NSString *where = [NSString stringWithFormat:@" %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ and is_active=1 ",contactType,contact_name,customer_phone,customer_fax,customer_zipcode,customer_sales_rep,customer_state,customer_name,customer_country,customer_cid,customer_city,customer_address,customer_email,price_name];
|
|
|
|
|
|
|
|
|
NSString *sql = [NSString stringWithFormat:@"select editable,company_name,country,addr,zipcode,state,city,contact_name,phone,contact_id,addr_1,addr_2,addr_3,addr_4,first_name,last_name,fax,email from offline_contact where %@ order by decrypt(company_name) limit %d offset %d",where,limit,offset];
|
|
|
@@ -3476,9 +3476,9 @@
|
|
|
keyword = keyword.lowercaseString;
|
|
|
keyword = [keyword stringByReplacingOccurrencesOfString:@"'" withString:@"''"];
|
|
|
|
|
|
- sqlQuery=[NSString stringWithFormat:@"select editable,company_name,country,addr,zipcode,state,city,contact_name,phone,contact_id,addr_1,addr_2,addr_3,addr_4,first_name,last_name,fax,email from offline_contact where %@ and (lower(contact_id ) like'%%%@%%' or lower(decrypt(company_name)) like '%%%@%%' or lower(decrypt(phone)) like '%%%@%%' or lower(decrypt(addr)) like '%%%@%%') order by decrypt(company_name) limit %d offset %d",contactType , keyword,keyword,keyword,keyword,limit, offset];
|
|
|
+ sqlQuery=[NSString stringWithFormat:@"select editable,company_name,country,addr,zipcode,state,city,contact_name,phone,contact_id,addr_1,addr_2,addr_3,addr_4,first_name,last_name,fax,email from offline_contact where %@ and (lower(contact_id ) like'%%%@%%' or lower(decrypt(company_name)) like '%%%@%%' or lower(decrypt(phone)) like '%%%@%%' or lower(decrypt(addr)) like '%%%@%%') and is_active=1 order by decrypt(company_name) limit %d offset %d",contactType , keyword,keyword,keyword,keyword,limit, offset];
|
|
|
|
|
|
- count=[iSalesDB get_recordcount:db table:@"offline_contact" where:[NSString stringWithFormat:@"%@=1 and (lower(contact_id ) like'%@' or lower(company_name) like'%@')",contactType,keyword,keyword]];
|
|
|
+ count=[iSalesDB get_recordcount:db table:@"offline_contact" where:[NSString stringWithFormat:@"%@=1 and (lower(contact_id ) like'%@' or lower(company_name) like'%@') and is_active=1",contactType,keyword,keyword]];
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -5161,7 +5161,7 @@
|
|
|
}
|
|
|
|
|
|
|
|
|
- int discount = sqlite3_column_int(stmt, 2);
|
|
|
+ double discount = sqlite3_column_int(stmt, 2);
|
|
|
int item_count = sqlite3_column_int(stmt, 3);
|
|
|
|
|
|
char *line_note = (char*)sqlite3_column_text(stmt, 4);
|
|
|
@@ -5225,6 +5225,7 @@
|
|
|
|
|
|
|
|
|
itemjson[@"Subtotal"] = [NSString stringWithFormat:@"%.2f",subTotal];
|
|
|
+ NSLog(@"item unite price: %@ \n discount: %f item count: %d subTotal: %f",Price,discount,item_count,subTotal);
|
|
|
|
|
|
|
|
|
ret[[NSString stringWithFormat:@"item_%ld",(*count)++]]=itemjson;
|