瀏覽代碼

资金模块-客户供应商计算付款余额

huangx 7 年之前
父節點
當前提交
f55331e2d1

+ 4 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerServiceImpl.java

@@ -127,6 +127,10 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
         customer.setCompanyId(companyId);
         customer.setCreatorId(userId);
         customer.setCreateTime(new Date());
+        //应付款余额
+        Double beginapamount = main.getCu_beginaramount()==null?new Double(0):main.getCu_beginaramount();
+        Double beginprepayamount = main.getCu_beginprerecamount()==null?new Double(0):main.getCu_beginprerecamount();
+        main.setCu_leftamount(beginapamount-beginprepayamount);
 
         //编号校验
         cu_code = pushMaxnubmer(cu_code, cu_id);

+ 4 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorServiceImpl.java

@@ -121,6 +121,10 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
             }
             //保存主表信息
             main.setVe_code(code);
+            //更新应付款余额
+            Double beginapamount = main.getVe_beginapamount()==null ? new Double(0):main.getVe_beginapamount();
+            Double beginprepayamount = main.getVe_beginprepayamount()==null ? new Double(0):main.getVe_beginprepayamount();
+            main.setVe_leftamount(beginapamount-beginprepayamount);
             getMapper().insertSelective(main);
             Long mainId = main.getId();
             //更新明细表vc_veid