|
@@ -60,7 +60,7 @@ class FyyOrderService extends Service
|
|
$args = '';
|
|
$args = '';
|
|
if(! empty($return_stock_detail)){
|
|
if(! empty($return_stock_detail)){
|
|
foreach ($return_stock_detail as $value){
|
|
foreach ($return_stock_detail as $value){
|
|
- $args .= "(product_no = '{$value['product_no']}' and technology_name = '{$value['technology_name']}' and wood_name = '{$value['wood_name']}') OR ";
|
|
|
|
|
|
+ $args .= "(product_no = '{$value['product_no']}' and technology_name = '{$value['technology_name']}') OR ";
|
|
}
|
|
}
|
|
$args = rtrim($args,'OR ');
|
|
$args = rtrim($args,'OR ');
|
|
SaleOrdersProductStockDetail::where('del_time',0)
|
|
SaleOrdersProductStockDetail::where('del_time',0)
|
|
@@ -101,7 +101,7 @@ class FyyOrderService extends Service
|
|
|
|
|
|
public function orderList($data){
|
|
public function orderList($data){
|
|
$model = SaleOrdersProduct::where('del_time',0)
|
|
$model = SaleOrdersProduct::where('del_time',0)
|
|
- ->select('id','order_no','out_order_no','out_order_no_time','customer_no','customer_name','table_header_mark','product_no','product_title','product_size','product_unit','order_quantity','technology_material','technology_name','wood_name','process_mark','table_body_mark','out_crt_man','out_checker_man','out_checker_time','production_quantity','box_num','finished_num','shipment_num')
|
|
|
|
|
|
+ ->select('id','order_no','out_order_no','out_order_no_time','customer_no','customer_name','table_header_mark','product_no','product_title','product_size','product_unit','order_quantity','technology_material','technology_name','wood_name','process_mark','table_body_mark','out_crt_man','out_checker_man','out_checker_time','production_quantity','box_num','finished_num','shipment_num','pre_shipment_time')
|
|
->orderBy('crt_time','desc')
|
|
->orderBy('crt_time','desc')
|
|
->orderBy('id','asc');
|
|
->orderBy('id','asc');
|
|
|
|
|
|
@@ -132,6 +132,7 @@ class FyyOrderService extends Service
|
|
if(! empty($data['out_crt_man'])) $model->where('out_crt_man', 'LIKE', '%'.$data['out_crt_man'].'%');
|
|
if(! empty($data['out_crt_man'])) $model->where('out_crt_man', 'LIKE', '%'.$data['out_crt_man'].'%');
|
|
if(! empty($data['out_checker_time'][0]) && ! empty($data['out_checker_time'][1])) $model->whereBetween('out_checker_time',[$data['out_checker_time'][0],$data['out_checker_time'][1]]);
|
|
if(! empty($data['out_checker_time'][0]) && ! empty($data['out_checker_time'][1])) $model->whereBetween('out_checker_time',[$data['out_checker_time'][0],$data['out_checker_time'][1]]);
|
|
if(! empty($data['out_order_no_time'][0]) && ! empty($data['out_order_no_time'][1])) $model->whereBetween('out_order_no_time',[$data['out_order_no_time'][0],$data['out_order_no_time'][1]]);
|
|
if(! empty($data['out_order_no_time'][0]) && ! empty($data['out_order_no_time'][1])) $model->whereBetween('out_order_no_time',[$data['out_order_no_time'][0],$data['out_order_no_time'][1]]);
|
|
|
|
+ if(! empty($data['pre_shipment_time'][0]) && ! empty($data['pre_shipment_time'][1])) $model->whereBetween('pre_shipment_time',[$data['pre_shipment_time'][0],$data['pre_shipment_time'][1]]);
|
|
if(isset($data['status'])) $model->where('status',$data['status']);
|
|
if(isset($data['status'])) $model->where('status',$data['status']);
|
|
if(isset($data['is_create'])) {
|
|
if(isset($data['is_create'])) {
|
|
if($data['is_create']){
|
|
if($data['is_create']){
|
|
@@ -168,7 +169,6 @@ class FyyOrderService extends Service
|
|
return [true, $list];
|
|
return [true, $list];
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
public function fillData($data){
|
|
public function fillData($data){
|
|
if(empty($data['data'])) return $data;
|
|
if(empty($data['data'])) return $data;
|
|
|
|
|
|
@@ -197,6 +197,7 @@ class FyyOrderService extends Service
|
|
$data['data'][$key]['sub'] = $detail_map[$keys] ?? [];
|
|
$data['data'][$key]['sub'] = $detail_map[$keys] ?? [];
|
|
$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]['pre_shipment_time'] = $value['pre_shipment_time'] ? date('Y-m-d',$value['pre_shipment_time']) : '';
|
|
$data['data'][$key]['product_quantity_on_hand'] = $detailMap[$keys] ?? 0;
|
|
$data['data'][$key]['product_quantity_on_hand'] = $detailMap[$keys] ?? 0;
|
|
if($value['production_quantity'] >= $value['order_quantity']){
|
|
if($value['production_quantity'] >= $value['order_quantity']){
|
|
$data['data'][$key]['is_create'] = 1;
|
|
$data['data'][$key]['is_create'] = 1;
|
|
@@ -231,7 +232,7 @@ class FyyOrderService extends Service
|
|
try {
|
|
try {
|
|
$args = '';
|
|
$args = '';
|
|
foreach ($return_product as $value){
|
|
foreach ($return_product as $value){
|
|
- $args .= "(product_no = '{$value['product_no']}' and technology_name = '{$value['technology_name']}' and wood_name = '{$value['wood_name']}') OR ";
|
|
|
|
|
|
+ $args .= "(product_no = '{$value['product_no']}' and technology_name = '{$value['technology_name']}') OR ";
|
|
}
|
|
}
|
|
$args = rtrim($args,'OR ');
|
|
$args = rtrim($args,'OR ');
|
|
SaleOrdersProductStockDetail::where('del_time',0)
|
|
SaleOrdersProductStockDetail::where('del_time',0)
|
|
@@ -246,7 +247,7 @@ class FyyOrderService extends Service
|
|
return [false,$exception->getMessage()];
|
|
return [false,$exception->getMessage()];
|
|
}
|
|
}
|
|
|
|
|
|
- return [true,''];
|
|
|
|
|
|
+ return [true, ''];
|
|
}
|
|
}
|
|
|
|
|
|
public function fyySaveOutOrder($data,$user){
|
|
public function fyySaveOutOrder($data,$user){
|
|
@@ -406,13 +407,12 @@ class FyyOrderService extends Service
|
|
'cdlcode' => $value['cdlcode'],
|
|
'cdlcode' => $value['cdlcode'],
|
|
'product_no' => $value['cinvcode'],//产品编码
|
|
'product_no' => $value['cinvcode'],//产品编码
|
|
'product_title' => $value['product_title'],
|
|
'product_title' => $value['product_title'],
|
|
- 'product_size' => $value['product_size'],
|
|
|
|
|
|
+ 'product_size' => $value['product_size'] ?? "",
|
|
'technology_name' => $cfree1 ?? '',
|
|
'technology_name' => $cfree1 ?? '',
|
|
'wood_name' => $cfree2 ?? '',
|
|
'wood_name' => $cfree2 ?? '',
|
|
'num' => $n,
|
|
'num' => $n,
|
|
'technology_material' => $value['technology_material'] ?? '',
|
|
'technology_material' => $value['technology_material'] ?? '',
|
|
'process_mark' => $value['process_mark'] ?? '',
|
|
'process_mark' => $value['process_mark'] ?? '',
|
|
- 'product_size' => $value['product_size'] ?? ''
|
|
|
|
];
|
|
];
|
|
}
|
|
}
|
|
|
|
|