//采购成本总帐凭证
private static GL_VOUCHER_SaveResponse GL_VOUCHER_Save(KDServiceClient client)
{
GL_VOUCHER_Save save = new GL_VOUCHER_Save();
//凭证
save.Model = new GL_VOUCHER();
//账簿
save.Model.FAccountBookID = new GL_VOUCHER_BD_AccountBook()
{
FNumber = "002",
FName = "蓝海柴油机械公司主账簿"
};
//日期
save.Model.FDate = DateTime.Parse("2015-08-25");
//核算组织
save.Model.FACCBOOKORGID = new GL_VOUCHER_ORG_Organizations { FNumber = "101" };
//凭证字
save.Model.FVOUCHERGROUPID = new GL_VOUCHER_BD_VOUCHERGROUP() { FNumber="PRE001" };
//凭证号:FVOUCHERGROUPNO
save.Model.FVOUCHERGROUPNO = "37";
//应付单明细
save.Model.GL_VOUCHER__FEntity = new GL_VOUCHER__FEntity [] {
new GL_VOUCHER__FEntity(){
//摘要:FEXPLANATION
FEXPLANATION = "abc001",
//科目编码:
FACCOUNTID = new GL_VOUCHER_BD_Account(){
FNUMBER="5001",
FNAME="生产成本"
},
//核算维度:FDetailID
FDetailID = new BD_FLEXITEMDETAILV_BD_FLEXITEMDETAILV(){
FDETAILID__FOPCODE="FYXM01_SYS"
},
//借方金额
FDEBIT = 500
}
};
var result = client.Send
return result;
}
---
上面是我的调用方法,但并没有成功的生成凭证,我在result中调试发现报了两个错:"字段“账簿”是必填项" ;"账簿非法,请重新输入!"
不明白我下面的代码哪里出了问题,怎么会报这样的错:
//账簿
save.Model.FAccountBookID = new GL_VOUCHER_BD_AccountBook()
{
FNumber = "002",
FName = "蓝海柴油机械公司主账簿"
};
---请高手解答。急!
推荐阅读