Commit 772eb7bc by 陶然

优化

parent be611350
......@@ -288,6 +288,7 @@ namespace Kivii.Finances.Transforms
invoice.PayerBankAccount = info.PayerBankAccount;
invoice.OperatorName = info.OperatorName;
invoice.Remark = info.Remark;
invoice.Summary = "手动录入发票!";
invoice.Metadata = new Dictionary<string, string>();
if (!info.Metadata.IsNullOrEmpty())
......
......@@ -299,7 +299,7 @@ namespace Kivii.Finances.Transforms
if (applys.Sum(o => o.Amount) != existDetails.Sum(p => p.Amount)) throw new Exception("总金额和明细总额不一致!");
var applyRelations = conn.Select<InvoiceApply>(o => Sql.In(o.ParentKvid, applys.ConvertAll(p => p.Kvid)) && o.OperateType == InvoiceApplyType.Related && o.OffsetKvid == Guid.Empty);
var payments = conn.Select<Payment>(o => Sql.In(o.Kvid, applyRelations.ConvertAll(p => p.BizKvid)));//Type:Split,Pos,Cash,WeChat...
(conn.Exists<Invoice>(o => o.OffsetKvid != Guid.Empty && Sql.In(o.BizKvid, payments.ConvertAll(p => p.RootKvid)))).ThrowIfTrue("已有开票的到账,无法重复开票,请驳回!");
(conn.Exists<Invoice>(o => o.OffsetKvid == Guid.Empty && Sql.In(o.BizKvid, payments.ConvertAll(p => p.RootKvid)))).ThrowIfTrue("已有开票的到账,无法重复开票,请驳回!");
var rtns = new RestfulExecutionResponse<InvoiceApply>();
rtns.Results = new List<InvoiceApply>();
......@@ -636,6 +636,7 @@ namespace Kivii.Finances.Transforms
invoice.PayerBankAccount = apply.PayerBankAccount;
invoice.OperatorName = apply.OperatorName;
invoice.Remark = apply.Remark;
invoice.Summary = "系统中开具发票!";
invoice.Metadata = new Dictionary<string, string>();
invoice.Metadata["PayeeOperatorName"] = apply.Metadata.ContainsKey("PayeeOperatorName") ? apply.Metadata["PayeeOperatorName"] : "";
......@@ -879,6 +880,7 @@ namespace Kivii.Finances.Transforms
invoice.PayerBankAccount = apply.PayerBankAccount;
invoice.OperatorName = apply.OperatorName;
invoice.Remark = apply.Remark;
invoice.Summary = "系统中开具发票!";
invoice.Metadata = new Dictionary<string, string>();
invoice.Metadata["PayeeOperatorName"] = apply.Metadata.ContainsKey("PayeeOperatorName") ? apply.Metadata["PayeeOperatorName"] : "";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment