|
@@ -162,31 +162,32 @@ class SalesOrderService extends Service
|
|
|
// }
|
|
|
// SalesOrderInfo::insert($insert);
|
|
|
// }
|
|
|
- $new = $old = [];
|
|
|
- $order = PaymentReceipt::where('del_time',0)
|
|
|
- ->where('crt_time',$model->crt_time)
|
|
|
- ->where('data_order_no',$data['order_number'])
|
|
|
- ->first();
|
|
|
- if(! empty($order)){
|
|
|
- $old = PaymentReceiptInfo::where('del_time',0)
|
|
|
- ->where('payment_receipt_id',$order->id)
|
|
|
- ->whereIn('type',[PaymentReceiptInfo::type_one])
|
|
|
- ->select('file')
|
|
|
- ->get()->toArray();
|
|
|
- $old = array_column($old,'file');
|
|
|
- }
|
|
|
|
|
|
- //收付款信息
|
|
|
- if(! empty($data['payment_receipt'])){
|
|
|
- if(empty($order)){
|
|
|
- $this->savePaymentReceiptOrder($data,$user,$time);
|
|
|
- }else{
|
|
|
- PaymentReceiptInfo::where('del_time',0)
|
|
|
- ->where('payment_receipt_id',$order->id)
|
|
|
- ->update(['del_time' => $time]);
|
|
|
- $this->savePaymentReceiptOrder($data,$user,$time,$order);
|
|
|
- }
|
|
|
- }
|
|
|
+// $new = $old = [];
|
|
|
+// $order = PaymentReceipt::where('del_time',0)
|
|
|
+// ->where('crt_time',$model->crt_time)
|
|
|
+// ->where('data_order_no',$data['order_number'])
|
|
|
+// ->first();
|
|
|
+// if(! empty($order)){
|
|
|
+// $old = PaymentReceiptInfo::where('del_time',0)
|
|
|
+// ->where('payment_receipt_id',$order->id)
|
|
|
+// ->whereIn('type',[PaymentReceiptInfo::type_one])
|
|
|
+// ->select('file')
|
|
|
+// ->get()->toArray();
|
|
|
+// $old = array_column($old,'file');
|
|
|
+// }
|
|
|
+//
|
|
|
+// //收付款信息
|
|
|
+// if(! empty($data['payment_receipt'])){
|
|
|
+// if(empty($order)){
|
|
|
+// $this->savePaymentReceiptOrder($data,$user,$time);
|
|
|
+// }else{
|
|
|
+// PaymentReceiptInfo::where('del_time',0)
|
|
|
+// ->where('payment_receipt_id',$order->id)
|
|
|
+// ->update(['del_time' => $time]);
|
|
|
+// $this->savePaymentReceiptOrder($data,$user,$time,$order);
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
DB::commit();
|
|
|
}catch (\Exception $exception){
|
|
@@ -194,7 +195,7 @@ class SalesOrderService extends Service
|
|
|
return [false,$exception->getMessage()];
|
|
|
}
|
|
|
|
|
|
- $this->delStorageFile($old, $new);
|
|
|
+// $this->delStorageFile($old, $new);
|
|
|
|
|
|
if(! empty($data['check'])) {
|
|
|
list($status,$msg) = (new CheckService())->checkAll([
|
|
@@ -311,7 +312,6 @@ class SalesOrderService extends Service
|
|
|
// }
|
|
|
// SalesOrderInfo::insert($insert);
|
|
|
// }
|
|
|
-
|
|
|
if(! empty($data['product'])){
|
|
|
$insert = [];
|
|
|
foreach ($data['product'] as $value){
|
|
@@ -458,20 +458,6 @@ class SalesOrderService extends Service
|
|
|
try {
|
|
|
DB::beginTransaction();
|
|
|
|
|
|
- $old = [];
|
|
|
- $order = PaymentReceipt::where('del_time',0)
|
|
|
- ->where('crt_time',$sale_order['crt_time'])
|
|
|
- ->where('data_order_no',$data['order_number'])
|
|
|
- ->first();
|
|
|
- if(! empty($order)){
|
|
|
- $old = PaymentReceiptInfo::where('del_time',0)
|
|
|
- ->where('payment_receipt_id',$order->id)
|
|
|
- ->whereIn('type',[PaymentReceiptInfo::type_one])
|
|
|
- ->select('file')
|
|
|
- ->get()->toArray();
|
|
|
- $old = array_column($old,'file');
|
|
|
- }
|
|
|
-
|
|
|
SalesOrder::where('del_time',0)
|
|
|
->where('id',$data['id'])->update(['del_time'=> time()]);
|
|
|
|
|
@@ -499,7 +485,7 @@ class SalesOrderService extends Service
|
|
|
return [false,$exception->getMessage()];
|
|
|
}
|
|
|
|
|
|
- $this->delStorageFile($old);
|
|
|
+// $this->delStorageFile($old);
|
|
|
|
|
|
return [true,''];
|
|
|
}
|
|
@@ -667,7 +653,7 @@ class SalesOrderService extends Service
|
|
|
$sales['payment_receipt_list'] = (new PaymentReceiptService())->getPaymentReceiptDataList($sales);
|
|
|
|
|
|
//详情里的收付款信息
|
|
|
- $sales['payment_receipt'] = (new PaymentReceiptService())->getPaymentReceiptDeatail($sales);
|
|
|
+// $sales['payment_receipt'] = (new PaymentReceiptService())->getPaymentReceiptDeatail($sales);
|
|
|
|
|
|
return [true, $sales];
|
|
|
}
|
|
@@ -812,7 +798,8 @@ class SalesOrderService extends Service
|
|
|
//收付款信息
|
|
|
if(! empty($data['payment_receipt']['order_number'])){
|
|
|
if(empty($data['payment_receipt']['data_type'])) $data['payment_receipt']['data_type'] = PaymentReceipt::data_type_one;
|
|
|
- if(empty($data['payment_receipt']['data_type']['type'])) return [false,'金额类型不能为空'];
|
|
|
+ if(empty($data['payment_receipt']['data_order_no'])) $data['payment_receipt']['data_order_no'] = $data['payment_receipt']['order_number'];
|
|
|
+ if(empty($data['payment_receipt']['type'])) return [false,'金额类型不能为空'];
|
|
|
if(empty($data['payment_receipt']['amount'])) return [false,'回款金额不能为空'];
|
|
|
$res = $this->checkNumber($data['payment_receipt']['amount']);
|
|
|
if(! $res) return [false, '回款金额请输入不超过两位小数并且大于0的数值'];
|