费用报销单在工作流中判断预算额度内与预算额度外的脚...
金蝶云社区-HZSLY
HZSLY
0人赞赏了该文章 1,250次浏览 未经作者许可,禁止转载编辑于2015年09月06日 14:14:41
客户的费用报销分为两种情况,预算额度内与预算额度外,其中预算额度外的由部门负责人提交流程,并走相关审批流程,但是脚本完成并测试后,发现脚本中关于预算控制策略的取数总是取不到,不知道问题出在哪里,脚本如下:
com . kingdee . eas . cp. bc . BizAccountBillEntryCollection bizAccountBillEntryCollection = com . kingdee . eas . cp. bc . BizAccountBillEntryFactory . getLocalInstance ( __bosContext ) . getBizAccountBillEntryCollection ( "where bill='" + id + "'" ) ; com . kingdee . eas . ma. budget . IBudgetCtrlFacade ibf = com . kingdee . eas . ma . budget .BudgetCtrlFacadeFactory . getLocalInstance ( __bosContext ) ; //取预算控制策略com . kingdee . eas . ma. budget . BgCtrlResultCollection bcr = new com . kingdee . eas . ma . budget .BgCtrlResultCollection ( ) ; bcr = ibf . getBudget ( id ); isPass = true ;isAdminPersonFlag = true ; testflag = bcr . size ( ) + "-" + bcr . get ( 0 ) . getBalance ( ) + "-" + bizAccountBillEntryCollection . size ( ) +"-" + id ;if ( bcr . size ( ) > 0 && bcr . get( 0 ) . getBalance ( ) != null ) { testflag = testflag + "1";for ( int i = 0 ; i < bcr . size ( ) ; i ++ ) {testflag = testflag + "2"; java . math . BigDecimal yue = bcr . get ( i ). getBalance ( ) ; java . lang . String OperationType = bcr . get( i ) . getBillItemNumber ( ) ; for ( int m = 0 ; m < bizAccountBillEntryCollection. size ( ) ; m ++ ) { testflag = testflag + "3"; bizAccountBillEntryinfo =bizAccountBillEntryCollection . get ( m ) ; java . math . BigDecimal amount =bizAccountBillEntryinfo . getAmount ( ) ; com . kingdee . bos . util . BOSUuidyewuTypeuuid = bizAccountBillEntryinfo . getOperationType ( ) . getId ( ) ; com . kingdee . eas . cp . bc .IOperationType iet = com . kingdee . eas . cp . bc . OperationTypeFactory .getLocalInstance ( __bosContext ) ; com . kingdee . eas . cp . bc .OperationTypeInfo eti = iet . getOperationTypeInfo ( new com . kingdee . bos . dao . ormapping .ObjectUuidPK ( yewuTypeuuid ) ) ; java . lang . String yewuType = eti .getNumber ( ) ; testflag = testflag + "4";if ( yewuType . equals ( OperationType )&& ( ( amount . intValue ( ) - yue . intValue ( ) ) > 0 ) ) { isPass = false ;testflag = "panduanchaoyusuan"; break;} else{testflag = "panduanweichaoyusuan";}