Esempio n. 1
0
        private void gridView1_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
        {
            Model.AtSummonDetail         _detail     = this.gridView1.GetRow(e.RowHandle) as Model.AtSummonDetail;
            IList <Model.AtSummonDetail> _detailList = this.bindingSource1.DataSource as IList <Model.AtSummonDetail>;

            if (e.Column == this.colJinE || e.Column == this.colJieorDai)
            {
                this.spinEditTotalDebits.EditValue = _detailList.Where(d => d.Lending == "借").ToList().Sum(d => d.AMoney);
                this.spinEditCreditTotal.EditValue = _detailList.Where(d => d.Lending == "貸").ToList().Sum(d => d.AMoney);
            }
            else if (e.Column == this.colKemuBianHao || e.Column == this.colKeMuMingCheng)
            {
                if (!string.IsNullOrEmpty(_detail.SubjectId))  //&& string.IsNullOrEmpty(_detail.Summary)
                {
                    var subject = new BL.AtAccountSubjectManager().Get(_detail.SubjectId);
                    if (subject != null && !string.IsNullOrEmpty(subject.CommonSummary))
                    {
                        _detail.Summary = subject.CommonSummary;
                    }
                }
            }


            //this.bindingSource1.Position = this.bindingSource1.IndexOf(_detail);
            this.gridControl1.RefreshDataSource();
        }
Esempio n. 2
0
 private void simpleButton1_Click(object sender, EventArgs e)
 {
     Model.AtSummonDetail detail = new Model.AtSummonDetail();
     detail.Subject = new Book.Model.AtAccountSubject();
     this.atSummon.Details.Add(detail);
     this.gridControl1.RefreshDataSource();
 }
        public bool ExistsExcept(Model.AtSummonDetail e)
        {
            Hashtable paras = new Hashtable();

            paras.Add("newId", e.Id);
            paras.Add("oldId", Get(e.SummonDetailId) == null?null:Get(e.SummonDetailId).Id);
            return(sqlmapper.QueryForObject <bool>("AtSummonDetail.existsexcept", paras));
        }
Esempio n. 4
0
 protected override void AddNew()
 {
     this.atSummon            = new Model.AtSummon();
     this.atSummon.SummonDate = DateTime.Now;
     this.atSummon.Id         = this.atSummonManager.GetId();
     this.atSummon.Details    = new List <Model.AtSummonDetail>();
     if (this.action == "insert")
     {
         Model.AtSummonDetail detail = new Model.AtSummonDetail();
         detail.Subject = new Book.Model.AtAccountSubject();
         this.atSummon.Details.Add(detail);
         this.bindingSource1.Position = this.bindingSource1.IndexOf(detail);
     }
 }
Esempio n. 5
0
        private void gridView1_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
        {
            Model.AtSummonDetail         _detail     = this.gridView1.GetRow(e.RowHandle) as Model.AtSummonDetail;
            IList <Model.AtSummonDetail> _detailList = this.bindingSource1.DataSource as IList <Model.AtSummonDetail>;

            if (e.Column == this.colJinE || e.Column == this.colJieorDai)
            {
                this.spinEditTotalDebits.EditValue = _detailList.Where(d => d.Lending == "借").ToList().Sum(d => d.AMoney);
                this.spinEditCreditTotal.EditValue = _detailList.Where(d => d.Lending == "貸").ToList().Sum(d => d.AMoney);
            }

            //this.bindingSource1.Position = this.bindingSource1.IndexOf(_detail);
            this.gridControl1.RefreshDataSource();
        }
Esempio n. 6
0
        private void simpleButton2_Click(object sender, EventArgs e)
        {
            if (this.bindingSource1.Current != null)
            {
                this.atSummon.Details.Remove(this.bindingSource1.Current as Book.Model.AtSummonDetail);

                if (this.atSummon.Details.Count == 0)
                {
                    Model.AtSummonDetail detail = new Model.AtSummonDetail();

                    detail.Subject = new Book.Model.AtAccountSubject();
                    this.atSummon.Details.Add(detail);
                    this.bindingSource1.Position = this.bindingSource1.IndexOf(detail);
                }

                this.gridControl1.RefreshDataSource();
            }
        }
Esempio n. 7
0
        protected override void AddNew()
        {
            this.atSummon                = new Model.AtSummon();
            this.atSummon.SummonDate     = DateTime.Now;
            this.atSummon.Id             = this.atSummonManager.GetId();
            this.atSummon.SummonId       = Guid.NewGuid().ToString();
            this.atSummon.Details        = new List <Model.AtSummonDetail>();
            this.atSummon.CreditTotal    = 0;
            this.atSummon.TotalDebits    = 0;
            this.atSummon.SummonCategory = "轉帳傳票";
            this.atSummon.EmployeeDS     = BL.V.ActiveOperator.Employee;
            //if (this.action == "insert")
            //{
            Model.AtSummonDetail detail = new Model.AtSummonDetail();
            detail.SummonDetailId = Guid.NewGuid().ToString();
            detail.AMoney         = 0;
            detail.Subject        = new Book.Model.AtAccountSubject();
            detail.Number         = 1;

            switch (this.comboBoxEditSummonCategory.SelectedIndex)
            {
            case 0:
                detail.Lending = "貸";

                break;

            case 1:
                detail.Lending = "借";
                break;

            case 2:
                detail.Lending = "";
                break;

            default:
                detail.Lending = "";
                break;
            }

            this.atSummon.Details.Add(detail);
        }
Esempio n. 8
0
        private void gridView1_CellValueChanging(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
        {
            Model.AtSummonDetail detail = this.gridView1.GetRow(e.RowHandle) as Model.AtSummonDetail;

            if (e.Column == this.gridColumn1)
            {
                if (detail.Lending == "貸" && this.comboBoxEditSummonCategory.SelectedIndex == 0)
                {
                }
                else
                {
                    detail.Lending = "借";
                }
                if (detail.Lending == "借" && this.comboBoxEditSummonCategory.SelectedIndex == 1)
                {
                }
                else
                {
                    detail.Lending = "貸";
                }
                this.bindingSource1.Position = this.bindingSource1.IndexOf(detail);
                this.gridControl1.RefreshDataSource();
            }
        }
 public Model.AtSummonDetail GetPrev(Model.AtSummonDetail e)
 {
     return(sqlmapper.QueryForObject <Model.AtSummonDetail>("AtSummonDetail.get_prev", e));
 }
Esempio n. 10
0
        public void InsertAtSummon(Model.InvoiceXS invoice, Dictionary <string, string> dic)
        {
            Model.AtSummon atSummon = new Book.Model.AtSummon();
            atSummon.SummonId       = Guid.NewGuid().ToString();
            atSummon.SummonDate     = DateTime.Now;
            atSummon.SummonCategory = "轉帳傳票";
            atSummon.InsertTime     = DateTime.Now;
            atSummon.UpdateTime     = DateTime.Now;
            //atSummon.Id = this.atSummonManager.GetId();
            atSummon.Id          = this.atSummonManager.GetConsecutiveId(DateTime.Now);
            atSummon.InvoiceXSId = invoice.InvoiceId;

            atSummon.Details = new List <Model.AtSummonDetail>();

            Model.AtSummonDetail detail1 = new Model.AtSummonDetail();
            detail1.SummonDetailId = Guid.NewGuid().ToString();
            detail1.SummonCatetory = atSummon.SummonCategory;
            detail1.Lending        = "借";
            detail1.AMoney         = invoice.InvoiceTotal;
            detail1.SubjectId      = dic[string.Format("應收帳款-{0}", invoice.Customer.CustomerShortName)];
            detail1.InsertTime     = DateTime.Now;
            detail1.UpdateTime     = DateTime.Now;
            atSummon.Details.Add(detail1);

            Model.AtSummonDetail detail2 = new Model.AtSummonDetail();
            detail2.SummonDetailId = Guid.NewGuid().ToString();
            detail2.SummonCatetory = atSummon.SummonCategory;
            detail2.Lending        = "貸";
            detail2.AMoney         = invoice.InvoiceHeji;
            detail2.SubjectId      = dic["銷貨收入"];
            detail2.InsertTime     = DateTime.Now;
            detail2.UpdateTime     = DateTime.Now;
            atSummon.Details.Add(detail2);

            if (invoice.InvoiceTax > 0)
            {
                Model.AtSummonDetail detail3 = new Model.AtSummonDetail();
                detail3.SummonDetailId = Guid.NewGuid().ToString();
                detail3.SummonCatetory = atSummon.SummonCategory;
                detail3.Lending        = "貸";
                detail3.AMoney         = invoice.InvoiceTax;
                detail3.SubjectId      = dic["銷項稅額"];
                detail3.InsertTime     = DateTime.Now;
                detail3.UpdateTime     = DateTime.Now;
                atSummon.Details.Add(detail3);
            }


            foreach (var item in atSummon.Details)
            {
                if (item.Lending == "借")
                {
                    item.Id = "A" + atSummon.Details.IndexOf(item);
                }
                else
                {
                    item.Id = "B" + atSummon.Details.IndexOf(item);
                }
            }

            atSummonManager.TiGuiExists(atSummon);

            //插入
            string invoiceKind   = "ats";
            string sequencekey_y = string.Format("{0}-y-{1}", invoiceKind, atSummon.SummonDate.Value.Year);
            string sequencekey_m = string.Format("{0}-m-{1}-{2}", invoiceKind, atSummon.SummonDate.Value.Year, atSummon.SummonDate.Value.Month);
            string sequencekey_d = string.Format("{0}-d-{1}", invoiceKind, atSummon.SummonDate.Value.ToString("yyyy-MM-dd"));
            string sequencekey   = string.Format(invoiceKind);

            SequenceManager.Increment(sequencekey_y);
            SequenceManager.Increment(sequencekey_m);
            SequenceManager.Increment(sequencekey_d);
            SequenceManager.Increment(sequencekey);

            atSummon.TotalDebits = atSummon.Details.Where(d => d.Lending == "借").Sum(d => d.AMoney);
            atSummon.CreditTotal = atSummon.Details.Where(d => d.Lending == "貸").Sum(d => d.AMoney);

            atSummonAccessor.Insert(atSummon);

            foreach (Model.AtSummonDetail atSummonDetail in atSummon.Details)
            {
                atSummonDetail.SummonId = atSummon.SummonId;
                atSummonDetailManager.Insert(atSummonDetail);
            }
        }
Esempio n. 11
0
 public Model.AtSummonDetail GetPrev(Model.AtSummonDetail e)
 {
     return(accessor.GetPrev(e));
 }
Esempio n. 12
0
 public bool HasRowsBefore(Model.AtSummonDetail e)
 {
     return(accessor.HasRowsBefore(e));
 }
Esempio n. 13
0
 public void Update(Model.AtSummonDetail atSummonDetail)
 {
     accessor.Update(atSummonDetail);
 }
Esempio n. 14
0
 public void Insert(Model.AtSummonDetail atSummonDetail)
 {
     accessor.Insert(atSummonDetail);
 }
Esempio n. 15
0
        //查询应付账款明细表
        private void btn_Search_Click(object sender, EventArgs e)
        {
            Book.UI.Query.ConditionCOChooseForm f = new ConditionCOChooseForm();
            if (f.ShowDialog(this) == DialogResult.OK)
            {
                ConditionCO condition = f.Condition as ConditionCO;
                dt = this.invoicecgmanager.SelectByConditionCOBiao(condition.StartInvoiceDate, condition.EndInvoiceDate, condition.StartJHDate, condition.EndJHDate, condition.StartFKDate, condition.EndFKDate, condition.SupplierStart, condition.SupplierEnd, condition.ProductStart, condition.ProductEnd, condition.COStartId, condition.COEndId, condition.CusXOId, condition.EmpStart, condition.EmpEnd);

                //查询条件
                this.shouldPayAccountCondition = this.shouldPayAccount.ShouldPayAccountCondition;
                if (this.shouldPayAccountCondition == null)
                {
                    this.shouldPayAccountCondition = new Book.Model.ShouldPayAccountCondition();
                    this.shouldPayAccountCondition.ShouldPayAccountConditionId = Guid.NewGuid().ToString();
                }
                this.shouldPayAccountCondition.StartInvoiceDate = condition.StartInvoiceDate;
                this.shouldPayAccountCondition.EndInvoiceDate   = condition.EndInvoiceDate;
                this.shouldPayAccountCondition.StartJHDate      = condition.StartJHDate;
                this.shouldPayAccountCondition.EndJHDate        = condition.EndJHDate;
                this.shouldPayAccountCondition.StartFKDate      = condition.StartFKDate;
                this.shouldPayAccountCondition.EndFKDate        = condition.EndFKDate;
                this.shouldPayAccountCondition.SupplierStart    = condition.SupplierStart;
                this.shouldPayAccountCondition.SupplierStartId  = condition.SupplierStart == null ? null : condition.SupplierStart.SupplierId;
                this.shouldPayAccountCondition.SupplierEnd      = condition.SupplierEnd;
                this.shouldPayAccountCondition.SupplierEndId    = condition.SupplierEnd == null ? null : condition.SupplierEnd.SupplierId;
                this.shouldPayAccountCondition.ProductStart     = condition.ProductStart;
                this.shouldPayAccountCondition.ProductStartId   = condition.ProductStart == null ? null : condition.ProductStart.ProductId;
                this.shouldPayAccountCondition.ProductEnd       = condition.ProductEnd;
                this.shouldPayAccountCondition.ProductEndId     = condition.ProductEnd == null ? null : condition.ProductEnd.ProductId;
                this.shouldPayAccountCondition.COStartId        = condition.COStartId;
                this.shouldPayAccountCondition.COEndId          = condition.COEndId;
                this.shouldPayAccountCondition.CusXOId          = condition.CusXOId;
                this.shouldPayAccountCondition.EmpStart         = condition.EmpStart;
                this.shouldPayAccountCondition.EmpStartId       = condition.EmpStart == null ? null : condition.EmpStart.EmployeeId;
                this.shouldPayAccountCondition.EmpEnd           = condition.EmpEnd;
                this.shouldPayAccountCondition.EmpEndId         = condition.EmpEnd == null ? null : condition.EmpEnd.EmployeeId;

                this.shouldPayAccount.ShouldPayAccountCondition   = this.shouldPayAccountCondition;
                this.shouldPayAccount.ShouldPayAccountConditionId = this.shouldPayAccountCondition == null ? null : this.shouldPayAccountCondition.ShouldPayAccountConditionId;

                if (condition.SupplierStart != null && condition.SupplierEnd != null)
                {
                    if (condition.SupplierStart.SupplierId != condition.SupplierEnd.SupplierId)
                    {
                        this.nccSupplier.EditValue   = null;
                        this.txt_PayMethod.EditValue = null;
                    }
                    else
                    {
                        this.nccSupplier.EditValue   = condition.SupplierStart == null ? null : condition.SupplierStart;
                        this.txt_PayMethod.EditValue = condition.SupplierStart == null ? null : condition.SupplierStart.PayMethod;
                    }
                }
                this.txt_InvoiceDate.EditValue = (condition.StartInvoiceDate == null ? null : condition.StartInvoiceDate.Value.ToString("yyyy-MM-dd")) + "  -  " + (condition.EndInvoiceDate == null ? null : condition.EndInvoiceDate.Value.ToString("yyyy-MM-dd"));
                this.txt_FKDate.EditValue      = (condition.StartFKDate == null ? null : condition.StartFKDate.Value.ToString("yyyy-MM-dd")) + "  -  " + (condition.EndFKDate == null ? null : condition.EndFKDate.Value.ToString("yyyy-MM-dd"));
                if (dt.Rows.Count > 0)
                {
                    this.spe_JinE.EditValue  = Math.Round(Convert.ToDouble(dt.Compute("Sum(JinE)", "1=1")), 0);
                    this.spe_ShuiE.EditValue = Math.Round(Convert.ToDouble(dt.Compute("Sum(ShuiE)", "")), 0);
                    this.spe_Total.EditValue = Math.Round(Convert.ToDouble(this.spe_JinE.Value) + Convert.ToDouble(this.spe_ShuiE.Value), 0);
                }
                //添加、删除会计传票详细
                int count = this.atSummon.Details.Count;
                for (int i = 0; i < count; i++)
                {
                    if (this.atSummon.Details.Any(d => d.Lending == "借"))
                    {
                        this.atSummon.Details.Remove(this.atSummon.Details.First(d => d.Lending == "借"));
                    }
                }

                atSummondetail = new Book.Model.AtSummonDetail();
                atSummondetail.SummonDetailId = Guid.NewGuid().ToString();
                atSummondetail.Lending        = "借";
                //atSummondetail.SubjectId = this.subjectList.First(d => d.Id == "2144001").SubjectId;
                atSummondetail.AMoney = Convert.ToDecimal(this.spe_JinE.EditValue) - Convert.ToDecimal(this.spe_ZheRang.EditValue);
                this.atSummon.Details.Add(atSummondetail);
                atSummondetail = new Book.Model.AtSummonDetail();
                atSummondetail.SummonDetailId = Guid.NewGuid().ToString();
                atSummondetail.Lending        = "借";
                //atSummondetail.SubjectId = this.subjectList.First(d => d.Id == "6213000").SubjectId;
                atSummondetail.AMoney = Convert.ToDecimal(this.spe_ShuiE.EditValue);
                this.atSummon.Details.Add(atSummondetail);
                this.CountJieDaiTotal(this.atSummon.Details);
                this.gridControl1.RefreshDataSource();

                this.spe_FKZheRang.EditValue = 0;
                this.spe_ZheRang.EditValue   = 0;

                //应付票据作业
                if (this.atBillsIncomeList.Count > 0)
                {
                    Model.AtBillsIncome atbill = this.atBillsIncomeList[0];

                    atbill.NotesMoney    = this.spe_Total.Value;
                    atbill.PassingObject = this.shouldPayAccountCondition.SupplierStartId;
                }
                else
                {
                    Model.AtBillsIncome atbill = new Book.Model.AtBillsIncome();
                    atbill.BillsId            = Guid.NewGuid().ToString();
                    atbill.TheOpenDate        = DateTime.Now;
                    atbill.ShouldPayAccountId = this.shouldPayAccount.ShouldPayAccountId;
                    atbill.NotesMoney         = this.spe_Total.Value;
                    atbill.PassingObject      = this.shouldPayAccountCondition.SupplierStartId;
                    this.atBillsIncomeList.Add(atbill);
                }
                this.gridControl3.RefreshDataSource();
            }
        }
Esempio n. 16
0
 public void Insert(Model.AtSummonDetail e)
 {
     this.Insert <Model.AtSummonDetail>(e);
 }
Esempio n. 17
0
 public void Update(Model.AtSummonDetail e)
 {
     this.Update <Model.AtSummonDetail>(e);
 }
Esempio n. 18
0
 public bool ExistsExcept(Model.AtSummonDetail e)
 {
     return(accessor.ExistsExcept(e));
 }
Esempio n. 19
0
 public bool HasRowsBefore(Model.AtSummonDetail e)
 {
     return(sqlmapper.QueryForObject <bool>("AtSummonDetail.has_rows_before", e));
 }
Esempio n. 20
0
 public bool HasRowsAfter(Model.AtSummonDetail e)
 {
     return(accessor.HasRowsAfter(e));
 }
Esempio n. 21
0
 public bool HasRowsAfter(Model.AtSummonDetail e)
 {
     return(sqlmapper.QueryForObject <bool>("AtSummonDetail.has_rows_after", e));
 }
Esempio n. 22
0
 public Model.AtSummonDetail GetNext(Model.AtSummonDetail e)
 {
     return(accessor.GetNext(e));
 }
Esempio n. 23
0
 public Model.AtSummonDetail GetNext(Model.AtSummonDetail e)
 {
     return(sqlmapper.QueryForObject <Model.AtSummonDetail>("AtSummonDetail.get_next", e));
 }
Esempio n. 24
0
        public void UpdateAtSummon(Model.InvoiceXS invoice, Dictionary <string, string> dic)
        {
            Model.AtSummon atSummon = atSummonManager.GetByInvoiceXSId(invoice.InvoiceId);
            if (atSummon != null)
            {
                atSummon.UpdateTime = DateTime.Now;

                atSummon.Details = atSummonDetailManager.Select(atSummon);

                foreach (var item in atSummon.Details)
                {
                    if (dic.Values.Contains(item.SubjectId))
                    {
                        if (item.Lending == "貸")
                        {
                            if (item.Subject.SubjectName == "銷貨收入")
                            {
                                if (item.AMoney != invoice.InvoiceHeji)
                                {
                                    item.AMoney     = invoice.InvoiceHeji;
                                    item.UpdateTime = DateTime.Now;

                                    atSummonDetailManager.Update(item);
                                }
                            }
                            else       //銷項稅額
                            {
                                if (invoice.InvoiceTax > 0)
                                {
                                    if (item.AMoney != invoice.InvoiceTax)
                                    {
                                        item.AMoney     = invoice.InvoiceTax;
                                        item.UpdateTime = DateTime.Now;

                                        atSummonDetailManager.Update(item);
                                    }
                                }
                                else
                                {
                                    atSummonDetailManager.Delete(item.SummonDetailId);
                                }
                            }
                        }
                        else          //應收賬款-客戶
                        {
                            if (item.AMoney != invoice.InvoiceTotal)
                            {
                                item.AMoney     = invoice.InvoiceTotal;
                                item.UpdateTime = DateTime.Now;

                                atSummonDetailManager.Update(item);
                            }
                        }
                    }
                }

                if (invoice.InvoiceTax > 0 && atSummon.Details.Count == 2 && !atSummon.Details.Any(d => d.Subject.SubjectName == "銷項稅額"))
                {
                    Model.AtSummonDetail detail3 = new Model.AtSummonDetail();
                    detail3.SummonId       = atSummon.SummonId;
                    detail3.SummonDetailId = Guid.NewGuid().ToString();
                    detail3.SummonCatetory = atSummon.SummonCategory;
                    detail3.Lending        = "貸";
                    detail3.Id             = "B2";
                    detail3.AMoney         = invoice.InvoiceTax;
                    detail3.SubjectId      = dic["銷項稅額"];
                    detail3.InsertTime     = DateTime.Now;
                    detail3.UpdateTime     = DateTime.Now;
                    atSummon.Details.Add(detail3);

                    atSummonDetailManager.Insert(detail3);
                }

                atSummon.TotalDebits = atSummon.Details.Where(d => d.Lending == "借").Sum(d => d.AMoney);
                atSummon.CreditTotal = atSummon.Details.Where(d => d.Lending == "貸").Sum(d => d.AMoney);

                atSummonAccessor.Update(atSummon);
            }
        }
Esempio n. 25
0
        public void UpdateAtSummon(Model.ProduceOtherInDepot produceOtherInDepot, Dictionary <string, string> dic)
        {
            Model.AtSummon atSummon = atSummonManager.GetByProduceOtherInDepotId(produceOtherInDepot.ProduceOtherInDepotId);
            if (atSummon != null)
            {
                atSummon.UpdateTime = DateTime.Now;

                atSummon.Details = atSummonDetailManager.Select(atSummon);

                foreach (var item in atSummon.Details)
                {
                    if (dic.Values.Contains(item.SubjectId))
                    {
                        if (item.Lending == "借")
                        {
                            if (item.Subject.SubjectName == "進項稅額")
                            {
                                if (produceOtherInDepot.ProduceTax > 0)
                                {
                                    if (item.AMoney != Convert.ToDecimal(produceOtherInDepot.ProduceTax))
                                    {
                                        item.AMoney     = Convert.ToDecimal(produceOtherInDepot.ProduceTax);
                                        item.UpdateTime = DateTime.Now;

                                        atSummonDetailManager.Update(item);
                                    }
                                }
                                else
                                {
                                    atSummonDetailManager.Delete(item.SummonDetailId);
                                }
                            }
                            else       //供應商分類對應的科目
                            {
                                if (item.AMoney != Convert.ToDecimal(produceOtherInDepot.ProduceAmount))
                                {
                                    item.AMoney     = Convert.ToDecimal(produceOtherInDepot.ProduceAmount);
                                    item.UpdateTime = DateTime.Now;

                                    atSummonDetailManager.Update(item);
                                }
                            }
                        }
                        else          //應付賬款-廠商
                        {
                            if (item.AMoney != Convert.ToDecimal(produceOtherInDepot.ProduceTotal))
                            {
                                item.AMoney     = Convert.ToDecimal(produceOtherInDepot.ProduceTotal);
                                item.UpdateTime = DateTime.Now;

                                atSummonDetailManager.Update(item);
                            }
                        }
                    }
                }

                if (produceOtherInDepot.ProduceTax > 0 && atSummon.Details.Count == 2 && !atSummon.Details.Any(d => d.Subject.SubjectName == "進項稅額"))
                {
                    Model.AtSummonDetail detail2 = new Model.AtSummonDetail();
                    detail2.SummonId       = atSummon.SummonId;
                    detail2.SummonDetailId = Guid.NewGuid().ToString();
                    detail2.SummonCatetory = atSummon.SummonCategory;
                    detail2.Lending        = "借";
                    detail2.Id             = "A2";
                    detail2.AMoney         = Convert.ToDecimal(produceOtherInDepot.ProduceTax);
                    detail2.SubjectId      = dic["進項稅額"];
                    detail2.InsertTime     = DateTime.Now;
                    detail2.UpdateTime     = DateTime.Now;
                    atSummon.Details.Add(detail2);

                    atSummonDetailManager.Insert(detail2);
                }

                atSummon.TotalDebits = atSummon.Details.Where(d => d.Lending == "借").Sum(d => d.AMoney);
                atSummon.CreditTotal = atSummon.Details.Where(d => d.Lending == "貸").Sum(d => d.AMoney);

                atSummonAccessor.Update(atSummon);
            }
        }