给应收应付的计算里面增加订金字段,解决计算逻辑bug
This commit is contained in:
parent
abdf93a7b7
commit
9ff1d99abf
@ -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);
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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 <=#{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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user