Răsfoiți Sursa

还原ADD To Portfolio。

Pen Li 9 ani în urmă
părinte
comite
92fb1deec2

BIN
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/macmini1.xcuserdatad/UserInterfaceState.xcuserstate


+ 2 - 2
RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m

@@ -10508,9 +10508,9 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     
     NSString *prodct_ids = [params objectForKey:@"product_id"];
 //    NSString *user = [params objectForKey:@"user"];
-    NSString *sql = [NSString stringWithFormat:@"insert into offline_portfolio (product_id,name,description,item_id) select * from (select p.product_id,p.name,p.description,p.item_id from product as p where p.product_id in (%@) and (select count(0) from offline_portfolio where product_id in (%@) and (is_delete is null or is_delete = 0)) = 0);",prodct_ids,prodct_ids];
+//    NSString *sql = [NSString stringWithFormat:@"insert into offline_portfolio (product_id,name,description,item_id) select * from (select p.product_id,p.name,p.description,p.item_id from product as p where p.product_id in (%@) and (select count(0) from offline_portfolio where product_id in (%@) and (is_delete is null or is_delete = 0)) = 0);",prodct_ids,prodct_ids];
     
-//    NSString *sql = @"delete from offline_portfolio;insert into offline_portfolio (product_id,name,description,item_id,fashion_id,available_qty,percent,percentage,sheet_price,sheet_discount,line_note)values(3715,'108237-318','Charlotte Fabric Chair, Cotton Cream',1054,4841,null,null,0,100.0,50.0,'Line Note');insert into offline_portfolio (product_id,name,description,item_id,fashion_id,available_qty,percent,percentage,sheet_price,sheet_discount,line_note)values(3716,'108237-318N','Charlotte Fabric Chair NWO Legs, Cotton Cream',1056,4842,null,null,0,77.0,10.0,'A O');";
+    NSString *sql = [NSString stringWithFormat:@"insert into offline_portfolio (product_id,name,description,item_id) select * from (select p.product_id,p.name,p.description,p.item_id from product as p where p.product_id in (%@) and p.product_id not in (select product_id from offline_portfolio));insert into offline_portfolio (product_id,name,description,item_id,is_delete) select * from (select p.product_id,p.name,p.description,p.item_id,0 from product as p left join offline_portfolio as f on p.product_id = f.product_id where p.product_id in (%@) and p.product_id in (select product_id from offline_portfolio) and f.is_delete = 1);delete from offline_portfolio where (select count(0) from offline_portfolio where product_id in (%@)) > 1 and is_delete = 1;",prodct_ids,prodct_ids,prodct_ids];
     
     int result = [iSalesDB execSql:sql];