cqpCow 11 meses atrás
pai
commit
f65f83cd20

+ 1 - 0
app/Service/PurchaseOrderService.php

@@ -279,6 +279,7 @@ class PurchaseOrderService extends Service
         $order['payment_receipt_list'] = (new PaymentReceiptService())->getPaymentReceiptDataList($order);
         //总回款金额 = 采购金额 - 退换货金额 - 坏账金额
         $total = $order['purchase_total'] - $order['return_exchange_amount'] - $order['payment_receipt_list']['bad_amount'];
+        if($total <= 0) $total = 0;
         //未回款金额 = 总回款金额 - 已回款金额 + 红冲金额(退还给客户的钱)
         $order['payment_receipt_list']['not_receipt_amount'] = $total - $order['payment_receipt_list']['receipt_amount'] + $order['payment_receipt_list']['red_amount'];
 

+ 1 - 0
app/Service/SalesOrderService.php

@@ -690,6 +690,7 @@ class SalesOrderService extends Service
         $sales['payment_receipt_list'] = (new PaymentReceiptService())->getPaymentReceiptDataList($sales);
         //总回款金额 = 合同金额 - 退换货金额 - 坏账金额
         $total = $sales['contract_fee'] - $sales['return_exchange_amount'] - $sales['payment_receipt_list']['bad_amount'];
+        if($total <= 0) $total = 0;
         //未回款金额 = 总回款金额 - 已回款金额 + 红冲金额
         $sales['payment_receipt_list']['not_receipt_amount'] = $total - $sales['payment_receipt_list']['receipt_amount'] + $sales['payment_receipt_list']['red_amount'];
         $sales['not_payment_receipt_amount'] = $sales['payment_receipt_list']['not_receipt_amount'];