|
|
@@ -2102,6 +2102,40 @@
|
|
|
// }
|
|
|
}
|
|
|
}
|
|
|
++(NSString*) getScanOrderPathByCode:(NSString*) order_code
|
|
|
+{
|
|
|
+ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
|
|
+ NSString *documents = [paths objectAtIndex:0];
|
|
|
+
|
|
|
+ NSDictionary *addressDic = [[NSUserDefaults standardUserDefaults] valueForKey:@"ScanAddress"];
|
|
|
+
|
|
|
+ NSString* servername = addressDic[@"name"];
|
|
|
+ AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
+ NSString* user = appDelegate.user;
|
|
|
+ NSString* orderpath = [documents stringByAppendingPathComponent:servername];
|
|
|
+ orderpath = [orderpath stringByAppendingPathComponent:user];
|
|
|
+ orderpath = [orderpath stringByAppendingPathComponent:order_code];
|
|
|
+ BOOL bdir=YES;
|
|
|
+ NSFileManager* fileManager = [NSFileManager defaultManager];
|
|
|
+ if(! [fileManager fileExistsAtPath:orderpath isDirectory:&bdir])
|
|
|
+ {
|
|
|
+
|
|
|
+ NSError *error = nil;
|
|
|
+ bool bsuccess=[fileManager createDirectoryAtPath:orderpath withIntermediateDirectories:YES attributes:nil error:&error];
|
|
|
+
|
|
|
+ if(!bsuccess)
|
|
|
+ DebugLog(@"Create cache folder failed");
|
|
|
+
|
|
|
+ // if(bsuccess)
|
|
|
+ // {
|
|
|
+ // sqlite3 *db = [self get_db];
|
|
|
+ //
|
|
|
+ // [self execSql:[NSString stringWithFormat:@"insert into img_cache(name) values('%@')",name] db:db];
|
|
|
+ // [iSalesDB close_db:db];
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ return orderpath;
|
|
|
+}
|
|
|
+(NSString*) getScanOrderPath
|
|
|
{
|
|
|
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
|
|
@@ -2376,6 +2410,16 @@
|
|
|
|
|
|
s+=msurcharge;
|
|
|
}
|
|
|
+
|
|
|
+ NSMutableDictionary* section =RASingleton.sharedInstance.scan_cart[@"section_0"];
|
|
|
+ int order_qty=0;
|
|
|
+ for(int c=0;c<[section[@"count"] intValue];c++)
|
|
|
+ {
|
|
|
+ NSDictionary* item = section[[NSString stringWithFormat:@"item_%d",c]];
|
|
|
+ order_qty+=[item[@"count"] intValue];
|
|
|
+
|
|
|
+ }
|
|
|
+// orderitem[@"model_count"] =[ NSString stringWithFormat:@"%@",order_qty];
|
|
|
// int newcount = 0;
|
|
|
for(int i=0;i<count;i++)
|
|
|
{
|
|
|
@@ -2383,7 +2427,7 @@
|
|
|
if([item[@"order_code"] isEqualToString: order_code ])
|
|
|
{
|
|
|
item[@"price"] = [NSString stringWithFormat:@"%.2f",p+s];
|
|
|
- item[@"model_count"] =[ NSString stringWithFormat:@"%@",RASingleton.sharedInstance.scan_cart[@"section_0"][@"count"] ];
|
|
|
+ item[@"model_count"] =[ NSString stringWithFormat:@"%d",order_qty];//RASingleton.sharedInstance.scan_cart[@"section_0"][@"count"] ];
|
|
|
orderlist[[NSString stringWithFormat:@"item_%d",i]] = item;
|
|
|
}
|
|
|
|