private void PopulateInvoiceExtra() { Facade.IInvoiceExtra facInvoiceExtra = new Facade.Invoice(); if (m_invoiceExtra == null) { m_invoiceExtra = new Entities.InvoiceExtra(); } if (lblInvoiceNo.Text != Orchestrator.Globals.Constants.UNALLOCATED_INVOICE_ID) { m_invoiceExtra.InvoiceId = int.Parse(lblInvoiceNo.Text); m_invoiceExtra.CreatedDate = Convert.ToDateTime(lblDateCreated.Text); } else { m_invoiceExtra.CreatedDate = DateTime.Now; } // Set the account code. Entities.Organisation orgClient = null; Facade.Organisation facOrg = new Orchestrator.Facade.Organisation(); orgClient = facOrg.GetForIdentityId(m_identityId); m_invoiceExtra.AccountCode = orgClient.AccountCode; // m_invoiceExtra.InvoiceDate = this.rdiInvoiceDate.SelectedDate.Value; m_invoiceExtra.InvoiceType = eInvoiceType.Extra; m_invoiceExtra.ClientInvoiceAmount = Decimal.Parse(txtAmountNet.Text, NumberStyles.Currency); m_invoiceExtra.InvoiceDetails = txtInvoiceDetails.Text; m_invoiceExtra.CreatedDate = DateTime.Now; m_invoiceExtra.NominalCode = cboNominalCode.SelectedValue; if (chkOverrideAmount.Checked) { m_invoiceExtra.OverrideReason = txtReasonForOverride.Text; m_invoiceExtra.OverrideTotalAmountGross = Decimal.Parse(txtOverrideAmountGross.Text, NumberStyles.Currency); m_invoiceExtra.OverrideTotalAmountNet = Decimal.Parse(txtOverrideAmountNet.Text, NumberStyles.Currency); m_invoiceExtra.OverrideTotalAmountVAT = Decimal.Parse(txtOverrideAmountVAT.Text, NumberStyles.Currency); } else { m_invoiceExtra.OverrideReason = string.Empty; m_invoiceExtra.OverrideTotalAmountGross = 0; m_invoiceExtra.OverrideTotalAmountNet = 0; m_invoiceExtra.OverrideTotalAmountVAT = 0; } m_invoiceExtra.Extras = facInvoiceExtra.GetExtraCollectionForExtraIds(Convert.ToString(ViewState["ExtraIdCSV"])); int vatNo = 0, vatType; decimal vatRate = 0.00M; vatType = int.Parse(cboVATType.SelectedValue); // Vat Rate and Vat Type Facade.IInvoice facInv = new Facade.Invoice(); facInv.GetVatRateForVatType((eVATType)vatType, m_invoiceExtra.InvoiceDate, out vatNo, out vatRate); m_invoiceExtra.VatRate = vatRate; m_invoiceExtra.VatNo = vatNo; if (chkPostToExchequer.Checked) { m_invoiceExtra.Posted = true; } else { m_invoiceExtra.Posted = false; } if (chkDelete.Checked) { m_invoiceExtra.ForCancellation = true; } else { m_invoiceExtra.ForCancellation = false; } }