Commit 2ca0a8e7 by liuyang

2024-07-03 1、销售开票修调整

parent 7609eabd
......@@ -346,4 +346,32 @@
</dynamic>
</select>
<!--查询采购已审核开票金额-->
<select id="queryInvoicing" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT
B.ACCOUNT_CODE as "accountCode",
B.COMPANY_CODE as "companyCode",
C.SETTLEMENT_NUMBER as "receiveNo", <!-- 收货单号 -->
SUM(C.THIS_SETTLEMENT_TAX) as "thisSettlementAmount" <!-- 金额 -->
from ${hggpSchema}.HGCW012 B
inner join ${hggpSchema}.HGCW013 C on B.ID = C.MAIN_ID
WHERE B.CONTRACT_TYPE = 1 AND B.REVIEW_STATUS = 1
<isNotEmpty prepend=" AND " property="accountCode">
B.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
B.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
B.COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="settlementNumber">
B.SETTLEMENT_NUMBER = #settlementNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountPeriod">
left(B.SIGNING_DATE,6) = #accountPeriod#
</isNotEmpty>
GROUP BY B.ACCOUNT_CODE, B.COMPANY_CODE, C.SETTLEMENT_NUMBER
</select>
</sqlMap>
......@@ -3,6 +3,7 @@ package com.baosight.hggp.hg.cw.tools;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.cw.domain.*;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.pz.domain.HGPZ003;
......@@ -31,11 +32,11 @@ public class HGCWTools {
return DaoBase.getInstance().query("HGCW001.queryCheckList", paramMap);
}
public static Map getMaxAccountPeriod(String companyCode) {
public static HGCW001 getMaxAccountPeriod(String companyCode) {
Map<String, Object> params = new HashMap<>();
params.put("companyCode", companyCode);
params.put("accountPeriodStatus",0);
List<Map> list = DaoBase.getInstance().query("HGCW001.getMaxAccountPeriod", params);
List<HGCW001> list = DaoBase.getInstance().query("HGCW001.getMaxAccountPeriod", params);
AssertUtils.isEmpty(list, "未找到公司对应的会计期间");
return list.get(0);
}
......@@ -459,6 +460,19 @@ public class HGCWTools {
AssertUtils.isEmpty(paramMap, "数据检查参数不能为空");
return DaoBase.getInstance().query("HGCW012.queryCheckList", paramMap);
}
/**
* 根据收货号查询
* @param receiveNo 收货单号
* @return Map
*/
public static Map getReceiveNo(String receiveNo){
AssertUtils.isEmpty(receiveNo, "发票号不能为空");
Map queryMap = new HashMap<>();
queryMap.put(HGCW012.FIELD_SETTLEMENT_NUMBER,receiveNo);
List<Map> list = DaoBase.getInstance().query(HGSqlConstant.HgCw012.INVOICING, queryMap);
return list.size() > 0 ? list.get(0) : null;
}
}
/**
......
......@@ -70,16 +70,16 @@
</isNotEmpty>
</sql>
<sql id="authCondition">
<!-- 无权限时使用 -->
<!--<sql id="authCondition">
&lt;!&ndash; 无权限时使用 &ndash;&gt;
<isNotEmpty prepend=" AND " property="authDepCode">
DEP_CODE = #authDepCode#
</isNotEmpty>
<!-- 仅本人和部门组合 -->
&lt;!&ndash; 仅本人和部门组合 &ndash;&gt;
<isEqual prepend=" AND " property="authCombination" compareValue="1">
(CREATED_BY = #authOnlyPeople# OR DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>)
</isEqual>
<!-- 仅本人或部门 -->
&lt;!&ndash; 仅本人或部门 &ndash;&gt;
<isNotEqual prepend=" AND " property="authCombination" compareValue="1">
<isNotEmpty property="authOnlyPeople">
CREATED_BY = #authOnlyPeople#
......@@ -88,7 +88,7 @@
DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>
</isNotEmpty>
</isNotEqual>
</sql>
</sql>-->
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.pz.domain.HGPZ007">
......@@ -110,7 +110,6 @@
DELETE_FLAG as "deleteFlag" <!-- 是否删除0.否1.是 -->
FROM ${hggpSchema}.HGPZ007 WHERE 1=1 AND DELETE_FLAG = 0
<include refid="condition" />
<include refid="authCondition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
......@@ -125,7 +124,6 @@
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGPZ007 WHERE 1=1 AND DELETE_FLAG = 0
<include refid="condition" />
<include refid="authCondition" />
</select>
<!--
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment