Browse Source

核销单:应收转应收、应付转应付修改

dingyl 6 years ago
parent
commit
3b3ddd0829

+ 5 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/VerificationServiceImpl.java

@@ -897,6 +897,11 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
         List<Verificationdetail> items2 = verificationdetailMapper.selectByFK(id);
         for(Verificationdet det : items1){
             Double nowbalanceDet = det.getVd_nowbalance()==null?new Double(0):det.getVd_nowbalance();
+            Subledger sub = subledgerMapper.selectByPrimaryKey(Math.toIntExact(det.getVd_slid()));
+            if (sub != null && sub.getSl_preamount() != 0 &&
+                    ("receivable_to_receivable".equals(verificationDTO.getVc_kind()) || "payable_to_payable".equals(verificationDTO.getVc_kind()))) {
+                nowbalanceDet=-1*nowbalanceDet;
+            }
             updateResAuditSubledeger(det.getVd_slid(),nowbalanceDet);
         }
         for(Verificationdetail detail : items2){