Example #1
0
        }//end

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

            this.SupplierCreditPaidDays = purchaseRepository.GetAllSalesInvoiceJson(this.JsonData).ToList();
            if (this.ShowAllTrue == false)
            {
                this.ShowSelectedCount = this.SupplierCreditPaidDays.Count();
            }
            else
            {
                this.ShowSelectedCount = 0;
            }
            this.SupplierCreditPaidDayscmb       = this.SupplierCreditPaidDays.OrderBy(x => x.SupplierName).ToList();
            this.SupplierCreditPaidDayscmbCredit = this.SupplierCreditPaidDayscmb.GroupBy(x => x.CashCreditNo).Select(g => g.First()).OrderBy(x => x.CreditCashNO).Where(y => y.CashCreditNo != null).ToList();
            this.SupplierCreditPaidDayscmbSup    = this.SupplierCreditPaidDays.GroupBy(x => x.SupplierName).Select(y => y.First()).OrderBy(x => x.SupplierName).Distinct().ToList();
            this.SupplierCreditPaidDayscmbInv    = this.SupplierCreditPaidDays.GroupBy(x => x.InvoiceNo).Select(y => y.First()).OrderBy(x => x.SortInvoiceNo).Distinct().ToList();
            DefaultList = this.SupplierCreditPaidDayscmb;

            Mouse.OverrideCursor = null;
        }
Example #2
0
        private void RefreshData()
        {
            ISupplierCreditPaidDaysRepository purchaseRepository = new SupplierCreditPaidDaysRepository();

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

            DefaultList = this.SupplierCreditPaidDays;
            FullPQList  = this.SupplierCreditPaidDays;
            //this.ShowAllCount = this.SupplierCreditPaidDayscmb.Count();
            SetDefaultSearchSelection(this.JsonData);


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

            ISupplierCreditPaidDaysRepository purchaseRepository = new SupplierCreditPaidDaysRepository();

            this.SupplierCreditPaidDays = purchaseRepository.GetAllSalesInvoiceJson(this.JsonData).ToList();
            if (this.ShowAllTrue == false)
            {
                this.ShowSelectedCount = this.SupplierCreditPaidDays.Count();
            }
            else
            {
                this.ShowSelectedCount = 0;
            }
            this.SupplierCreditPaidDayscmb       = this.SupplierCreditPaidDays.OrderBy(x => x.SupplierName).ToList();
            this.SupplierCreditPaidDayscmbCredit = this.SupplierCreditPaidDayscmb.GroupBy(x => x.CashCreditNo).Select(g => g.First()).OrderBy(x => x.CreditCashNO).Where(y => y.CashCreditNo != null).ToList();
            this.SupplierCreditPaidDayscmbSup    = this.SupplierCreditPaidDays.GroupBy(x => x.SupplierName).Select(y => y.First()).OrderBy(x => x.SupplierName).Distinct().ToList();
            this.SupplierCreditPaidDayscmbInv    = this.SupplierCreditPaidDays.GroupBy(x => x.InvoiceNo).Select(y => y.First()).OrderBy(x => x.SortInvoiceNo).Distinct().ToList();
            DefaultList = this.SupplierCreditPaidDayscmb;

            Mouse.OverrideCursor = null;
        }
Example #4
0
        void GetOptionsandTaxValues()
        {
            OptionsEntity oData = new OptionsEntity();
            ISupplierCreditPaidDaysRepository purchaseRepository = new SupplierCreditPaidDaysRepository();

            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.SupplierCreditPaidDays)
                    //{
                    //    item.InvoiceAmount = Math.Round(Convert.ToDouble(item.InvoiceAmount), decimalpoints).ToString();
                    //}
                    //this.SupplierCreditPaidDays = this.SupplierCreditPaidDays.Where(x => x.ExcIncGST == true).ToList();
                }
                else
                {
                    this.IncludingGSTTrue  = false;
                    this.IncludingGSTFalse = true;
                    int decimalpoints = Convert.ToInt32(DecimalPlaces);
                    //foreach (var item in this.SupplierCreditPaidDays)
                    //{
                    //    //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.SupplierCreditPaidDays != null)
                    {
                        this.SupplierCreditPaidDays = this.SupplierCreditPaidDays.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;
            }
        }
Example #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;

                ISupplierCreditPaidDaysRepository purchaseRepository = new SupplierCreditPaidDaysRepository();
                var results = purchaseRepository.SaveSearchJson(jsonSearch, Convert.ToInt32(ScreenId.SupplierCreditPaidDays), "SupplierCreditPaidDays_List");
                if (Count != 0)
                {
                    this.SupplierCreditPaidDays    = purchaseRepository.GetAllSalesInvoiceJson(jsonSearch).ToList();
                    this.SupplierCreditPaidDayscmb = this.SupplierCreditPaidDays.GroupBy(x => x.Name).Select(y => y.First()).OrderBy(x => x.Name).ToList();
                    this.AveragePaidDays           = this.SupplierCreditPaidDays.Average(e => e.PaidInDays).ToString();
                }


                DefaultList = this.SupplierCreditPaidDayscmb;


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