cqpCow 1 year ago
parent
commit
af0deb9045
1 changed files with 4 additions and 4 deletions
  1. 4 4
      app/Service/PurchaseOrderService.php

+ 4 - 4
app/Service/PurchaseOrderService.php

@@ -258,18 +258,18 @@ class PurchaseOrderService extends Service
         $order['return_exchange'] = (new ReturnExchangeOrderService())->getDifferentAmount($order['id'],ReturnExchangeOrder::Order_type2);
         $order['return_exchange_amount'] = 0;
         foreach ($order['return_exchange'] as $value){
-            if($value['state'] == ReturnExchangeOrder::State_two)  $sales['return_exchange_amount'] += $value['difference_amount'];
+            if($value['state'] == ReturnExchangeOrder::State_two)  $order['return_exchange_amount'] += $value['difference_amount'];
         }
 
         //回款单信息 审核过的
         $order['payment_receipt_list'] = (new PaymentReceiptService())->getPaymentReceiptDataList($order,PaymentReceipt::data_type_two);
         //坏账金额 = 已审核退货退款金额 - 红冲金额
-        $sales['payment_receipt_list']['bad_amount'] = bcsub($sales['return_exchange_amount'], $sales['payment_receipt_list']['red_amount'],2);
+        $order['payment_receipt_list']['bad_amount'] = bcsub($order['return_exchange_amount'], $order['payment_receipt_list']['red_amount'],2);
         //未回款金额 = 总金额 - 已回款金额 - 坏账金额
-        $sales['payment_receipt_list']['not_receipt_amount'] = bcsub(bcsub($sales['purchase_total'], $sales['payment_receipt_list']['receipt_amount']), $sales['payment_receipt_list']['bad_amount'], 2);
+        $order['payment_receipt_list']['not_receipt_amount'] = bcsub(bcsub($order['purchase_total'], $order['payment_receipt_list']['receipt_amount']), $order['payment_receipt_list']['bad_amount'], 2);
         //回款单信息 审核过的
 
-        $order['not_payment_receipt_amount'] =  bcsub($sales['purchase_total'],$sales['payment_receipt_list']['not_confirm_receipt_amount'],2);
+        $order['not_payment_receipt_amount'] =  bcsub($order['purchase_total'],$order['payment_receipt_list']['not_confirm_receipt_amount'],2);
 
         return [true, $order];
     }