private void ShowAllDetails() { try { if (docID == "CASHPAYMENTVOUCHER" || docID == "BANKPAYMENTVOUCHER") { grdPRDetail.Columns["PartyCode"].Visible = false; grdPRDetail.Columns["PartyName"].Visible = false; grdPRDetail.Columns["SLType"].Visible = false; grdPRDetail.Columns["ChequeNo"].Visible = true; grdPRDetail.Columns["ChequeDate"].Visible = true; paymentvoucher vh = new paymentvoucher(); vh.DocumentID = docID; vh.VoucherNo = voucherNo; vh.VoucherDate = voucherDate; paymentvoucher pvh = PaymentVoucherDB.getVoucherHeaderForTrialBalance(vh); txtTemporarryNo.Text = pvh.TemporaryNo.ToString(); dtTempDate.Value = pvh.TemporaryDate; txtVoucherNo.Text = pvh.VoucherNo.ToString(); dtVoucherDate.Value = pvh.VoucherDate; txtvoucherType.Text = pvh.VoucherType; cmbBookType.SelectedIndex = Structures.ComboFUnctions.getComboIndex(cmbBookType, pvh.BookType); txtPayeeCode.Text = pvh.SLCode.ToString(); txtPayeeName.Text = pvh.SLName; txtBillDetails.Text = pvh.BillDetails; cmbBankTransMode.SelectedIndex = Structures.ComboFUnctions.getComboIndex(cmbBankTransMode, pvh.BankTransactionMode); cmbOfficeID.SelectedIndex = Structures.ComboFUnctions.getComboIndex(cmbOfficeID, pvh.OfficeID); cmbProjectID.SelectedIndex = cmbProjectID.FindString(pvh.ProjectID); cmbCurrencyID.SelectedIndex = Structures.ComboFUnctions.getComboIndex(cmbCurrencyID, pvh.CurrencyID); txtExchangeRate.Text = pvh.ExchangeRate.ToString(); txtVoucherAmount.Text = pvh.VoucherAmount.ToString(); txtvoucherAmountINR.Text = pvh.VoucherAmountINR.ToString(); txtAmountInWords.Text = NumberToString.convert(pvh.VoucherAmount.ToString()).Trim().Replace("INR", pvh.CurrencyID); txtnarration.Text = pvh.Narration.ToString(); List <paymentvoucherdetail> VDetail = PaymentVoucherDB.getVoucherDetail(pvh); grdPRDetail.Rows.Clear(); int i = 0; decimal totCredit = 0; decimal totDebit = 0; foreach (paymentvoucherdetail vd in VDetail) { AddPRDetailRow(); grdPRDetail.Rows[i].Cells["AccountCode"].Value = vd.AccountCode; grdPRDetail.Rows[i].Cells["AccountName"].Value = vd.AccountName; grdPRDetail.Rows[i].Cells["AmountDebit"].Value = vd.AmountDebit; totDebit = totDebit + vd.AmountDebit; grdPRDetail.Rows[i].Cells["AmountCredit"].Value = vd.AmountCredit; totCredit = totCredit + vd.AmountCredit; grdPRDetail.Rows[i].Cells["ChequeNo"].Value = vd.ChequeNo; grdPRDetail.Rows[i].Cells["ChequeDate"].Value = vd.ChequeDate; i++; } txtTotalCreditAmnt.Text = totCredit.ToString(); txtTotalDebitAmnt.Text = totDebit.ToString(); } else if (docID == "BANKRECEIPTVOUCHER" || docID == "CASHRECEIPTVOUCHER") { grdPRDetail.Columns["PartyCode"].Visible = false; grdPRDetail.Columns["PartyName"].Visible = false; grdPRDetail.Columns["SLType"].Visible = false; grdPRDetail.Columns["ChequeNo"].Visible = true; grdPRDetail.Columns["ChequeDate"].Visible = true; ReceiptVoucherHeader vh = new ReceiptVoucherHeader(); vh.DocumentID = docID; vh.VoucherNo = voucherNo; vh.VoucherDate = voucherDate; ReceiptVoucherHeader rvh = ReceiptVoucherDB.getReceiptVoucherHeaderForTrailbalance(vh); txtTemporarryNo.Text = rvh.TemporaryNo.ToString(); dtTempDate.Value = rvh.TemporaryDate; txtVoucherNo.Text = rvh.VoucherNo.ToString(); dtVoucherDate.Value = rvh.VoucherDate; txtvoucherType.Text = rvh.VoucherType; cmbBookType.SelectedIndex = Structures.ComboFUnctions.getComboIndex(cmbBookType, rvh.BookType); txtPayeeCode.Text = rvh.SLCode.ToString(); txtPayeeName.Text = rvh.SLName; txtBillDetails.Text = rvh.BillDetails; cmbBankTransMode.SelectedIndex = Structures.ComboFUnctions.getComboIndex(cmbBankTransMode, rvh.BankTransactionMode); cmbOfficeID.SelectedIndex = Structures.ComboFUnctions.getComboIndex(cmbOfficeID, rvh.OfficeID); cmbProjectID.SelectedIndex = cmbProjectID.FindString(rvh.ProjectID); cmbCurrencyID.SelectedIndex = Structures.ComboFUnctions.getComboIndex(cmbCurrencyID, rvh.CurrencyID); txtExchangeRate.Text = rvh.ExchangeRate.ToString(); txtVoucherAmount.Text = rvh.VoucherAmount.ToString(); txtvoucherAmountINR.Text = rvh.VoucherAmountINR.ToString(); txtAmountInWords.Text = NumberToString.convert(rvh.VoucherAmount.ToString()).Trim().Replace("INR", rvh.CurrencyID); txtnarration.Text = rvh.Narration.ToString(); List <ReceiptVoucherDetail> VDetail = ReceiptVoucherDB.getVoucherDetail(rvh); grdPRDetail.Rows.Clear(); int i = 0; decimal totCredit = 0; decimal totDebit = 0; foreach (ReceiptVoucherDetail vd in VDetail) { AddPRDetailRow(); grdPRDetail.Rows[i].Cells["AccountCode"].Value = vd.AccountCode; grdPRDetail.Rows[i].Cells["AccountName"].Value = vd.AccountName; grdPRDetail.Rows[i].Cells["AmountDebit"].Value = vd.AmountDebit; totDebit = totDebit + vd.AmountDebit; grdPRDetail.Rows[i].Cells["AmountCredit"].Value = vd.AmountCredit; totCredit = totCredit + vd.AmountCredit; grdPRDetail.Rows[i].Cells["ChequeNo"].Value = vd.ChequeNo; grdPRDetail.Rows[i].Cells["ChequeDate"].Value = vd.ChequeDate; i++; } txtTotalCreditAmnt.Text = totCredit.ToString(); txtTotalDebitAmnt.Text = totDebit.ToString(); } else if (docID == "JOURNALVOUCHER" || docID == "PJV" || docID == "SJV") { grdPRDetail.Columns["PartyCode"].Visible = true; grdPRDetail.Columns["PartyName"].Visible = true; grdPRDetail.Columns["SLType"].Visible = true; grdPRDetail.Columns["ChequeNo"].Visible = false; grdPRDetail.Columns["ChequeDate"].Visible = false; JournalVoucherHeader jvhTemp = new JournalVoucherHeader(); jvhTemp.DocumentID = docID; jvhTemp.JournalNo = voucherNo; jvhTemp.JournalDate = voucherDate; JournalVoucherHeader jvh = JournalVoucherDB.getJournalHeaderForTrialBalance(jvhTemp); txtTemporarryNo.Text = jvh.TemporaryNo.ToString(); //txtvoucherType.Text = "Journal"; dtTempDate.Value = jvh.TemporaryDate; //txtAmountInWords.Text = NumberToString.convert(txtTotalDebitAmnt.Text); txtVoucherNo.Text = jvh.JournalNo.ToString(); dtVoucherDate.Value = jvh.JournalDate; txtnarration.Text = jvh.Narration.ToString(); decimal totDebit = 0; decimal totCredit = 0; List <JournalVoucherDetail> JVDetail = JournalVoucherDB.getJournalVoucherDetail(jvh); grdPRDetail.Rows.Clear(); int i = 0; foreach (JournalVoucherDetail jvd in JVDetail) { AddPRDetailRow(); grdPRDetail.Rows[i].Cells["AccountCode"].Value = jvd.AccountCode; grdPRDetail.Rows[i].Cells["AccountName"].Value = jvd.AccountName; grdPRDetail.Rows[i].Cells["PartyCode"].Value = jvd.SLCode; grdPRDetail.Rows[i].Cells["PartyName"].Value = jvd.SLName; grdPRDetail.Rows[i].Cells["SLType"].Value = jvd.SLType; grdPRDetail.Rows[i].Cells["AmountDebit"].Value = jvd.AmountDebit; grdPRDetail.Rows[i].Cells["AmountCredit"].Value = jvd.AmountCredit; totDebit = totDebit + jvd.AmountDebit; totCredit = totCredit + jvd.AmountCredit; i++; } txtTotalCreditAmnt.Text = totCredit.ToString(); txtTotalDebitAmnt.Text = totDebit.ToString(); txtAmountInWords.Text = NumberToString.convert(txtTotalDebitAmnt.Text); } } catch (Exception ex) { MessageBox.Show("Error in showing details"); } }
private void ShowAllDetails() { try { if (JVdocID == "PJV") { invoiceinheader iih = new invoiceinheader(); iih.DocumentID = InvDociD; iih.TemporaryNo = InvTemporaryNo; iih.TemporaryDate = InvTemporaryDate; PJVHeader pjvh = PJVDB.getPJVHeaderPerInvoiceIN(iih); if (pjvh.TemporaryNo == 0) { MessageBox.Show("PJV Not prepared"); return; } txtTemporarryNo.Text = pjvh.TemporaryNo.ToString(); dtTempDate.Value = pjvh.TemporaryDate; txtJournalNo.Text = pjvh.JournalNo.ToString(); dtJournalDate.Value = pjvh.JournalDate; txtINVTempNo.Text = pjvh.InvTempNo.ToString(); dtINVTempDate.Value = pjvh.InvTempDate; txtnarration.Text = pjvh.Narration.ToString(); List <PJVDetail> PJVDetail = PJVDB.getPJVDetail(pjvh); grdPRDetail.Rows.Clear(); int i = 0; decimal totCredit = 0; decimal totDebit = 0; foreach (PJVDetail vd in PJVDetail) { AddPRDetailRow(); grdPRDetail.Rows[i].Cells["AccountCode"].Value = vd.AccountCode; grdPRDetail.Rows[i].Cells["AccountName"].Value = vd.AccountName; grdPRDetail.Rows[i].Cells["AmountDebit"].Value = vd.AmountDebit; totDebit = totDebit + vd.AmountDebit; grdPRDetail.Rows[i].Cells["AmountCredit"].Value = vd.AmountCredit; totCredit = totCredit + vd.AmountCredit; grdPRDetail.Rows[i].Cells["PartyCode"].Value = vd.SLCode; grdPRDetail.Rows[i].Cells["PartyName"].Value = vd.SLName; grdPRDetail.Rows[i].Cells["gSLType"].Value = vd.SLType; i++; } txtTotalCreditAmnt.Text = totCredit.ToString(); txtTotalDebitAmnt.Text = totDebit.ToString(); txtAmountInWords.Text = NumberToString.convert(txtTotalDebitAmnt.Text); } else if (JVdocID == "SJV") { invoiceoutheader ioh = new invoiceoutheader(); ioh.DocumentID = InvDociD; ioh.TemporaryNo = InvTemporaryNo; ioh.TemporaryDate = InvTemporaryDate; SJVHeader sjvh = SJVDB.getSJVHeaderPerInvoiceOut(ioh); if (sjvh.TemporaryNo == 0) { MessageBox.Show("SJV Not prepared"); return; } txtTemporarryNo.Text = sjvh.TemporaryNo.ToString(); dtTempDate.Value = sjvh.TemporaryDate; txtJournalNo.Text = sjvh.JournalNo.ToString(); dtJournalDate.Value = sjvh.JournalDate; txtINVTempNo.Text = sjvh.InvTempNo.ToString(); dtINVTempDate.Value = sjvh.InvTempDate; txtnarration.Text = sjvh.Narration.ToString(); List <SJVDetail> SJVdetail = SJVDB.getSJVDetail(sjvh); grdPRDetail.Rows.Clear(); int i = 0; decimal totCredit = 0; decimal totDebit = 0; foreach (SJVDetail vd in SJVdetail) { AddPRDetailRow(); grdPRDetail.Rows[i].Cells["AccountCode"].Value = vd.AccountCode; grdPRDetail.Rows[i].Cells["AccountName"].Value = vd.AccountName; grdPRDetail.Rows[i].Cells["AmountDebit"].Value = vd.AmountDebit; totDebit = totDebit + vd.AmountDebit; grdPRDetail.Rows[i].Cells["AmountCredit"].Value = vd.AmountCredit; totCredit = totCredit + vd.AmountCredit; grdPRDetail.Rows[i].Cells["PartyCode"].Value = vd.SLCode; grdPRDetail.Rows[i].Cells["PartyName"].Value = vd.SLName; grdPRDetail.Rows[i].Cells["gSLType"].Value = vd.SLType; i++; } txtTotalCreditAmnt.Text = totCredit.ToString(); txtTotalDebitAmnt.Text = totDebit.ToString(); txtAmountInWords.Text = NumberToString.convert(txtTotalDebitAmnt.Text); } } catch (Exception ex) { MessageBox.Show("Error in showing details"); } }