|
|
- Rows detailRows = dbConnect.runSqlQuery("select t1.sa_dispatchid ,t1.sa_dispatch_itemsid sainvoicedetailid,t2.itemno fitemno,t2.k3outcode fk3outcode,t1.qty fqty,t3.price fprice,t1.remarks fnotes,t3.spec customproperties,t2.spec flong from sa_dispatch_items t1 inner join plm_item t2 on t1.itemid=t2.itemid and t1.siteid=t2.siteid inner join sa_orderitems t3 on t1.sa_orderitemsid=t3.sa_orderitemsid and t1.siteid=t3.siteid where t1.sa_dispatchid in" + rows.toJsonArray("sainvoiceid").toJSONString().replace("[", "(").replace("]", ")") + " and t1.siteid='lsa'");
|
|
|
+ Rows detailRows = dbConnect.runSqlQuery("select t1.sa_dispatchid ,t1.sa_dispatch_itemsid sainvoicedetailid,t2.itemno fitemno,t2.k3outcode fk3outcode,t1.qty fqty,t3.price fprice,t1.remarks fnotes,t3.spec customproperties,t2.spec flong,t4.sa_accountclassinfos from sa_dispatch_items t1 inner join plm_item t2 on t1.itemid=t2.itemid and t1.siteid=t2.siteid inner join sa_orderitems t3 on t1.sa_orderitemsid=t3.sa_orderitemsid and t1.siteid=t3.siteid left join (SELECT sa_orderid,t1.siteid,if(ifnull(replace(replace(replace(JSON_EXTRACT (t1.sa_accountclassinfos, '$**.accountname' ),'[',''),']',''),'\"',''),'')='',t2.accountname,replace(replace(replace(JSON_EXTRACT (t1.sa_accountclassinfos, '$**.accountname' ),'[',''),']',''),'\"','')) as sa_accountclassinfos FROM sa_order t1 left join sa_accountclass t2 on t1.sa_accountclassid=t2.sa_accountclassid and t1.siteid=t2.siteid) t4 on t3.sa_orderid=t4.sa_orderid and t3.siteid=t4.siteid where t1.sa_dispatchid in" + rows.toJsonArray("sainvoiceid").toJSONString().replace("[", "(").replace("]", ")") + " and t1.siteid='lsa'");
|