现金流量表计算相关
parent
64ad3ee909
commit
a53e91620c
|
@ -0,0 +1,197 @@
|
|||
package cn.palmte.work.bean;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 现金流量
|
||||
* @author xiongshiyan at 2021/11/6 , contact me with email yanshixiong@126.com or phone 15208384257
|
||||
*/
|
||||
public class CashFlowBean {
|
||||
/**
|
||||
* a销售商品、提供劳务收到的现金
|
||||
* */
|
||||
private BigDecimal saleIncomeCash;
|
||||
/**
|
||||
* b收到的税费返还
|
||||
* */
|
||||
private BigDecimal taxReturn;
|
||||
/**
|
||||
* c其他与经营活动有关的现金【保证金收入】
|
||||
*/
|
||||
private BigDecimal earnestMoneyIncome;
|
||||
/**
|
||||
* d购买商品、接受劳务支付的现金【设备支出+工程支出】
|
||||
*/
|
||||
private BigDecimal purchaseCost;
|
||||
/**
|
||||
* e支付的各项税费
|
||||
*/
|
||||
private BigDecimal taxCost;
|
||||
/**
|
||||
*f支付其他与经营活动有关的现金
|
||||
*/
|
||||
private BigDecimal earnestMoneyCost;
|
||||
/**
|
||||
* g经营活动产生的现金流量净额
|
||||
* g=a+c+b-d-f-e
|
||||
*/
|
||||
//private BigDecimal netCashFlow;
|
||||
/**
|
||||
* h投资活动现金流入
|
||||
*/
|
||||
private BigDecimal cashInflowFromInvestingActivities;
|
||||
/**
|
||||
* i投资活动现金流出
|
||||
*/
|
||||
private BigDecimal cashOutflowFromInvestingActivities;
|
||||
/**
|
||||
* j投资活动产生的现金流量净额
|
||||
*/
|
||||
private BigDecimal netCashFromInvestingActivities;
|
||||
/**
|
||||
* k融资资金流入【垫资计划】
|
||||
*/
|
||||
private BigDecimal financingCapitalInflow;
|
||||
/**
|
||||
* l融资资金流出【还款计划】
|
||||
*/
|
||||
private BigDecimal financingCapitalOutflow;
|
||||
/**
|
||||
*m筹资活动产生的现金流量净额
|
||||
* m=k-l
|
||||
*/
|
||||
//private BigDecimal financingCapitalCashflow;
|
||||
/**
|
||||
* n货币资金净增加额
|
||||
* n=g+j+m
|
||||
*/
|
||||
//private BigDecimal netIncreaseMonetaryFunds;
|
||||
|
||||
public BigDecimal getSaleIncomeCash() {
|
||||
return handleSpecial(saleIncomeCash);
|
||||
}
|
||||
|
||||
public void setSaleIncomeCash(BigDecimal saleIncomeCash) {
|
||||
this.saleIncomeCash = saleIncomeCash;
|
||||
}
|
||||
|
||||
public BigDecimal getTaxReturn() {
|
||||
return handleSpecial(taxReturn);
|
||||
}
|
||||
|
||||
public void setTaxReturn(BigDecimal taxReturn) {
|
||||
this.taxReturn = taxReturn;
|
||||
}
|
||||
|
||||
public BigDecimal getEarnestMoneyIncome() {
|
||||
return handleSpecial(earnestMoneyIncome);
|
||||
}
|
||||
|
||||
public void setEarnestMoneyIncome(BigDecimal earnestMoneyIncome) {
|
||||
this.earnestMoneyIncome = earnestMoneyIncome;
|
||||
}
|
||||
|
||||
public BigDecimal getPurchaseCost() {
|
||||
return handleSpecial(purchaseCost);
|
||||
}
|
||||
|
||||
public void setPurchaseCost(BigDecimal purchaseCost) {
|
||||
this.purchaseCost = purchaseCost;
|
||||
}
|
||||
|
||||
public BigDecimal getTaxCost() {
|
||||
return handleSpecial(taxCost);
|
||||
}
|
||||
|
||||
public void setTaxCost(BigDecimal taxCost) {
|
||||
this.taxCost = taxCost;
|
||||
}
|
||||
|
||||
public BigDecimal getEarnestMoneyCost() {
|
||||
return handleSpecial(earnestMoneyCost);
|
||||
}
|
||||
|
||||
public void setEarnestMoneyCost(BigDecimal earnestMoneyCost) {
|
||||
this.earnestMoneyCost = earnestMoneyCost;
|
||||
}
|
||||
|
||||
public BigDecimal getNetCashFlow() {
|
||||
|
||||
BigDecimal saleIncomeCash = getSaleIncomeCash();
|
||||
BigDecimal taxReturn = getTaxReturn();
|
||||
BigDecimal earnestMoneyIncome = getEarnestMoneyIncome();
|
||||
BigDecimal purchaseCost = getPurchaseCost();
|
||||
BigDecimal taxCost = getTaxCost();
|
||||
BigDecimal earnestMoneyCost = getEarnestMoneyCost();
|
||||
|
||||
return saleIncomeCash
|
||||
.add(taxReturn)
|
||||
.add(earnestMoneyIncome)
|
||||
.subtract(purchaseCost)
|
||||
.subtract(taxCost)
|
||||
.subtract(earnestMoneyCost);
|
||||
}
|
||||
|
||||
public BigDecimal getCashInflowFromInvestingActivities() {
|
||||
return handleSpecial(cashInflowFromInvestingActivities);
|
||||
}
|
||||
|
||||
public void setCashInflowFromInvestingActivities(BigDecimal cashInflowFromInvestingActivities) {
|
||||
this.cashInflowFromInvestingActivities = cashInflowFromInvestingActivities;
|
||||
}
|
||||
|
||||
public BigDecimal getCashOutflowFromInvestingActivities() {
|
||||
return handleSpecial(cashOutflowFromInvestingActivities);
|
||||
}
|
||||
|
||||
public void setCashOutflowFromInvestingActivities(BigDecimal cashOutflowFromInvestingActivities) {
|
||||
this.cashOutflowFromInvestingActivities = cashOutflowFromInvestingActivities;
|
||||
}
|
||||
|
||||
public BigDecimal getNetCashFromInvestingActivities() {
|
||||
return handleSpecial(netCashFromInvestingActivities);
|
||||
}
|
||||
|
||||
public void setNetCashFromInvestingActivities(BigDecimal netCashFromInvestingActivities) {
|
||||
this.netCashFromInvestingActivities = netCashFromInvestingActivities;
|
||||
}
|
||||
|
||||
public BigDecimal getFinancingCapitalInflow() {
|
||||
return handleSpecial(financingCapitalInflow);
|
||||
}
|
||||
|
||||
public void setFinancingCapitalInflow(BigDecimal financingCapitalInflow) {
|
||||
this.financingCapitalInflow = financingCapitalInflow;
|
||||
}
|
||||
|
||||
public BigDecimal getFinancingCapitalOutflow() {
|
||||
return handleSpecial(financingCapitalOutflow);
|
||||
}
|
||||
|
||||
public void setFinancingCapitalOutflow(BigDecimal financingCapitalOutflow) {
|
||||
this.financingCapitalOutflow = financingCapitalOutflow;
|
||||
}
|
||||
|
||||
public BigDecimal getFinancingCapitalCashflow() {
|
||||
BigDecimal financingCapitalInflow = getFinancingCapitalInflow();
|
||||
BigDecimal financingCapitalOutflow = getFinancingCapitalOutflow();
|
||||
return financingCapitalInflow.subtract(financingCapitalOutflow);
|
||||
}
|
||||
|
||||
public BigDecimal getNetIncreaseMonetaryFunds() {
|
||||
BigDecimal netCashFlow = getNetCashFlow();
|
||||
BigDecimal netCashFromInvestingActivities = getNetCashFromInvestingActivities();
|
||||
BigDecimal financingCapitalCashflow = getFinancingCapitalCashflow();
|
||||
return netCashFlow
|
||||
.add(netCashFromInvestingActivities)
|
||||
.add(financingCapitalCashflow);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理特殊值
|
||||
* null就返回0
|
||||
*/
|
||||
protected BigDecimal handleSpecial(BigDecimal src) {
|
||||
return null == src ? new BigDecimal(0) : src;
|
||||
}
|
||||
}
|
|
@ -157,6 +157,8 @@ public class ProjectController extends BaseController{
|
|||
model.put("projectBudgetPlanDetailTotal", projectBudgetService.getProjectBudgetPlanDetailTotal(project, projectBudgetPlanDetails));
|
||||
//资金计划表中的统计信息【下面资金小表】
|
||||
model.put("underwrittenPlanStatistic", projectBudgetService.getProjectUnderwrittenPlanStatisticBean(projectBudgetPlanDetails));
|
||||
//现金表
|
||||
model.put("cashFlowBean", projectBudgetService.getCashFlowBean(project, projectBudgetPlanDetails));
|
||||
//freemarker可以利用的静态方法
|
||||
model.put("Utils", FreeMarkerUtil.fromStaticPackage("cn.palmte.work.utils.Utils"));
|
||||
return "admin/project_budget_edit";
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package cn.palmte.work.service;
|
||||
|
||||
import cn.palmte.work.bean.BudgetBean;
|
||||
import cn.palmte.work.bean.CashFlowBean;
|
||||
import cn.palmte.work.bean.ProjectConfigBean;
|
||||
import cn.palmte.work.bean.ProjectUnderwrittenPlanStatisticBean;
|
||||
import cn.palmte.work.model.*;
|
||||
|
@ -548,4 +549,30 @@ public class ProjectBudgetService {
|
|||
|
||||
return bean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算现金流量表
|
||||
*/
|
||||
public CashFlowBean getCashFlowBean(Project project, List<ProjectBudgetPlanDetail> projectBudgetPlanDetails){
|
||||
CashFlowBean cashFlowBean = new CashFlowBean();
|
||||
//获取统计值
|
||||
ProjectBudgetPlanDetail detailTotal = getProjectBudgetPlanDetailTotal(project, projectBudgetPlanDetails);
|
||||
|
||||
//a
|
||||
cashFlowBean.setSaleIncomeCash(detailTotal.getSaleIncome());
|
||||
//c
|
||||
cashFlowBean.setEarnestMoneyIncome(detailTotal.getEarnestMoneyIncome());
|
||||
//d
|
||||
cashFlowBean.setPurchaseCost(detailTotal.getDeviceCost()
|
||||
.add(detailTotal.getEngineerCost()));
|
||||
//f
|
||||
cashFlowBean.setEarnestMoneyCost(detailTotal.getProjectManageCost()
|
||||
.add(detailTotal.getEarnestMoneyCost())
|
||||
.add(detailTotal.getCapitalInterest()));
|
||||
//k
|
||||
cashFlowBean.setFinancingCapitalInflow(detailTotal.getUnderwrittenPlan());
|
||||
//l
|
||||
cashFlowBean.setFinancingCapitalOutflow(detailTotal.getRepaymentPlan());
|
||||
return cashFlowBean;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -476,12 +476,60 @@ function updateBudgetPlanDetailData(details) {
|
|||
$("input[name='costExpropriationTaxExclude']").val($(".input-underwritten-plan-statistic-capital-interest-budget-plan").val());
|
||||
//更新项目贡献率
|
||||
updateProjectContributionProfitRate();
|
||||
//更新现金流量
|
||||
updateCashFlow();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 绑定公司管理费用输入框
|
||||
*/
|
||||
function bindCompanyManageChangeable() {
|
||||
$("input[name='costCompanyManageTaxExclude']").change(function () {
|
||||
//更新项目贡献率
|
||||
updateProjectContributionProfitRate();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新现金流量表
|
||||
*/
|
||||
function updateCashFlow() {
|
||||
|
||||
var saleIncome = $(".input-total-sale-income-budget-plan").val();
|
||||
var earnestMoneyIncome = $(".input-total-earnest-money-income-budget-plan").val();
|
||||
var deviceCost = $(".input-total-device-cost-budget-plan").val();
|
||||
var engineerCost = $(".input-total-engineer-cost-budget-plan").val();
|
||||
|
||||
var projectManageCost = $(".input-total-project-manage-cost-budget-plan").val();
|
||||
var earnestMoneyCost = $(".input-total-earnest-money-cost-budget-plan").val();
|
||||
var capitalInterest = $(".input-total-capital-interest-budget-plan").val();
|
||||
|
||||
var underwrittenPlan = $(".input-total-underwritten-plan-budget-plan").val();
|
||||
var repaymentPlan = $(".input-total-repayment-plan-budget-plan").val();
|
||||
|
||||
var d = f2(deviceCost)+f2(engineerCost);
|
||||
var f = f2(projectManageCost)+f2(earnestMoneyCost)+f2(capitalInterest);
|
||||
var g = f2(saleIncome)+0+f2(earnestMoneyIncome)-d-0-f;
|
||||
var m = f2(underwrittenPlan)-f2(repaymentPlan);
|
||||
var n = g+0+m;
|
||||
|
||||
console.log(saleIncome,earnestMoneyIncome,deviceCost,
|
||||
engineerCost,projectManageCost,earnestMoneyCost,
|
||||
capitalInterest,underwrittenPlan,repaymentPlan,
|
||||
d,f,g,m,m);
|
||||
|
||||
|
||||
$("input[name='saleIncomeCash']").val(saleIncome);
|
||||
$("input[name='earnestMoneyIncome']").val(earnestMoneyIncome);
|
||||
$("input[name='purchaseCost']").val(d);
|
||||
$("input[name='earnestMoneyCost']").val(f);
|
||||
|
||||
$("input[name='netCashFlow']").val(g);
|
||||
|
||||
$("input[name='financingCapitalInflow']").val(underwrittenPlan);
|
||||
$("input[name='financingCapitalOutflow']").val(repaymentPlan);
|
||||
|
||||
$("input[name='financingCapitalCashflow']").val(m);
|
||||
$("input[name='netIncreaseMonetaryFunds']").val(n);
|
||||
}
|
|
@ -347,59 +347,59 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>销售商品、提供劳务收到的现金a</td>
|
||||
<td><input name="" value="${budgetBean.a!0}" readonly required></td>
|
||||
<td><input name="saleIncomeCash" value="${Utils.format(cashFlowBean.saleIncomeCash,'0')}" readonly required title="取自资金计划表(销售收款)"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>收到的税费返还b</td>
|
||||
<td><input name="" value="${budgetBean.a!0}" readonly required></td>
|
||||
<td>/<input type="hidden" name="taxReturn" value="${Utils.format(cashFlowBean.taxReturn,'0')}" readonly required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>收到其他与经营活动有关的现金c</td>
|
||||
<td><input name="" value="${budgetBean.a!0}" readonly required></td>
|
||||
<td><input name="earnestMoneyIncome" value="${Utils.format(cashFlowBean.earnestMoneyIncome,'0')}" readonly required title="取自资金计划表(保证金收款)"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>购买商品、接受劳务支付的现d</td>
|
||||
<td><input name="" value="${budgetBean.a!0}" readonly required></td>
|
||||
<td><input name="purchaseCost" value="${Utils.format(cashFlowBean.purchaseCost,'0')}" readonly required title="取自资金计划表(设备支出+工程支出)"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>支付的各项税费e</td>
|
||||
<td><input name="" value="${budgetBean.a!0}" readonly required></td>
|
||||
<td>/<input type="hidden" name="taxCost" value="${Utils.format(cashFlowBean.taxCost,'0')}" readonly required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>支付其他与经营活动有关的现金f</td>
|
||||
<td><input name="" value="${budgetBean.a!0}" readonly required></td>
|
||||
<td><input name="earnestMoneyCost" value="${Utils.format(cashFlowBean.earnestMoneyCost,'0')}" readonly required title="取自资金计划表(经营性开支+保证金支出+资金利息)"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>经营活动产生的现金流量净额g</td>
|
||||
<td><input name="" value="${budgetBean.a!0}" readonly required></td>
|
||||
<td><input name="netCashFlow" value="${Utils.format(cashFlowBean.netCashFlow,'0')}" readonly required title="g=a+c+b-d-f-e"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>投资活动现金流入h</td>
|
||||
<td><input name="" value="${budgetBean.a!0}" readonly required></td>
|
||||
<td>/<input type="hidden" name="cashInflowFromInvestingActivities" value="${Utils.format(cashFlowBean.cashInflowFromInvestingActivities,'0')}" readonly required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>投资活动现金流出i</td>
|
||||
<td><input name="" value="${budgetBean.a!0}" readonly required></td>
|
||||
<td>/<input type="hidden" name="cashOutflowFromInvestingActivities" value="${Utils.format(cashFlowBean.cashOutflowFromInvestingActivities,'0')}" readonly required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>投资活动产生的现金流量净额j</td>
|
||||
<td><input name="" value="${budgetBean.a!0}" readonly required></td>
|
||||
<td>/<input type="hidden" name="netCashFromInvestingActivities" value="${Utils.format(cashFlowBean.netCashFromInvestingActivities,'0')}" readonly required></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>融资资金流入k</td>
|
||||
<td><input name="" value="${budgetBean.a!0}" readonly required></td>
|
||||
<td><input name="financingCapitalInflow" value="${Utils.format(cashFlowBean.financingCapitalInflow,'0')}" readonly required title="从资金计划表查(垫资计划)"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>还款资金流出l</td>
|
||||
<td><input name="" value="${budgetBean.a!0}" readonly required></td>
|
||||
<td><input name="financingCapitalOutflow" value="${Utils.format(cashFlowBean.financingCapitalOutflow,'0')}" readonly required title="从资金计划表查(还款计划)"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>筹资活动产生的现金流量净额m</td>
|
||||
<td><input name="" value="${budgetBean.a!0}" readonly required></td>
|
||||
<td><input name="financingCapitalCashflow" value="${Utils.format(cashFlowBean.financingCapitalCashflow,'0')}" readonly required title="m=k-l"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>货币资金净增加额n</td>
|
||||
<td><input name="" value="${budgetBean.a!0}" readonly required></td>
|
||||
<td><input name="netIncreaseMonetaryFunds" value="${Utils.format(cashFlowBean.netIncreaseMonetaryFunds,'0')}" readonly required title="n=g+j+m"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
Loading…
Reference in New Issue