protected void Load_Report() { iBiz.FinPro.Transactions.Reports bReport = new iBiz.FinPro.Transactions.Reports(); DateTime?fromDate = null; DateTime?toDate = null; if (radFromDate.SelectedDate.HasValue) { fromDate = radFromDate.SelectedDate.Value; } if (radToDate.SelectedDate.HasValue) { toDate = radToDate.SelectedDate.Value; } wucDataPager.maxPageShow = 100; wucDataPager.pageSize = 15; wucDataPager.showLastPages = false; int recordNoFrom = (wucDataPager.pageSize * wucDataPager.currentPage) - wucDataPager.pageSize; int recordNoTo = recordNoFrom + wucDataPager.pageSize; int maxRows = bReport.MaxJournalRows(fromDate, toDate, Convert.ToBoolean(isOfficial), recordNoFrom, recordNoTo); wucDataPager.maxRows = maxRows; lvGrid.DataSource = bReport.Journal_Vochars(fromDate, toDate, Convert.ToBoolean(isOfficial), recordNoFrom, recordNoTo); lvGrid.DataBind(); ////// Total Rows //IDataReader idr = bReport.Journal_Vochars(fromDate, toDate, Convert.ToBoolean(sysIndex)); //double totalDebit = 0; //double totalCredit = 0; //if (idr != null) //{ // while (idr.Read()) // { // totalCredit += Convert.ToDouble(idr["credit"]); // totalDebit += Convert.ToDouble(idr["debit"]); // } //} //ltrTotalDebit.Text = totalDebit.ToString(); //ltrTotalCredit.Text = totalCredit.ToString(); }
protected string Get_LineChart_Data() { iBiz.FinPro.Accounts bAcc = new iBiz.FinPro.Accounts(); iBiz.FinPro.Accounts.objAccount objAccount; iBiz.FinPro.Transactions.Reports bReports = new iBiz.FinPro.Transactions.Reports(); string accountIDs = iBiz.FinPro.Statics.Dashboard_LineChart_Account; string[] accountIdArr = accountIDs.Split(','); string rt = ""; // "{ name: \"Pakistan\", data: [3.907, 7.943, 7.848, 9.284, 9.263, 9.801, 3.890, 8.238, 9.552, 6.855,] }, "; for (int i = 0; i < accountIdArr.Length; i++) { int accountId = Convert.ToInt32(accountIdArr[i]); objAccount = new iBiz.FinPro.Accounts.objAccount(); objAccount = bAcc.Select(accountId); if (objAccount != null) { string dataString = ""; DateTime currentDate = DateTime.Now; for (int j = 11; j >= 0; j--) { DateTime tempDate = currentDate.AddMonths(j * -1); DateTime startDate = Convert.ToDateTime(tempDate.Month.ToString() + "/1/" + tempDate.Year.ToString()); DateTime endDate = Convert.ToDateTime(tempDate.Month.ToString() + "/" + DateTime.DaysInMonth(tempDate.Year, tempDate.Month).ToString() + "/" + tempDate.Year.ToString()); string str = currentDate.AddMonths(i * -1).ToString("MMM, yyyy"); string data = bReports.Account_Period_Sum(objAccount.accountID, startDate, endDate, Convert.ToBoolean(sysIndex)).ToString(); dataString += "[" + data + ", '" + str + "']" + ","; } rt += "{ name: \"" + objAccount.accountTitle + "\", data: [ " + dataString + " ] }, "; } } return(rt); }
protected void Load_Report() { iBiz.FinPro.Transactions.Reports bReport = new iBiz.FinPro.Transactions.Reports(); DateTime?fromDate = null; DateTime?toDate = null; if (tbFromDate.Text.Trim().Length == 0) { } else { fromDate = Convert.ToDateTime(tbFromDate.Text.Trim()); } if (tbToDate.Text.Trim().Length == 0) { } else { toDate = Convert.ToDateTime(tbToDate.Text.Trim()); } lvGrid.DataSource = bReport.Trial_Balance(fromDate, toDate, Convert.ToBoolean(isOfficial)); lvGrid.DataBind(); IDataReader idr = bReport.Trial_Balance(fromDate, toDate, Convert.ToBoolean(isOfficial)); decimal totalDebit = 0; decimal totalCredit = 0; if (idr != null) { while (idr.Read()) { totalCredit += Convert.ToDecimal(idr["credit"]); totalDebit += Convert.ToDecimal(idr["debit"]); } } ltrTotalDebit.Text = Difference_Amount(totalDebit); ltrTotalCredit.Text = Difference_Amount(totalCredit); }
protected void Load_Report() { ltrOpeningBalance.Text = "0"; iBiz.FinPro.Transactions.Reports bReport = new iBiz.FinPro.Transactions.Reports(); int accountID = Convert.ToInt32(ddlAccounts.SelectedValue); if (!string.IsNullOrEmpty(Request.QueryString["id"])) { accountID = Convert.ToInt32(Request.QueryString["id"]); ddlAccounts.SelectedValue = accountID.ToString(); } int deptId = ddlDepartment.SelectedValue != null?Convert.ToInt32(ddlDepartment.SelectedValue) : 0; DateTime?nullDate = null; //tbFromDate_CalendarExtender.SelectedDate = tbFromDate.Text.Trim().Length > 0 ? Convert.ToDateTime(tbFromDate.Text) : nullDate; //tbToDate_CalendarExtender.SelectedDate = tbToDate.Text.Trim().Length > 0 ? Convert.ToDateTime(tbToDate.Text) : nullDate; DateTime?fromDate = tbFromDate.Text.Trim().Length > 0 ? Convert.ToDateTime(tbFromDate.Text) : nullDate; DateTime?toDate = tbToDate.Text.Trim().Length > 0 ? Convert.ToDateTime(tbToDate.Text) : nullDate; //if (radFromDate.SelectedDate.HasValue) //{ // fromDate = radFromDate.SelectedDate.Value; //} //if (radToDate.SelectedDate.HasValue) //{ // toDate = radToDate.SelectedDate.Value; //} lvGrid.DataSource = bReport.Ledger(accountID, fromDate, toDate, Convert.ToBoolean(sysIndex), deptId); lvGrid.DataBind(); IDataReader idr = bReport.Ledger(accountID, fromDate, toDate, Convert.ToBoolean(sysIndex), deptId); decimal totalDebit = 0; decimal totalCredit = 0; if (idr != null) { while (idr.Read()) { totalCredit += Convert.ToDecimal(idr["CreditAmount"]); totalDebit += Convert.ToDecimal(idr["DebitAmount"]); } } if (!fromDate.HasValue) { fromDate = DateTime.Now.AddYears(-2); } iBiz.FinPro.Transactions.Reports bTransReport = new iBiz.FinPro.Transactions.Reports(); ltrOpeningBalance.Text = bTransReport.Get_Openning_Balance(accountID, fromDate.Value, deptId).ToString("0"); ltrTotalDebit.Text = Comma_Amount(totalDebit); ltrTotalCredit.Text = Comma_Amount(totalCredit); hlPrintable.NavigateUrl = string.Format("~/FinApp/RShow_Ledger.aspx?accId={0}&from={1}&to={2}&deptId={3}", accountID, fromDate.HasValue ? fromDate.Value.ToString("MM-dd-yyyy") : "", toDate.HasValue ? toDate.Value.ToString("MM-dd-yyyy") : "", deptId.ToString()); }