/// <summary>
 /// Ledger Posting Edit
 /// </summary>
 public void MasterLedgerPostingEdit()
 {
     try
     {
         LedgerPostingInfo InfoLedgerPosting = new LedgerPostingInfo();
         LedgerPostingSP SpLedgerPosting = new LedgerPostingSP();
         ExchangeRateSP SpExchangRate = new ExchangeRateSP();
         InfoLedgerPosting.Credit = Convert.ToDecimal(txtTotal.Text);
         InfoLedgerPosting.Date = dtpDate.Value;
         InfoLedgerPosting.Debit = 0;
         InfoLedgerPosting.DetailsId = 0;
         InfoLedgerPosting.Extra1 = string.Empty;
         InfoLedgerPosting.Extra2 = string.Empty;
         InfoLedgerPosting.InvoiceNo = strInvoiceNo;
         InfoLedgerPosting.ChequeNo = string.Empty;
         InfoLedgerPosting.ChequeDate = DateTime.Now;
         InfoLedgerPosting.LedgerId = Convert.ToDecimal(cmbBankorCash.SelectedValue.ToString());
         if (!isAutomatic)
         {
             InfoLedgerPosting.VoucherNo = txtVoucherNo.Text.Trim();
         }
         else
         {
             InfoLedgerPosting.VoucherNo = strVoucherNo;
         }
         InfoLedgerPosting.VoucherTypeId = decPaymentVoucherTypeId;
         InfoLedgerPosting.YearId = PublicVariables._decCurrentFinancialYearId;
         SpLedgerPosting.LedgerPostingEditByVoucherTypeAndVoucherNo(InfoLedgerPosting);
     }
     catch (Exception ex)
     {
         MessageBox.Show("PV22:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }