diff --git a/erp_web/pages/reports/customer_account.html b/erp_web/pages/reports/customer_account.html index 3d6ea2fb..0b18fc38 100644 --- a/erp_web/pages/reports/customer_account.html +++ b/erp_web/pages/reports/customer_account.html @@ -104,7 +104,7 @@ }, {title: '类型', field: 'type', width: 100}, {title: '单位名称', field: 'supplierName', width: 200}, - {title: '单据金额', field: 'discountLastMoney', width: 80}, + {title: '单据金额', field: 'billMoney', width: 80}, {title: '实际支付', field: 'changeAmount', width: 80}, {title: '本期变化', field: 'allPrice', width: 80}, {title: '单据日期', field: 'oTime', width: 160} diff --git a/erp_web/pages/reports/vendor_account.html b/erp_web/pages/reports/vendor_account.html index 5bd33d75..aa829f42 100644 --- a/erp_web/pages/reports/vendor_account.html +++ b/erp_web/pages/reports/vendor_account.html @@ -103,7 +103,7 @@ }, {title: '类型', field: 'type', width: 100}, {title: '单位名称', field: 'supplierName', width: 200}, - {title: '单据金额', field: 'discountLastMoney', width: 80}, + {title: '单据金额', field: 'billMoney', width: 80}, {title: '实际支付', field: 'changeAmount', width: 80}, {title: '本期变化', field: 'allPrice', width: 80}, {title: '单据日期', field: 'oTime', width: 160} diff --git a/src/main/java/com/jsh/erp/controller/DepotHeadController.java b/src/main/java/com/jsh/erp/controller/DepotHeadController.java index 1430b3cd..5d689dc4 100644 --- a/src/main/java/com/jsh/erp/controller/DepotHeadController.java +++ b/src/main/java/com/jsh/erp/controller/DepotHeadController.java @@ -253,32 +253,35 @@ public class DepotHeadController { if ((p1.compareTo(BigDecimal.ZERO))==-1) { p1 = p1.abs(); } + if(dha.getOtherMoney()!=null) { + p1 = p1.add(dha.getOtherMoney()); //与其它费用相加 + } if ((p2 .compareTo(BigDecimal.ZERO))==-1) { p2 = p2.abs(); } if (type.equals("采购入库")) { - allPrice = p2 .subtract(p1); + allPrice = p2.subtract(p1); } else if (type.equals("销售退货入库")) { - allPrice = p2 .subtract(p1); + allPrice = p2.subtract(p1); } else if (type.equals("销售出库")) { - allPrice = p1 .subtract(p2); + allPrice = p1.subtract(p2); } else if (type.equals("采购退货出库")) { - allPrice = p1 .subtract(p2); + allPrice = p1.subtract(p2); } else if (type.equals("付款")) { allPrice = p1.add(p2); } else if (type.equals("收款")) { allPrice = BigDecimal.ZERO.subtract(p1.add(p2)); } else if (type.equals("收入")) { - allPrice = p1 .subtract(p2); + allPrice = p1.subtract(p2); } else if (type.equals("支出")) { - allPrice = p2 .subtract(p1); + allPrice = p2.subtract(p1); } - dha.setDiscountLastMoney(p1); //金额 - dha.setChangeAmount(p2); //金额 + dha.setBillMoney(p1); //单据金额 + dha.setChangeAmount(p2); //实际支付 DecimalFormat df = new DecimalFormat(".##"); - dha.setAllPrice(new BigDecimal(df.format(allPrice .multiply(new BigDecimal(j))))); //计算后的金额 - dha.setSupplierName(dha.getSupplierName()); //供应商 - dha.setoTime(dha.getoTime()); //入库出库日期 + dha.setAllPrice(new BigDecimal(df.format(allPrice.multiply(new BigDecimal(j))))); //本期变化 + dha.setSupplierName(dha.getSupplierName()); //单位名称 + dha.setoTime(dha.getoTime()); //单据日期 resList.add(dha); } } diff --git a/src/main/java/com/jsh/erp/datasource/mappers/DepotHeadMapperEx.java b/src/main/java/com/jsh/erp/datasource/mappers/DepotHeadMapperEx.java index bc847c8a..6b3280d6 100644 --- a/src/main/java/com/jsh/erp/datasource/mappers/DepotHeadMapperEx.java +++ b/src/main/java/com/jsh/erp/datasource/mappers/DepotHeadMapperEx.java @@ -100,6 +100,12 @@ public interface DepotHeadMapperEx { @Param("modeName") String modeName, @Param("endTime") String endTime); + BigDecimal findAllOtherMoney( + @Param("supplierId") Integer supplierId, + @Param("type") String type, + @Param("subType") String subType, + @Param("endTime") String endTime); + List getDetailByNumber( @Param("number") String number); diff --git a/src/main/java/com/jsh/erp/datasource/vo/DepotHeadVo4StatementAccount.java b/src/main/java/com/jsh/erp/datasource/vo/DepotHeadVo4StatementAccount.java index 92a1097d..9a529d26 100644 --- a/src/main/java/com/jsh/erp/datasource/vo/DepotHeadVo4StatementAccount.java +++ b/src/main/java/com/jsh/erp/datasource/vo/DepotHeadVo4StatementAccount.java @@ -11,6 +11,10 @@ public class DepotHeadVo4StatementAccount { private BigDecimal discountLastMoney; + private BigDecimal otherMoney; + + private BigDecimal billMoney; + private BigDecimal changeAmount; private BigDecimal allPrice; @@ -45,6 +49,22 @@ public class DepotHeadVo4StatementAccount { this.discountLastMoney = discountLastMoney; } + public BigDecimal getOtherMoney() { + return otherMoney; + } + + public void setOtherMoney(BigDecimal otherMoney) { + this.otherMoney = otherMoney; + } + + public BigDecimal getBillMoney() { + return billMoney; + } + + public void setBillMoney(BigDecimal billMoney) { + this.billMoney = billMoney; + } + public BigDecimal getChangeAmount() { return changeAmount; } diff --git a/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java b/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java index 7d21af05..330a8c09 100644 --- a/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java +++ b/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java @@ -343,10 +343,12 @@ public class DepotHeadService { public BigDecimal findAllMoney(Integer supplierId, String type, String subType, String mode, String endTime)throws Exception { String modeName = ""; + BigDecimal allOtherMoney = BigDecimal.ZERO; if (mode.equals("实际")) { modeName = "ChangeAmount"; } else if (mode.equals("合计")) { modeName = "DiscountLastMoney"; + allOtherMoney = depotHeadMapperEx.findAllOtherMoney(supplierId, type, subType, endTime); } BigDecimal result = null; try{ @@ -354,6 +356,9 @@ public class DepotHeadService { }catch(Exception e){ JshException.readFail(logger, e); } + if(allOtherMoney!=null) { + result = result.add(allOtherMoney); + } return result; } diff --git a/src/main/resources/mapper_xml/DepotHeadMapperEx.xml b/src/main/resources/mapper_xml/DepotHeadMapperEx.xml index c90f7509..6121f421 100644 --- a/src/main/resources/mapper_xml/DepotHeadMapperEx.xml +++ b/src/main/resources/mapper_xml/DepotHeadMapperEx.xml @@ -34,6 +34,7 @@ + @@ -251,7 +252,7 @@ + +