Exemplo n.º 1
0
 protected override DevExpress.XtraReports.UI.XtraReport GetReport()
 {
     Model.ShouldPayAccountCondition model = this.shouldPayAccount.ShouldPayAccountCondition;
     if (model != null)
     {
         dt = this.invoicecgmanager.SelectByConditionCOBiao(model.StartInvoiceDate, model.EndInvoiceDate, model.StartJHDate == null ? global::Helper.DateTimeParse.NullDate : (DateTime)model.StartJHDate, model.EndJHDate == null ? global::Helper.DateTimeParse.EndDate : (DateTime)model.EndJHDate, model.StartFKDate, model.EndFKDate, model.SupplierStart, model.SupplierEnd, model.ProductStart, model.ProductEnd, model.COStartId, model.COEndId, model.CusXOId, model.EmpStart, model.EmpEnd);
     }
     else
     {
         dt = null;
     }
     return(new ROInvoiceCGlistBiao(this.shouldPayAccount, dt, this.txt_AtSummonId.Text));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Update a ShouldPayAccountCondition.
 /// </summary>
 public void Update(Model.ShouldPayAccountCondition shouldPayAccountCondition)
 {
     //
     // todo: add other logic here.
     //
     try
     {
         BL.V.BeginTransaction();
         accessor.Update(shouldPayAccountCondition);
         BL.V.CommitTransaction();
     }
     catch
     {
         BL.V.RollbackTransaction();
         throw;
     }
 }
 public void Update(Model.ShouldPayAccountCondition e)
 {
     this.Update <Model.ShouldPayAccountCondition>(e);
 }
 public void Insert(Model.ShouldPayAccountCondition e)
 {
     this.Insert <Model.ShouldPayAccountCondition>(e);
 }
Exemplo n.º 5
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();
            }
        }