NC 科目对照表调整了收支项目对应的会计科目生成凭证后,调整后的会计科目在现金流量分析没有生成对应的现金流量,导致凭证保存的时报“错误:现金流量本币金额分析错误!”
如下图:
收支项目的“外部律师费”生成的科目是“管理费用\外聘顾问中介费\审计费”,实际应该是“管理费用\外聘顾问中介费\外部律师费”
在【动态建模平台】-【会计平台】-【通用平台】下的【分类定义-集团或分类定义-业务单元】节点(注意,有些可能是集团、业务单元两个节点都需要修改,然后在【单据生成】节点下重新生成中勾选重置入账规则,选对应的模块或者全选所有模块,确定后才生效
)下,调整对应的会计科目。如下图:
如果知道对应的科目对照表,也可以在节点【科目对照表-集团或业务单元】中经行调整。
调整会计科目保存后,重走入账规则,在【财务会计】-【总账】-【凭证管理】-【制单】节点中的“凭证”按钮下的现金流量分析
需要在【财务会计】-【总账】-【现金流量表】-【科目关系设置-集团或组织】节点下找到现金流量对应的会计科目进行修改为正确的即可。
再重新打开【制单】节点,找到对应单据,点击现金流量分析按钮即可发现生成了对应的科目了
报如下图错误,是因为增加了两个科目:
130103 其他流动资产\待转销项税
1301099 其他流动资产\其他
而在现金流量表没有新增对于的科目,即在科目关系设置节点中没有设置现金流量与科目的对应关系
这里一定要理清楚哪些会计科目设置到哪些现金流量表表项,比如我下面这个就是会计科目设置对应的现金流量表表项不对就一直报错
正确的应该是如此:
“现金流量本币金额分析错误!” 和 “现金流量原币金额分析错误!” 报错提示对应的逻辑代码:
nc.bs.gl.cashflowcaseio.CashFlowCaseIODMO
主要相关方法:
/**
* 错误分析现金流量
*
*/
public nc.vo.gl.pubvoucher.OperationResultVO[] analyseError(String pa, nc.vo.gl.pubinterface.VoucherSaveInterfaceVO vo) {
nc.vo.gl.pubvoucher.OperationResultVO[] vs = new nc.vo.gl.pubvoucher.OperationResultVO[1];
nc.vo.gl.pubvoucher.OperationResultVO rs = new nc.vo.gl.pubvoucher.OperationResultVO();
vs[0] = rs;
nc.vo.gl.pubvoucher.VoucherVO voucher = vo.voucher;
if (voucher == null || voucher.getDetails() == null) {
return vs;
}
if (voucher.getVoucherkind().intValue() == 2) {
return vs;
}
if (pa.trim().equals(GLParaValueConst.GL089_UNCTRL)) {
return vs;
}
nc.vo.gl.pubvoucher.DetailVO[] vos = voucher.getDetails();
HashMap accMap = new HashMap();
boolean isCashVoucher = false;
if (pa.trim().equals(GLParaValueConst.GL089_MAIN_ITEM) || pa.trim().equals(GLParaValueConst.GL089_MAIN_ASS_ITEM)) {
try {
// CashFlowCaseOpDMO opDMO = new CashFlowCaseOpDMO();
// AccsubjBookBO accsubjBO = new AccsubjBookBO();
String[] pk_acc = new String[vos.length];
for (int i = 0; i < vos.length; i++) {
pk_acc[i] = vos[i].getPk_accasoa();
}
nc.vo.bd.account.AccountVO[] accVOs = null;
if(voucher.getPrepareddate()!=null){
accVOs = AccountUtilGL.queryByPks(pk_acc,voucher.getPrepareddate().toStdString());
}else{
accVOs = AccountUtilGL.queryByPks(pk_acc);
}
if (accVOs == null) {
return vs;
}
for (int i = 0; i < accVOs.length; i++) {
if (accVOs[i].getCashtype() != null && accVOs[i].getCashtype().intValue() > 0) {
isCashVoucher = true;
}
accMap.put(accVOs[i].getPk_accasoa(), accVOs[i]);
}
// 现金类凭证
//if (isCashVoucher) {
int checkResult = isErrorInWhole(vos, accMap, voucher.getPk_accountingbook());
if (checkResult != 0) {
rs.m_intSuccess = 2;
if (checkResult == 1)
rs.m_strDescription = nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("2002gl55", "UPP2002gl55-000740")/*
* @res
* "现金流量本币金额分析错误!"
*/;
if (checkResult == 2)
rs.m_strDescription = nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("2002gl55", "UPP2002gl55-000741")/*
* @res
* "现金流量原币金额分析错误!"
*/;
return vs;
}
//}
} catch (Exception e) {
reportException(e);
rs.m_intSuccess = 2;
rs.m_strDescription = nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("2002gl55", "UPP2002gl55-000742")/*
* @res
* "现金流量分析错误!"
*/;
}
}
if (pa.trim().equals(GLParaValueConst.GL089_MAIN_ASS_ITEM)) {
nc.vo.gl.pubvoucher.OperationResultVO[] orSub = checkSubAssSetting(vo, accMap);
if (orSub != null && orSub.length > 0) {
return orSub;
}
}
return vs;
}
/**
* 错误分析现金流量(整张凭证所有分录一起分析)
*
*/
private int isErrorInWhole(nc.vo.gl.pubvoucher.DetailVO[] vos, HashMap accMap, String strPKGLOrgbook) throws Exception {
String pa = null;
try {
pa = GLPubProxy.getRemoteGlPara().isCheckNativeAmount(vos[0].getPk_glorgbook());
} catch (Exception e) {
reportException(e);
throw new nc.vo.pub.BusinessException(nc.bs.ml.NCLangResOnserver.getInstance().getStrByID("200235", "UPP200235-000012")/*
* @res
* "现金流量检查时错误!"
*/);
}
boolean flag0 = checkCfForVoucher(vos, accMap, strPKGLOrgbook, 0);
if (flag0) {
return 1;
} else if (pa != null && !pa.equalsIgnoreCase(CF_SAVE_CHECK_MAINONLY)) {
boolean flag1 = checkCfForVoucher(vos, accMap, strPKGLOrgbook, 1);
if (flag1) {
return 2;
} else {
return 0;
}
} else {
return 0;
}
}
/**
* @param vos
* @param accMap
* @param strPKGLOrgbook
* @param type
* 0: 本币 / 1: 原币
* @return
* @throws Exception
*/
private boolean checkCfForVoucher(nc.vo.gl.pubvoucher.DetailVO[] vos, HashMap accMap, String strPKGLOrgbook, int type) throws Exception {
CashFlowCaseOpDMO opDMO = new CashFlowCaseOpDMO();
HashMap<String, UFDouble> map = new HashMap<String, UFDouble>();
// HashMap<String, UFDouble> moneyMapForVoucher = new HashMap<String,
// UFDouble>();
QueryConditionVO qvo = new QueryConditionVO();
qvo.setPk_glorgbook(strPKGLOrgbook);
String[] pks = getMoneyCurrencyMapForVoucher(vos, map, type, qvo, accMap);
qvo.setPk_voucherDetail(pks);
// 本币不按照币种检查
if (type == 0) {
UFDouble cashflow = getNativeAmount(vos, accMap);
UFDouble cashFlowSum = opDMO.getCashFlowSumForCertainCurrency(qvo, null, type);
return (cashflow.compareTo(cashFlowSum) != 0);
} else {
// 注意:这里取合计金额时考虑了流入流出的方向
HashSet<String> currencyTypeSet = new HashSet<String>();
for (DetailVO onevo : vos) {
nc.vo.bd.account.AccountVO subjvo = (nc.vo.bd.account.AccountVO) accMap.get(onevo.getPk_accasoa());
if (subjvo.getCashtype().intValue() > 0) {
currencyTypeSet.add(onevo.getPk_currtype());
}
}
Iterator iter = currencyTypeSet.iterator();
while (iter.hasNext()) {
String pk_currtype = (String) iter.next();
UFDouble analyzedCfAmount = opDMO.getCashFlowSumForCertainCurrency(qvo, pk_currtype, type);
UFDouble voucherCfAmount = map.get(pk_currtype);
if (analyzedCfAmount != null && analyzedCfAmount.compareTo(voucherCfAmount) == 0) {
continue;
}
if (isNullEqual(analyzedCfAmount, voucherCfAmount)) {
continue;
}
return true;
}
return false;
}
}
nc.bs.gl.cashflowcase.CashFlowCaseOpDMO文章来源:https://www.toymoban.com/news/detail-687688.html
/**
* @param conVO
* @param pk_currtype
* @return
* @throws SQLException
*/
public UFDouble getCashFlowSumForCertainCurrency(QueryConditionVO conVO, String pk_currtype, int type)
throws SQLException {
/** ********************************************************** */
// 保留的系统管理接口:
beforeCallMethod("nc.bs.gl.cashflowcase.CashFlowCaseOpDMO", "getCashFlowSum", new Object[] { conVO });
/** ********************************************************** */
String str = null;
// if (conVO.getPk_voucherDetail() != null && conVO.getPk_voucherDetail().length > 0) {
// str = " (";
// for (int i = 0; i < conVO.getPk_voucherDetail().length; i++) {
// if (i == conVO.getPk_voucherDetail().length - 1) {
// str += "'" + conVO.getPk_voucherDetail()[i] + "' )";
// } else {
// str += "'" + conVO.getPk_voucherDetail()[i] + "' ,";
// }
// }
// }
if (conVO.getPk_voucherDetail() != null && conVO.getPk_voucherDetail().length > 0) {
try {
str = " and " + GLSqlUtil.buildInSql("gl_cashflowcase.pk_detail", conVO.getPk_voucherDetail());
} catch (BusinessException e) {
Logger.error(e.getMessage(), e);
throw new SQLException(e);
}
}
String sqls = "";
// 因为需要默认"没有设置现金流入流出方向"的现金流量为"流入",所以这里加上了case:when(2是流出,流出为负)
if (type == 0)
sqls = " select sum(moneymain*(case when bd_cashflow.itemtype = 2 then -1 else 1 end)) ";
else
sqls = " select sum(money*(case when bd_cashflow.itemtype = 2 then -1 else 1 end)) ";
sqls += " from gl_cashflowcase,bd_cashflow,gl_detail";
sqls += " where bd_cashflow.pk_cashflow = gl_cashflowcase.pk_cashflow ";
sqls += " and gl_detail.pk_detail = gl_cashflowcase.pk_detail";
sqls += " and gl_cashflowcase.pk_accountingbook = '" + conVO.getPk_glorgbook() + "'";
if (pk_currtype != null)
sqls += " and (gl_cashflowcase.pk_currtype = '" + pk_currtype
+ "' or (isnull(gl_cashflowcase.pk_currtype,'~')='~' and gl_detail.pk_currtype='" + pk_currtype
+ "'))";
if (str != null) {
// sqls += " and gl_cashflowcase.pk_detail in " + str;
sqls += str;
}
sqls += " and (isnull(ismain,'~')='~' or ismain <> 'N') "; // 只算主表数据
UFDouble res = null;
Connection con = null;
PreparedStatement stmt = null;
nc.bs.logging.Logger.debug("sql:"+sqls);
try {
con = getConnection();
stmt = con.prepareStatement(sqls);
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
Object t1 = rs.getObject(1);
if (t1 != null) {
res = new UFDouble(t1.toString());
}
}
if (res == null) {
res = new UFDouble(0);
}
} finally {
try {
if (stmt != null) {
stmt.close();
}
} catch (Exception e) {
}
try {
if (con != null) {
con.close();
}
} catch (Exception e) {
}
}
/** ********************************************************** */
// 保留的系统管理接口:
afterCallMethod("nc.bs.gl.cashflowcase.CashFlowCaseOpDMO", "getCashFlowSum", new Object[] { conVO });
/** ********************************************************** */
return res;
}
如下图,sql语句执行得到的值和代码逻辑获取得到的值不一样,就是因为现金流量表跟会计科目没有设置对照关系。
文章来源地址https://www.toymoban.com/news/detail-687688.html
到了这里,关于NC 科目对照表调整了收支项目对应的会计科目生成凭证后,调整后的会计科目在现金流量分析没有生成对应的现金流量,导致凭证保存的时报“错误:现金流量本币金额分析错误!”的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!