Exemplo n.º 1
0
        public ROInvoiceCGlist(ConditionCO condition)
            : this()
        {
            DateTime start = condition.StartDate;
            DateTime end   = condition.EndDate;

            this.xrLabelReportName.Text = Properties.Resources.JHDetail;
            this.xrLabelDateRange.Text  = string.Format(Properties.Resources.DateRange, start.ToString("yyyy-MM-dd"), end.ToString("yyyy-MM-dd"));
            if (condition.SupplierStart != null && condition.SupplierEnd != null)
            {
                this.lblSupplierRange.Text += condition.SupplierStart.ToString() + "~" + condition.SupplierEnd.ToString();
            }

            IList <Model.InvoiceCGDetail> Details = this.invoicecgmanager.SelectByConditionCO(condition.StartDate, condition.EndDate, 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);

            if (Details == null || Details.Count == 0)
            {
                throw new Helper.InvalidValueException("ӛ䛞é¿Õ");
            }

            this.DataSource = Details;

            this.TCInvoiceCGDetailMoney.DataBindings.Add("Text", this.DataSource, Model.InvoiceCGDetail.PRO_InvoiceCGDetailMoney, global::Helper.DateTimeParse.GetFormatA(BL.V.SetDataFormat.CGJEXiao.Value));
            this.TCInvoiceCGDetailPrice.DataBindings.Add("Text", this.DataSource, Model.InvoiceCGDetail.PRO_InvoiceCGDetailPrice, global::Helper.DateTimeParse.GetFormatA(BL.V.SetDataFormat.CGDJXiao.Value));
            this.TCInvoiceCOId.DataBindings.Add("Text", this.DataSource, Model.InvoiceCGDetail.PRO_InvoiceCOId);
            //this.TCInvoiceDate.DataBindings.Add("Text", this.DataSource, "Invoice." + Model.InvoiceCG.PROPERTY_INVOICEDATE, "{0:yyyy-MM-dd}");
            this.TCInvoicePaymentDate.DataBindings.Add("Text", this.DataSource, "Invoice." + Model.InvoiceCG.PRO_InvoiceHisDate, "{0:yyyy-MM-dd}");

            this.TCInvoiceId.DataBindings.Add("Text", this.DataSource, Model.InvoiceCGDetail.PRO_InvoiceId);
            this.TCInvoiceProductUnit.DataBindings.Add("Text", this.DataSource, Model.InvoiceCGDetail.PRO_InvoiceProductUnit);
            this.TCNoCGQuantity.DataBindings.Add("Text", this.DataSource, "InvoiceCODetail." + Model.InvoiceCODetail.PRO_NoArrivalQuantity);
            this.TCOrderQuantity.DataBindings.Add("Text", this.DataSource, "InvoiceCODetail." + Model.InvoiceCODetail.PRO_OrderQuantity);
            this.TCProduct.DataBindings.Add("Text", this.DataSource, "Product." + Model.Product.PRO_ProductName);
            this.TCProductQuantity.DataBindings.Add("Text", this.DataSource, Model.InvoiceCGDetail.PRO_InvoiceCGDetailQuantity);

            this.xrlblTotalShuliang.Summary.FormatString     = "{0:0}";
            this.xrlblTotalShuliang.Summary.Func             = SummaryFunc.Sum;
            this.xrlblTotalShuliang.Summary.IgnoreNullValues = true;
            this.xrlblTotalShuliang.Summary.Running          = SummaryRunning.Report;
            this.xrlblTotalShuliang.DataBindings.Add("Text", this.DataSource, Model.InvoiceCGDetail.PRO_InvoiceCGDetailQuantity);

            this.xrlblTotalShuiE.Summary.FormatString     = "{0:0}";
            this.xrlblTotalShuiE.Summary.Func             = SummaryFunc.Sum;
            this.xrlblTotalShuiE.Summary.IgnoreNullValues = true;
            this.xrlblTotalShuiE.Summary.Running          = SummaryRunning.Report;
            this.xrlblTotalShuiE.DataBindings.Add("Text", this.DataSource, Model.InvoiceCGDetail.PRO_InvoiceCGDetailTax);

            this.xrlblTotalHeJi.Summary.FormatString     = "{0:0}";
            this.xrlblTotalHeJi.Summary.Func             = SummaryFunc.Sum;
            this.xrlblTotalHeJi.Summary.IgnoreNullValues = true;
            this.xrlblTotalHeJi.Summary.Running          = SummaryRunning.Report;
            this.xrlblTotalHeJi.DataBindings.Add("Text", this.DataSource, Model.InvoiceCGDetail.PRO_InvoiceCGDetailMoney);

            this.xrlblTotalJinE.Summary.FormatString     = "{0:0}";
            this.xrlblTotalJinE.Summary.Func             = SummaryFunc.Sum;
            this.xrlblTotalJinE.Summary.IgnoreNullValues = true;
            this.xrlblTotalJinE.Summary.Running          = SummaryRunning.Report;
            this.xrlblTotalJinE.DataBindings.Add("Text", this.DataSource, Model.InvoiceCGDetail.PRO_InvoiceCGDetailTaxMoney);
        }
Exemplo n.º 2
0
        public ROInvoiceCO(ConditionCO condition)
            : this()
        {
            DateTime start = condition.StartDate;
            DateTime end   = condition.EndDate;

            this.xrLabelReportName.Text = Properties.Resources.InvoiceCODetail;

            this.xrLabelDateRange.Text = string.Format(Properties.Resources.DateRange, start.ToString("yyyy-MM-dd"), end.ToString("yyyy/MM/dd"));
            IList <Model.InvoiceCO> Details = this.invoiceManager.SelectDateRangAndWhere(condition.COStartId, condition.COEndId, condition.SupplierStart, condition.SupplierEnd, condition.StartDate, condition.EndDate, condition.ProductStart, condition.ProductEnd, condition.CusXOId, condition.StartJHDate, condition.EndJHDate, condition.InvoiceFlag.Value, condition.InvoiceCGIdStart, condition.InvoiceCGIdEnd);

            if (Details == null || Details.Count <= 0)
            {
                throw new global::Helper.InvalidValueException("無數據");
            }

            this.bindingSource1.DataSource = Details;

            this.lblInvoiceId.DataBindings.Add("Text", this.DataSource, Model.Invoice.PROPERTY_INVOICEID);
            this.lblInvoiceDate.DataBindings.Add("Text", this.DataSource, Model.Invoice.PROPERTY_INVOICEDATE, "{0:yyyy-MM-dd}");
            this.lblCustomer.DataBindings.Add("Text", this.DataSource, "Customer." + Model.Customer.PRO_CustomerFullName);
            // this.xrLabelEmp0.DataBindings.Add("Text", this.DataSource, "Employee0." + Model.Employee.PROPERTY_EMPLOYEENAME);
            this.lblEmployee.DataBindings.Add("Text", this.DataSource, "Employee0." + Model.Employee.PROPERTY_EMPLOYEENAME);
            this.lblYJRQ.DataBindings.Add("Text", this.DataSource, Model.InvoiceXO.PRO_InvoiceYjrq, "{0:yyyy-MM-dd}");
            this.lblSupplier.DataBindings.Add("Text", this.DataSource, "Supplier." + Model.Supplier.PROPERTY_SUPPLIERSHORTNAME);
            this.lblInvoiceHeji.DataBindings.Add("Text", this.DataSource, Model.InvoiceCO.PRO_InvoiceHeji, "{0:0}");
            this.lblInvoiceTax.DataBindings.Add("Text", this.DataSource, Model.InvoiceCO.PRO_InvoiceTax, "{0:0}");
            this.lblInvoiceTotal.DataBindings.Add("Text", this.DataSource, Model.InvoiceCO.PRO_InvoiceTotal, "{0:0}");
            this.lblCustomerInvoiceXOID.DataBindings.Add("Text", this.DataSource, Model.InvoiceCO.PRO_InvoiceCustomXOId);

            this.xrLabelTotalHeJi.Summary.FormatString     = "{0:0}";
            this.xrLabelTotalHeJi.Summary.Func             = SummaryFunc.Sum;
            this.xrLabelTotalHeJi.Summary.IgnoreNullValues = true;
            this.xrLabelTotalHeJi.Summary.Running          = SummaryRunning.Report;
            this.xrLabelTotalHeJi.DataBindings.Add("Text", this.DataSource, Model.InvoiceCO.PRO_InvoiceHeji, "{0:0}");

            this.xrLabelTotalTax.Summary.FormatString     = "{0:0}";
            this.xrLabelTotalTax.Summary.Func             = SummaryFunc.Sum;
            this.xrLabelTotalTax.Summary.IgnoreNullValues = true;
            this.xrLabelTotalTax.Summary.Running          = SummaryRunning.Report;
            this.xrLabelTotalTax.DataBindings.Add("Text", this.DataSource, Model.InvoiceCO.PRO_InvoiceTax, "{0:0}");

            this.xrLabelTotalZongJi.Summary.FormatString     = "{0:0}";
            this.xrLabelTotalZongJi.Summary.Func             = SummaryFunc.Sum;
            this.xrLabelTotalZongJi.Summary.IgnoreNullValues = true;
            this.xrLabelTotalZongJi.Summary.Running          = SummaryRunning.Report;
            this.xrLabelTotalZongJi.DataBindings.Add("Text", this.DataSource, Model.InvoiceCO.PRO_InvoiceTotal, "{0:0}");

            this.xrSubreport1.ReportSource = new ROInvoiceCO_1(condition);
        }
Exemplo n.º 3
0
        public ROInvoiceCOlist(ConditionCO condition)
            : this()
        {
            DateTime?start = condition.StartInvoiceDate;
            DateTime?end   = condition.EndInvoiceDate;

            this.xrLabelReportName.Text = Properties.Resources.InvoiceCODetail;
            this.xrLabelDateRange.Text  = string.Format(Properties.Resources.DateRange, (start.HasValue ? start.Value.ToString("yyyy-MM-dd") : ""), (end.HasValue ? end.Value.ToString("yyyy/MM/dd") : ""));

            IList <Model.InvoiceCODetail> Details = this.invoicecomanager.Select(condition.COStartId, condition.COEndId, condition.SupplierStart, condition.SupplierEnd, condition.StartInvoiceDate, condition.EndInvoiceDate, condition.ProductStart, condition.ProductEnd, condition.CusXOId, condition.StartJHDate, condition.EndJHDate, condition.InvoiceFlag, condition.EmpStart, condition.EmpEnd);

            if (Details == null || Details.Count == 0)
            {
                throw new Helper.MessageValueException("ŸoÓ›ä›");
            }

            this.DataSource = Details;

            this.TCdanjia.DataBindings.Add("Text", this.DataSource, Model.InvoiceCODetail.PRO_InvoiceCODetailPrice, "{0:0.###}");
            this.TCdanjubianhao.DataBindings.Add("Text", this.DataSource, Model.InvoiceCODetail.PRO_InvoiceId);
            this.TCdanwei.DataBindings.Add("Text", this.DataSource, Model.InvoiceCODetail.PRO_InvoiceProductUnit);
            this.TCgongyingshang.DataBindings.Add("Text", this.DataSource, "Invoice.Supplier." + Model.Supplier.PROPERTY_SUPPLIERFULLNAME);
            this.TCjine.DataBindings.Add("Text", this.DataSource, Model.InvoiceCODetail.PRO_InvoiceCODetailMoney, "{0:0}");
            this.TCkehu.DataBindings.Add("Text", this.DataSource, "Invoice.Customer." + Model.Customer.PRO_CustomerFullName);
            this.TCkehudingdanhao.DataBindings.Add("Text", this.DataSource, "Invoice." + Model.InvoiceCO.PRO_InvoiceCustomXOId);
            this.TCriqi.DataBindings.Add("Text", this.DataSource, "Invoice." + Model.InvoiceCO.PROPERTY_INVOICEDATE, "{0:yyyy/MM/dd}");
            //this.TCshangpingbianhao.DataBindings.Add("Text", this.DataSource, "Product." + Model.Product.PRO_Id); Ô­žé ÉÌÆ·¾ŽÌ–
            this.TCshangpingbianhao.DataBindings.Add("Text", this.DataSource, Model.InvoiceCODetail.PRO_InvoiceXOYjrq, "{0:yyyy/MM/dd}");

            this.TCshangpingmingcheng.DataBindings.Add("Text", this.DataSource, "Product." + Model.Product.PRO_ProductName);
            this.TCshuliang.DataBindings.Add("Text", this.DataSource, Model.InvoiceCODetail.PRO_OrderQuantity);
            this.TCyujiaoriqi.DataBindings.Add("Text", this.DataSource, "Invoice." + Model.InvoiceCO.PRO_InvoiceYjrq, "{0:yyyy/MM/dd}");
            this.TCArrivalQuantity.DataBindings.Add("Text", this.DataSource, Model.InvoiceCODetail.PRO_ArrivalQuantity);
            this.TCInvoiceCTQuantity.DataBindings.Add("Text", this.DataSource, Model.InvoiceCODetail.PRO_InvoiceCTQuantity);
            this.TC_Pihao.DataBindings.Add("Text", this.DataSource, "Invoice." + Model.InvoiceCO.PRO_SupplierLotNumber);


            this.xrlblTotalShuliang.Summary.FormatString     = "{0:0}";
            this.xrlblTotalShuliang.Summary.Func             = SummaryFunc.Sum;
            this.xrlblTotalShuliang.Summary.IgnoreNullValues = true;
            this.xrlblTotalShuliang.Summary.Running          = SummaryRunning.Report;
            this.xrlblTotalShuliang.DataBindings.Add("Text", this.DataSource, Model.InvoiceCODetail.PRO_OrderQuantity);

            this.xrlblTotalJinE.Summary.FormatString     = "{0:0}";
            this.xrlblTotalJinE.Summary.Func             = SummaryFunc.Sum;
            this.xrlblTotalJinE.Summary.IgnoreNullValues = true;
            this.xrlblTotalJinE.Summary.Running          = SummaryRunning.Report;
            this.xrlblTotalJinE.DataBindings.Add("Text", this.DataSource, Model.InvoiceCODetail.PRO_InvoiceCODetailMoney);
        }
Exemplo n.º 4
0
 public ROInvoiceCO_1(ConditionCO cond)
 {
     InitializeComponent();
     this.condition = cond;
     this.TCProductId.DataBindings.Add("Text", this.DataSource, Model.InvoiceCODetail.PRO_Inumber);
     this.TCProductName.DataBindings.Add("Text", this.DataSource, "Product." + Model.Product.PRO_ProductName);
     this.TCInvoiceProductUnit.DataBindings.Add("Text", this.DataSource, Model.InvoiceCODetail.PRO_InvoiceProductUnit);
     this.TCOrderQuantity.DataBindings.Add("Text", this.DataSource, Model.InvoiceCODetail.PRO_OrderQuantity, "{0:0.###}");
     this.TCArrivalQuantity.DataBindings.Add("Text", this.DataSource, Model.InvoiceCODetail.PRO_ArrivalQuantity, "{0:0.###}");
     this.TCInvoiceCODetailPrice.DataBindings.Add("Text", this.DataSource, Model.InvoiceCODetail.PRO_InvoiceCODetailPrice, "{0:0.###}");
     this.TCInvoiceCODetailMoney.DataBindings.Add("Text", this.DataSource, Model.InvoiceCODetail.PRO_InvoiceCODetailMoney, "{0:0.###}");
     this.TCNetWeight.DataBindings.Add("Text", this.DataSource, "Product." + Model.Product.PRO_NetWeight, "{0:0.###}");
     this.TCGrossWeight.DataBindings.Add("Text", this.DataSource, "Product." + Model.Product.PRO_GrossWeight, "{0:0.###}");
     this.TCVolume.DataBindings.Add("Text", this.DataSource, "Product." + Model.Product.PRO_Volume, "{0:0.###}");
     this.TCProductDesc.DataBindings.Add("Rtf", this.DataSource, "Product." + Model.Product.PRO_ProductDescription);
     this.TCInvoiceCODetailNote.DataBindings.Add("Text", this.DataSource, Model.InvoiceCODetail.PRO_InvoiceCODetailNote);
 }
Exemplo n.º 5
0
        //两参构造
        public Q16_1(ConditionCO condition)
        {
            InitializeComponent();
            this.condition = condition;
            this.xrTableCellProductId.DataBindings.Add("Text", this.DataSource, Model.InvoiceCGDetail.PRO_Inumber);
            this.xrTableCellProductName.DataBindings.Add("Text", this.DataSource, "Product." + Model.Product.PRO_ProductName);
            this.xrTableCellProductGuige.DataBindings.Add("Text", this.DataSource, "Product." + Model.Product.PRO_ProductSpecification);
            this.xrTableCellProductQuantity.DataBindings.Add("Text", this.DataSource, Model.InvoiceCGDetail.PRO_InvoiceCGDetailQuantity);

            this.xrTablePrice.DataBindings.Add("Text", this.DataSource, Model.InvoiceCGDetail.PRO_InvoiceCGDetailPrice, "{0:0.###}");
            this.xrTableTaxPrice.DataBindings.Add("Text", this.DataSource, Model.InvoiceCGDetail.PRO_InvoiceCGDetailTaxPrice, "{0:0.###}");
            this.xrTableHeJi.DataBindings.Add("Text", this.DataSource, Model.InvoiceCGDetail.PRO_InvoiceCGDetailMoney, "{0:0.###}");
            this.xrTableTax.DataBindings.Add("Text", this.DataSource, Model.InvoiceCGDetail.PRO_InvoiceCGDetailTax, "{0:0.###}");
            this.xrTableTaxTotal.DataBindings.Add("Text", this.DataSource, Model.InvoiceCGDetail.PRO_InvoiceCGDetailTaxMoney, "{0:0.###}");
            this.xrTableOrderQuantity.DataBindings.Add("Text", this.DataSource, "InvoiceCODetail." + Model.InvoiceCODetail.PRO_OrderQuantity, "{0:0.###}");
            this.xrTableNoCGQuantity.DataBindings.Add("Text", this.DataSource, "InvoiceCODetail." + Model.InvoiceCODetail.PRO_NoArrivalQuantity, "{0:0.###}");
            this.xrTableInQuantity.DataBindings.Add("Text", this.DataSource, Model.InvoiceCGDetail.PRO_InvoiceCGDetaiInQuantity, "{0:0.###}");
            this.xrTableTransferQuantity.DataBindings.Add("Text", this.DataSource, Model.InvoiceCGDetail.PRO_ProduceTransferQuantity, "{0:0.###}");
            this.xrTableZR.DataBindings.Add("Text", this.DataSource, Model.InvoiceCGDetail.PRO_InvoiceAllowance, "{0:0.###}");
            this.xrTableUnit.DataBindings.Add("Text", this.DataSource, Model.InvoiceCGDetail.PRO_InvoiceProductUnit);
            this.xrCheckBoxZS.DataBindings.Add("Checked", this.DataSource, Model.InvoiceCGDetail.PRO_Donatetowards);
            this.xrTableCellCOId.DataBindings.Add("Text", this.DataSource, Model.InvoiceCGDetail.PRO_InvoiceCOId);
            this.xrTableWorkHouse.DataBindings.Add("Text", this.DataSource, "WorkHouse." + Model.WorkHouse.PROPERTY_WORKHOUSENAME);
        }
Exemplo n.º 6
0
        public ROInvoiceCGlistBiao(ConditionCO condition)
            : this()
        {
            this.xrLabelReportName.Text    = "應付賬款明細表";
            this.lblSupplierName.Text      = condition.SupplierStart == null ? "" : condition.SupplierStart.SupplierFullName;
            this.lblInvoiceDateRange.Text += (condition.StartInvoiceDate == null ? null : condition.StartInvoiceDate.Value.ToString("yyyy-MM-dd")) + "  -  " + (condition.EndInvoiceDate == null ? null : condition.EndInvoiceDate.Value.ToString("yyyy-MM-dd"));
            this.lblPayDate.Text          += (condition.StartFKDate == null ? null : condition.StartFKDate.Value.ToString("yyyy-MM-dd")) + "  -  " + (condition.EndFKDate == null ? null : condition.EndFKDate.Value.ToString("yyyy-MM-dd"));
            this.lblTel.Text     += condition.SupplierStart == null ? "" : condition.SupplierStart.SupplierPhone1;
            this.lblAddress.Text += condition.SupplierStart == null ? "" : condition.SupplierStart.CompanyAddress;
            this.lblFax.Text     += condition.SupplierStart == null ? "" : condition.SupplierStart.SupplierFax;
            if (condition.SupplierStart != null)
            {
                this.lblPayMethod.Text += condition.SupplierStart.PayMethod == null ? "" : condition.SupplierStart.PayMethod.PayMethodName;
                this.lblNoId.Text      += condition.SupplierStart.NoId;
            }
            //Bind
            this.DataSource = 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);

            if (this.DataSource == null || (this.DataSource as DataTable).Rows.Count == 0)
            {
                throw new Exception("查無記錄!");
            }


            string  sF;
            decimal jine = 0, shuie = 0, zonge = 0;

            foreach (DataRow dr in (this.DataSource as DataTable).Rows)
            {
                //if (dr[0].ToString().Contains("PID") || dr[0].ToString().Contains("POD"))
                //{
                //    try
                //    {
                //        //string DJ = dr["DanJia"].ToString();
                //        //double Quantity = string.IsNullOrEmpty(dr["JHSL"].ToString()) ? 0 : Convert.ToDouble(dr["JHSL"].ToString());
                //        //dr["DanJia"] = BL.SupplierProductManager.CountPrice(DJ, Quantity);
                //        //dr["JinE"] = Convert.ToDouble(dr["DanJia"]) * Convert.ToDouble(dr["JHSL"]);
                //        //dr["ShuiE"] = Convert.ToDouble(dr["JinE"]) * 0.05;
                //        //dr["Total"] = Convert.ToDouble(dr["JinE"]) + Convert.ToDouble(dr["ShuiE"]);
                //    }
                //    catch (Exception ex)
                //    {
                //        sF = ex.Message;
                //    }
                //}
                jine  += Convert.ToDecimal(dr["JinE"]);
                shuie += Convert.ToDecimal(dr["ShuiE"]);
            }

            zonge = jine + shuie;

            if (this.DataSource == null || (this.DataSource as DataTable).Rows.Count == 0)
            {
                throw new global::Helper.InvalidValueException("無記錄");
            }

            this.tcJHDH.DataBindings.Add("Text", this.DataSource, "JHDN");
            this.tcJHRQ.DataBindings.Add("Text", this.DataSource, "JHRQ", "{0:yyyy-MM-dd}");
            this.tcProductName.DataBindings.Add("Text", this.DataSource, "ProductName");
            this.tcJHSL.DataBindings.Add("Text", this.DataSource, "JHSL");
            this.tcDJ.DataBindings.Add("Text", this.DataSource, "DanJia", "{0:0.####}");
            this.tcJinE.DataBindings.Add("Text", this.DataSource, "JinE", global::Helper.DateTimeParse.GetFormatA(BL.V.SetDataFormat.CGJEXiao.Value));
            this.tcCGorWWDanHao.DataBindings.Add("Text", this.DataSource, "CGorWWDanHao");
            this.tcDW.DataBindings.Add("Text", this.DataSource, "ProductUnit");

            this.TCZJinE.Text      = this.invoicecgmanager.GetSiSheWuRu(jine, 0).ToString();
            this.TCTotalShuiE.Text = this.invoicecgmanager.GetSiSheWuRu(shuie, 0).ToString();
            this.TCTotalMoney.Text = this.invoicecgmanager.GetSiSheWuRu(zonge, 0).ToString();

            //this.TCZJinE.Summary.FormatString = "{0:0}";
            //this.TCZJinE.Summary.Func = SummaryFunc.Sum;
            //this.TCZJinE.Summary.IgnoreNullValues = true;
            //this.TCZJinE.Summary.Running = SummaryRunning.Report;
            //this.TCZJinE.DataBindings.Add("Text", this.DataSource, "JinE");

            //this.TCTotalShuiE.Summary.FormatString = "{0:0}";
            //this.TCTotalShuiE.Summary.Func = SummaryFunc.Sum;
            //this.TCTotalShuiE.Summary.IgnoreNullValues = true;
            //this.TCTotalShuiE.Summary.Running = SummaryRunning.Report;
            //this.TCTotalShuiE.DataBindings.Add("Text", this.DataSource, "ShuiE");

            //this.TCTotalMoney.Summary.FormatString = "{0:0}";
            //this.TCTotalMoney.Summary.Func = SummaryFunc.Sum;
            //this.TCTotalMoney.Summary.IgnoreNullValues = true;
            //this.TCTotalMoney.Summary.Running = SummaryRunning.Report;
            //this.TCTotalMoney.DataBindings.Add("Text", this.DataSource, "Total");
        }
Exemplo n.º 7
0
        protected override void OnOK1()
        {
            if (this.condition == null)
            {
                this.condition = new ConditionCO();
            }

            if (global::Helper.DateTimeParse.DateTimeEquls(this.dateEditStartDate.DateTime, new DateTime()))
            {
                this.condition.StartDate = global::Helper.DateTimeParse.NullDate;
            }

            else
            {
                this.condition.StartDate = this.dateEditStartDate.DateTime;
            }


            if (global::Helper.DateTimeParse.DateTimeEquls(this.dateEditEndDate.DateTime, new DateTime()))
            {
                this.condition.EndDate = global::Helper.DateTimeParse.EndDate;
            }

            else
            {
                this.condition.EndDate = this.dateEditEndDate.DateTime;
            }
            if (global::Helper.DateTimeParse.DateTimeEquls(this.dateEditJHDate1.DateTime, new DateTime()))
            {
                this.condition.StartJHDate = global::Helper.DateTimeParse.NullDate;
            }
            else
            {
                this.condition.StartJHDate = this.dateEditJHDate1.DateTime;
            }
            if (global::Helper.DateTimeParse.DateTimeEquls(this.dateEditJHDate2.DateTime, new DateTime()))
            {
                this.condition.EndJHDate = global::Helper.DateTimeParse.EndDate;
            }
            else
            {
                this.condition.EndJHDate = this.dateEditJHDate2.DateTime;
            }

            if (this.dateEditFKStart.EditValue != null)
            {
                this.condition.StartFKDate = this.dateEditFKStart.DateTime;
            }
            if (this.dateEditFKEnd.EditValue != null)
            {
                this.condition.EndFKDate = this.dateEditFKEnd.DateTime;
            }

            this.condition.ProductStart  = this.buttonEditPro1.EditValue as Model.Product;
            this.condition.ProductEnd    = this.buttonEditPro2.EditValue as Model.Product;
            this.condition.SupplierStart = this.newChooseSupStart.EditValue as Model.Supplier;
            this.condition.SupplierEnd   = this.newChooseSupEnd.EditValue as Model.Supplier;
            this.condition.COStartId     = string.IsNullOrEmpty(this.textEditCOID1.Text) ? null : this.textEditCOID1.Text;
            this.condition.COEndId       = string.IsNullOrEmpty(this.textEditCOID2.Text) ? null : this.textEditCOID2.Text;
            this.condition.InvoiceFlag   = this.checkEdit1.Checked == true ? 1 : 0;
            this.condition.CusXOId       = this.textEditCusXOId.EditValue == null ? null : this.textEditCusXOId.Text;
            this.condition.EmpStart      = this.nccEmployeeStart.EditValue as Model.Employee;
            this.condition.EmpEnd        = this.nccEmployeeEnd.EditValue as Model.Employee;
        }
Exemplo n.º 8
0
        //三参构造
        public Q16(ConditionCO condition)
            : this()
        {
            this.xrLabelReportName.Text = Properties.Resources.JHDetail;
            this.xrLabelDateRange.Text  = string.Format(Properties.Resources.DateRange, condition.StartDate.ToString("yyyy/MM/dd"), condition.EndDate.ToString("yyyy/MM/dd"));
            IList <Model.InvoiceCG> Details = new BL.InvoiceCGManager().Select(condition.COStartId, condition.COEndId, condition.SupplierStart, condition.SupplierEnd, condition.StartDate, condition.EndDate, condition.ProductStart, condition.ProductEnd, condition.CusXOId, condition.StartJHDate, condition.EndJHDate);

            //this.supplierDetails = supplierDetails;
            //IList<Model.InvoiceCG> cgdetails = new List<Model.InvoiceCG>();
            //IList<Model.InvoiceCG> cgdetail = new List<Model.InvoiceCG>();

            //foreach (Model.Supplier supplier in this.supplierDetails)
            //{
            //    cgdetail = invoiceManager.Select(supplier);
            //    if (cgdetail != null)
            //    {
            //        foreach (Model.InvoiceCG cgInvoice in cgdetail)
            //        {
            //            cgdetails.Add(cgInvoice);
            //        }
            //        cgdetail.Clear();
            //    }
            //}
            if (Details == null || Details.Count <= 0)
            {
                throw new global::Helper.InvalidValueException("無數據");
            }

            this.bindingSource1.DataSource = Details;

            // this.xrLabelDateRange.Text = string.Format(Properties.Resources.DateRange, start.ToString("yyyy/MM/dd"), end.ToString("yyyy/MM/dd"));
            this.xrLabelInvoiceId.DataBindings.Add("Text", this.DataSource, Model.Invoice.PROPERTY_INVOICEID);
            this.xrLabelInvoiceDate.DataBindings.Add("Text", this.DataSource, Model.Invoice.PROPERTY_INVOICEDATE, "{0:yyyy-MM-dd}");
            this.xrLabelSupplier.DataBindings.Add("Text", this.DataSource, "Supplier." + Model.Supplier.PROPERTY_SUPPLIERSHORTNAME);
            //this.xrLabelCOId.DataBindings.Add("Text", this.DataSource,"InvoiceCO."+ Model.Invoice.PROPERTY_INVOICEID);
            this.xrLabelDepot.DataBindings.Add("Text", this.DataSource, "Depot." + Model.Depot.PRO_DepotName);

            this.xrLabelEmp0.DataBindings.Add("Text", this.DataSource, "Employee0." + Model.Employee.PROPERTY_EMPLOYEENAME);
            this.xrLabelEmp1.DataBindings.Add("Text", this.DataSource, "Employee1." + Model.Employee.PROPERTY_EMPLOYEENAME);
            this.xrLabelCGDate.DataBindings.Add("Text", this.DataSource, Model.InvoiceCG.PRO_InvoiceHisDate, "{0:yyyy-MM-dd}");
            this.xrLabelTaxCaluType.DataBindings.Add("Text", this.DataSource, Model.InvoiceCG.PROPERTY_TaxCaluTypeName);

            //this.xrLabelZongji.DataBindings.Add("Text", this.DataSource, Model.InvoiceCG.PROPERTY_INVOICEZONGJI, "{0:0}");
            this.xrLabelTaxrate.DataBindings.Add("Text", this.DataSource, Model.InvoiceCG.PRO_InvoiceTaxrate, "{0:0.00}");
            this.xrLabelHeji.DataBindings.Add("Text", this.DataSource, "InvoiceHeji", "{0:0}");
            this.xrLabelTax.DataBindings.Add("Text", this.DataSource, "InvoiceTax", "{0:0}");
            this.xrLabelZongji.DataBindings.Add("Text", this.DataSource, "InvoiceTotal", "{0:0}");
            //new Model.InvoiceCG().InvoiceCO.InvoiceTotal
            //xrTableRow2.Table.Rows.Count;
            //    xrTableRow2.Table.Rows


            //  this.xrLabelHeji.Text=this.Detail.s


            this.xrLabelTotalHeJi.Summary.FormatString     = "{0:0}";
            this.xrLabelTotalHeJi.Summary.Func             = SummaryFunc.Sum;
            this.xrLabelTotalHeJi.Summary.IgnoreNullValues = true;
            this.xrLabelTotalHeJi.Summary.Running          = SummaryRunning.Report;
            this.xrLabelTotalHeJi.DataBindings.Add("Text", this.DataSource, "InvoiceHeji", "{0:0}");


            this.xrLabelTotalTax.Summary.FormatString     = "{0:0}";
            this.xrLabelTotalTax.Summary.Func             = SummaryFunc.Sum;
            this.xrLabelTotalTax.Summary.IgnoreNullValues = true;
            this.xrLabelTotalTax.Summary.Running          = SummaryRunning.Report;
            this.xrLabelTotalTax.DataBindings.Add("Text", this.DataSource, "InvoiceTax", "{0:0}");

            this.xrLabelTotalZongJi.Summary.FormatString     = "{0:0}";
            this.xrLabelTotalZongJi.Summary.Func             = SummaryFunc.Sum;
            this.xrLabelTotalZongJi.Summary.IgnoreNullValues = true;
            this.xrLabelTotalZongJi.Summary.Running          = SummaryRunning.Report;
            this.xrLabelTotalZongJi.DataBindings.Add("Text", this.DataSource, "InvoiceTotal", "{0:0}");

            //this.xrLabelTotalZSE.Summary.FormatString = "{0:0}";
            //this.xrLabelTotalZSE.Summary.Func = SummaryFunc.Sum;
            //this.xrLabelTotalZSE.Summary.IgnoreNullValues = true;
            //this.xrLabelTotalZSE.Summary.Running = SummaryRunning.Report;
            //this.xrLabelTotalZSE.DataBindings.Add("Text", this.DataSource, Model.InvoiceCG.PROPERTY_INVOICEZSE, "{0:0}");

            this.xrSubreport1.ReportSource = new Q16_1(condition);
        }
Exemplo n.º 9
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();
            }
        }