public PurchaseInvoiceForm GetDataIntoModel() { PurchaseInvoiceForm PQForm = new PurchaseInvoiceForm(); PQForm.InvoiceDetails = new List <PurchaseInvoiceDetailEntity>(); PurchaseInvoiceEntity model = new PurchaseInvoiceEntity(); model.InvoiceNo = this.InvoiceNo; model.InvoiceDate = this.InvoiceDate; model.TotalBeforeTax = this.TotalBeforeTax; model.TotalTax = this.TotalTax; model.TotalAfterTax = this.TotalAfterTax; model.PaymentDueDate = this.PaymentDueDate; model.OurPONo = this.OurPONo; model.SupplierID = this.SelectedSupplierID; model.TermsAndConditions = this.TermsAndConditions; if (ExcludingTax == true) { model.ExcIncGST = false; } else { model.ExcIncGST = true; } PQForm.Invoice = model; foreach (var item in PQDetailsEntity) { PurchaseInvoiceDetailEntity pqEntity = new PurchaseInvoiceDetailEntity(); pqEntity.PINo = Convert.ToString(item.SelectedPSID); pqEntity.PandSCode = item.PandSCode; pqEntity.PandSName = item.PandSName; pqEntity.PIQty = item.PQQty; pqEntity.PIPrice = item.PQPrice; pqEntity.PIDiscount = item.PQDiscount; pqEntity.GSTRate = item.GSTRate; pqEntity.GSTRateStr = Convert.ToString(item.GSTRate) + "%"; pqEntity.PIAmount = item.PQAmount; if (item.SelectedPSID != null && Convert.ToInt32(item.SelectedPSID) > 0) { PQForm.InvoiceDetails.Add(pqEntity); } } return(PQForm); }
public DebitNoteForm GetDataIntoModel() { OptionsEntity oData = new OptionsEntity(); ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository(); oData = purchaseRepository.GetOptionSettings(); DebitNoteForm PQForm = new DebitNoteForm(); PQForm.InvoiceDetails = new List <PurchaseInvoiceDetailEntity>(); DebitNoteEntity model = new DebitNoteEntity(); model.DebitNo = this.DebitNo; model.DebitDate = this.DebitDate; model.TotalBeforeTax = this.TotalBeforeTax; model.TotalTax = this.TotalTax; model.TotalAfterTax = this.TotalAfterTax; model.SupplierCreditNoteNo = this.SupplierCreditNoteNo; model.SupplierCreditNoteDate = DateTime.ParseExact(this.SupplierCreditNoteDateStr, oData.DateFormat, null); model.SupplierCreditNoteAmount = this.SupplierCreditNoteAmount; model.SupplierID = this.SelectedSupplierID; model.TermsAndConditions = this.TermsAndConditions; PQForm.DebitNote = model; foreach (var item in PQDetailsEntity) { PurchaseInvoiceDetailEntity pqEntity = new PurchaseInvoiceDetailEntity(); pqEntity.PINo = Convert.ToString(item.SelectedPSID); pqEntity.PandSCode = item.PandSCode; pqEntity.PandSName = item.PandSName; pqEntity.PIQty = item.PQQty; pqEntity.PIPrice = item.PQPrice; pqEntity.PIDiscount = item.PQDiscount; pqEntity.GSTRate = item.GSTRate; pqEntity.GSTRateStr = Convert.ToString(item.GSTRate) + "%"; pqEntity.PIAmount = item.PQAmount; if (item.SelectedPSID != null && Convert.ToInt32(item.SelectedPSID) > 0) { PQForm.InvoiceDetails.Add(pqEntity); } } return(PQForm); }
public DebitNoteForm GetDataIntoModel() { DebitNoteForm PQForm = new DebitNoteForm(); PQForm.InvoiceDetails = new List <PurchaseInvoiceDetailEntity>(); DebitNoteEntity model = new DebitNoteEntity(); model.DebitNo = this.DebitNo; model.DebitDate = this.DebitDate; model.TotalBeforeTax = this.TotalBeforeTax; model.TotalTax = this.TotalTax; model.TotalAfterTax = this.TotalAfterTax; model.SupplierCreditNoteNo = this.SupplierCreditNoteNo; model.SupplierCreditNoteDate = this.SupplierCreditNoteDate; model.SupplierCreditNoteAmount = this.SupplierCreditNoteAmount; model.SupplierID = this.SelectedSupplierID; model.TermsAndConditions = this.TermsAndConditions; PQForm.DebitNote = model; foreach (var item in PQDetailsEntity) { PurchaseInvoiceDetailEntity pqEntity = new PurchaseInvoiceDetailEntity(); pqEntity.PINo = Convert.ToString(item.SelectedPSID); pqEntity.PandSCode = item.PandSCode; pqEntity.PandSName = item.PandSName; pqEntity.PIQty = item.PQQty; pqEntity.PIPrice = item.PQPrice; pqEntity.PIDiscount = Math.Round((decimal)item.PQDiscount, 2); pqEntity.GSTRate = item.GSTRate; pqEntity.GSTRateStr = Convert.ToString(item.GSTRate) + "%"; pqEntity.PIAmount = item.PQAmount; if (item.SelectedPSID != null && Convert.ToInt32(item.SelectedPSID) > 0) { PQForm.InvoiceDetails.Add(pqEntity); } } return(PQForm); }