NC 科目對(duì)照表調(diào)整了收支項(xiàng)目對(duì)應(yīng)的會(huì)計(jì)科目生成憑證后,調(diào)整后的會(huì)計(jì)科目在現(xiàn)金流量分析沒有生成對(duì)應(yīng)的現(xiàn)金流量,導(dǎo)致憑證保存的時(shí)報(bào)“錯(cuò)誤:現(xiàn)金流量本幣金額分析錯(cuò)誤!”
如下圖:
收支項(xiàng)目的“外部律師費(fèi)”生成的科目是“管理費(fèi)用\外聘顧問中介費(fèi)\審計(jì)費(fèi)”,實(shí)際應(yīng)該是“管理費(fèi)用\外聘顧問中介費(fèi)\外部律師費(fèi)”
在【動(dòng)態(tài)建模平臺(tái)】-【會(huì)計(jì)平臺(tái)】-【通用平臺(tái)】下的【分類定義-集團(tuán)或分類定義-業(yè)務(wù)單元】節(jié)點(diǎn)(注意,有些可能是集團(tuán)、業(yè)務(wù)單元兩個(gè)節(jié)點(diǎn)都需要修改,然后在【單據(jù)生成】節(jié)點(diǎn)下重新生成中勾選重置入賬規(guī)則,選對(duì)應(yīng)的模塊或者全選所有模塊,確定后才生效
)下,調(diào)整對(duì)應(yīng)的會(huì)計(jì)科目。如下圖:
如果知道對(duì)應(yīng)的科目對(duì)照表,也可以在節(jié)點(diǎn)【科目對(duì)照表-集團(tuán)或業(yè)務(wù)單元】中經(jīng)行調(diào)整。
調(diào)整會(huì)計(jì)科目保存后,重走入賬規(guī)則,在【財(cái)務(wù)會(huì)計(jì)】-【總賬】-【憑證管理】-【制單】節(jié)點(diǎn)中的“憑證”按鈕下的現(xiàn)金流量分析
需要在【財(cái)務(wù)會(huì)計(jì)】-【總賬】-【現(xiàn)金流量表】-【科目關(guān)系設(shè)置-集團(tuán)或組織】節(jié)點(diǎn)下找到現(xiàn)金流量對(duì)應(yīng)的會(huì)計(jì)科目進(jìn)行修改為正確的即可。
再重新打開【制單】節(jié)點(diǎn),找到對(duì)應(yīng)單據(jù),點(diǎn)擊現(xiàn)金流量分析按鈕即可發(fā)現(xiàn)生成了對(duì)應(yīng)的科目了
報(bào)如下圖錯(cuò)誤,是因?yàn)樵黾恿藘蓚€(gè)科目:
130103 其他流動(dòng)資產(chǎn)\待轉(zhuǎn)銷項(xiàng)稅
1301099 其他流動(dòng)資產(chǎn)\其他
而在現(xiàn)金流量表沒有新增對(duì)于的科目,即在科目關(guān)系設(shè)置節(jié)點(diǎn)中沒有設(shè)置現(xiàn)金流量與科目的對(duì)應(yīng)關(guān)系
這里一定要理清楚哪些會(huì)計(jì)科目設(shè)置到哪些現(xiàn)金流量表表項(xiàng),比如我下面這個(gè)就是會(huì)計(jì)科目設(shè)置對(duì)應(yīng)的現(xiàn)金流量表表項(xiàng)不對(duì)就一直報(bào)錯(cuò)
正確的應(yīng)該是如此:
“現(xiàn)金流量本幣金額分析錯(cuò)誤!” 和 “現(xiàn)金流量原幣金額分析錯(cuò)誤!” 報(bào)錯(cuò)提示對(duì)應(yīng)的邏輯代碼:
nc.bs.gl.cashflowcaseio.CashFlowCaseIODMO
主要相關(guān)方法:
/**
* 錯(cuò)誤分析現(xiàn)金流量
*
*/
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]);
}
// 現(xiàn)金類憑證
//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
* "現(xiàn)金流量本幣金額分析錯(cuò)誤!"
*/;
if (checkResult == 2)
rs.m_strDescription = nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("2002gl55", "UPP2002gl55-000741")/*
* @res
* "現(xiàn)金流量原幣金額分析錯(cuò)誤!"
*/;
return vs;
}
//}
} catch (Exception e) {
reportException(e);
rs.m_intSuccess = 2;
rs.m_strDescription = nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("2002gl55", "UPP2002gl55-000742")/*
* @res
* "現(xiàn)金流量分析錯(cuò)誤!"
*/;
}
}
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;
}
/**
* 錯(cuò)誤分析現(xiàn)金流量(整張憑證所有分錄一起分析)
*
*/
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
* "現(xiàn)金流量檢查時(shí)錯(cuò)誤!"
*/);
}
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 {
// 注意:這里取合計(jì)金額時(shí)考慮了流入流出的方向
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文章來源:http://www.zghlxwxcb.cn/news/detail-687688.html
/**
* @param conVO
* @param pk_currtype
* @return
* @throws SQLException
*/
public UFDouble getCashFlowSumForCertainCurrency(QueryConditionVO conVO, String pk_currtype, int type)
throws SQLException {
/** ********************************************************** */
// 保留的系統(tǒng)管理接口:
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 = "";
// 因?yàn)樾枰J(rèn)"沒有設(shè)置現(xiàn)金流入流出方向"的現(xiàn)金流量為"流入",所以這里加上了case:when(2是流出,流出為負(fù))
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') "; // 只算主表數(shù)據(jù)
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) {
}
}
/** ********************************************************** */
// 保留的系統(tǒng)管理接口:
afterCallMethod("nc.bs.gl.cashflowcase.CashFlowCaseOpDMO", "getCashFlowSum", new Object[] { conVO });
/** ********************************************************** */
return res;
}
如下圖,sql語句執(zhí)行得到的值和代碼邏輯獲取得到的值不一樣,就是因?yàn)楝F(xiàn)金流量表跟會(huì)計(jì)科目沒有設(shè)置對(duì)照關(guān)系。文章來源地址http://www.zghlxwxcb.cn/news/detail-687688.html
到了這里,關(guān)于NC 科目對(duì)照表調(diào)整了收支項(xiàng)目對(duì)應(yīng)的會(huì)計(jì)科目生成憑證后,調(diào)整后的會(huì)計(jì)科目在現(xiàn)金流量分析沒有生成對(duì)應(yīng)的現(xiàn)金流量,導(dǎo)致憑證保存的時(shí)報(bào)“錯(cuò)誤:現(xiàn)金流量本幣金額分析錯(cuò)誤!”的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!