Ejemplo n.º 1
0
        }//end

        void showincGST(object param)
        {
            Mouse.OverrideCursor = Cursors.Wait;
            int decimalpoints = Convert.ToInt32(this.DecimalPlaces);
            //foreach (var item in this.CustomerCreditPaidDays)
            //{
            //    //item.InvoiceAmount = item.InvoiceAmountIncGST;
            //    item.InvoiceAmount = Math.Round(Convert.ToDouble(item.InvoiceAmountIncGST), decimalpoints).ToString();
            //}
            //if (this.ShowAllTrue == false)
            //    this.CustomerCreditPaidDays = DefaultList.Where(x => x.ExcIncGST == true).ToList();
            //else
            //    this.CustomerCreditPaidDays = FullPQList.Where(x => x.ExcIncGST == true).ToList();
            ICustomerCreditPaidDaysRepository purchaseRepository = new CustomerCreditPaidDaysRepository();

            this.CustomerCreditPaidDays = purchaseRepository.GetAllSalesInvoiceJson(this.JsonData).ToList();
            if (this.ShowAllTrue == false)
            {
                this.ShowSelectedCount = this.CustomerCreditPaidDays.Count();
            }
            else
            {
                this.ShowSelectedCount = 0;
            }
            this.CustomerCreditPaidDayscmb       = this.CustomerCreditPaidDays.OrderBy(x => x.CustomerName).ToList();
            this.CustomerCreditPaidDayscmbCredit = this.CustomerCreditPaidDayscmb.GroupBy(x => x.CashCreditNo).Select(g => g.First()).OrderBy(x => x.CreditCashNO).Where(y => y.CashCreditNo != null).ToList();
            this.CustomerCreditPaidDayscmbSup    = this.CustomerCreditPaidDays.GroupBy(x => x.CustomerName).Select(y => y.First()).OrderBy(x => x.CustomerName).Distinct().ToList();
            this.CustomerCreditPaidDayscmbInv    = this.CustomerCreditPaidDays.GroupBy(x => x.InvoiceNo).Select(y => y.First()).OrderBy(x => x.SortInvoiceNo).Distinct().ToList();
            DefaultList = this.CustomerCreditPaidDayscmb;

            Mouse.OverrideCursor = null;
        }
Ejemplo n.º 2
0
        private void RefreshData()
        {
            ICustomerCreditPaidDaysRepository purchaseRepository = new CustomerCreditPaidDaysRepository();

            // this.DateFormat = purchaseRepository.GetDateFormat();
            //this.ShowAllCount = purchaseRepository.GetAllPurchaseInvoice().Count();
            GetOptionsandTaxValues();
            this.JsonData = purchaseRepository.GetLastSelectionData(Convert.ToInt32(ScreenId.CustomerCreditPaidDays));
            this.CustomerCreditPaidDays    = purchaseRepository.GetAllSalesInvoiceJson(this.JsonData).ToList();
            this.CustomerCreditPaidDayscmb = this.CustomerCreditPaidDays.GroupBy(x => x.Name).Select(y => y.First()).OrderBy(x => x.Name).ToList();
            this.ShowSelectedCount         = this.CustomerCreditPaidDays.Count();
            this.YearRange       = purchaseRepository.GetYearRange().ToList();
            this.AveragePaidDays = this.CustomerCreditPaidDays.Average(e => e.PaidInDays).ToString();

            DefaultList = this.CustomerCreditPaidDays;
            FullPQList  = this.CustomerCreditPaidDays;
            //this.ShowAllCount = this.CustomerCreditPaidDayscmb.Count();
            SetDefaultSearchSelection();


            // this.TotalCusM1 = Convert.ToString(CustomerCreditPaidDays.Sum(e => e.TotalM1));
        }
Ejemplo n.º 3
0
        void showexcGST(object param)
        {
            Mouse.OverrideCursor = Cursors.Wait;
            int decimalpoints = Convert.ToInt32(this.DecimalPlaces);

            ICustomerCreditPaidDaysRepository purchaseRepository = new CustomerCreditPaidDaysRepository();

            this.CustomerCreditPaidDays = purchaseRepository.GetAllSalesInvoiceJson(this.JsonData).ToList();
            if (this.ShowAllTrue == false)
            {
                this.ShowSelectedCount = this.CustomerCreditPaidDays.Count();
            }
            else
            {
                this.ShowSelectedCount = 0;
            }
            this.CustomerCreditPaidDayscmb       = this.CustomerCreditPaidDays.OrderBy(x => x.CustomerName).ToList();
            this.CustomerCreditPaidDayscmbCredit = this.CustomerCreditPaidDayscmb.GroupBy(x => x.CashCreditNo).Select(g => g.First()).OrderBy(x => x.CreditCashNO).Where(y => y.CashCreditNo != null).ToList();
            this.CustomerCreditPaidDayscmbSup    = this.CustomerCreditPaidDays.GroupBy(x => x.CustomerName).Select(y => y.First()).OrderBy(x => x.CustomerName).Distinct().ToList();
            this.CustomerCreditPaidDayscmbInv    = this.CustomerCreditPaidDays.GroupBy(x => x.InvoiceNo).Select(y => y.First()).OrderBy(x => x.SortInvoiceNo).Distinct().ToList();
            DefaultList = this.CustomerCreditPaidDayscmb;

            Mouse.OverrideCursor = null;
        }
Ejemplo n.º 4
0
        void GetOptionsandTaxValues()
        {
            OptionsEntity oData = new OptionsEntity();
            ICustomerCreditPaidDaysRepository purchaseRepository = new CustomerCreditPaidDaysRepository();

            oData = purchaseRepository.GetOptionSettings();
            if (oData != null)
            {
                this.CurrencyName   = oData.CurrencyCode;   //there is no currency name field in database
                this.CurrencyCode   = oData.CurrencyCode;
                this.CurrencyFormat = oData.NumberFormat;
                this.DateFormat     = oData.DateFormat;
                this.DecimalPlaces  = oData.DecimalPlaces;
                if (oData.ShowAmountIncGST == true)
                {
                    this.IncludingGSTTrue  = true;
                    this.IncludingGSTFalse = false;
                    //int decimalpoints = Convert.ToInt32(DecimalPlaces);
                    //foreach (var item in this.CustomerCreditPaidDays)
                    //{
                    //    item.InvoiceAmount = Math.Round(Convert.ToDouble(item.InvoiceAmount), decimalpoints).ToString();
                    //}
                    //this.CustomerCreditPaidDays = this.CustomerCreditPaidDays.Where(x => x.ExcIncGST == true).ToList();
                }
                else
                {
                    this.IncludingGSTTrue  = false;
                    this.IncludingGSTFalse = true;
                    int decimalpoints = Convert.ToInt32(DecimalPlaces);
                    //foreach (var item in this.CustomerCreditPaidDays)
                    //{
                    //    //item.InvoiceAmount = item.InvoiceAmountExcGST;
                    //    //item.InvoiceAmount = Math.Round(Convert.ToDouble(item.InvoiceAmountExcGST), decimalpoints).ToString();
                    //    item.InvoiceAmount = Math.Round(Convert.ToDouble(item.InvoiceAmount), decimalpoints).ToString();
                    //}
                    if (this.CustomerCreditPaidDays != null)
                    {
                        this.CustomerCreditPaidDays = this.CustomerCreditPaidDays.ToList();
                    }
                }
            }
            else
            {
                this.CurrencyName   = "USD";
                this.CurrencyCode   = "USD";
                this.CurrencyFormat = "en-US";
                this.DateFormat     = "dd/MM/yyyy";
            }



            TaxModel objDefaultTax = new TaxModel();

            objDefaultTax = purchaseRepository.GetDefaultTaxes();
            if (objDefaultTax != null)
            {
                this.TaxName = objDefaultTax.TaxName;
                //this.TaxName = objDefaultTax.TaxRate;
            }
            else
            {
                this.TaxName = "GST Free";
                //this.TaxRate = 0;
            }
        }
Ejemplo n.º 5
0
        void Search(object param)
        {
            if (Count != 0)
            {
                SearchValues = new List <SearchEntity>();
                //this.ShowSelectedTrue = true;
                //this.ShowAllTrue = false;
                if (this.SelectedSearchYear != null || this.SelectedSearchYear == string.Empty)
                {
                    SearchEntity value = new SearchEntity();
                    value.FieldName  = "Year";
                    value.FieldValue = this.SelectedSearchYear;
                    SearchValues.Add(value);
                    var year = Convert.ToInt32(this.SelectedSearchYear);
                }
                else
                {
                    SearchEntity value = new SearchEntity();
                    value.FieldName  = "Year";
                    value.FieldValue = "0";
                    SearchValues.Add(value);
                    var year = Convert.ToInt32(this.SelectedSearchYear);
                }
                if (this.SelectedSearchQuarter != null || this.SelectedSearchQuarter == string.Empty)
                {
                    SearchEntity value = new SearchEntity();
                    value.FieldName  = "Quarter";
                    value.FieldValue = this.SelectedSearchQuarter;
                    int month1;
                    int month2;
                    int month3;
                    if (Convert.ToInt32(this.SelectedSearchQuarter) == 1)
                    {
                        month1 = 1;
                        month2 = 2;
                        month3 = 3;
                    }
                    else if (Convert.ToInt32(this.SelectedSearchQuarter) == 2)
                    {
                        month1 = 4;
                        month2 = 5;
                        month3 = 6;
                    }
                    else if (Convert.ToInt32(this.SelectedSearchQuarter) == 3)
                    {
                        month1 = 7;
                        month2 = 8;
                        month3 = 9;
                    }
                    else
                    {
                        month1 = 10;
                        month2 = 11;
                        month3 = 12;
                    }
                    SearchValues.Add(value);
                }
                else
                {
                    SearchEntity value = new SearchEntity();
                    value.FieldName  = "Quarter";
                    value.FieldValue = "0";
                    SearchValues.Add(value);
                }
                if (this.SelectedSearchMonth != null || this.SelectedSearchMonth == string.Empty)
                {
                    SearchEntity value = new SearchEntity();
                    value.FieldName  = "Month";
                    value.FieldValue = this.SelectedSearchMonth;
                    SearchValues.Add(value);
                    var month = Convert.ToInt32(this.SelectedSearchMonth);
                }
                else
                {
                    SearchEntity value = new SearchEntity();
                    value.FieldName  = "Month";
                    value.FieldValue = "0";
                    SearchValues.Add(value);
                }

                jsonSearch    = JsonConvert.SerializeObject(SearchValues);
                this.JsonData = jsonSearch;

                ICustomerCreditPaidDaysRepository purchaseRepository = new CustomerCreditPaidDaysRepository();
                var results = purchaseRepository.SaveSearchJson(jsonSearch, Convert.ToInt32(ScreenId.CustomerCreditPaidDays), "CustomerCreditPaidDays_List");
                if (Count != 0)
                {
                    this.CustomerCreditPaidDays    = purchaseRepository.GetAllSalesInvoiceJson(jsonSearch).ToList();
                    this.CustomerCreditPaidDayscmb = this.CustomerCreditPaidDays.GroupBy(x => x.Name).Select(y => y.First()).OrderBy(x => x.Name).ToList();
                    this.AveragePaidDays           = this.CustomerCreditPaidDays.Average(e => e.PaidInDays).ToString();
                }


                DefaultList = this.CustomerCreditPaidDayscmb;


                //this.TotalCusM1 = Convert.ToString(CustomerCreditPaidDays.Sum(e => e.TotalM1));
            }
        }