Browse Source

Merge branch 'dev' of ssh://10.10.100.21/source/saas-platform into dev

chenw 7 years ago
parent
commit
c675310c4a
50 changed files with 424 additions and 328 deletions
  1. 1 1
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java
  2. 2 2
      applications/commons/commons-server/src/main/resources/mapper/HomePageMapper.xml
  3. 1 1
      applications/document/document-server/src/main/resources/mapper/CustomeraddressMapper.xml
  4. 1 1
      applications/document/document-server/src/main/resources/mapper/VendorcontactMapper.xml
  5. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthreceiptsServiceImpl.java
  6. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthspendingsServiceImpl.java
  7. 12 24
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java
  8. 6 2
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/RecbalanceServiceImpl.java
  9. 2 4
      applications/money/money-server/src/main/resources/mapper/FundtransferMapper.xml
  10. 2 3
      applications/money/money-server/src/main/resources/mapper/OthreceiptsMapper.xml
  11. 2 4
      applications/money/money-server/src/main/resources/mapper/OthspendingsMapper.xml
  12. 2 3
      applications/money/money-server/src/main/resources/mapper/PaybalanceMapper.xml
  13. 2 3
      applications/money/money-server/src/main/resources/mapper/RecbalanceMapper.xml
  14. 13 2
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/ProdInOutController.java
  15. 2 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/PurchaseMapper.java
  16. 4 6
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java
  17. 3 0
      applications/purchase/purchase-server/src/main/resources/mapper/PurchaseMapper.xml
  18. 2 0
      applications/sale/sale-server/src/main/resources/mapper/ProdInOutListMapper.xml
  19. 2 0
      applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/ProdInOutList.java
  20. 13 4
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/controller/ProdInOutController.java
  21. 8 0
      frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js
  22. 1 1
      frontend/saas-web/app/view/core/dbfind/types/CustomerDbfindTrigger.js
  23. 14 1
      frontend/saas-web/app/view/core/form/FormPanelController.js
  24. 13 14
      frontend/saas-web/app/view/core/query/QueryFormPanel.js
  25. 16 4
      frontend/saas-web/app/view/core/report/ReportPanelController.js
  26. 2 1
      frontend/saas-web/app/view/document/bom/FormPanel.js
  27. 1 1
      frontend/saas-web/app/view/document/customer/FormPanel.js
  28. 1 1
      frontend/saas-web/app/view/home/InfoCard.js
  29. 10 2
      frontend/saas-web/app/view/home/charts/SaleTrend.js
  30. 2 0
      frontend/saas-web/app/view/money/fundtransfer/FormPanel.js
  31. 5 1
      frontend/saas-web/app/view/money/recBalance/FormPanel.js
  32. 158 138
      frontend/saas-web/app/view/money/report/CustomerCheck.js
  33. 13 1
      frontend/saas-web/app/view/money/report/CustomerCheckModel.js
  34. 22 1
      frontend/saas-web/app/view/money/report/VendorCheck.js
  35. 14 1
      frontend/saas-web/app/view/money/report/VendorCheckModel.js
  36. 21 9
      frontend/saas-web/app/view/money/verification/FormPanel.js
  37. 2 1
      frontend/saas-web/app/view/purchase/purchase/FormPanel.js
  38. 2 1
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js
  39. 9 0
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanelController.js
  40. 2 1
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js
  41. 9 0
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanelController.js
  42. 5 1
      frontend/saas-web/app/view/sale/sale/FormPanelController.js
  43. 1 1
      frontend/saas-web/app/view/sale/sale/QueryPanel.js
  44. 4 0
      frontend/saas-web/app/view/sale/saleOut/QueryPanel.js
  45. 2 0
      frontend/saas-web/app/view/stock/make/FormPanel.js
  46. 5 1
      frontend/saas-web/app/view/stock/otherIn/FormPanel.js
  47. 1 41
      frontend/saas-web/app/view/stock/otherIn/FormPanelController.js
  48. 5 1
      frontend/saas-web/app/view/stock/otherOut/FormPanel.js
  49. 1 41
      frontend/saas-web/app/view/stock/otherOut/FormPanelController.js
  50. 1 1
      frontend/saas-web/app/view/stock/stockamount/DataList.js

+ 1 - 1
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java

@@ -86,7 +86,7 @@ public enum BizExceptionCode implements BaseExceptionCode {
     BANK_AMOUNT_NOTENOUGH(74004, "资金账号不足"),
     SUBLEDGER_NOT_EXIS(74005,"来源单据不存在"),
     CHECK_SETACOUNT_EXIS(74006, "不能删除单据日期小于等于结账期间<u>%s</u>的单据"),
-    VERIFICATION_CHECK_BALANCE(74007,"核销金额不能大于未核销金额"),
+    VERIFICATION_CHECK_BALANCE(74007,"本次核销金额不相等!"),
     DELETE_NOT_EXIS(74008,"删除失败,当前单据不存在!"),
     DOCUMENTS_AUDITED(74009,"存在已审核单据:%S"),
     DOCUMENTS_UNAUDITED(74009,"存在未审核单据:%S"),

+ 2 - 2
applications/commons/commons-server/src/main/resources/mapper/HomePageMapper.xml

@@ -17,7 +17,7 @@
       (
 	  select concat('{"x":"其它","y":',ifnull(round((all_sum - five_sum)/10000,2),0),'}') other from (
 		(select sum(si_amount) all_sum from statsinfo  where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='PURC')a,
-        (select sum(si_amount) five_sum from statsinfo where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='PURC' ORDER BY si_amount desc limit 0,5) b)
+        (select sum(si_amount) five_sum from (select si_amount from  statsinfo where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='PURC' ORDER BY si_amount desc limit 0,5)e) b)
 	  ) b1
     </select>
 
@@ -72,7 +72,7 @@
     ) c)d,(
 
     select concat('{"x":"其它","y":',ifnull(round((all_sum - five_sum)/10000,2),0),'}') other from ( (select sum(si_amount) all_sum from statsinfo  where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='SALE')a,
-    (select sum(si_amount) five_sum from statsinfo where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='SALE' ORDER BY si_amount desc limit 0,5)b))e)
+    ( select sum(si_amount) five_sum from (select si_amount from statsinfo where companyid=#{componyId} and si_yearmonth=DATE_FORMAT(now(),'%Y%m') and si_type='SALE' ORDER BY si_amount desc limit 0,5)f)b))e)
     </select>
 
     <select id="getSaleFutureData" parameterType="long" resultType="string">

+ 1 - 1
applications/document/document-server/src/main/resources/mapper/CustomeraddressMapper.xml

@@ -251,7 +251,7 @@
       #{item.ca_text3,jdbcType=VARCHAR},
       #{item.ca_text4,jdbcType=VARCHAR},
       #{item.ca_text5,jdbcType=VARCHAR},
-      #{creatorId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{creatorName,jdbcType=VARCHAR}
+      #{item.creatorId,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.creatorName,jdbcType=VARCHAR}
        )
     </foreach>
   </insert>

+ 1 - 1
applications/document/document-server/src/main/resources/mapper/VendorcontactMapper.xml

@@ -262,7 +262,7 @@
       #{item.updateTime,jdbcType=TIMESTAMP}, #{item.vc_text1,jdbcType=VARCHAR}, #{item.vc_text2,jdbcType=VARCHAR},
       #{item.vc_text3,jdbcType=VARCHAR}, #{item.vc_text4,jdbcType=VARCHAR}, #{item.vc_text5,jdbcType=VARCHAR},
       #{item.vc_default,jdbcType=VARCHAR},
-      #{creatorId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{creatorName,jdbcType=VARCHAR}
+      #{item.creatorId,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.creatorName,jdbcType=VARCHAR}
       )
     </foreach>
   </insert>

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

@@ -336,7 +336,7 @@ public class OthreceiptsServiceImpl extends CommonBaseServiceImpl<OthreceiptsMap
 
     @Override
     public void othreceiptsBatchAudit(BatchDealBaseDTO baseDTO){
-        String validate = othreceiptsMapper.validateBatchUnAudit(baseDTO.getBaseDTOs());
+        String validate = othreceiptsMapper.validateAudit(baseDTO.getBaseDTOs());
         if (!StringUtils.isEmpty(validate)){
             String message = BizExceptionCode.DOCUMENTS_AUDITED.getMessage();
             throw new BizException(500, String.format(message, validate));

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

@@ -332,7 +332,7 @@ public class OthspendingsServiceImpl extends CommonBaseServiceImpl<OthspendingsM
     @Override
     public void othspendingBatchAudit(BatchDealBaseDTO baseDTO){
 
-        String validate = othspendingsMapper.validateBatchUnAudit(baseDTO.getBaseDTOs());
+        String validate = othspendingsMapper.validateAudit(baseDTO.getBaseDTOs());
         if (!StringUtils.isEmpty(validate)){
             String message = BizExceptionCode.DOCUMENTS_AUDITED.getMessage();
             throw new BizException(500, String.format(message, validate));

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

@@ -436,7 +436,7 @@ public class PaybalanceServiceImpl extends CommonBaseServiceImpl<PaybalanceMappe
 
     @Override
     public void paybalanceBatchAudit(BatchDealBaseDTO baseDTO){
-        String validate = paybalanceMapper.validateBatchUnAudit(baseDTO.getBaseDTOs());
+        String validate = paybalanceMapper.validateAudit(baseDTO.getBaseDTOs());
         if (!StringUtils.isEmpty(validate)){
             String message = BizExceptionCode.DOCUMENTS_AUDITED.getMessage();
             throw new BizException(500, String.format(message, validate));
@@ -515,32 +515,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 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);
 
-        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);
+        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);
     }

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

@@ -441,7 +441,7 @@ public class RecbalanceServiceImpl extends CommonBaseServiceImpl<RecbalanceMappe
 
     @Override
     public void recbalanceBatchAudit(BatchDealBaseDTO baseDTO){
-        String validate = recbalanceMapper.validateBatchUnAudit(baseDTO.getBaseDTOs());
+        String validate = recbalanceMapper.validateAudit(baseDTO.getBaseDTOs());
         if (!StringUtils.isEmpty(validate)){
             String message = BizExceptionCode.DOCUMENTS_AUDITED.getMessage();
             throw new BizException(500, String.format(message, validate));
@@ -521,11 +521,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}

+ 13 - 2
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/ProdInOutController.java

@@ -9,6 +9,7 @@ import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.purchase.dto.ProdInOutFormDTO;
 import com.usoftchina.saas.purchase.po.ProdInOutList;
 import com.usoftchina.saas.purchase.service.ProdInOutService;
+import com.usoftchina.saas.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -130,7 +131,12 @@ public class ProdInOutController {
      */
     @PostMapping("/batchAudit")
     public Result batchAudit(@RequestBody BatchDealBaseDTO baseDTOs) {
-        return Result.success(prodInOutService.batchAudit(baseDTOs));
+        String mess = prodInOutService.batchAudit(baseDTOs);
+        if (StringUtils.hasLength(mess)){
+            return Result.error(mess);
+        }else {
+            return Result.success(mess);
+        }
     }
 
     /**
@@ -141,7 +147,12 @@ public class ProdInOutController {
      */
     @PostMapping("/batchUnAudit")
     public Result batchUnAudit(@RequestBody BatchDealBaseDTO baseDTOs) {
-        return Result.success(prodInOutService.batchUnAudit(baseDTOs));
+        String mess = prodInOutService.batchUnAudit(baseDTOs);
+        if (StringUtils.hasText(mess)){
+            return Result.error(mess);
+        }else {
+            return Result.success(mess);
+        }
     }
 
     /**

+ 2 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/PurchaseMapper.java

@@ -36,4 +36,6 @@ public interface PurchaseMapper extends CommonBaseMapper<Purchase>{
     Integer validateVendor(@Param("id") Long id);
 
     Integer validateProduct(@Param("id") Long id);
+
+    void updateDelivery(@Param("id")Long id);
 }

+ 4 - 6
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java

@@ -15,7 +15,6 @@ import com.usoftchina.saas.commons.po.BillCodeSeq;
 import com.usoftchina.saas.commons.po.Operation;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
-import com.usoftchina.saas.document.api.ProductApi;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.exception.ExceptionCode;
 import com.usoftchina.saas.page.PageRequest;
@@ -51,8 +50,6 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
     @Autowired
     private PurchaseListMapper purchaseListMapper;
     @Autowired
-    private ProductApi productApi;
-    @Autowired
     private MaxnumberService maxnumberService;
     @Autowired
     private ProdInOutMapper prodInOutMapper;
@@ -143,7 +140,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
                 detail.setPd_puid(pu_id);
                 detail.setPd_code(pu_code);
                 detail.setPd_yqty(new Double(0));
-                detail.setPd_delivery(item.getPd_delivery()==null?purchase.getPu_delivery():item.getPd_delivery());
+//                detail.setPd_delivery(item.getPd_delivery()==null?purchase.getPu_delivery():item.getPd_delivery());
                 detail.setCompanyId(companyId);
                 detail.setCreatorId(userId);
                 detail.setCreateTime(new Date());
@@ -169,7 +166,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
             PurchaseDetail detail = BeanMapper.map(item, PurchaseDetail.class);
             detail.setPd_puid(pu_id);
             detail.setPd_code(pu_code);
-            detail.setPd_delivery(item.getPd_delivery()==null?purchase.getPu_delivery():item.getPd_delivery());
+//            detail.setPd_delivery(item.getPd_delivery()==null?purchase.getPu_delivery():item.getPd_delivery());
             detail.setUpdaterId(userId);
             detail.setUpdateTime(new Date());
             if (StringUtils.isEmpty(detail.getId()) || "0".equals(detail.getId().toString())) {
@@ -190,7 +187,8 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
             purchasedetailMapper.batchUpdate(updateDetails);
         }
         baseDTO = getBaseDTOById(pu_id);
-
+        //明细需求日期为空时==主表交货日期
+        getMapper().updateDelivery(pu_id);
         //计算金额,未税单价,未税金额等
         calcPurchase(pu_id);
         //日志

+ 3 - 0
applications/purchase/purchase-server/src/main/resources/mapper/PurchaseMapper.xml

@@ -439,6 +439,9 @@
     select count(1) from purchasedetail left join product on PD_PRODID=pr_id where  pd_puid=#{id} and pr_statuscode='CLOSE';
   </select>
 
+  <update id="updateDelivery" parameterType="long">
+    update purchasedetail set PD_DELIVERY = (select PU_DELIVERY from purchase where pu_id=#{id}) where pd_puid=#{id} and PD_DELIVERY is null
+  </update>
 
 
 </mapper>

+ 2 - 0
applications/sale/sale-server/src/main/resources/mapper/ProdInOutListMapper.xml

@@ -69,6 +69,8 @@
     <result column="pi_auditdate" jdbcType="TIMESTAMP" property="pi_auditdate" />
     <result column="pi_auditman" jdbcType="VARCHAR" property="pi_auditman" />
     <result column="pi_remark" jdbcType="VARCHAR" property="pi_remark" />
+    <result column="pi_prstatus" jdbcType="VARCHAR" property="pi_prstatus" />
+    <result column="pi_prstatuscode" jdbcType="VARCHAR" property="pi_prstatuscode" />
   </resultMap>
 
 

+ 2 - 0
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/ProdInOutList.java

@@ -166,4 +166,6 @@ public class ProdInOutList extends CommonBaseEntity{
     private String pr_text2;
     private String pr_text3;
     private String pr_text4;
+    private String pi_prstatus;
+    private String pi_prstatuscode;
 }

+ 13 - 4
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/controller/ProdInOutController.java

@@ -9,6 +9,7 @@ import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.storage.dto.ProdInOutFormDTO;
 import com.usoftchina.saas.storage.po.ProdInOutList;
 import com.usoftchina.saas.storage.service.ProdInOutService;
+import com.usoftchina.saas.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -131,8 +132,12 @@ public class ProdInOutController {
      */
     @PostMapping("/batchAudit")
     public Result batchAudit(@RequestBody BatchDealBaseDTO baseDTOs) {
-        String res = prodInOutService.batchAudit(baseDTOs);
-        return Result.success(res);
+        String mess = prodInOutService.batchAudit(baseDTOs);
+        if (StringUtils.hasLength(mess)){
+            return Result.error(mess);
+        }else {
+            return Result.success(mess);
+        }
     }
 
     /**
@@ -143,8 +148,12 @@ public class ProdInOutController {
      */
     @PostMapping("/batchUnAudit")
     public Result batchUnAudit(@RequestBody BatchDealBaseDTO baseDTOs) {
-        String res = prodInOutService.batchUnAudit(baseDTOs);
-        return Result.success(res);
+        String mess = prodInOutService.batchUnAudit(baseDTOs);
+        if (StringUtils.hasText(mess)){
+            return Result.error(mess);
+        }else {
+            return Result.success(mess);
+        }
     }
 
     /**

+ 8 - 0
frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js

@@ -18,6 +18,9 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
     },
     //输入值之后进行模糊查询
     doQuery: function(queryString, forceAll, rawQuery) {
+        if(!this.fireEvent('beforequery', this)) {
+            return;
+        };
     	queryString = queryString || '';
     	var me = this;
     	if(me.lastQueryValue!=queryString){
@@ -308,6 +311,11 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
         return true;
     },
 
+    setValue: function(v) {
+        this.callParent(arguments);
+        this.publishState('value', v);
+    },
+
     getValue: function(f) {
         var me = this,val = me.rawToValue(me.processRawValue(me.getRawValue()));
         me.value = val;

+ 1 - 1
frontend/saas-web/app/view/core/dbfind/types/CustomerDbfindTrigger.js

@@ -54,7 +54,7 @@ Ext.define('saas.view.core.dbfind.types.CustomerDbfindTrigger', {
     }, {
         text: "业务员编号",
         dataIndex: "cu_sellercode",
-        width:110
+        width:150
     }, {
         text: "业务员",
         dataIndex: "cu_sellername",

+ 14 - 1
frontend/saas-web/app/view/core/form/FormPanelController.js

@@ -16,7 +16,9 @@ Ext.define('saas.view.core.form.FormPanelController', {
         var me = this,
         form = me.getView(),
         xtype = form.xtype,
-        _config = form._config,
+        _config = {
+            initId: form.initId,
+        },
         currentTab = saas.util.BaseUtil.getCurrentTab();
         
         var view = {
@@ -60,6 +62,17 @@ Ext.define('saas.view.core.form.FormPanelController', {
         // 单据状态为录入状态(未审核)
         main[form._statusCodeField] = auditTexts.unAuditCode;
         main[form._statusField] = auditTexts.unAuditText;
+        //录入人,录入日期,审核人,审核日期清空
+        main['creatorId'] = null;
+        main['creatorName'] = null;
+        main['createTime'] = null;
+        main['updaterId'] = null;
+        main['updaterName'] = null;
+        main['updateTime'] = null;
+        main[form._auditmanField] = null;
+        main[form._auditdateField] = null;
+
+
 
         for(var k in main) {
             // 主表日期改为当前日期

+ 13 - 14
frontend/saas-web/app/view/core/query/QueryFormPanel.js

@@ -81,20 +81,19 @@ Ext.define('saas.view.core.query.QueryFormPanel', {
             }
         },
         beforerender: function(form) {
-            // var fiels = form.getForm().getFields();
-            // fiels.each(function(f) {
-            //     console.log(f, f.on);
-            //     f.on && f.on({
-            //         keydown: {
-            //             // fn: 'onQuery',
-            //             fn: function(th, e, eOpts) {
-            //                 if(e.keyCode == 13) {
-            //                     form.up('core-query-querypanel').getController().onQuery()
-            //                 }
-            //             }
-            //         }
-            //     });
-            // });
+            var fiels = form.getForm().getFields();
+            fiels.each(function(f) {
+                f.enableKeyEvents = true;
+                f.on && f.on({
+                    keydown: {
+                        fn: function(th, e, eOpts) {
+                            if(e.keyCode == 13) {
+                                form.up('core-query-querypanel').getController().onQuery()
+                            }
+                        }
+                    }
+                });
+            });
         }
     }
 

+ 16 - 4
frontend/saas-web/app/view/core/report/ReportPanelController.js

@@ -45,9 +45,21 @@ Ext.define('saas.view.core.report.ReportPanelController', {
         });
     },
     printHtml: function(html){
-        var d = window.open("", "print");
-        d.document.write(html);
-        d.document.close();
-        d.print();
+        var iframe=document.getElementById("saas-print-iframe");
+        if(!iframe){
+            iframe = document.createElement('IFRAME');
+            var doc = null;
+            iframe.setAttribute("id", "saas-print-iframe");
+            iframe.setAttribute('style', 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;');
+            document.body.appendChild(iframe);
+            doc = iframe.contentWindow.document;
+            doc.write(html);
+            doc.close();
+            iframe.contentWindow.focus();
+        }
+        iframe.contentWindow.print();
+        if (navigator.userAgent.indexOf("MSIE") > 0){
+            document.body.removeChild(iframe);
+        }
     },
 });

+ 2 - 1
frontend/saas-web/app/view/document/bom/FormPanel.js

@@ -160,7 +160,8 @@ Ext.define('saas.view.document.bom.FormPanel', {
                 editor : {
                     xtype : "numberfield",
                     decimalPrecision: 0,
-                    minValue:0
+                    minValue:0,
+                    maxLength: 10
                 },
                 renderer : function(v) {
                     var arr = (v + '.').split('.');

+ 1 - 1
frontend/saas-web/app/view/document/customer/FormPanel.js

@@ -159,7 +159,7 @@ Ext.define('saas.view.document.customer.FormPanel', {
         name : "cu_sellername", 
         fieldLabel : "业务员", 
         editable:false,
-        allowBlank : true, 
+        allowBlank : false, 
         columnWidth : 0.25
     },{
         xtype : "hidden", 

+ 1 - 1
frontend/saas-web/app/view/home/InfoCard.js

@@ -71,7 +71,7 @@ Ext.define('saas.view.home.InfoCard', {
                 unauditship: {
                     title: '未审核出货',
                     color: 'default',
-                    viewType: 'purchase-purchasein-querypanel',
+                    viewType: 'sale-saleout-querypanel',
                     condition: 'pi_statuscode<>\'AUDITED\' and pi_class=\'出货单\' and prodinout.companyId=' + companyId
                 }
             },

+ 10 - 2
frontend/saas-web/app/view/home/charts/SaleTrend.js

@@ -67,7 +67,7 @@ Ext.define('saas.view.home.charts.SaleTrend', {
                 }],
                 series: [{
                     type: 'line',
-                    smooth: true,
+                    // smooth: true,
                     title: '销售额',
                     xField: 'x',
                     yField: 'sale',
@@ -100,7 +100,7 @@ Ext.define('saas.view.home.charts.SaleTrend', {
                     // renderer: me.onSeriesRenderer
                 }, {
                     type: 'line',
-                    smooth: true,
+                    // smooth: true,
                     title: '销售回款',
                     xField: 'x',
                     yField: 'saleback',
@@ -131,6 +131,14 @@ Ext.define('saas.view.home.charts.SaleTrend', {
                         fillOpacity: 0.1,
                     },
                 }],
+                legend: {
+                    type: 'dom',
+                    docked: 'top',
+                    padding: 0,
+                    bodyPadding: 0,
+                    border: 0,
+                    cls: 'x-monthio-legend'
+                },
                 listeners: {
                     itemhighlightchange: me.itemhighlightchange
                 }

+ 2 - 0
frontend/saas-web/app/view/money/fundtransfer/FormPanel.js

@@ -68,6 +68,7 @@ Ext.define('saas.view.money.fundtransfer.FormPanel', {
                 dataIndex : "ftd_bankname", 
                 xtype : "", 
                 items : null,
+                allowBlank : false,
                 editor : {
                     xtype : "bandinfoDbfindTrigger",
                     displayField : "display", 
@@ -99,6 +100,7 @@ Ext.define('saas.view.money.fundtransfer.FormPanel', {
                 dataIndex : "ftd_inbankname", 
                 xtype : "", 
                 items : null,
+                allowBlank : false,
                 editor : {
                     displayField : "display", 
                     editable : true, 

+ 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: "日期",

+ 158 - 138
frontend/saas-web/app/view/money/report/CustomerCheck.js

@@ -11,15 +11,15 @@ Ext.define('saas.view.money.report.CustomerCheckCheck', {
     listUrl: '/api/money/report/customercheck',
     defaultCondition: null,
     reportTitle: '客户对账单',
-    QueryWidth:0.2,
-    autoLoad:false,
+    QueryWidth: 0.2,
+    autoLoad: false,
     //筛选:客户、日期(必填)
-    searchItems: [ {
+    searchItems: [{
         xtype: 'customerDbfindTrigger',
         name: 'pi_custname',
         fieldLabel: '客户名称',
         columnWidth: 0.2,
-        allowBlank:false,
+        allowBlank: false,
     }, {
         xtype: 'monthdatefield',
         name: 'ym',
@@ -32,141 +32,161 @@ Ext.define('saas.view.money.report.CustomerCheckCheck', {
         columnWidth: 0.4
     }],
 
-    reportColumns: [
-        {
-            text: 'id',
-            dataIndex: 'pi_id',
-            hidden: true
-        }, {
-            text: '单号',
-            dataIndex: 'pi_inoutno',
-            width: 150
-        }, {
-            text: '单据类型',
-            dataIndex: 'pi_class',
-            width: 110
-        }, {
-            text: '单据日期',
-            dataIndex: 'pi_date',
-            xtype: 'datecolumn',
-            width: 110
-        }, {
-            text: '序号',
-            dataIndex: 'pd_pdno',
-            xtype: 'numbercolumn',
-            width: 80
-        },{
-            text: '物料编号',
-            width: 150,
-            dataIndex: 'pr_code'
-        }, {
-            text: '物料名称',
-            dataIndex: 'pr_detail',
-            width: 200
-        }, {
-            text: '物料规格',
-            dataIndex: 'pr_spec',
-            width: 150
-        }, {
-            text: '单位',
-            dataIndex: 'pd_unit',
-            width: 80
-        }, {
-            text: '数量',
-            xtype: 'numbercolumn',
-            dataIndex: 'qty',
-            xtype: 'numbercolumn',
-            width: 110
-        }, {
-            text: '单价',
-            dataIndex: 'pd_orderprice',
-            xtype: 'numbercolumn',
-            width: 110
-        }, {
-            text: '税率',
-            dataIndex: 'pd_taxrate',
-            xtype: 'numbercolumn',
-            width: 80
-        }, {
-            text: '金额',
-            xtype: 'numbercolumn',
-            width: 110,
-            dataIndex: 'pd_total',
-            xtype: 'numbercolumn',
-            // renderer : function(v) {
-            //     var arr = (v + '.').split('.');
-            //     var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            //     var format = '0,000.' + xr.join();
-            //     return Ext.util.Format.number(v, format);
-            // },
-            // summaryType: 'sum',
-            // summaryRenderer: function(v) {
-            //     var arr = (v + '.').split('.');
-            //     var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            //     var format = '0,000.' + xr.join();
-            //     return Ext.util.Format.number(v, format);
-            // }
-        }, {
-            text: '不含税单价',
-            width: 110,
-            dataIndex: 'pd_netprice',
-            xtype: 'numbercolumn'
-        }, {
-            text: '不含税金额',
-            width: 110,
-            xtype: 'numbercolumn',
-            dataIndex: 'pd_nettotal',
-            xtype: 'numbercolumn',
-            // renderer : function(v) {
-            //     var arr = (v + '.').split('.');
-            //     var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            //     var format = '0,000.' + xr.join();
-            //     return Ext.util.Format.number(v, format);
-            // },
-            // summaryType: 'sum',
-            // summaryRenderer: function(v) {
-            //     var arr = (v + '.').split('.');
-            //     var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            //     var format = '0,000.' + xr.join();
-            //     return Ext.util.Format.number(v, format);
-            // }
-        }, {
-            text: '备注',
-            dataIndex: 'pd_remark',
-            width: 250
-        }, {
-            text: '期初应付',
-            dataIndex: 'beginamount',
-            hidden: true,
-            width: 0,
-            summaryType: 'cus',
-        }, {
-            text: '本期发生',
-            dataIndex: 'nowamount',
-            hidden: true,
-            width: 0,
-            summaryType: 'cus',
-        }, {
-            text: '本期付款',
-            dataIndex: 'nowpay',
-            hidden: true,
-            width: 0,
-            summaryType: 'cus',
-        }, {
-            text: '本期结余',
-            dataIndex: 'nowbalance',
-            hidden: true,
-            width: 0,
-            summaryType: 'cus',
-        }],
-        applyParams: function(p) {
-            var me = this,
+    reportColumns: [{
+        text: 'id',
+        dataIndex: 'pi_id',
+        hidden: true
+    }, {
+        text: '单号',
+        dataIndex: 'pi_inoutno',
+        width: 150
+    }, {
+        text: '单据类型',
+        dataIndex: 'pi_class',
+        width: 110
+    }, {
+        text: '单据日期',
+        dataIndex: 'pi_date',
+        xtype: 'datecolumn',
+        width: 110
+    }, {
+        text: '序号',
+        dataIndex: 'pd_pdno',
+        xtype: 'numbercolumn',
+        width: 80
+    }, {
+        text: '物料编号',
+        width: 150,
+        dataIndex: 'pr_code'
+    }, {
+        text: '物料名称',
+        dataIndex: 'pr_detail',
+        width: 200
+    }, {
+        text: '物料规格',
+        dataIndex: 'pr_spec',
+        width: 150
+    }, {
+        text: '单位',
+        dataIndex: 'pd_unit',
+        width: 80
+    }, {
+        text: '数量',
+        xtype: 'numbercolumn',
+        dataIndex: 'qty',
+        xtype: 'numbercolumn',
+        width: 110
+    }, {
+        text: '单价',
+        dataIndex: 'pd_orderprice',
+        xtype: 'numbercolumn',
+        width: 110
+    }, {
+        text: '税率',
+        dataIndex: 'pd_taxrate',
+        xtype: 'numbercolumn',
+        width: 80
+    }, {
+        text: '金额',
+        xtype: 'numbercolumn',
+        width: 110,
+        dataIndex: 'pd_total',
+        xtype: 'numbercolumn',
+        // renderer : function(v) {
+        //     var arr = (v + '.').split('.');
+        //     var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+        //     var format = '0,000.' + xr.join();
+        //     return Ext.util.Format.number(v, format);
+        // },
+        // summaryType: 'sum',
+        // summaryRenderer: function(v) {
+        //     var arr = (v + '.').split('.');
+        //     var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+        //     var format = '0,000.' + xr.join();
+        //     return Ext.util.Format.number(v, format);
+        // }
+    }, {
+        text: '不含税单价',
+        width: 110,
+        dataIndex: 'pd_netprice',
+        xtype: 'numbercolumn'
+    }, {
+        text: '不含税金额',
+        width: 110,
+        xtype: 'numbercolumn',
+        dataIndex: 'pd_nettotal',
+        xtype: 'numbercolumn',
+        // renderer : function(v) {
+        //     var arr = (v + '.').split('.');
+        //     var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+        //     var format = '0,000.' + xr.join();
+        //     return Ext.util.Format.number(v, format);
+        // },
+        // summaryType: 'sum',
+        // summaryRenderer: function(v) {
+        //     var arr = (v + '.').split('.');
+        //     var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+        //     var format = '0,000.' + xr.join();
+        //     return Ext.util.Format.number(v, format);
+        // }
+    }, {
+        text: '备注',
+        dataIndex: 'pd_remark',
+        width: 250
+    }, {
+        text: '期初应付',
+        dataIndex: 'beginamount',
+        hidden: true,
+        width: 0,
+        summaryType: 'cus',
+    }, {
+        text: '本期发生',
+        dataIndex: 'nowamount',
+        hidden: true,
+        width: 0,
+        summaryType: 'cus',
+    }, {
+        text: '本期付款',
+        dataIndex: 'nowpay',
+        hidden: true,
+        width: 0,
+        summaryType: 'cus',
+    }, {
+        text: '本期结余',
+        dataIndex: 'nowbalance',
+        hidden: true,
+        width: 0,
+        summaryType: 'cus',
+    }],
+
+    listeners: {
+        afterrender: function(panel) {
+            panel.setLoadButtonDisabled(true);
+        },
+    },
+
+    setLoadButtonDisabled: function (disabled) {
+        var panel = this,
+            grid = panel.down('grid'),
+            p = grid.down('pagingtoolbar'),
+            bs = p.query('button'),
+            loadButton = Ext.Array.findBy(bs, function (b) {
+                return b.iconCls == 'x-tbar-loading';
+            });
+
+        if (loadButton) {
+            loadButton.setDisabled(disabled);
+        }
+    },
+
+    applyParams: function (p) {
+        var me = this,
             viewModel = me.getViewModel(),
             formData = viewModel.get('form'),
             ym = formData.ym;
-    
-            return Ext.Object.merge(p, {
-                ym: ym
-            });
-        }
+
+        return Ext.Object.merge(p, {
+            ym: ym
+        });
+    }
 });

+ 13 - 1
frontend/saas-web/app/view/money/report/CustomerCheckModel.js

@@ -1,4 +1,16 @@
 Ext.define('saas.view.money.report.CustomerCheckModel', {
     extend: 'saas.view.core.report.ReportPanelModel',
-    alias: 'viewmodel.money-report-customercheck'
+    alias: 'viewmodel.money-report-customercheck',
+
+    formulas: {
+        pi_custname_change: {
+            bind: '{form.pi_custname}',
+            get: function(v) {
+                var me = this,
+                panel = me.getView();
+
+                panel.setLoadButtonDisabled(!v);
+            }
+        }
+    }
 });

+ 22 - 1
frontend/saas-web/app/view/money/report/VendorCheck.js

@@ -19,7 +19,7 @@ Ext.define('saas.view.money.report.VendorCheck', {
         name: 'pi_vendname',
         fieldLabel: '供应商名称',
         columnWidth: 0.2,
-        allowBlank:false,
+        allowBlank:false
     }, {
         xtype: 'monthdatefield',
         name: 'ym',
@@ -164,6 +164,27 @@ Ext.define('saas.view.money.report.VendorCheck', {
         width: 0,
         summaryType: 'cus',
     }],
+
+    listeners: {
+        afterrender: function(panel) {
+            panel.setLoadButtonDisabled(true);
+        },
+    },
+
+    setLoadButtonDisabled: function (disabled) {
+        var panel = this,
+            grid = panel.down('grid'),
+            p = grid.down('pagingtoolbar'),
+            bs = p.query('button'),
+            loadButton = Ext.Array.findBy(bs, function (b) {
+                return b.iconCls == 'x-tbar-loading';
+            });
+
+        if (loadButton) {
+            loadButton.setDisabled(disabled);
+        }
+    },
+
     applyParams: function(p) {
         var me = this,
         viewModel = me.getViewModel(),

+ 14 - 1
frontend/saas-web/app/view/money/report/VendorCheckModel.js

@@ -1,4 +1,17 @@
 Ext.define('saas.view.money.report.VendorCheckModel', {
     extend: 'saas.view.core.report.ReportPanelModel',
-    alias: 'viewmodel.money-report-vendorcheck'
+    alias: 'viewmodel.money-report-vendorcheck',
+
+    formulas: {
+        pi_vendname_change: {
+            bind: '{form.pi_vendname}',
+            get: function(v) {
+                var me = this,
+                panel = me.getView();
+
+                panel.setLoadButtonDisabled(!v);
+            }
+        }
+    }
+
 });

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

@@ -590,18 +590,30 @@ 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',
+            receipts_offset_receivable: ['ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)<>0 and ifnull(sl_namount,0)<>0 ' +
+            ' and ((sl_kind=\'收款单\') or (sl_kind=\'期初余额\' and sl_ym=' +
+            '(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid)))',
                 'ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
-                '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',
+                ' and (sl_kind in (\'出货单\',\'销售退货单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
+                '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'],
+            prepaid_offset_payable: ['ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)<>0 and ifnull(sl_namount,0)<>0 ' +
+            ' and ((sl_kind=\'付款单\') or (sl_kind=\'期初余额\' and sl_ym=' +
+            '(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid)))',
                 'ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
-                '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'],
+                ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
+                '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'],
+            receivable_offset_payable: ['ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
+            ' and ((sl_kind in (\'出货单\',\'销售退货单\')) or (sl_kind=\'期初余额\' and sl_ym=' +
+            '(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid)))',
+                'ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
+                ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
+                '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'],
             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 (\'期初余额\',\'出货单\',\'销售退货单\')'],
-            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 (\'出货单\',\'销售退货单\')) or (sl_kind=\'期初余额\' and sl_ym=' +
+            '(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'],
+            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 (\'采购验收单\',\'采购验退单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
+            '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))']
         }
     },
 

+ 2 - 1
frontend/saas-web/app/view/purchase/purchase/FormPanel.js

@@ -14,8 +14,9 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
      _codeField: 'pu_code',
      _statusField: 'pu_status',
      _statusCodeField: 'pu_statuscode',
+     _auditmanField: 'pu_auditman',
+     _auditdateField:'pu_auditdate',
      _relationColumn: 'pd_puid',
-
      _readUrl:'/api/purchase/purchase/read',
      _saveUrl:'/api/purchase/purchase/save',
      _auditUrl:'/api/purchase/purchase/audit',

+ 2 - 1
frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js

@@ -14,7 +14,8 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
     _codeField: 'pi_inoutno',
     _statusField: 'pi_status',
     _statusCodeField: 'pi_statuscode',
-    
+    _auditmanField: 'pi_auditman',
+    _auditdateField:'pi_auditdate',
     _relationColumn: 'pd_piid',
     _readUrl:'/api/purchase/prodinout/read',
     _saveUrl:'/api/purchase/prodinout/save',

+ 9 - 0
frontend/saas-web/app/view/purchase/purchaseIn/FormPanelController.js

@@ -110,6 +110,15 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanelController', {
         // 单据状态为录入状态(未审核)
         main[form._statusCodeField] = auditTexts.unAuditCode;
         main[form._statusField] = auditTexts.unAuditText;
+        //录入人,录入日期,审核人,审核日期清空
+        main['creatorId'] = null;
+        main['creatorName'] = null;
+        main['createTime'] = null;
+        main['updaterId'] = null;
+        main['updaterName'] = null;
+        main['updateTime'] = null;
+        main[form._auditmanField] = null;
+        main[form._auditdateField] = null;
 
         for(var k in main) {
             // 主表日期改为当前日期

+ 2 - 1
frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js

@@ -14,7 +14,8 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
     _codeField: 'pi_inoutno',
     _statusField: 'pi_status',
     _statusCodeField: 'pi_statuscode',
-    
+    _auditmanField: 'pi_auditman',
+    _auditdateField:'pi_auditdate',
     _relationColumn: 'pd_piid',
     _readUrl:'/api/purchase/prodinout/read',
     _saveUrl:'/api/purchase/prodinout/save',

+ 9 - 0
frontend/saas-web/app/view/purchase/purchaseOut/FormPanelController.js

@@ -112,6 +112,15 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanelController', {
         // 单据状态为录入状态(未审核)
         main[form._statusCodeField] = auditTexts.unAuditCode;
         main[form._statusField] = auditTexts.unAuditText;
+        //录入人,录入日期,审核人,审核日期清空
+        main['creatorId'] = null;
+        main['creatorName'] = null;
+        main['createTime'] = null;
+        main['updaterId'] = null;
+        main['updaterName'] = null;
+        main['updateTime'] = null;
+        main[form._auditmanField] = null;
+        main[form._auditdateField] = null;
 
         for(var k in main) {
             // 主表日期改为当前日期

+ 5 - 1
frontend/saas-web/app/view/sale/sale/FormPanelController.js

@@ -17,7 +17,11 @@ Ext.define('saas.view.sale.sale.FormPanelController', {
                                 from:'cu_name',to:'sa_custname'
                             },{
                                 from:'ca_address',to:'sa_toplace'
-                        }],
+                            },{
+                                from:'cu_sellercode',to:'sa_sellercode'
+                            },{
+                                from:'cu_sellername',to:'sa_seller'
+                            }],
                     }) ;   
 
                 }

+ 1 - 1
frontend/saas-web/app/view/sale/sale/QueryPanel.js

@@ -238,7 +238,7 @@ Ext.define('saas.view.sale.sale.QueryPanel', {
             text: '已审核采购单数',
             dataIndex: 'sd_pdqty',
             xtype: 'numbercolumn',
-            width: 120,
+            width: 180,
             renderer : function(v) {
                 var arr = (v + '.').split('.');
                 var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');

+ 4 - 0
frontend/saas-web/app/view/sale/saleOut/QueryPanel.js

@@ -172,6 +172,10 @@ Ext.define('saas.view.sale.saleout.QueryPanel', {
             text: '物料编号',
             dataIndex: 'pd_prodcode',
             width: 150
+        }, {
+            text: '物料名称',
+            dataIndex: 'pr_detail',
+            width: 150
         }, {
             text: '出货数量',
             dataIndex: 'pd_outqty',

+ 2 - 0
frontend/saas-web/app/view/stock/make/FormPanel.js

@@ -14,6 +14,8 @@ Ext.define('saas.view.stock.make.FormPanel', {
      _codeField: 'ma_code',
      _statusField: 'ma_status',
      _statusCodeField: 'ma_statuscode',
+     _auditmanField: 'ma_auditman',
+     _auditdateField:'ma_auditdate',
      _relationColumn: 'mm_maid',
 
      _readUrl:'/api/storage/make/read',

+ 5 - 1
frontend/saas-web/app/view/stock/otherIn/FormPanel.js

@@ -15,7 +15,8 @@ Ext.define('saas.view.stock.otherIn.FormPanel', {
     _codeField: 'pi_inoutno',
     _statusField: 'pi_status',
     _statusCodeField: 'pi_statuscode',
-    
+    _auditmanField: 'pi_auditman',
+    _auditdateField:'pi_auditdate',
     _relationColumn: 'pd_piid',
     _readUrl:'/api/storage/prodinout/read',
     _saveUrl:'/api/storage/prodinout/save',
@@ -260,6 +261,9 @@ Ext.define('saas.view.stock.otherIn.FormPanel', {
                     decimalPrecision: 0,
                     minValue: 0,
                     maxValue: 100
+                },
+                renderer : function(v) {
+                    return Ext.util.Format.number(v, '0');
                 }
             },
             {

+ 1 - 41
frontend/saas-web/app/view/stock/otherIn/FormPanelController.js

@@ -82,45 +82,5 @@ Ext.define('saas.view.stock.otherIn.FormPanelController', {
                 },
             },
         });
-    },
-    initCopyData: function(formData) {
-        var me = this;
-        var form = this.getView();
-        var detailCount = form.detailCount;
-        var main = formData.main;
-        var auditTexts = form.auditTexts;
-
-        // 单号、id清空
-        main[form._idField] = 0;
-        main[form._codeField] = '';
-
-        // 单据状态为录入状态(未审核)
-        main[form._statusCodeField] = auditTexts.unAuditCode;
-        main[form._statusField] = auditTexts.unAuditText;
-        main['pi_auditman'] = '';
-        main['pi_auditdate'] = null;
-        for(var k in main) {
-            // 主表日期改为当前日期
-            if(saas.util.BaseUtil.isDateString(main[k])) {
-                main[k] = Ext.Date.format(new Date, 'Y-m-d H:i:s');
-            }
-        }
-
-        for(var j = 0; j < detailCount; j++) {
-            var detail = formData['detail' + j];
-            for(var x = 0; x < detail.length; x ++) {
-                var d = detail[x];
-
-                for(var k in d) {
-                    // 从表id清空
-                    delete d['id'];
-                    // 从表日期清空
-                    if(saas.util.BaseUtil.isDateString(d[k])) {
-                        d[k] = '';
-                    }
-                }
-            }
-        }
-        return me.myInitCopyData(formData);;
-    }    
+    }
 });

+ 5 - 1
frontend/saas-web/app/view/stock/otherOut/FormPanel.js

@@ -14,7 +14,8 @@ Ext.define('saas.view.stock.otherOut.FormPanel', {
     _codeField: 'pi_inoutno',
     _statusField: 'pi_status',
     _statusCodeField: 'pi_statuscode',
-
+    _auditmanField: 'pi_auditman',
+    _auditdateField:'pi_auditdate',
     _relationColumn: 'pd_piid',
     _readUrl: '/api/storage/prodinout/read',
     _saveUrl: '/api/storage/prodinout/save',
@@ -233,6 +234,9 @@ Ext.define('saas.view.stock.otherOut.FormPanel', {
                     decimalPrecision: 0,
                     minValue: 0,
                     maxValue: 100
+                },
+                renderer : function(v) {
+                    return Ext.util.Format.number(v, '0');
                 }
             },
             {

+ 1 - 41
frontend/saas-web/app/view/stock/otherOut/FormPanelController.js

@@ -103,45 +103,5 @@ Ext.define('saas.view.stock.otherOut.FormPanelController', {
             renderTo: this.ownerCmp.ownerCt.getEl()
         }).show();
 
-    },
-    initCopyData: function(formData) {
-        var me = this;
-        var form = this.getView();
-        var detailCount = form.detailCount;
-        var main = formData.main;
-        var auditTexts = form.auditTexts;
-
-        // 单号、id清空
-        main[form._idField] = 0;
-        main[form._codeField] = '';
-
-        // 单据状态为录入状态(未审核)
-        main[form._statusCodeField] = auditTexts.unAuditCode;
-        main[form._statusField] = auditTexts.unAuditText;
-        main['pi_auditman'] = '';
-        main['pi_auditdate'] = null;
-        for(var k in main) {
-            // 主表日期改为当前日期
-            if(saas.util.BaseUtil.isDateString(main[k])) {
-                main[k] = Ext.Date.format(new Date, 'Y-m-d H:i:s');
-            }
-        }
-
-        for(var j = 0; j < detailCount; j++) {
-            var detail = formData['detail' + j];
-            for(var x = 0; x < detail.length; x ++) {
-                var d = detail[x];
-
-                for(var k in d) {
-                    // 从表id清空
-                    delete d['id'];
-                    // 从表日期清空
-                    if(saas.util.BaseUtil.isDateString(d[k])) {
-                        d[k] = '';
-                    }
-                }
-            }
-        }
-        return me.myInitCopyData(formData);;
-    }     
+    }
 });

+ 1 - 1
frontend/saas-web/app/view/stock/stockamount/DataList.js

@@ -94,7 +94,7 @@ Ext.define('saas.view.stock.stockamount.DataList', {
         width : 110.0, 
         renderer : function(v) {
             var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length>8?8:arr[1].length)).fill('0');
+            var xr = (new Array(arr[1].length>3?3:arr[1].length)).fill('0');
             var format = '0.' + xr.join();
             return Ext.util.Format.number(v, format);
         }