给应收应付的计算里面增加订金字段,解决计算逻辑bug

This commit is contained in:
季圣华 2022-06-03 00:31:30 +08:00
parent abdf93a7b7
commit 9ff1d99abf
3 changed files with 17 additions and 0 deletions

View File

@ -148,6 +148,12 @@ public interface DepotHeadMapperEx {
@Param("subType") String subType,
@Param("endTime") String endTime);
BigDecimal findDepositMoney(
@Param("supplierId") Integer supplierId,
@Param("type") String type,
@Param("subType") String subType,
@Param("endTime") String endTime);
List<DepotHeadVo4List> getDetailByNumber(
@Param("number") String number);

View File

@ -580,11 +580,13 @@ public class DepotHeadService {
public BigDecimal findAllMoney(Integer supplierId, String type, String subType, String mode, String endTime)throws Exception {
String modeName = "";
BigDecimal allOtherMoney = BigDecimal.ZERO;
BigDecimal allDepositMoney = BigDecimal.ZERO;
if (mode.equals("实际")) {
modeName = "change_amount";
} else if (mode.equals("合计")) {
modeName = "discount_last_money";
allOtherMoney = depotHeadMapperEx.findAllOtherMoney(supplierId, type, subType, endTime);
allDepositMoney = depotHeadMapperEx.findDepositMoney(supplierId, type, subType, endTime);
}
BigDecimal result = BigDecimal.ZERO;
try{
@ -595,6 +597,9 @@ public class DepotHeadService {
if(allOtherMoney!=null) {
result = result.add(allOtherMoney);
}
if(allDepositMoney!=null) {
result = result.subtract(allDepositMoney);
}
return result;
}

View File

@ -534,6 +534,12 @@
and ifnull(delete_flag,'0') !='1'
</select>
<select id="findDepositMoney" resultType="java.math.BigDecimal">
select ifnull(sum(deposit),0) as allDepositMoney from jsh_depot_head where type=#{type} and sub_type = #{subType}
and organ_id =#{supplierId} and oper_time &lt;=#{endTime}
and ifnull(delete_flag,'0') !='1'
</select>
<select id="getDetailByNumber" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample" resultMap="ResultMapEx">
select dh.*, concat(dh.sub_type,dh.type) as depotHeadType, a.name AccountName,
s.supplier OrganName, s.contacts, s.telephone, s.address