public void GetPandSDetails() { #region getting Options details var lstOptions = pandRepository.GetOptionDetails(); if (lstOptions != null) { bool?tax = lstOptions.ShowAmountIncGST; if (tax == true) { IsExcludingTax = false; } else { IsExcludingTax = true; } } #endregion var pqDetails = ProductAndServices.Where(p => p.ID == SelectedPandSID).SingleOrDefault(); if (pqDetails != null) { // PQDEntity = lst.Where(l => l.ID == SelectedPSID).SingleOrDefault(); if (IsExcludingTax == true) { Price = Math.Round(Convert.ToDecimal(pqDetails.StandardCostpriceBeforeGST), 2); } else { Price = Math.Round(Convert.ToDecimal(pqDetails.StandardCostpriceAfterGST), 2); } } }
private void OnSelectionChanged() { if (ProductAndServices != null && this.SelectedPSID != null) { var sqDetails = ProductAndServices.Where(p => p.ID == Convert.ToInt32(this.SelectedPSID)).SingleOrDefault(); if (sqDetails != null) { PandSCode = sqDetails.PSCode; PandSName = sqDetails.PSName; GSTRate = sqDetails.TaxRate; PriceIncTax = sqDetails.CostPriceIncludingTaxBackup; PriceExcTax = sqDetails.CostPriceExcludingTaxBackup; if (SharedValues.IsIncludeTax == false) { PQPrice = Convert.ToString(Convert.ToDecimal(sqDetails.CostPriceExcludingTax)); } else { PQPrice = Convert.ToString(Convert.ToDecimal(sqDetails.CostPriceIncludingTax)); } PQQty = 1; // SQDiscount = 0; //if (SharedValues.CustomerDiscount != null) //{ // PQDiscount = SharedValues.CustomerDiscount; //} GSTRateStr = Convert.ToString(GSTRate) + "%"; // OnQtyChangeTotalAmt(ExcludingTax); } } }
/// <summary> /// This method is used to get new PO /// </summary> public void GetNewPO() { VisibilityForImage = Visibility.Collapsed; IsNew = true; ID = 0; SelectedSupplierID = 0; BillToAddress = string.Empty; ShipToAddress = string.Empty; //ValidForDays = 0; OrderNo = GenerateNewOrderNo(); TermsAndConditions = TandC; OrderDate = DateTime.Now.Date; DeliveryDate = DateTime.Now.Date; TotalBeforeTax = 0; TotalTax = 0; TotalAfterTax = 0; TotalBeforeTaxStr = Convert.ToString(0); TotalTaxStr = Convert.ToString(0); TotalAfterTaxStr = Convert.ToString(0); POErrors = string.Empty; AllFieldsEnabled = true; AllFieldsReadonly = false; SupplierEnabled = true;// added on 23 may 2017 PurchaseOrderEntity = new PurchaseOrderEntity(); PODetailsEntity.Clear(); LstSuppliers = supplierRepository.GetAllSupplier().Where(s => s.IsInActive != "Y").ToList(); ProductAndServices = ProductAndServices.OrderBy(x => x.PSName).Where(x => x.IsInActive == "N").ToObservable(); // PODetailsEntity = new ObservableCollection<DataGridViewModel>(); var row = new DataGridViewModel(ProductList.Where(x => x.IsInActive == "N").ToList()); //row.PQQty = 1; //row.PQDiscount = 0; //row.GSTRate = TaxRate; //row.GSTRateStr = Convert.ToString(TaxRate) + "%"; PODetailsEntity.Add(row); OnPropertyChanged("PODetailsEntity"); var lstOptions = pandsRepository.GetOptionDetails(); bool?tax = lstOptions.ShowAmountIncGST; if (tax == true) { ExcludingTax = false; IncludingTax = true; } else { IncludingTax = false; ExcludingTax = true; } }
private void OnSelectionChanged() { if (ProductAndServices != null && this.SelectedPSID != null) { var sqDetails = ProductAndServices.Where(p => p.ID == Convert.ToInt32(this.SelectedPSID)).SingleOrDefault(); var cus = customerRepository.GetAllCustomers().Where(s => s.ID == SharedValues.SelectedCusId).SingleOrDefault(); this.TaxandRateList = customerRepository.GetTaxCodeAndRatesList(); if (cus != null && this.TaxandRateList != null) { var Tax = this.TaxandRateList.Where(x => x.TaxID == cus.TaxId).FirstOrDefault(); if (Tax != null) { SelectedTaxId = Tax.TaxRate; } } if (sqDetails != null) { PandSCode = sqDetails.PSCode; PandSName = sqDetails.PSName; if (cus.Cus_Charge_GST == false) { GSTRate = SelectedTaxId; } else { GSTRate = sqDetails.TaxRate; } PriceIncTax = sqDetails.SellPriceIncludingTaxBackup; PriceExcTax = sqDetails.SellPriceExcludingTaxBackup; if (SharedValues.IsIncludeTax == false) { SQPrice = Convert.ToString(Convert.ToDecimal(sqDetails.SellPriceExcludingTax)); } else { SQPrice = Convert.ToString(Convert.ToDecimal(sqDetails.SellPriceIncludingTax)); } SQQty = 1; // SQDiscount = 0; if (SharedValues.CustomerDiscount != null) { SQDiscount = SharedValues.CustomerDiscount; } GSTRateStr = Convert.ToString(GSTRate) + "%"; // OnQtyChangeTotalAmt(ExcludingTax); } } }
public void GetPurchaseOrder(string pqNo) { // Mouse.OverrideCursor = Cursors.Wait; PurchaseOrderForm pqf = pqRepository.GetPurchaseOrder(pqNo); this.ID = pqf.Order.ID; this.OrderNo = pqf.Order.OrderNo; this.OrderDate = pqf.Order.OrderDate; //this.ValidForDays = pqf.Order.ValidForDays; this.DeliveryDate = pqf.Order.DeliveryDate; this.SelectedSupplierID = pqf.Order.SupplierID; //if (this.SelectedSupplierID > 0) //{ // GetSupplierDetails(); //} this.TermsAndConditions = pqf.Order.TermsAndConditions; this.TotalBeforeTax = pqf.Order.TotalBeforeTax; this.TotalTax = pqf.Order.TotalTax; this.TotalAfterTax = pqf.Order.TotalAfterTax; this.TotalBeforeTaxStr = Convert.ToString(this.TotalBeforeTax); this.TotalTaxStr = Convert.ToString(TotalTax); this.TotalAfterTaxStr = Convert.ToString(TotalAfterTax); if (pqf.Order.ExcIncGST == true) { ExcludingTax = false; IncludingTax = true; // PODEntity.GSTRate = 0; } else { ExcludingTax = true; IncludingTax = false; // PODEntity.GSTRate = TaxRate; } if (PO_Conv_to_PI == true) { AllFieldsReadonly = true; AllFieldsEnabled = false; } else { AllFieldsReadonly = false; AllFieldsEnabled = true; LstSuppliers = supplierRepository.GetAllSupplier().Where(s => s.IsInActive != "Y").ToList(); ProductAndServices = ProductAndServices.OrderBy(x => x.PSName).Where(x => x.IsInActive != "Y").ToObservable(); } this.Status = pqf.Order.Status; if (Status == Convert.ToByte(PO_Status.Cancelled)) { StatusString = "Cancelled"; VisibilityForImage = Visibility.Visible; AllFieldsEnabled = false; AllFieldsReadonly = true; } else if (Status == Convert.ToByte(PO_Status.Collected)) { StatusString = "Collected"; VisibilityForImage = Visibility.Visible; AllFieldsEnabled = false; AllFieldsReadonly = true; } else if (Status == Convert.ToByte(PO_Status.Refunded)) { StatusString = "Refunded"; VisibilityForImage = Visibility.Visible; AllFieldsEnabled = false; AllFieldsReadonly = true; } else { StatusString = ""; VisibilityForImage = Visibility.Collapsed; AllFieldsEnabled = true; AllFieldsReadonly = false; } //this.PO_Conv_to_PO = pqf.Order.PO_Conv_to_PO; this.PO_Conv_to_PI = pqf.Order.PO_Conv_to_PI; SupplierEnabled = false;// added on 23 may 2017 this.PODetailsEntity = new ObservableCollection <DataGridViewModel>(); foreach (var item in pqf.OrderDetails) { DataGridViewModel pqEntity = new DataGridViewModel(ProductList); pqEntity.SelectedPSID = Convert.ToString(item.PONo); pqEntity.PandSCode = item.PandSCode; pqEntity.PandSName = item.PandSName; pqEntity.GSTRate = Math.Round(Convert.ToDecimal(item.GSTRate), DecimalPlaces); pqEntity.GSTRateStr = Convert.ToString(pqEntity.GSTRate) + "%"; pqEntity.PQQty = item.POQty; pqEntity.PQPrice = Convert.ToString(item.Price); pqEntity.PQDiscount = item.PODiscount; // PODEntity.GSTRate = item.GSTRate; pqEntity.PQAmount = item.POAmount; PODetailsEntity.Add(pqEntity); } }
public void GetPurchaseQuotation(string pqNo) { // Mouse.OverrideCursor = Cursors.Wait; PurchaseQuotationForm pqf = pqRepository.GetPurchaseQuotation(pqNo); this.ID = pqf.Quotation.ID; this.QuotationNo = pqf.Quotation.QuotationNo; this.QuotationDate = pqf.Quotation.QuotationDate; this.ValidForDays = pqf.Quotation.ValidForDays; this.SelectedSupplierID = pqf.Quotation.SupplierID; //if (this.SelectedSupplierID > 0) //{ // GetSupplierDetails(); //} this.TermsAndConditions = pqf.Quotation.TermsAndConditions; this.TotalBeforeTax = pqf.Quotation.TotalBeforeTax; this.TotalTax = pqf.Quotation.TotalTax; this.TotalAfterTax = pqf.Quotation.TotalAfterTax; this.TotalBeforeTaxStr = Convert.ToString(this.TotalBeforeTax); this.TotalTaxStr = Convert.ToString(TotalTax); this.TotalAfterTaxStr = Convert.ToString(TotalAfterTax); if (pqf.Quotation.ExcIncGST == true) { ExcludingTax = false; IncludingTax = true; // PQDEntity.GSTRate = 0; } else { ExcludingTax = true; IncludingTax = false; // PQDEntity.GSTRate = TaxRate; } this.PQ_Conv_to_PO = pqf.Quotation.PQ_Conv_to_PO; this.PQ_Conv_to_PI = pqf.Quotation.PQ_Conv_to_PI; if (PQ_Conv_to_PO == true || PQ_Conv_to_PI == true) { AllFieldsReadonly = true; AllFieldsEnabled = false; } else { AllFieldsReadonly = false; AllFieldsEnabled = true; LstSuppliers = supplierRepository.GetAllSupplier().Where(s => s.IsInActive != "Y").ToList(); ProductAndServices = ProductAndServices.OrderBy(x => x.PSName).Where(x => x.IsInActive != "Y").ToObservable(); } SupplierEnabled = false; this.PQDetailsEntity = new ObservableCollection <DataGridViewModel>(); foreach (var item in pqf.QuotationDetails) { DataGridViewModel pqEntity = new DataGridViewModel(ProductList); pqEntity.SelectedPSID = Convert.ToString(item.PQNo); pqEntity.PandSCode = item.PandSCode; pqEntity.PandSName = item.PandSName; pqEntity.GSTRate = Math.Round(Convert.ToDecimal(item.GSTRate), DecimalPlaces); pqEntity.GSTRateStr = Convert.ToString(pqEntity.GSTRate) + "%"; pqEntity.PQQty = item.PQQty; pqEntity.PQPrice = Convert.ToString(item.Price); pqEntity.PQDiscount = item.PQDiscount; // PQDEntity.GSTRate = item.GSTRate; pqEntity.PQAmount = item.PQAmount; PQDetailsEntity.Add(pqEntity); } }