|
|
@@ -1474,6 +1474,8 @@
|
|
|
}
|
|
|
+(NSDictionary*) model_bundle:(int) item_id db:(sqlite3*)db compute_part:(bool)compute
|
|
|
{
|
|
|
+ UIApplication * app = [UIApplication sharedApplication];
|
|
|
+ AppDelegate *appDelegate = (AppDelegate *)[app delegate];
|
|
|
|
|
|
NSMutableDictionary* ret = [[NSMutableDictionary alloc]init];
|
|
|
|
|
|
@@ -1506,7 +1508,7 @@
|
|
|
int use_unitprice = sqlite3_column_int(statement, 5);
|
|
|
if(use_unitprice!=1)
|
|
|
{
|
|
|
- unit_price=0;
|
|
|
+ unit_price=[self get_model_default_price:appDelegate.contact_id product_id:nil item_id:@(item_id) db:db].doubleValue;
|
|
|
}
|
|
|
|
|
|
itemjson[@"model"]=nsname;
|
|
|
@@ -1696,7 +1698,7 @@
|
|
|
|
|
|
char *str_price = (char*)sqlite3_column_text(statement, 1);
|
|
|
|
|
|
- int item_id = sqlite3_column_int(statement, 8);
|
|
|
+ int item_id = sqlite3_column_int(statement, 7);
|
|
|
|
|
|
NSString* Price=nil;
|
|
|
if(str_price==nil)
|
|
|
@@ -1736,8 +1738,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
- int stockUom = sqlite3_column_int(statement, 9);
|
|
|
- int _id = sqlite3_column_int(statement, 10);
|
|
|
+ int stockUom = sqlite3_column_int(statement, 8);
|
|
|
+ int _id = sqlite3_column_int(statement, 9);
|
|
|
|
|
|
|
|
|
NSDictionary* bsubtotaljson=[self model_subtotal:item_id count:item_count db:db compute_part:true];
|