收款单WEBSERVICE问题
明明在程序里设置了这些必填字段,可是还是不行,跟踪出的提示信息还是下面的内容
:
"单据体“收款单明细”第1行字段“收款用途”是必填项"
"字段“付款单位”是必填项"
"字段“往来单位”是必填项"
"字段“单据类型”是必填项"
"第1行分录,实收金额必须大于0"
"第1行分录,银行业务的结算方式,我方银行相关信息必录!"
程序代码如下,我真不知道还要设置哪些字段了:
AR_RECEIVEBILL receibill = new ServiceReference1.AR_RECEIVEBILL();
AR_RECEIVEBILL_ORG_Organizations payOrg = new AR_RECEIVEBILL_ORG_Organizations();
receibill.FPAYORGID = payOrg;//收款组织
receibill.FPAYORGID.FNUMBER = bill.PayOrgNumber;
receibill.FSETTLEORGID = new AR_RECEIVEBILL_ORG_Organizations();//结算组织
receibill.FSETTLEORGID.FNUMBER = bill.PayOrgNumber;
receibill.FSALEORGID = new AR_RECEIVEBILL_ORG_Organizations ();//销售组织
receibill.FSALEORGID.FNUMBER = bill.PayOrgNumber;
receibill.FPAYUNITTYPE = bill.FPAYUNITTYPE;//付款类型
AR_RECEIVEBILL_BOS_ItemClass fpayunit = new AR_RECEIVEBILL_BOS_ItemClass();
receibill.FPAYUNIT = fpayunit;//付款单位
receibill.FPAYUNIT.FNumber= bill.FPAYUNITFNumber;
AR_RECEIVEBILL_BD_Currency fcurrency = new AR_RECEIVEBILL_BD_Currency();
receibill.FCURRENCYID = fcurrency;//币别
receibill.FCURRENCYID.FNUMBER = bill.FCURRENCYIDFNUMBER;
AR_RECEIVEBILL_BOS_BillType fbilltype = new AR_RECEIVEBILL_BOS_BillType();
receibill.FBillTypeID = fbilltype;//单据类型
receibill.FBillTypeID.FName = bill.FBillTypeIDFName;
receibill.FDATE = DateTime.Parse(bill.FDATE);//业务日期
AR_RECEIVEBILL_BOS_ItemClass fcontactunit = new AR_RECEIVEBILL_BOS_ItemClass();
receibill.FCONTACTUNIT = fcontactunit;//往来单位
receibill.FCONTACTUNIT.FNumber = bill.FCONTACTUNITFNumber;
receibill.FCONTACTUNITTYPE = bill.FCONTACTUNITTYPE;//往来单位类型
receibill.FDOCUMENTSTATUS = "Z";//单据状态
receibill.FCancelStatus="A";//作废标志
AR_RECEIVEBILL__FRECEIVEBILLENTRY entry1 = new AR_RECEIVEBILL__FRECEIVEBILLENTRY();
AR_RECEIVEBILL_CN_BANKACNT faccountid = new AR_RECEIVEBILL_CN_BANKACNT();
entry1.FACCOUNTID = faccountid;//我方帐号
entry1.FACCOUNTID.FNumber = bill.FACCOUNTIDFNumber;
entry1.FOPPOSITEBANKACCOUNT = bill.FOPPOSITEBANKACCOUNT;//对方帐号
entry1.FOPPOSITEBANKNAME = bill.FOPPOSITEBANKNAME;//对方开户行
entry1.FOPPOSITECCOUNTNAME = bill.FOPPOSITECCOUNTNAME;//对方账号名称
AR_RECEIVEBILL_BD_SETTLETYPE fsettletypeid = new AR_RECEIVEBILL_BD_SETTLETYPE();
entry1.FSETTLETYPEID = fsettletypeid;//结算方式,电汇
entry1.FSETTLETYPEID.FNumber = bill.FSETTLETYPEIDFNumber;
AR_RECEIVEBILL_CN_RECPAYPURPOSE fpurposeid = new AR_RECEIVEBILL_CN_RECPAYPURPOSE();
entry1.FPURPOSEID = fpurposeid;//收款用途,销售收款
entry1.FPURPOSEID.FNumber = bill.FPURPOSEIDFNumber;
entry1.FRECTOTALAMOUNTFOR = bill.FRECTOTALAMOUNTFOR;//应收金额
entry1.FREALRECAMOUNTFOR_D = bill.FRECTOTALAMOUNTFOR;//实收金额
entry1.FSETTLENO = "JSFS04_SYS";
List
list.Add(entry1);
receibill.AR_RECEIVEBILL__FRECEIVEBILLENTRY = list.ToArray();
string result = "";
result=client.AR_RECEIVEBILL_Save(userName, receibill, null, out status);
推荐阅读