【二开插件】销售普通发票自动开具金税发票
需求:销售普通发票审核后,自动开具金税发票,不需要点击“金税发票开具”按钮
public class CreateIV : AbstractOperationServicePlugIn { public override void AfterExecuteOperationTransaction(AfterExecuteOperationTransaction e) { base.AfterExecuteOperationTransaction(e); OperateResultCollection oResult = this.OperationResult.OperateResult; if (this.OperationResult.IsSuccess && oResult.Count > 0) { foreach (DynamicObject o in e.DataEntitys) { PushIV(o); } } } private void PushIV(DynamicObject obj) { string invoiceid = obj["F_invoice_id"].ToString(); #region 下推金税 OperateResultCollection operateResults = new OperateResultCollection(); Dictionary<string, string> sourceBills = new Dictionary<string, string>(); sourceBills.Add(obj["Id"].ToString(), obj["BillNo"].ToString()); GoldenTaxServiceHelper.PushGTInvoice(this.Context, "IV_SALESOC", "IV_GTINVOICE", sourceBills, operateResults, true, "0"); //GTCommonFunction.ShowOperateResult(this.View, operateResults); #endregion //下推失败记录信息到操作日志 var logs = new List<LogObject>(); foreach(OperateResult op in operateResults) { if (!op.SuccessStatus) { LogObject log = new LogObject { pkValue = "0", Description = op.Message, OperateName = "自动开具金税发票", ObjectTypeId = "BOS_SCHEDULETYPE", SubSystemId = "BOS", Environment = OperatingEnvironment.BizOperate }; logs.Add(log); } } if (logs.Count > 0) { LogServiceHelper.BatchWriteLog(this.Context, logs); } } }
注:
1.具体可反编译销售发票单据的表单插件Kingdee.K3.FIN.IV.Business.PlugIn.GoldenTax.GTOperateEdit中的BarItemClick方法自行查看,最终是调用GoldenTaxServiceHelper.PushGTInvoice方法真正进行开票。
2.以上代码不涉及超额拆分开票的情况
【二开插件】销售普通发票自动开具金税发票
需求:销售普通发票审核后,自动开具金税发票,不需要点击“金税发票开具”按钮public class CreateIV : AbstractOperationServicePlugIn{ ...
点击下载文档
上一篇:《番茄工作法》一次只做一件事下一篇:PLM常见问题-直播-文字版
本文2024-09-16 17:16:44发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-14672.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章