集成费用报销单报错,源单的费用类型找不到原创
4人赞赏了该文章
295次浏览
编辑于2022年01月24日 14:02:48
1、场景:如上图,集成有冲申请的报销单出错。
2、原因:上游申请明细分录id和冲申请款分录的id不一致导致
3、解决方案:先确保上游都集成了,上游id配置的聚合函数和下游的源单聚合函数一致
如果确实一致,且测试两边的集成后id不一致(请到测试环境测试重现,重现可在测试环境脚本加上为空分支处理)
//处理冲申请分录的成本中心和费用类型 var reqcheck = tar.reqCheckEntries; for(var i=0; i < reqcheck.length; i++){ sql = "select a.fexpenseTypeid as expensetypeid,a.fcostcenterid as costcenterid,b.fname_l2 as expensetypename,c.fname_l2 as costcentername from T_BC_OtherExpenseBillEntry a left join t_bc_expensetype b on a.fexpenseTypeid = b.fid left join t_org_baseunit c on a.fcostcenterid = c.fid where a.fid = ?"; var expensetype = query_row($tar,sql,[reqcheck[i].sourceBillEntryID],[VARCHAR]); //to_eas_id上下游不一致时 if(expensetype==null){ //1、根据苍穹中的sourceentryid 查询出对应的单据头fnubmer、分录的seq var srcId = param;//param变量为值转换的入参 var sql_src ="select A.fbillno,B.fseq from t_er_dailyapplybill@FI A inner join t_er_dailyapplydetail B on A.fid = B.fid where B.fid = ?"; var kJson = query_row($src,sql_src,[srcId],[VARCHAR]); var number = kJson.fbillno; var seq = kJson.fseq; //2、在EAS系统 根据number 和分录序号 查询出对应的费用申请表分录id var sql_tar ="select B.fid from T_BC_OtherExpenseBillEntry B inner join T_BC_OtherExpenseBill A on A.fid = B.fbillid where B.fseq = ? and A.fnumber =?"; var sourceid = query_value($tar,sql_tar,[seq,number],[INTEGER,VARCHAR]); expensetype = query_row($tar,sql,sourceid,[VARCHAR]); } reqcheck[i].sourceBillExpenseTypeId = expensetype.expensetypeid; reqcheck[i].sourceBillExpenseType = expensetype.expensetypename; reqcheck[i].sourceBillCostCenterId = expensetype.costcenterid; reqcheck[i].sourceBillCostCenterName = expensetype.costcentername; }
赞 4
4人点赞
还没有人点赞,快来当第一个点赞的人吧!
打赏
0人打赏
还没有人打赏,快来当第一个打赏的人吧!
推荐阅读