提交 05dcde4f authored 作者: fengzy's avatar fengzy

oa付款单

上级 06a90f9f
...@@ -248,80 +248,103 @@ class flow_oafkClassModel extends flowModel ...@@ -248,80 +248,103 @@ class flow_oafkClassModel extends flowModel
$paymentMethod = $this->rs['paymentMethod'];//付款方式 $paymentMethod = $this->rs['paymentMethod'];//付款方式
$cbxmid = $this->rs['cbzxid'];//成本中心 $cbxmid = $this->rs['cbzxid'];//成本中心
$cbxmid = substr($cbxmid, 0, strpos($cbxmid, "(")); $cbxmid = substr($cbxmid, 0, strpos($cbxmid, "("));
$oafk_details=$this->db->getrows('oa_c_fund_details_fk',"mid='".$this->rs['id']."'");
$arr=[];
foreach ($oafk_details as $k=> $value) {
foreach ($value as $key => $val) {
switch ($key) {
case 'charge_amount':
$arr['FPAYAPPLYENTRY'][$k]['FAPPLYAMOUNTFOR']=$val;
break;
break;
default:
$arr['FPAYAPPLYENTRY'][$k]['FSETTLETYPEID']['FNumber']='JSFS04_SYS';
$arr['FPAYAPPLYENTRY'][$k]['FPAYPURPOSEID']['FNumber']='SFKYT08_SYS';
$arr['FPAYAPPLYENTRY'][$k]['FENDDATE']=$this->rs['applydt'].' 00:00:00';
$arr['FPAYAPPLYENTRY'][$k]['FEXPECTPAYDATE']=$this->rs['applydt'].' 00:00:00';
$arr['FPAYAPPLYENTRY'][$k]['FEACHBANKACCOUNT'] = $data['bank_code'];
$arr['FPAYAPPLYENTRY'][$k]['FEACHCCOUNTNAME'] = $data['bank_holder'];
$arr['FPAYAPPLYENTRY'][$k]['FEACHBANKNAME'] = $data['open_bank_name'];
break;
}
}
}
$data_model = '{ $data_model = '{
"Creator": "", "Creator": "",
"NeedUpDateFields": [], "NeedUpDateFields": [],
"NeedReturnFields": [], "NeedReturnFields": [],
"IsDeleteEntry": "true", "IsDeleteEntry": "true",
"SubSystemId": "", "SubSystemId": "",
"IsVerifyBaseDataField": "false", "IsVerifyBaseDataField": "false",
"IsEntryBatchFill": "true", "IsEntryBatchFill": "true",
"ValidateFlag": "true", "ValidateFlag": "true",
"NumberSearch": "true", "NumberSearch": "true",
"InterationFlags": "", "InterationFlags": "",
"IsAutoSubmitAndAudit": "false", "IsAutoSubmitAndAudit": "false",
"Model": { "Model": {
"FID": 0, "FID": 0,
"FBILLTYPEID": { "FBILLTYPEID": {
"FNUMBER": "FKSQ008" "FNUMBER": "FKSQ008"
}, },
"FCREATORID": { "FDATE": "2020-06-29 00:00:00",
"FNUMBER": "" "FCONTACTUNITTYPE": "BD_Supplier",
}, "FCONTACTUNIT": {
"FDATE": "2020-03-02 00:00:00", "FNumber": "GDGYS-0003"
"FCONTACTUNITTYPE": "BD_Supplier", },
"FCONTACTUNIT": { "FRECTUNITTYPE": "BD_Supplier",
"FNumber": "GSGYS-0005" "FRECTUNIT": {
}, "FNumber": "GDGYS-0003"
"FRECTUNITTYPE": "BD_Supplier", },
"FRECTUNIT": { "FCURRENCYID": {
"FNumber": "GSGYS-0005" "FNumber": "PRE001"
}, },
"FCURRENCYID": { "FAPPLYORGID": {
"FNumber": "PRE001" "FNumber": "1000"
}, },
"FAPPLYORGID": { "FPAYORGID": {
"FNumber": "1000" "FNumber": "1000"
}, },
"FPAYORGID": { "FSETTLEORGID": {
"FNumber": "1000" "FNumber": "1000"
}, },
"FSETTLEORGID": { "FPURCHASEORGID": {
"FNumber": "1000" "FNumber": "1000"
}, },
"FPURCHASEORGID": { "FDOCUMENTSTATUS": "Z",
"FNumber": "1000" "FCANCELSTATUS": "A",
}, "FMAINBOOKID": {
"FDOCUMENTSTATUS": "Z", "FNUMBER": "PRE001"
"FCANCELSTATUS": "A", },
"FMAINBOOKID": { "FIsCredit": false,
"FNUMBER": "PRE001" "FSETTLECUR": {
}, "FNUMBER": "PRE001"
"FIsCredit": false, },
"FSETTLECUR": { "FISCARRYRATE": false,
"FNUMBER": "PRE001" "F_PAEZ_Cbzx": {
}, "FNUMBER": "GS.BJ.B01.02"
"FISCARRYRATE": false, },
"F_PAEZ_Cbzx": { "F_PAEZ_OADJBH": "213123213",
"FNUMBER": "GS.BJ.B01.02"
} }
}';
}
}';
$arr['FPAYAPPLYENTRY'][0]['FENDDATE'] = $this->rs['applydt'] . ' 00:00:00';
$arr['FPAYAPPLYENTRY'][0]['FEXPECTPAYDATE'] = $this->rs['applydt'] . ' 00:00:00';
$arr['FPAYAPPLYENTRY'][0]['FAPPLYAMOUNTFOR'] = intval($amountOfThisPayment);
$arr['FPAYAPPLYENTRY'][0]['FEACHBANKACCOUNT'] = $data['bank_code'];
$arr['FPAYAPPLYENTRY'][0]['FEACHCCOUNTNAME'] = $data['bank_holder'];
$arr['FPAYAPPLYENTRY'][0]['FEACHBANKNAME'] = $data['open_bank_name'];
$model = json_decode($data_model, true); $model = json_decode($data_model, true);
$model['Model']['F_PAEZ_Cbzx']['FNUMBER'] = $cbxmid; $model['Model']['F_PAEZ_Cbzx']['FNUMBER'] = $cbxmid;
$model['Model']['FCREATORID']['FNUMBER'] = $gonncode; $model['Model']['FCREATORID']['FNUMBER'] = $gonncode;
$model['Model']['FDATE'] = $applydt; $model['Model']['FDATE'] = $applydt;
// $model['Model']['FCONTACTUNIT']['FNumber']=$suppliername; $model['Model']['F_PAEZ_OADJBH'] = $this->rs['docnum'];;
// $model['Model']['FRECTUNIT']['FNumber']=$suppliername; $model['Model']['FCONTACTUNIT']['FNumber']=$suppliername;
$model['Model']['FRECTUNIT']['FNumber']=$suppliername;
$model['Model']['FPAYAPPLYENTRY'] = $arr['FPAYAPPLYENTRY']; $model['Model']['FPAYAPPLYENTRY'] = $arr['FPAYAPPLYENTRY'];
...@@ -334,6 +357,7 @@ class flow_oafkClassModel extends flowModel ...@@ -334,6 +357,7 @@ class flow_oafkClassModel extends flowModel
$post_content = self::create_postdata($data); $post_content = self::create_postdata($data);
$result = self::invoke_add($cloudUrl, $post_content, $cookie_jar); $result = self::invoke_add($cloudUrl, $post_content, $cookie_jar);
$array = json_decode($result, true); $array = json_decode($result, true);
var_dump($array);
if ($array['Result']['ResponseStatus']['IsSuccess']) { if ($array['Result']['ResponseStatus']['IsSuccess']) {
$num = $array['Result']['Number']; $num = $array['Result']['Number'];
$this->update("`fbillno`='$num'", $this->rs['id']); $this->update("`fbillno`='$num'", $this->rs['id']);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论