Browse Source

资金模块-解决bug

huangx 7 years ago
parent
commit
481d7ef8c6

+ 12 - 24
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java

@@ -523,32 +523,20 @@ public class PaybalanceServiceImpl extends CommonBaseServiceImpl<PaybalanceMappe
         subledger.setSl_vendid(paybalance.getPb_vendid());
         subledger.setSl_date(paybalance.getPb_date());
         subledger.setSl_ym(DateUtils.getYm(paybalance.getPb_date()));
-        if (paybalance.getPb_pdamount() == null){
-            subledger.setSl_amount((double) 0);
-        }else {
-            subledger.setSl_amount(paybalance.getPb_pdamount() * -1);
-        }
-        subledger.setSl_orderamount(paybalance.getPb_pdamount());
-
-        Double yamount = paybalance.getPb_preamount();
-        if (yamount == null){
-            yamount = Double.valueOf(0);
-        }
-        if (yamount > 0 || yamount < 0){
-            subledger.setSl_yamount(yamount);
-        }else {
-            subledger.setSl_yamount((double) 0);
+        Double pdamount = paybalance.getPb_pdamount()==null?new Double(0):paybalance.getPb_pdamount();
+        Double preamount = paybalance.getPb_preamount()==null?new Double(0):paybalance.getPb_preamount();
+        Double pbdamount = new Double(0);
+        subledger.setSl_amount(-pdamount);
+        subledger.setSl_yamount(preamount);
+        subledger.setSl_orderamount(pdamount);
+
+        if(preamount!=0){
+            pbdamount = paybalance.getPb_pbdamount()==null?new Double(0):paybalance.getPb_pbdamount();
         }
-        if (subledger.getSl_orderamount() == null){
-            subledger.setSl_orderamount((double) 0);
-        }
-
-        if (subledger.getSl_discount() == null){
-            subledger.setSl_discount((double) 0);
-        }
-        subledger.setSl_namount(subledger.getSl_orderamount() + subledger.getSl_discount() - subledger.getSl_yamount());
+        subledger.setSl_namount(pdamount-pbdamount);
         subledger.setSl_remark(subledger.getSl_remark());
-        subledger.setSl_preamount(subledger.getSl_preamount());
+        subledger.setSl_preamount(preamount);
+
 
         subledgerMapper.insertSelective(subledger);
     }

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

@@ -529,11 +529,15 @@ public class RecbalanceServiceImpl extends CommonBaseServiceImpl<RecbalanceMappe
         subledger.setSl_ym(DateUtils.getYm(recbalance.getRb_date()));
         Double rdamount = recbalance.getRb_rdamount()==null?new Double(0):recbalance.getRb_rdamount();
         Double preamount = recbalance.getRb_preamount()==null?new Double(0):recbalance.getRb_preamount();
+        Double pbdamount = new Double(0);
         subledger.setSl_amount(-rdamount);
         subledger.setSl_yamount(preamount);
         subledger.setSl_orderamount(rdamount);
 
-        subledger.setSl_namount(rdamount-preamount);
+        if(preamount!=0){
+            pbdamount = recbalance.getRb_rbdamount()==null?new Double(0):recbalance.getRb_rbdamount();
+        }
+        subledger.setSl_namount(rdamount-pbdamount);
         subledger.setSl_remark(subledger.getSl_remark());
         subledger.setSl_preamount(preamount);
 

+ 2 - 4
applications/money/money-server/src/main/resources/mapper/FundtransferMapper.xml

@@ -230,10 +230,8 @@
 
   <select id="selectFundtransferBycondition" resultMap="BaseResultMap">
     select
-    <include refid="Base_Column_List" />,
-    <include refid="Detail_Column_List" />
-    from Fundtransfer left join fundtransferdetail on ftd_ftid=ft_id and
-    Fundtransfer.companyId= fundtransferdetail.companyId
+    <include refid="Base_Column_List" />
+    from Fundtransfer
     <where>
       <if test="con != null">
         ${con}

+ 2 - 3
applications/money/money-server/src/main/resources/mapper/OthreceiptsMapper.xml

@@ -310,9 +310,8 @@
   </select>
   <select id="selectOthreceiptsBycondition" resultMap="BaseResultMap">
     select
-    <include refid="Base_Column_List" />,
-    <include refid="Detail_Column_List" />
-    from Othreceipts left join othreceiptsdetail on ord_orid=or_id and Othreceipts.companyId=othreceiptsdetail.companyId
+    <include refid="Base_Column_List" />
+    from Othreceipts
     <where>
       <if test="con != null">
         ${con}

+ 2 - 4
applications/money/money-server/src/main/resources/mapper/OthspendingsMapper.xml

@@ -306,10 +306,8 @@
 
   <select id="selectOthspendingsBycondition" resultMap="BaseResultMap">
     select
-    <include refid="Base_Column_List" />,
-    <include refid="Detail_Column_List" />
-    from Othspendings left join othspendingsdetail on osd_osid=os_id
-    and Othspendings.companyId=othspendingsdetail.companyId
+    <include refid="Base_Column_List" />
+    from Othspendings
     <where>
       <if test="con != null">
         ${con}

+ 2 - 3
applications/money/money-server/src/main/resources/mapper/PaybalanceMapper.xml

@@ -424,9 +424,8 @@
 
   <select id="selectPaybalanceBycondition" resultMap="BaseResultMap">
     select
-    <include refid="Base_Column_List" />,
-    <include refid="detail_Column_List" />
-    from paybalance left join paybalancedet on pd_pbid=pb_id and paybalance.companyId=paybalancedet.companyId
+    <include refid="Base_Column_List" />
+    from paybalance
     <where>
       <if test="con != null">
         ${con}

+ 2 - 3
applications/money/money-server/src/main/resources/mapper/RecbalanceMapper.xml

@@ -138,9 +138,8 @@
 
   <select id="selectRecbalanceBycondition" resultMap="BaseResultMap">
     select
-    <include refid="Base_Column_List" />,
-    <include refid="detail_Column_List" />
-    from recbalance left join recbalancedet on rd_rbid=rb_id and recbalance.companyId=recbalancedet.companyId
+    <include refid="Base_Column_List" />
+    from recbalance
     <where>
       <if test="con != null">
         ${con}

+ 5 - 1
frontend/saas-web/app/view/money/recBalance/FormPanel.js

@@ -56,7 +56,11 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
         xtype: 'hidden',
         name: 'rb_rbdamount',
         fieldLabel: '本次核销金额'
-    }, {
+    },{
+        xtype: 'hidden',
+        name: 'rb_rdamount',
+        fieldLabel: '本次付款金额',
+    },  {
         xtype: "datefield",
         name: "rb_date",
         fieldLabel: "日期",

+ 4 - 4
frontend/saas-web/app/view/money/verification/FormPanel.js

@@ -592,16 +592,16 @@ Ext.define('saas.view.money.verification.FormPanel', {
         defaultConditions: {
             receipts_offset_receivable: ['ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)<>0 and ifnull(sl_namount,0)<>0',
                 'ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
-                'and sl_kind in (\'期初余额\',\'出货单\',\'销售退货单\')'],
+                ' and sl_kind in (\'期初余额\',\'出货单\',\'销售退货单\')'],
             prepaid_offset_payable: ['ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)<>0 and ifnull(sl_namount,0)<>0',
                 'ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
-                'and sl_kind in (\'期初余额\',\'采购验收单\',\'采购验退单\')'],
+                ' and sl_kind in (\'期初余额\',\'采购验收单\',\'采购验退单\')'],
             receivable_offset_payable: ['ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0',
                 'ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0'],
             receivable_to_receivable: ['ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
-            'and sl_kind in (\'期初余额\',\'出货单\',\'销售退货单\')'],
+            ' and sl_kind in (\'期初余额\',\'出货单\',\'销售退货单\')'],
             payable_to_payable: ['ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
-            'and sl_kind in (\'期初余额\',\'采购验收单\',\'采购验退单\')']
+            ' and sl_kind in (\'期初余额\',\'采购验收单\',\'采购验退单\')']
         }
     },