|
@@ -372,11 +372,13 @@ class FyySqlServerService extends Service
|
|
|
|
|
|
$new = [];
|
|
|
foreach ($data as $value){
|
|
|
- $new[$value['id']][] = $value;
|
|
|
+ $keys = $value['id'] . $value['cwhcode'];
|
|
|
+ $new[$keys][] = $value;
|
|
|
}
|
|
|
|
|
|
foreach ($new as $value){
|
|
|
$main_tmp = $value[0];
|
|
|
+ $bodys_tmp = [];
|
|
|
foreach ($value as $val){
|
|
|
$bodys_tmp[] = [
|
|
|
"idlsid"=>$val['idlsid'],
|
|
@@ -389,8 +391,8 @@ class FyySqlServerService extends Service
|
|
|
"iquantity"=>$val['iquantity'],
|
|
|
"inum"=>$val['inum'],
|
|
|
"iinvexchrate"=> $val['iinvexchrate'] ?? 0,
|
|
|
- "iunitcost"=>$val['iunitcost'],
|
|
|
- "iprice"=>$val['imoney'],
|
|
|
+ "iunitcost"=>$val['iunitcost'] * 0.95,
|
|
|
+ "iprice"=>$val['iunitcost'] * 0.95 * $val['iquantity'],
|
|
|
"cbmemo"=>"",
|
|
|
];
|
|
|
}
|
|
@@ -414,6 +416,7 @@ class FyySqlServerService extends Service
|
|
|
"bredvouch"=> $bredvouch,
|
|
|
"cwhcode"=>$main_tmp['cwhcode'],
|
|
|
"cdepcode"=>$main_tmp['cdepcode'],
|
|
|
+ "ccuscode"=>$main_tmp['cuscode'],
|
|
|
"crdcode"=>'',
|
|
|
"cmemo"=> '',
|
|
|
"cdefine10" => $main_tmp['customer_name'], //客户名称
|
|
@@ -542,7 +545,7 @@ class FyySqlServerService extends Service
|
|
|
}
|
|
|
if(! empty($data['order_no'])) $model->where('a.cSOcode',$data['order_no']);
|
|
|
|
|
|
- $message = $model->select('a.cDLCode as cdlcode','a.DLID as id','a.cDefine10 as customer_name','a.cSOCode as csocode','a.cDepCode as cdepcode','a.cCusCode as cuscode','b.iDLsID as idlsid','b.cWhCode as cwhcode','b.cInvCode as cinvcode','b.cInvName as product_title','b.cFree1 as cfree1','b.cFree2 as cfree2','b.cPosition as cposition','b.cBatch as cbatch','b.iQuantity as iquantity','b.iNum as inum','b.iInvExchRate as iinvexchrate','b.fOutQuantity as out_quantity','b.iUnitPrice as iunitcost','b.iMoney as imoney')
|
|
|
+ $message = $model->select('a.cDLCode as cdlcode','a.DLID as id','a.cDefine10 as customer_name','a.cSOCode as csocode','a.cDepCode as cdepcode','a.cCusCode as cuscode','b.iDLsID as idlsid','b.cWhCode as cwhcode','b.cInvCode as cinvcode','b.cInvName as product_title','b.cFree1 as cfree1','b.cFree2 as cfree2','b.cPosition as cposition','b.cBatch as cbatch','b.iQuantity as iquantity','b.iNum as inum','b.iInvExchRate as iinvexchrate','b.fOutQuantity as out_quantity','b.iUnitPrice as iunitcost','b.iMoney as imoney','b.cDefine28 as technology_material')
|
|
|
->get()->toArray();
|
|
|
|
|
|
if(! empty($message)){
|