Esempio n. 1
0
        /// <summary>
        /// This method is used to get new PQ
        /// </summary>
        public void GetNewPQ()
        {
            IsNew = true;
            ID    = 0;
            SelectedSupplierID = 0;
            BillToAddress      = string.Empty;
            ShipToAddress      = string.Empty;
            // ValidForDays = 0;
            InvoiceNo = string.Empty;
            // PQDetailsEntity.Clear();
            this.OurPONo           = GenerateNewInvoiceNo();
            TotalBeforeTax         = 0;
            TotalTax               = 0;
            TotalAfterTax          = 0;
            TotalBeforeTaxStr      = Convert.ToString(0);
            TotalTaxStr            = Convert.ToString(0);
            TotalAfterTaxStr       = Convert.ToString(0);
            PQErrors               = string.Empty;
            AllFieldsEnabled       = true;
            AllFieldsReadonly      = false;
            this.PaymentDueDateStr = null;
            this.InvoiceNo         = "PI-" + pqRepository.GetNewLatestInvoiceNo();
            PurchaseInvoiceEntity  = new PurchaseInvoiceEntity();
            BEDetailsEntity.Clear();
            LstSuppliers = supplierRepository.GetAllSupplier().Where(s => s.IsInActive != "Y").ToList();

            Accounts = Accounts.OrderBy(x => x.AccountName).Where(x => x.IsInactive == "N").ToObservable();
            //PQDetailsEntity = new ObservableCollection<DataGridViewModel>();
            var row = new AccountDataGridViewModel(AccountsList.Where(x => x.IsInactive == "N").ToList());

            row.TaxList = Taxes.ToList();;
            BEDetailsEntity.Add(row);
            OnPropertyChanged("BEDetailsEntity");
        }
        private double CalculateReservationCost(double pricePerDay, DateTime PickupDate, DateTime ReturnDate, params double[] Taxes)
        {
            var totalVehicleCost = pricePerDay;
            var totalRentalDays  = Convert.ToInt32((ReturnDate - PickupDate).TotalDays);

            if (totalRentalDays > 0)
            {
                totalVehicleCost = pricePerDay * totalRentalDays;
            }
            var totalRentalCost = totalVehicleCost;

            Taxes.ToList().ForEach(tax => { totalRentalCost = totalRentalCost + tax; });
            return(Math.Round(totalRentalCost, 2));
        }
Esempio n. 3
0
 public List <Tax> GetTaxes()
 {
     return(Taxes.ToList());
 }