提交 420ea6a3 authored 作者: fengzy's avatar fengzy

费用报销脚本

上级 54af5fc9
...@@ -358,7 +358,127 @@ class openfinfybxClassAction extends openapiAction ...@@ -358,7 +358,127 @@ class openfinfybxClassAction extends openapiAction
} }
var_dump($arr); $cloudUrl = "http://36.110.39.211/k3cloud/";
//登陆参数
$data = array(
'5e64f6ff0bd47f',//帐套Id
'Administrator',//用户名
'666666',//密码
'2052'//语言标识359010087
);
//定义记录Cloud服务端返回的Session
$cookie_jar = tempnam('/tmp','CloudSession');
$post_content = self::create_postdata($data);
$result = self::invoke_login($cloudUrl,$post_content,$cookie_jar);
header("Content-type: text/html; charset=utf8");
$applicant=$fininfomlist['applicant'];//申请人
$applydt=$fininfomlist['applydt'];//申请日期
$data_model ='{
"Creator": "",
"NeedUpDateFields": [],
"NeedReturnFields": [],
"IsDeleteEntry": "true",
"SubSystemId": "",
"IsVerifyBaseDataField": "false",
"IsEntryBatchFill": "true",
"ValidateFlag": "true",
"NumberSearch": "true",
"InterationFlags": "",
"IsAutoSubmitAndAudit": "false",
"Model": {
"FID": 0,
"FBILLTYPEID": {
"FNUMBER": "FKSQ005_SYS"
},
"FDATE": "2020-02-11 00:00:00",
"FCONTACTUNITTYPE": "BD_Empinfo",
"FCONTACTUNIT": {
"FNumber": "GONN-0002"
},
"FRECTUNITTYPE": "BD_Empinfo",
"FRECTUNIT": {
"FNumber": "GONN-0002"
},
"FCURRENCYID": {
"FNumber": "PRE001"
},
"FPAYORGID": {
"FNumber": "1000"
},
"FSETTLEORGID": {
"FNumber": "1000"
},
"FDEPARTMENT": {
"FNumber": "GS.BM.08"
},
"F_PAEZ_OADJBH": "123321",
"FDOCUMENTSTATUS": "Z",
"FCANCELSTATUS": "A",
"FMAINBOOKID": {
"FNUMBER": "PRE001"
},
"FIsCredit": false,
"FAPPLYORGID": {
"FNumber": "1000"
},
"FSETTLECUR": {
"FNUMBER": "PRE001"
},
"FISCARRYRATE": false,
"F_PAEZ_CBZX1": {
"FNUMBER": " GS.BJ.B1"
}
}
}';
$model=json_decode($data_model,true);
$model['Model']['FDATE']=$applydt;
$model['Model']['FDEPARTMENT']['FNumber']=self::dept($fininfomlist['applicationdpt']);
$model['Model']['FCONTACTUNIT']['FNumber']=$gonncode;
$model['Model']['F_PAEZ_OADJBH']=$fininfomlist['docnum'];
$model['Model']['FRECTUNIT']['FNumber']=$gonncode;
$model['Model']['FPAYAPPLYENTRY']=$arr['FPAYAPPLYENTRY'];
$data_model=json_encode($model);
$data = array(
'CN_PAYAPPLY',//业务对象标识FormId
$data_model//具体Json字串
);
$post_content = self::create_postdata($data);
$result = self::invoke_add($cloudUrl,$post_content,$cookie_jar);
$array = json_decode($result,true);
var_dump($array);
// $num=$array['Result']['Number'];
// if($array['Result']['ResponseStatus']['IsSuccess']){
// $this->update("`fsrcbillno`='$num'", $this->rs['id']);
// $this->erplog($this->rs['docnum'],'fininfom','付款申请单保存成功',json_encode($array),date("Y-m-d H:i:s"),2,$num,$array['Result']['Id'],1);
// if($this->apply_submit($cloudUrl,$cookie_jar,$array['Result']['Id'],$array['Result']['Number'])){
// $this->erplog($this->rs['docnum'],'fininfom','付款申请单提交成功',json_encode($array),date("Y-m-d H:i:s"),2,$num,$array['Result']['Id'],2);
// }else{
// $this->erplog($this->rs['docnum'],'fininfom','付款申请单提交失败',json_encode($array),date("Y-m-d H:i:s"),1,$num,$array['Result']['Id'],2);
// }
// if($this->apply_audit($cloudUrl,$cookie_jar,$array['Result']['Id'],$array['Result']['Number'])){
// $this->erplog($this->rs['docnum'],'fininfom','付款申请单审核成功',json_encode($array),date("Y-m-d H:i:s"),2,$num,$array['Result']['Id'],3);
// }else{
// $this->erplog($this->rs['docnum'],'fininfom','付款申请单审核失败',json_encode($array),date("Y-m-d H:i:s"),1,$num,$array['Result']['Id'],3);
// }
// }else{
// $this->erplog($this->rs['docnum'],'fininfom','付款申请单保存失败',json_encode($array),date("Y-m-d H:i:s"),1,$num,$array['Result']['Id'],1);
// }
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论