给应收应付的计算里面增加订金字段,解决计算逻辑bug
This commit is contained in:
@@ -148,6 +148,12 @@ public interface DepotHeadMapperEx {
|
|||||||
@Param("subType") String subType,
|
@Param("subType") String subType,
|
||||||
@Param("endTime") String endTime);
|
@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(
|
List<DepotHeadVo4List> getDetailByNumber(
|
||||||
@Param("number") String number);
|
@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 {
|
public BigDecimal findAllMoney(Integer supplierId, String type, String subType, String mode, String endTime)throws Exception {
|
||||||
String modeName = "";
|
String modeName = "";
|
||||||
BigDecimal allOtherMoney = BigDecimal.ZERO;
|
BigDecimal allOtherMoney = BigDecimal.ZERO;
|
||||||
|
BigDecimal allDepositMoney = BigDecimal.ZERO;
|
||||||
if (mode.equals("实际")) {
|
if (mode.equals("实际")) {
|
||||||
modeName = "change_amount";
|
modeName = "change_amount";
|
||||||
} else if (mode.equals("合计")) {
|
} else if (mode.equals("合计")) {
|
||||||
modeName = "discount_last_money";
|
modeName = "discount_last_money";
|
||||||
allOtherMoney = depotHeadMapperEx.findAllOtherMoney(supplierId, type, subType, endTime);
|
allOtherMoney = depotHeadMapperEx.findAllOtherMoney(supplierId, type, subType, endTime);
|
||||||
|
allDepositMoney = depotHeadMapperEx.findDepositMoney(supplierId, type, subType, endTime);
|
||||||
}
|
}
|
||||||
BigDecimal result = BigDecimal.ZERO;
|
BigDecimal result = BigDecimal.ZERO;
|
||||||
try{
|
try{
|
||||||
@@ -595,6 +597,9 @@ public class DepotHeadService {
|
|||||||
if(allOtherMoney!=null) {
|
if(allOtherMoney!=null) {
|
||||||
result = result.add(allOtherMoney);
|
result = result.add(allOtherMoney);
|
||||||
}
|
}
|
||||||
|
if(allDepositMoney!=null) {
|
||||||
|
result = result.subtract(allDepositMoney);
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -534,6 +534,12 @@
|
|||||||
and ifnull(delete_flag,'0') !='1'
|
and ifnull(delete_flag,'0') !='1'
|
||||||
</select>
|
</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 id="getDetailByNumber" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample" resultMap="ResultMapEx">
|
||||||
select dh.*, concat(dh.sub_type,dh.type) as depotHeadType, a.name AccountName,
|
select dh.*, concat(dh.sub_type,dh.type) as depotHeadType, a.name AccountName,
|
||||||
s.supplier OrganName, s.contacts, s.telephone, s.address
|
s.supplier OrganName, s.contacts, s.telephone, s.address
|
||||||
|
|||||||
Reference in New Issue
Block a user