Browse Source

收据出现负数问题修改

wangli 4 years ago
parent
commit
64eaa7e220

+ 4 - 2
smart-city-platform/src/main/java/com/bz/smart_city/service/impl/pay/PayInvoiceServiceImpl.java

@@ -240,13 +240,15 @@ public class PayInvoiceServiceImpl implements PayinvoiceService {
 
 
         BigDecimal receivedFee=BigDecimal.ZERO;
-        BigDecimal debt=BigDecimal.ZERO;
+        BigDecimal debt=BigDecimal.ZERO;//缴纳的欠费
+        BigDecimal autoReceivedamount=BigDecimal.ZERO;//划扣的欠费
         //计算出缴纳的欠费金额
         for(PrintReceivedInfo receivedInfo:payfeeInfoPrint){
             debt=debt.add(receivedInfo.getReceivedamount());
+            autoReceivedamount=autoReceivedamount.add(receivedInfo.getAutoReceivedamount());
         }
         //计算出实收金额
-        receivedFee= debt.add(printInvoiceData.getRemaining()).subtract(printInvoiceData.getLastRemaining());
+        receivedFee= debt.add(autoReceivedamount).add(printInvoiceData.getRemaining()).subtract(printInvoiceData.getLastRemaining());
         printInvoiceData.setReceivablefee(debt);
         printInvoiceData.setTransamount(receivedFee);
         printInvoiceData.setPrintReceivedInfo(payfeeInfoPrint);