/// <summary>
 /// Function to Update values in PDCReceivableMaster Table
 /// </summary>
 /// <param name="pdcreceivablemasterinfo"></param>
 public void PDCReceivableMasterEdit(PDCReceivableMasterInfo pdcreceivablemasterinfo)
 {
     try
     {
         if (sqlcon.State == ConnectionState.Closed)
         {
             sqlcon.Open();
         }
         SqlCommand sccmd = new SqlCommand("PDCReceivableMasterEdit", sqlcon);
         sccmd.CommandType = CommandType.StoredProcedure;
         SqlParameter sprmparam = new SqlParameter();
         sprmparam       = sccmd.Parameters.Add("@pdcReceivableMasterId", SqlDbType.Decimal);
         sprmparam.Value = pdcreceivablemasterinfo.PdcReceivableMasterId;
         sprmparam       = sccmd.Parameters.Add("@voucherNo", SqlDbType.VarChar);
         sprmparam.Value = pdcreceivablemasterinfo.VoucherNo;
         sprmparam       = sccmd.Parameters.Add("@invoiceNo", SqlDbType.VarChar);
         sprmparam.Value = pdcreceivablemasterinfo.InvoiceNo;
         sprmparam       = sccmd.Parameters.Add("@suffixPrefixId", SqlDbType.Decimal);
         sprmparam.Value = pdcreceivablemasterinfo.SuffixPrefixId;
         sprmparam       = sccmd.Parameters.Add("@date", SqlDbType.DateTime);
         sprmparam.Value = pdcreceivablemasterinfo.Date;
         sprmparam       = sccmd.Parameters.Add("@ledgerId", SqlDbType.Decimal);
         sprmparam.Value = pdcreceivablemasterinfo.LedgerId;
         sprmparam       = sccmd.Parameters.Add("@amount", SqlDbType.Decimal);
         sprmparam.Value = pdcreceivablemasterinfo.Amount;
         sprmparam       = sccmd.Parameters.Add("@chequeNo", SqlDbType.VarChar);
         sprmparam.Value = pdcreceivablemasterinfo.ChequeNo;
         sprmparam       = sccmd.Parameters.Add("@chequeDate", SqlDbType.DateTime);
         sprmparam.Value = pdcreceivablemasterinfo.ChequeDate;
         sprmparam       = sccmd.Parameters.Add("@narration", SqlDbType.VarChar);
         sprmparam.Value = pdcreceivablemasterinfo.Narration;
         sprmparam       = sccmd.Parameters.Add("@userId", SqlDbType.Decimal);
         sprmparam.Value = pdcreceivablemasterinfo.UserId;
         sprmparam       = sccmd.Parameters.Add("@bankId", SqlDbType.Decimal);
         sprmparam.Value = pdcreceivablemasterinfo.BankId;
         sprmparam       = sccmd.Parameters.Add("@voucherTypeId", SqlDbType.Decimal);
         sprmparam.Value = pdcreceivablemasterinfo.VoucherTypeId;
         sprmparam       = sccmd.Parameters.Add("@financialYearId", SqlDbType.Decimal);
         sprmparam.Value = pdcreceivablemasterinfo.FinancialYearId;
         sprmparam       = sccmd.Parameters.Add("@extraDate", SqlDbType.DateTime);
         sprmparam.Value = pdcreceivablemasterinfo.ExtraDate;
         sprmparam       = sccmd.Parameters.Add("@extra1", SqlDbType.VarChar);
         sprmparam.Value = pdcreceivablemasterinfo.Extra1;
         sprmparam       = sccmd.Parameters.Add("@extra2", SqlDbType.VarChar);
         sprmparam.Value = pdcreceivablemasterinfo.Extra2;
         sccmd.ExecuteNonQuery();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         sqlcon.Close();
     }
 }
Ejemplo n.º 2
0
        public decimal PDCReceivableMasterAdd(PDCReceivableMasterInfo pdcreceivablemasterinfo)
        {
            decimal decIdentity = 0m;

            try
            {
                if (base.sqlcon.State == ConnectionState.Closed)
                {
                    base.sqlcon.Open();
                }
                SqlCommand sccmd = new SqlCommand("PDCReceivableMasterAdd", base.sqlcon);
                sccmd.CommandType = CommandType.StoredProcedure;
                SqlParameter sprmparam16 = new SqlParameter();
                sprmparam16       = sccmd.Parameters.Add("@voucherNo", SqlDbType.VarChar);
                sprmparam16.Value = pdcreceivablemasterinfo.VoucherNo;
                sprmparam16       = sccmd.Parameters.Add("@invoiceNo", SqlDbType.VarChar);
                sprmparam16.Value = pdcreceivablemasterinfo.InvoiceNo;
                sprmparam16       = sccmd.Parameters.Add("@suffixPrefixId", SqlDbType.Decimal);
                sprmparam16.Value = pdcreceivablemasterinfo.SuffixPrefixId;
                sprmparam16       = sccmd.Parameters.Add("@date", SqlDbType.DateTime);
                sprmparam16.Value = pdcreceivablemasterinfo.Date;
                sprmparam16       = sccmd.Parameters.Add("@ledgerId", SqlDbType.Decimal);
                sprmparam16.Value = pdcreceivablemasterinfo.LedgerId;
                sprmparam16       = sccmd.Parameters.Add("@amount", SqlDbType.Decimal);
                sprmparam16.Value = pdcreceivablemasterinfo.Amount;
                sprmparam16       = sccmd.Parameters.Add("@chequeNo", SqlDbType.VarChar);
                sprmparam16.Value = pdcreceivablemasterinfo.ChequeNo;
                sprmparam16       = sccmd.Parameters.Add("@chequeDate", SqlDbType.DateTime);
                sprmparam16.Value = pdcreceivablemasterinfo.ChequeDate;
                sprmparam16       = sccmd.Parameters.Add("@narration", SqlDbType.VarChar);
                sprmparam16.Value = pdcreceivablemasterinfo.Narration;
                sprmparam16       = sccmd.Parameters.Add("@userId", SqlDbType.Decimal);
                sprmparam16.Value = pdcreceivablemasterinfo.UserId;
                sprmparam16       = sccmd.Parameters.Add("@bankId", SqlDbType.Decimal);
                sprmparam16.Value = pdcreceivablemasterinfo.BankId;
                sprmparam16       = sccmd.Parameters.Add("@voucherTypeId", SqlDbType.Decimal);
                sprmparam16.Value = pdcreceivablemasterinfo.VoucherTypeId;
                sprmparam16       = sccmd.Parameters.Add("@financialYearId", SqlDbType.Decimal);
                sprmparam16.Value = pdcreceivablemasterinfo.FinancialYearId;
                sprmparam16       = sccmd.Parameters.Add("@extra1", SqlDbType.VarChar);
                sprmparam16.Value = pdcreceivablemasterinfo.Extra1;
                sprmparam16       = sccmd.Parameters.Add("@extra2", SqlDbType.VarChar);
                sprmparam16.Value = pdcreceivablemasterinfo.Extra2;
                decIdentity       = Convert.ToDecimal(sccmd.ExecuteScalar().ToString());
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                base.sqlcon.Close();
            }
            return(decIdentity);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Function to Update values in PDCReceivableMaster Table
 /// </summary>
 /// <param name="pdcreceivablemasterinfo"></param>
 public void PDCReceivableMasterEdit(PDCReceivableMasterInfo pdcreceivablemasterinfo)
 {
     try
     {
         spPdcRecievebleMaster.PDCReceivableMasterEdit(pdcreceivablemasterinfo);
     }
     catch (Exception ex)
     {
         MessageBox.Show("PDCR:4" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Function to insert values to PDCReceivableMaster Table
        /// </summary>
        /// <param name="pdcreceivablemasterinfo"></param>
        /// <returns></returns>
        public decimal PDCReceivableMasterAdd(PDCReceivableMasterInfo pdcreceivablemasterinfo)
        {
            decimal decIdentity = 0;

            try
            {
                decIdentity = spPdcRecievebleMaster.PDCReceivableMasterAdd(pdcreceivablemasterinfo);
            }
            catch (Exception ex)
            {
                MessageBox.Show("PDCR:3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(decIdentity);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Function to get particular values from PDCReceivableMaster Table based on the parameter
        /// </summary>
        /// <param name="pdcReceivableMasterId"></param>
        /// <returns></returns>
        public PDCReceivableMasterInfo PDCReceivableMasterView(decimal pdcReceivableMasterId)
        {
            PDCReceivableMasterInfo pdcreceivablemasterinfo = new PDCReceivableMasterInfo();

            try
            {
                pdcreceivablemasterinfo = spPdcRecievebleMaster.PDCReceivableMasterView(pdcReceivableMasterId);
            }
            catch (Exception ex)
            {
                MessageBox.Show("PDCR:10" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(pdcreceivablemasterinfo);
        }
Ejemplo n.º 6
0
        public PDCReceivableMasterInfo PDCReceivableMasterView(decimal pdcReceivableMasterId)
        {
            PDCReceivableMasterInfo pdcreceivablemasterinfo = new PDCReceivableMasterInfo();
            SqlDataReader           sdrreader = null;

            try
            {
                if (base.sqlcon.State == ConnectionState.Closed)
                {
                    base.sqlcon.Open();
                }
                SqlCommand sccmd = new SqlCommand("PDCReceivableMasterView", base.sqlcon);
                sccmd.CommandType = CommandType.StoredProcedure;
                SqlParameter sprmparam2 = new SqlParameter();
                sprmparam2       = sccmd.Parameters.Add("@pdcReceivableMasterId", SqlDbType.Decimal);
                sprmparam2.Value = pdcReceivableMasterId;
                sdrreader        = sccmd.ExecuteReader();
                while (sdrreader.Read())
                {
                    pdcreceivablemasterinfo.PdcReceivableMasterId = decimal.Parse(((DbDataReader)sdrreader)[0].ToString());
                    pdcreceivablemasterinfo.VoucherNo             = ((DbDataReader)sdrreader)[1].ToString();
                    pdcreceivablemasterinfo.InvoiceNo             = ((DbDataReader)sdrreader)[2].ToString();
                    pdcreceivablemasterinfo.SuffixPrefixId        = decimal.Parse(((DbDataReader)sdrreader)[3].ToString());
                    pdcreceivablemasterinfo.Date            = DateTime.Parse(((DbDataReader)sdrreader)[4].ToString());
                    pdcreceivablemasterinfo.LedgerId        = decimal.Parse(((DbDataReader)sdrreader)[5].ToString());
                    pdcreceivablemasterinfo.Amount          = decimal.Parse(((DbDataReader)sdrreader)[6].ToString());
                    pdcreceivablemasterinfo.ChequeNo        = ((DbDataReader)sdrreader)[7].ToString();
                    pdcreceivablemasterinfo.ChequeDate      = DateTime.Parse(((DbDataReader)sdrreader)[8].ToString());
                    pdcreceivablemasterinfo.Narration       = ((DbDataReader)sdrreader)[9].ToString();
                    pdcreceivablemasterinfo.UserId          = decimal.Parse(((DbDataReader)sdrreader)[10].ToString());
                    pdcreceivablemasterinfo.BankId          = decimal.Parse(((DbDataReader)sdrreader)[11].ToString());
                    pdcreceivablemasterinfo.VoucherTypeId   = decimal.Parse(((DbDataReader)sdrreader)[12].ToString());
                    pdcreceivablemasterinfo.FinancialYearId = decimal.Parse(((DbDataReader)sdrreader)[13].ToString());
                    pdcreceivablemasterinfo.ExtraDate       = DateTime.Parse(((DbDataReader)sdrreader)[14].ToString());
                    pdcreceivablemasterinfo.Extra1          = ((DbDataReader)sdrreader)[15].ToString();
                    pdcreceivablemasterinfo.Extra2          = ((DbDataReader)sdrreader)[16].ToString();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                sdrreader.Close();
                base.sqlcon.Close();
            }
            return(pdcreceivablemasterinfo);
        }
 /// <summary>
 /// Fill function to updation
 /// </summary>
 public void FillFunction()
 {
     try
     {
         PDCRecivebleBll BllPdcRecieveble = new PDCRecivebleBll();
         PDCReceivableMasterInfo infopdcrecivable = new PDCReceivableMasterInfo();
         infopdcrecivable = BllPdcRecieveble.PDCReceivableMasterView(decPDCReceivableEditId);
         txtVoucherNo.ReadOnly = false;
         strVoucherNo = infopdcrecivable.VoucherNo;
         strInvoiceNo = infopdcrecivable.InvoiceNo;
         txtVoucherNo.Text = strInvoiceNo;
         decSufixprefixPdcReceivableID = infopdcrecivable.SuffixPrefixId;
         decPDCReceivableVoucherTypeId = infopdcrecivable.VoucherTypeId;
         VoucherTypeBll BllVoucherType = new VoucherTypeBll();
         isAutomatic = BllVoucherType.CheckMethodOfVoucherNumbering(decPDCReceivableVoucherTypeId);
         if (isAutomatic)
         {
             txtVoucherNo.ReadOnly = true;
         }
         else
         {
             txtVoucherNo.ReadOnly = false;
             lblVoucherNoManualValidator.Visible = false;
         }
         if (infopdcrecivable.PdcReceivableMasterId != 0)
         {
             txtVoucherNo.Text = infopdcrecivable.InvoiceNo;
             dtpVoucherDate.Value = infopdcrecivable.Date;
             txtVoucherDate.Text = dtpVoucherDate.Value.ToString("dd-MMM-yyyy");
             txtNarration.Text = infopdcrecivable.Narration;
             cmbAccountLedger.SelectedValue = infopdcrecivable.LedgerId;
             txtAmount.Text = infopdcrecivable.Amount.ToString();
             if (infopdcrecivable.BankId != 0)
                 cmbBank.SelectedValue = infopdcrecivable.BankId;
             else
                 cmbBank.SelectedValue = string.Empty;
             txtcheckNo.Text = infopdcrecivable.ChequeNo;
             txtCheckDate.Text = infopdcrecivable.ChequeDate.ToString("dd-MMM-yyyy");
             btnSave.Text = "Update";
             PartyBalanceBll BllPartyBalance = new PartyBalanceBll();
             List<DataTable> listObj = new List<DataTable>();
             listObj = BllPartyBalance.PartyBalanceViewByVoucherNoAndVoucherType(decPDCReceivableVoucherTypeId, strVoucherNo, infopdcrecivable.Date);
             dtblPartyBalance = listObj[0];
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PP24:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
        /// <summary>
        /// Save function
        /// </summary>
        public void SaveFunction()
        {
            try
            {
                DateValidation Objdatevalidation = new DateValidation();
                OtherDateValidationFunction ObjotherdateValidation = new OtherDateValidationFunction();
                Objdatevalidation.DateValidationFunction(txtVoucherDate);
                ObjotherdateValidation.DateValidationFunction(txtCheckDate, false);
                DataTable dtblMaster = new DataTable();
                SettingsBll BllSettings = new SettingsBll();
                PDCRecivebleBll BllPdcreceivable = new PDCRecivebleBll();
                PDCReceivableMasterInfo InfopdcRecivable = new PDCReceivableMasterInfo();
                PartyBalanceBll BllPartyBalance = new PartyBalanceBll();
                InfopdcRecivable.VoucherNo = strVoucherNo;
                InfopdcRecivable.InvoiceNo = txtVoucherNo.Text.Trim();
                InfopdcRecivable.Date = DateTime.Parse(txtVoucherDate.Text);
                InfopdcRecivable.LedgerId = Convert.ToDecimal(cmbAccountLedger.SelectedValue.ToString());
                InfopdcRecivable.Amount = decimal.Parse(txtAmount.Text);
                InfopdcRecivable.Narration = txtNarration.Text;
                if (txtcheckNo.Text != string.Empty)
                    InfopdcRecivable.ChequeNo = txtcheckNo.Text;
                else
                    InfopdcRecivable.ChequeNo = string.Empty;
                if (txtCheckDate.Text != string.Empty)
                    InfopdcRecivable.ChequeDate = Convert.ToDateTime(txtCheckDate.Text);
                else
                    InfopdcRecivable.ChequeDate = DateTime.Now;
                InfopdcRecivable.UserId = PublicVariables._decCurrentUserId;
                InfopdcRecivable.VoucherTypeId = decPDCReceivableVoucherTypeId;
                if (cmbBank.SelectedValue != null && cmbBank.SelectedValue.ToString() != string.Empty)
                {
                    InfopdcRecivable.BankId = Convert.ToDecimal(cmbBank.SelectedValue.ToString());
                }
                else
                    InfopdcRecivable.BankId = 0;
                InfopdcRecivable.ExtraDate = DateTime.Now;
                InfopdcRecivable.Extra1 = string.Empty;
                InfopdcRecivable.Extra2 = string.Empty;
                if (!isInEditMode)
                {
                    decimal decIdentity = BllPdcreceivable.PDCReceivableMasterAdd(InfopdcRecivable);
                    LedgerPosting();
                    PartyBalanceAddOrEdit();
                    Messages.SavedMessage();
                    if (cbxPrint.Checked)
                    {
                        if (BllSettings.SettingsStatusCheck("Printer") == "Dot Matrix")
                        {
                            PrintForDotMatrix(decIdentity);
                        }
                        else
                        {
                            Print(decIdentity);
                        }
                    }
                    ClearFunction();
                }
                else
                {

                    decimal decIdentity = decPDCReceivableEditId;
                    InfopdcRecivable.PdcReceivableMasterId = decPDCReceivableEditId;
                    BllPdcreceivable.PDCReceivableMasterEdit(InfopdcRecivable);

                    LedgerPostingBll BllLedgerPosting = new LedgerPostingBll();
                    BllLedgerPosting.LedgerPostingDeleteByVoucherNoVoucherTypeIdAndLedgerId(strVoucherNo, decPDCReceivableVoucherTypeId, 12);
                    BllPartyBalance.PartyBalanceDeleteByVoucherTypeAndVoucherNo(decPDCReceivableVoucherTypeId, strVoucherNo);
                    PartyBalanceAddOrEdit();
                    LedgerPostingEdit(decPDCReceivableEditId);
                    Messages.UpdatedMessage();
                    if (cbxPrint.Checked)
                    {
                        if (BllSettings.SettingsStatusCheck("Printer") == "Dot Matrix")
                        {
                            PrintForDotMatrix(decIdentity);
                        }
                        else
                        {
                            Print(decIdentity);
                        }
                    }
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("PR9:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        /// <summary>
        /// Ledger Posting Function, here saving the curresponding details into the ledger
        /// </summary>
        public void LedgerPostingAdd()
        {
            try
            {
                string strstatus = cmbStatus.Text.ToString();
                LedgerPostingInfo InfoPosting = new LedgerPostingInfo();
                LedgerPostingBll BllLedgerPosting = new LedgerPostingBll();
                AccountLedgerBll bllAccountLedger = new AccountLedgerBll();
                LedgerPostingInfo infoLedgerPosting = new LedgerPostingInfo();
                PDCClearanceBll BllPdcClearance = new PDCClearanceBll();
                PDCPayableMasterInfo infoPDCPayable = new PDCPayableMasterInfo();
                PDCPayableBll BllPDCPayable = new PDCPayableBll();
                PDCReceivableMasterInfo infoPDCReceivable = new PDCReceivableMasterInfo();
                PDCRecivebleBll BllPDCReciveble = new PDCRecivebleBll();
                strVoucherType = BllPdcClearance.TypeOfVoucherReturnUnderVoucherName(cmbvouchertype.Text.ToString());
                if (strVoucherType == "PDC Payable")
                {
                    infoPDCPayable = BllPDCPayable.PDCPayableMasterView(Convert.ToDecimal(cmbInvoiceNo.SelectedValue.ToString()));
                    infoLedgerPosting.VoucherNo = strVoucherNo;
                    infoLedgerPosting.InvoiceNo = txtvoucherNo.Text.Trim();
                    infoLedgerPosting.Date = Convert.ToDateTime(txtVoucherDate.Text.ToString());
                    infoLedgerPosting.VoucherTypeId = decPDCclearanceVoucherTypeId;
                    infoLedgerPosting.YearId = PublicVariables._decCurrentFinancialYearId;
                    infoLedgerPosting.ChequeDate = Convert.ToDateTime(txtcheckdate.Text.ToString());
                    infoLedgerPosting.ChequeNo = txtcheckNo.Text.Trim();
                    infoLedgerPosting.ExtraDate = PublicVariables._dtCurrentDate;
                    infoLedgerPosting.Extra1 = string.Empty;
                    infoLedgerPosting.Extra2 = string.Empty;
                    if (strstatus == "Cleared")
                    {

                        infoLedgerPosting.LedgerId = infoPDCPayable.BankId;
                        infoLedgerPosting.Debit = 0;
                        infoLedgerPosting.Credit = Convert.ToDecimal(txtAmount.Text.ToString());
                    }
                    else if (strstatus == "Bounced")
                    {
                        infoLedgerPosting.LedgerId = infoPDCPayable.LedgerId;
                        infoLedgerPosting.Debit = 0;
                        infoLedgerPosting.Credit = Convert.ToDecimal(txtAmount.Text.ToString());
                    }
                    BllLedgerPosting.LedgerPostingAdd(infoLedgerPosting);
                    infoLedgerPosting.VoucherTypeId = decPDCclearanceVoucherTypeId;
                    infoLedgerPosting.VoucherNo = txtvoucherNo.Text.Trim();
                    infoLedgerPosting.Date = Convert.ToDateTime(txtVoucherDate.Text.ToString());
                    infoLedgerPosting.YearId = PublicVariables._decCurrentFinancialYearId;
                    infoLedgerPosting.ChequeDate = Convert.ToDateTime(txtcheckdate.Text);
                    infoLedgerPosting.ChequeNo = txtcheckNo.Text.Trim();
                    infoLedgerPosting.ExtraDate = PublicVariables._dtCurrentDate;
                    infoLedgerPosting.Extra1 = string.Empty;
                    infoLedgerPosting.Extra2 = string.Empty;
                    infoLedgerPosting.VoucherNo = strVoucherNo;
                    infoLedgerPosting.InvoiceNo = txtvoucherNo.Text.Trim();
                    infoLedgerPosting.LedgerId = 6;
                    infoLedgerPosting.Debit = Convert.ToDecimal(txtAmount.Text.ToString());
                    infoLedgerPosting.Credit = 0;
                    BllLedgerPosting.LedgerPostingAdd(infoLedgerPosting);
                }
                else if (strVoucherType == "PDC Receivable")
                {
                    infoPDCReceivable = BllPDCReciveble.PDCReceivableMasterView(Convert.ToDecimal(cmbInvoiceNo.SelectedValue.ToString()));
                    infoLedgerPosting.VoucherTypeId = decPDCclearanceVoucherTypeId;
                    infoLedgerPosting.VoucherNo = strVoucherNo;
                    infoLedgerPosting.InvoiceNo = txtvoucherNo.Text.Trim();
                    infoLedgerPosting.Date = PublicVariables._dtCurrentDate;
                    infoLedgerPosting.LedgerId = 7;
                    infoLedgerPosting.YearId = PublicVariables._decCurrentFinancialYearId;
                    infoLedgerPosting.Debit = 0;
                    infoLedgerPosting.Credit = Convert.ToDecimal(txtAmount.Text.ToString());
                    infoLedgerPosting.ChequeDate = Convert.ToDateTime(txtcheckdate.Text.ToString());
                    infoLedgerPosting.ChequeNo = txtcheckNo.Text.Trim();
                    infoLedgerPosting.ExtraDate = PublicVariables._dtCurrentDate;
                    infoLedgerPosting.Extra1 = string.Empty;
                    infoLedgerPosting.Extra2 = string.Empty;
                    BllLedgerPosting.LedgerPostingAdd(infoLedgerPosting);
                    infoLedgerPosting.VoucherTypeId = decPDCclearanceVoucherTypeId;
                    infoLedgerPosting.Date = PublicVariables._dtCurrentDate;
                    if (strstatus == "Cleared")
                    {
                        infoLedgerPosting.LedgerId = infoPDCReceivable.BankId;
                    }
                    else if (strstatus == "Bounced")
                    {
                        infoLedgerPosting.LedgerId = infoPDCReceivable.LedgerId;
                    }
                    infoLedgerPosting.VoucherNo = strVoucherNo;
                    infoLedgerPosting.InvoiceNo = txtvoucherNo.Text.Trim();
                    infoLedgerPosting.YearId = PublicVariables._decCurrentFinancialYearId;
                    infoLedgerPosting.Debit = Convert.ToDecimal(txtAmount.Text.ToString());
                    infoLedgerPosting.Credit = 0;
                    infoLedgerPosting.ChequeDate = Convert.ToDateTime(txtcheckdate.Text);
                    infoLedgerPosting.ChequeNo = txtcheckNo.Text.Trim();
                    infoLedgerPosting.ExtraDate = PublicVariables._dtCurrentDate;
                    infoLedgerPosting.Extra1 = string.Empty;
                    infoLedgerPosting.Extra2 = string.Empty;
                    BllLedgerPosting.LedgerPostingAdd(infoLedgerPosting);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("PC12:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }