public decimal ReceiptDetailsAdd(ReceiptDetailsInfo receiptdetailsinfo)
        {
            decimal decResult = 0;

            try
            {
                decResult = spReceiptDetails.ReceiptDetailsAdd(receiptdetailsinfo);
            }
            catch (Exception)
            {
                throw;
            }
            return(decResult);
        }
        public decimal ReceiptDetailsEdit(ReceiptDetailsInfo receiptdetailsinfo)
        {
            decimal decReceiptDetailsId = 0;

            try
            {
                ReceiptDetailsSP spReceiptDetails = new ReceiptDetailsSP();
                decReceiptDetailsId = spReceiptDetails.ReceiptDetailsAdd(receiptdetailsinfo);
            }
            catch (Exception ex)
            {
                MessageBox.Show("RD3:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(decReceiptDetailsId);
        }
Ejemplo n.º 3
0
        public decimal ReceiptDetailsEdit(ReceiptDetailsInfo receiptdetailsinfo)
        {
            decimal decReceiptDetailsId = 0m;

            try
            {
                if (base.sqlcon.State == ConnectionState.Closed)
                {
                    base.sqlcon.Open();
                }
                SqlCommand sccmd = new SqlCommand("ReceiptDetailsEdit", base.sqlcon);
                sccmd.CommandType = CommandType.StoredProcedure;
                SqlParameter sprmparam10 = new SqlParameter();
                sprmparam10         = sccmd.Parameters.Add("@receiptDetailsId", SqlDbType.Decimal);
                sprmparam10.Value   = receiptdetailsinfo.ReceiptDetailsId;
                sprmparam10         = sccmd.Parameters.Add("@receiptMasterId", SqlDbType.Decimal);
                sprmparam10.Value   = receiptdetailsinfo.ReceiptMasterId;
                sprmparam10         = sccmd.Parameters.Add("@ledgerId", SqlDbType.Decimal);
                sprmparam10.Value   = receiptdetailsinfo.LedgerId;
                sprmparam10         = sccmd.Parameters.Add("@amount", SqlDbType.Decimal);
                sprmparam10.Value   = receiptdetailsinfo.Amount;
                sprmparam10         = sccmd.Parameters.Add("@exchangeRateId", SqlDbType.Decimal);
                sprmparam10.Value   = receiptdetailsinfo.ExchangeRateId;
                sprmparam10         = sccmd.Parameters.Add("@chequeNo", SqlDbType.VarChar);
                sprmparam10.Value   = receiptdetailsinfo.ChequeNo;
                sprmparam10         = sccmd.Parameters.Add("@chequeDate", SqlDbType.DateTime);
                sprmparam10.Value   = receiptdetailsinfo.ChequeDate;
                sprmparam10         = sccmd.Parameters.Add("@extra1", SqlDbType.VarChar);
                sprmparam10.Value   = receiptdetailsinfo.Extra1;
                sprmparam10         = sccmd.Parameters.Add("@extra2", SqlDbType.VarChar);
                sprmparam10.Value   = receiptdetailsinfo.Extra2;
                decReceiptDetailsId = sccmd.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                base.sqlcon.Close();
            }
            return(decReceiptDetailsId);
        }
Ejemplo n.º 4
0
        public ReceiptDetailsInfo ReceiptDetailsView(decimal receiptDetailsId)
        {
            ReceiptDetailsInfo receiptdetailsinfo = new ReceiptDetailsInfo();
            SqlDataReader      sdrreader          = null;

            try
            {
                if (base.sqlcon.State == ConnectionState.Closed)
                {
                    base.sqlcon.Open();
                }
                SqlCommand sccmd = new SqlCommand("ReceiptDetailsView", base.sqlcon);
                sccmd.CommandType = CommandType.StoredProcedure;
                SqlParameter sprmparam2 = new SqlParameter();
                sprmparam2       = sccmd.Parameters.Add("@receiptDetailsId", SqlDbType.Decimal);
                sprmparam2.Value = receiptDetailsId;
                sdrreader        = sccmd.ExecuteReader();
                while (sdrreader.Read())
                {
                    receiptdetailsinfo.ReceiptDetailsId = decimal.Parse(((DbDataReader)sdrreader)[0].ToString());
                    receiptdetailsinfo.ReceiptMasterId  = decimal.Parse(((DbDataReader)sdrreader)[1].ToString());
                    receiptdetailsinfo.LedgerId         = decimal.Parse(((DbDataReader)sdrreader)[2].ToString());
                    receiptdetailsinfo.Amount           = decimal.Parse(((DbDataReader)sdrreader)[3].ToString());
                    receiptdetailsinfo.ChequeNo         = ((DbDataReader)sdrreader)[4].ToString();
                    receiptdetailsinfo.ChequeDate       = DateTime.Parse(((DbDataReader)sdrreader)[5].ToString());
                    receiptdetailsinfo.ExtraDate        = DateTime.Parse(((DbDataReader)sdrreader)[6].ToString());
                    receiptdetailsinfo.Extra1           = ((DbDataReader)sdrreader)[7].ToString();
                    receiptdetailsinfo.Extra2           = ((DbDataReader)sdrreader)[8].ToString();
                    receiptdetailsinfo.ExchangeRateId   = decimal.Parse(((DbDataReader)sdrreader)[9].ToString());
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                sdrreader.Close();
                base.sqlcon.Close();
            }
            return(receiptdetailsinfo);
        }
        /// <summary>
        /// Edit function
        /// </summary>
        /// <param name="decMasterId"></param>
        public void Edit(decimal decMasterId)
        {
            try
            {
                int inRowCount = dgvReceiptVoucher.RowCount;
                int inTableRowCount = dtblPartyBalance.Rows.Count;
                int inB = 0;
                ReceiptMasterInfo InfoReceiptMaster = new ReceiptMasterInfo();
                ReceiptDetailsInfo InfoReceiptDetails = new ReceiptDetailsInfo();
                RecieptVoucherBll bllRecieptVoucher = new RecieptVoucherBll();

                LedgerPostingBll BllLedgerPosting = new LedgerPostingBll();
                LedgerPostingInfo InfoLegerPosting = new LedgerPostingInfo();
                PartyBalanceInfo InfopartyBalance = new PartyBalanceInfo();
                PartyBalanceBll BllPartyBalance = new PartyBalanceBll();
                BankReconciliationBll BllBankReconciliation = new BankReconciliationBll();
                InfoReceiptMaster.Date = dtpDate.Value;
                InfoReceiptMaster.ReceiptMasterId = decMasterId;
                InfoReceiptMaster.Extra1 = string.Empty;
                InfoReceiptMaster.Extra2 = string.Empty;
                InfoReceiptMaster.ExtraDate = DateTime.Now;
                InfoReceiptMaster.FinancialYearId = PublicVariables._decCurrentFinancialYearId;
                InfoReceiptMaster.LedgerId = Convert.ToDecimal(cmbCashOrBank.SelectedValue.ToString());
                InfoReceiptMaster.Narration = txtNarration.Text.Trim();
                decimal decTotalAmount = TotalAmountCalculation();
                InfoReceiptMaster.TotalAmount = decTotalAmount;
                InfoReceiptMaster.UserId = PublicVariables._decCurrentUserId;
                if (!isAutomatic)
                {
                    InfoReceiptMaster.VoucherNo = txtVoucherNo.Text.Trim();
                    InfoReceiptMaster.InvoiceNo = txtVoucherNo.Text.Trim();
                    InfoReceiptMaster.SuffixPrefixId = 0;
                }
                else
                {
                    InfoReceiptMaster.VoucherNo = strVoucherNo;
                    InfoReceiptMaster.InvoiceNo = strInvoiceNo;
                    InfoReceiptMaster.SuffixPrefixId = decDailySuffixPrefixId;
                }
                InfoReceiptMaster.VoucherTypeId = decReceiptVoucherTypeId;
                decimal decEffectRow = bllRecieptVoucher.ReceiptMasterEdit(InfoReceiptMaster);
                if (decEffectRow != 0)
                {
                    MasterLedgerPostingEdit();
                }
                foreach (object obj in arrlstOfRemove)
                {
                    string str = Convert.ToString(obj);
                    bllRecieptVoucher.ReceiptDetailsDelete(Convert.ToDecimal(str));
                    BllLedgerPosting.LedgerPostDeleteByDetailsId(Convert.ToDecimal(str), strVoucherNo, decReceiptVoucherTypeId);
                }
                decimal decReceiptDetailsId1 = 0;
                BllLedgerPosting.LedgerPostingDeleteByVoucherNoVoucherTypeIdAndLedgerId(strVoucherNo, decReceiptVoucherTypeId, 12);
                for (int inI = 0; inI < inRowCount - 1; inI++)
                {
                    InfoReceiptDetails.Amount = Convert.ToDecimal(dgvReceiptVoucher.Rows[inI].Cells["dgvtxtAmount"].Value.ToString());
                    InfoReceiptDetails.ExchangeRateId = Convert.ToDecimal(dgvReceiptVoucher.Rows[inI].Cells["dgvcmbCurrency"].Value.ToString());
                    InfoReceiptDetails.Extra1 = string.Empty;
                    InfoReceiptDetails.Extra2 = string.Empty;
                    InfoReceiptDetails.ReceiptMasterId = InfoReceiptMaster.ReceiptMasterId;
                    if (dgvReceiptVoucher.Rows[inI].Cells["dgvcmbAccountLedger"].Value != null && dgvReceiptVoucher.Rows[inI].Cells["dgvcmbAccountLedger"].Value.ToString() != string.Empty)
                    {
                        InfoReceiptDetails.LedgerId = Convert.ToDecimal(dgvReceiptVoucher.Rows[inI].Cells["dgvcmbAccountLedger"].Value.ToString());
                    }
                    if (dgvReceiptVoucher.Rows[inI].Cells["dgvtxtChequeNo"].Value != null && dgvReceiptVoucher.Rows[inI].Cells["dgvtxtChequeNo"].Value.ToString() != string.Empty)
                    {
                        InfoReceiptDetails.ChequeNo = dgvReceiptVoucher.Rows[inI].Cells["dgvtxtChequeNo"].Value.ToString();
                        if (dgvReceiptVoucher.Rows[inI].Cells["dgvtxtChequeDate"].Value != null && dgvReceiptVoucher.Rows[inI].Cells["dgvtxtChequeDate"].Value.ToString() != string.Empty)
                        {
                            InfoReceiptDetails.ChequeDate = Convert.ToDateTime(dgvReceiptVoucher.Rows[inI].Cells["dgvtxtChequeDate"].Value);
                        }
                        else
                        {
                            InfoReceiptDetails.ChequeDate = DateTime.Now;
                        }
                    }
                    else
                    {
                        InfoReceiptDetails.ChequeNo = string.Empty;
                        InfoReceiptDetails.ChequeDate = DateTime.Now;
                    }
                    if (dgvReceiptVoucher.Rows[inI].Cells["dgvtxtReceiptDetailsId"].Value == null || dgvReceiptVoucher.Rows[inI].Cells["dgvtxtReceiptDetailsId"].Value.ToString() == string.Empty)//if new rows are added
                    {
                        if (dgvReceiptVoucher.Rows[inI].HeaderCell.Value.ToString() != "X")
                        {
                            decimal decReceiptDetailsId = bllRecieptVoucher .ReceiptDetailsAdd(InfoReceiptDetails);
                            if (decReceiptDetailsId != 0)
                            {
                                for (int inJ = 0; inJ < inTableRowCount; inJ++)
                                {
                                    if (dgvReceiptVoucher.Rows[inI].Cells["dgvcmbAccountLedger"].Value.ToString() == dtblPartyBalance.Rows[inJ]["LedgerId"].ToString())
                                    {
                                        PartyBalanceAddOrEdit(inJ);
                                    }
                                }
                                inB++;
                                DetailsLedgerPosting(inI, decReceiptDetailsId);
                            }
                        }
                    }
                    else
                    {
                        if (dgvReceiptVoucher.Rows[inI].HeaderCell.Value.ToString() != "X")
                        {
                            InfoReceiptDetails.ReceiptDetailsId = Convert.ToDecimal(dgvReceiptVoucher.Rows[inI].Cells["dgvtxtreceiptDetailsId"].Value.ToString());
                            decimal decReceiptDetailsId = bllRecieptVoucher.ReceiptDetailsEdit(InfoReceiptDetails);
                            if (decReceiptDetailsId != 0)
                            {
                                for (int inJ = 0; inJ < inTableRowCount; inJ++)
                                {
                                    if (dgvReceiptVoucher.Rows[inI].Cells["dgvcmbAccountLedger"].Value.ToString() == dtblPartyBalance.Rows[inJ]["LedgerId"].ToString())
                                    {
                                        PartyBalanceAddOrEdit(inJ);
                                    }
                                }
                                inB++;
                                decReceiptDetailsId = InfoReceiptDetails.ReceiptDetailsId;
                                decimal decLedgerPostId = Convert.ToDecimal(dgvReceiptVoucher.Rows[inI].Cells["dgvtxtLedgerPostingId"].Value.ToString());
                                DetailsLedgerPostingEdit(inI, decLedgerPostId, decReceiptDetailsId1);
                            }
                        }
                        else
                        {
                            decimal decDetailsId = Convert.ToDecimal(dgvReceiptVoucher.Rows[inI].Cells["dgvtxtreceiptDetailsId"].Value.ToString());
                            bllRecieptVoucher.ReceiptDetailsDelete(decDetailsId);
                            BllLedgerPosting.LedgerPostDeleteByDetailsId(decDetailsId, strVoucherNo, decReceiptVoucherTypeId);
                            for (int inJ = 0; inJ < dtblPartyBalance.Rows.Count; inJ++)
                            {
                                if (dtblPartyBalance.Rows.Count == inJ)
                                {
                                    break;
                                }
                                if (dgvReceiptVoucher.Rows[inI].Cells["dgvcmbAccountLedger"].Value != null && dgvReceiptVoucher.Rows[inI].Cells["dgvcmbAccountLedger"].Value.ToString() != string.Empty)
                                {
                                    if (dtblPartyBalance.Rows[inJ]["LedgerId"].ToString() == dgvReceiptVoucher.Rows[inI].Cells["dgvcmbAccountLedger"].Value.ToString())
                                    {
                                        if (dtblPartyBalance.Rows[inJ]["PartyBalanceId"].ToString() != "0")
                                        {
                                            arrlstOfDeletedPartyBalanceRow.Add(dtblPartyBalance.Rows[inJ]["PartyBalanceId"]);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                DeletePartyBalanceOfRemovedRow();
                isUpdated = true;
                Messages.UpdatedMessage();
                if (cbxPrintafterSave.Checked)
                {
                    if (BllSettings.SettingsStatusCheck("Printer") == "Dot Matrix")
                    {
                        PrintForDotMatrix(InfoReceiptMaster.ReceiptMasterId);
                    }
                    else
                    {
                        Print(InfoReceiptMaster.ReceiptMasterId);
                    }
                }
                if (frmReceiptRegisterObj != null)
                {
                    this.Close();
                    frmReceiptRegisterObj.CallFromReceiptVoucher(this);
                }
                if (frmReceiptReportObj != null)
                {
                    this.Close();
                    frmReceiptReportObj.CallFromReceiptVoucher(this);
                }
                if (frmDayBookObj != null)
                {
                    this.Close();
                }
                if (frmBillallocationObj != null)
                {
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("RV13:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        /// <summary>
        /// Save function
        /// </summary>
        public void Save()
        {
            try
            {
                int inGridRowCount = dgvReceiptVoucher.RowCount;
                int inTableRowCount = dtblPartyBalance.Rows.Count;
                int inB = 0;
                ReceiptMasterInfo InfoReceiptMaster = new ReceiptMasterInfo();
                RecieptVoucherBll bllRecieptVoucher=new RecieptVoucherBll();
               // ReceiptMasterSP SpReceiptMaster = new ReceiptMasterSP();
                ReceiptDetailsInfo InfoReceiptDetails = new ReceiptDetailsInfo();
                PartyBalanceBll BllPartyBalance = new PartyBalanceBll();
                PartyBalanceInfo InfopartyBalance = new PartyBalanceInfo();
                InfoReceiptMaster.Date = dtpDate.Value;
                InfoReceiptMaster.Extra1 = string.Empty;
                InfoReceiptMaster.Extra2 = string.Empty;
                InfoReceiptMaster.FinancialYearId = PublicVariables._decCurrentFinancialYearId;
                InfoReceiptMaster.LedgerId = Convert.ToDecimal(cmbCashOrBank.SelectedValue.ToString());
                InfoReceiptMaster.Narration = txtNarration.Text;
                decimal decTotalAmount = TotalAmountCalculation();
                InfoReceiptMaster.TotalAmount = decTotalAmount;
                InfoReceiptMaster.UserId = PublicVariables._decCurrentUserId;
                if (!isAutomatic)
                {
                    InfoReceiptMaster.VoucherNo = txtVoucherNo.Text.Trim();
                    InfoReceiptMaster.InvoiceNo = txtVoucherNo.Text.Trim();
                    InfoReceiptMaster.SuffixPrefixId = 0;
                }
                else
                {
                    InfoReceiptMaster.VoucherNo = strVoucherNo;
                    InfoReceiptMaster.InvoiceNo = strInvoiceNo;
                    InfoReceiptMaster.SuffixPrefixId = decDailySuffixPrefixId;
                }
                InfoReceiptMaster.VoucherTypeId = decReceiptVoucherTypeId;
                decimal decReceiptMasterId = bllRecieptVoucher.ReceiptMasterAdd(InfoReceiptMaster);
                if (decReceiptMasterId != 0)
                {
                    MasterLedgerPosting();
                }
                for (int inI = 0; inI < inGridRowCount - 1; inI++)
                {
                    if (dgvReceiptVoucher.Rows[inI].HeaderCell.Value.ToString() != "X")
                    {
                        InfoReceiptDetails.Amount = Convert.ToDecimal(dgvReceiptVoucher.Rows[inI].Cells["dgvtxtAmount"].Value.ToString());
                        InfoReceiptDetails.ExchangeRateId = Convert.ToDecimal(dgvReceiptVoucher.Rows[inI].Cells["dgvcmbCurrency"].Value.ToString());
                        InfoReceiptDetails.Extra1 = string.Empty;
                        InfoReceiptDetails.Extra2 = string.Empty;
                        InfoReceiptDetails.LedgerId = Convert.ToDecimal(dgvReceiptVoucher.Rows[inI].Cells["dgvcmbAccountLedger"].Value.ToString());
                        InfoReceiptDetails.ReceiptMasterId = decReceiptMasterId;
                        if (dgvReceiptVoucher.Rows[inI].Cells["dgvcmbAccountLedger"].Value != null && dgvReceiptVoucher.Rows[inI].Cells["dgvcmbAccountLedger"].Value.ToString() != string.Empty)
                        {
                            InfoReceiptDetails.LedgerId = Convert.ToDecimal(dgvReceiptVoucher.Rows[inI].Cells["dgvcmbAccountLedger"].Value.ToString());
                        }
                        if (dgvReceiptVoucher.Rows[inI].Cells["dgvtxtChequeNo"].Value != null && dgvReceiptVoucher.Rows[inI].Cells["dgvtxtChequeNo"].Value.ToString() != string.Empty)
                        {
                            InfoReceiptDetails.ChequeNo = dgvReceiptVoucher.Rows[inI].Cells["dgvtxtChequeNo"].Value.ToString();
                            if (dgvReceiptVoucher.Rows[inI].Cells["dgvtxtChequeDate"].Value != null && dgvReceiptVoucher.Rows[inI].Cells["dgvtxtChequeDate"].Value.ToString() != string.Empty)
                            {
                                InfoReceiptDetails.ChequeDate = Convert.ToDateTime(dgvReceiptVoucher.Rows[inI].Cells["dgvtxtChequeDate"].Value);
                            }
                            else
                            {
                                InfoReceiptDetails.ChequeDate = DateTime.Now;
                            }
                        }
                        else
                        {
                            InfoReceiptDetails.ChequeNo = string.Empty;
                            InfoReceiptDetails.ChequeDate = DateTime.Now;
                        }
                        decimal decReceiptDetailsId = bllRecieptVoucher.ReceiptDetailsAdd(InfoReceiptDetails);
                        if (decReceiptDetailsId != 0)
                        {
                            for (int inJ = 0; inJ < inTableRowCount; inJ++)
                            {
                                if (dgvReceiptVoucher.Rows[inI].Cells["dgvcmbAccountLedger"].Value.ToString() == dtblPartyBalance.Rows[inJ]["LedgerId"].ToString())
                                {
                                    PartyBalanceAddOrEdit(inJ);
                                }
                            }
                            inB++;
                            DetailsLedgerPosting(inI, decReceiptDetailsId);
                        }
                    }
                }

                Messages.SavedMessage();
                if (cbxPrintafterSave.Checked)
                {
                    if (BllSettings.SettingsStatusCheck("Printer") == "Dot Matrix")
                    {
                        PrintForDotMatrix(decReceiptMasterId);
                    }
                    else
                    {
                        Print(decReceiptMasterId);
                    }
                }
                Clear();
            }
            catch (Exception ex)
            {
                MessageBox.Show("RV12:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        /// <summary>
        /// Fill function for updation
        /// </summary>
        public void FillFunction()
        {
            try
            {
                isValueChange = false;
                ReceiptMasterInfo InfoReceiptMaster = new ReceiptMasterInfo();

                ReceiptDetailsInfo InfoReceiptDetails = new ReceiptDetailsInfo();
                RecieptVoucherBll bllRecieptVoucherBll = new RecieptVoucherBll();

                PartyBalanceBll BllPartyBalance = new PartyBalanceBll();
                LedgerPostingBll BllLedgerPosting = new LedgerPostingBll();
                VoucherTypeBll BllVoucherType = new VoucherTypeBll();
                AccountGroupBll BllAccountGroup = new AccountGroupBll();
                AccountLedgerBll bllAccountLedger = new AccountLedgerBll();
                InfoReceiptMaster = bllRecieptVoucherBll.ReceiptMasterViewByMasterId(decRecieptmasterId);
                isAutomatic = BllVoucherType.CheckMethodOfVoucherNumbering(InfoReceiptMaster.VoucherTypeId);
                if (isAutomatic)
                {
                    txtVoucherNo.ReadOnly = true;
                    txtVoucherNo.Text = InfoReceiptMaster.InvoiceNo;
                }
                else
                {
                    txtVoucherNo.ReadOnly = false;
                    txtVoucherNo.Text = InfoReceiptMaster.VoucherNo;
                }
                dtpDate.Value = InfoReceiptMaster.Date;
                cmbCashOrBank.SelectedValue = InfoReceiptMaster.LedgerId;
                txtNarration.Text = InfoReceiptMaster.Narration;
                txtTotal.Text = InfoReceiptMaster.TotalAmount.ToString();
                decDailySuffixPrefixId = InfoReceiptMaster.SuffixPrefixId;
                decReceiptVoucherTypeId = InfoReceiptMaster.VoucherTypeId;
                strVoucherNo = InfoReceiptMaster.VoucherNo;
                strInvoiceNo = InfoReceiptMaster.InvoiceNo;
                List<DataTable> listobj = new List<DataTable>();
                listobj = bllRecieptVoucherBll.ReceiptDetailsViewByMasterId(decRecieptmasterId);
                for (int inI = 0; inI < listobj[0].Rows.Count; inI++)
                {
                    dgvReceiptVoucher.Rows.Add();
                    dgvReceiptVoucher.Rows[inI].Cells["dgvcmbAccountLedger"].Value = Convert.ToDecimal(listobj[0].Rows[inI]["ledgerId"].ToString());
                    dgvReceiptVoucher.Rows[inI].Cells["dgvtxtreceiptMasterId"].Value = listobj[0].Rows[inI]["receiptMasterId"].ToString();
                    dgvReceiptVoucher.Rows[inI].Cells["dgvtxtreceiptDetailsId"].Value = listobj[0].Rows[inI]["receiptDetailsId"].ToString();
                    dgvReceiptVoucher.Rows[inI].Cells["dgvtxtAmount"].Value = listobj[0].Rows[inI]["amount"].ToString();
                    dgvReceiptVoucher.Rows[inI].Cells["dgvcmbCurrency"].Value = Convert.ToDecimal(listobj[0].Rows[inI]["exchangeRateId"].ToString());
                    decimal decDetailsId1 = Convert.ToDecimal(listobj[0].Rows[inI]["receiptDetailsId"].ToString());
                    decimal decLedgerPostingId = BllLedgerPosting.LedgerPostingIdFromDetailsId(decDetailsId1, strVoucherNo, decReceiptVoucherTypeId);
                    dgvReceiptVoucher.Rows[inI].Cells["dgvtxtLedgerPostingId"].Value = decLedgerPostingId.ToString();
                    decimal decLedgerId = Convert.ToDecimal(listobj[0].Rows[inI]["ledgerId"].ToString());
                    bool IsBankAccount = BllAccountGroup.AccountGroupwithLedgerId(decLedgerId);
                    decimal decI = Convert.ToDecimal(bllAccountLedger.AccountGroupIdCheck(dgvReceiptVoucher.Rows[inI].Cells["dgvcmbAccountLedger"].FormattedValue.ToString()));
                    if (decI > 0)
                    {
                        dgvReceiptVoucher.Rows[inI].Cells["dgvtxtAmount"].ReadOnly = true;
                        dgvReceiptVoucher.Rows[inI].Cells["dgvcmbCurrency"].ReadOnly = true;
                    }
                    else
                    {
                        dgvReceiptVoucher.Rows[inI].Cells["dgvtxtAmount"].ReadOnly = false;
                        dgvReceiptVoucher.Rows[inI].Cells["dgvcmbCurrency"].ReadOnly = false;
                    }
                    if (listobj[0].Rows[inI]["chequeNo"].ToString() != string.Empty)
                    {
                        dgvReceiptVoucher.Rows[inI].Cells["dgvtxtChequeNo"].Value = listobj[0].Rows[inI]["chequeNo"].ToString();
                        dgvReceiptVoucher.Rows[inI].Cells["dgvtxtChequeDate"].Value = Convert.ToDateTime(listobj[0].Rows[inI]["chequeDate"].ToString()).ToString("dd-MMM-yyyy");
                    }
                    dgvReceiptVoucher.Rows[inI].HeaderCell.Value = string.Empty;
                }
                List<DataTable> listObj = new List<DataTable>();
                listObj = BllPartyBalance.PartyBalanceViewByVoucherNoAndVoucherType(decReceiptVoucherTypeId, strVoucherNo, InfoReceiptMaster.Date);
                dtblPartyBalance = listObj[0];
                isValueChange = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show("RV34:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }