|
@@ -471,7 +471,7 @@ class DispatchService extends Service
|
|
$map = $this->getDispatchQuantity(array_column($data['data'],'id'));
|
|
$map = $this->getDispatchQuantity(array_column($data['data'],'id'));
|
|
$emp_map = Employee::whereIn('id',array_column($data['data'],'crt_id'))
|
|
$emp_map = Employee::whereIn('id',array_column($data['data'],'crt_id'))
|
|
->pluck('emp_name','id')
|
|
->pluck('emp_name','id')
|
|
- ->toArray();
|
|
|
|
|
|
+ ->toArray();dd($map);
|
|
|
|
|
|
$tech = Technology::where('id',9)->first();
|
|
$tech = Technology::where('id',9)->first();
|
|
$process_id_str = "";
|
|
$process_id_str = "";
|
|
@@ -489,7 +489,8 @@ class DispatchService extends Service
|
|
$last_process = end($tmp);
|
|
$last_process = end($tmp);
|
|
$dispatch_quantity = $last_process['dispatch_quantity'] ?? 0;
|
|
$dispatch_quantity = $last_process['dispatch_quantity'] ?? 0;
|
|
$data['data'][$key]['dispatch_quantity'] = $dispatch_quantity;
|
|
$data['data'][$key]['dispatch_quantity'] = $dispatch_quantity;
|
|
- $data['data'][$key]['not_dispatch_quantity'] = bcsub($value['production_quantity'], $dispatch_quantity,3);
|
|
|
|
|
|
+ $not_dispatch_quantity = bcsub($value['production_quantity'], $dispatch_quantity,3);
|
|
|
|
+ $data['data'][$key]['not_dispatch_quantity'] = $not_dispatch_quantity >= 0 ? $not_dispatch_quantity : 0;
|
|
$data['data'][$key]['out_order_no_time'] = $value['out_order_no_time'] ? date('Y-m-d',$value['out_order_no_time']) : '';
|
|
$data['data'][$key]['out_order_no_time'] = $value['out_order_no_time'] ? date('Y-m-d',$value['out_order_no_time']) : '';
|
|
$data['data'][$key]['out_checker_time'] = $value['out_checker_time'] ? date('Y-m-d',$value['out_checker_time']) : '';
|
|
$data['data'][$key]['out_checker_time'] = $value['out_checker_time'] ? date('Y-m-d',$value['out_checker_time']) : '';
|
|
$data['data'][$key]['production_time'] = $value['production_time'] ? date('Y-m-d',$value['production_time']) : '';
|
|
$data['data'][$key]['production_time'] = $value['production_time'] ? date('Y-m-d',$value['production_time']) : '';
|
|
@@ -544,7 +545,8 @@ class DispatchService extends Service
|
|
foreach ($result as $value){
|
|
foreach ($result as $value){
|
|
$key = $value['order_product_id'] . $value['process_id'];
|
|
$key = $value['order_product_id'] . $value['process_id'];
|
|
if(isset($return[$key])){
|
|
if(isset($return[$key])){
|
|
- $return[$key] += $value['dispatch_quantity'];
|
|
|
|
|
|
+ $tmp = bcadd($return[$key],$value['dispatch_quantity'],3);
|
|
|
|
+ $return[$key] = $tmp;
|
|
}else{
|
|
}else{
|
|
$return[$key] = $value['dispatch_quantity'];
|
|
$return[$key] = $value['dispatch_quantity'];
|
|
}
|
|
}
|