/// <summary> /// Gets the report S23 h. /// </summary> /// <param name="reportParameter">The report parameter.</param> /// <param name="oRsTool">The o rs tool.</param> /// <returns>IList<S23HModel>.</returns> public IList <S23HModel> GetReportS23H(ReportParameter reportParameter, ReportSharpHelper oRsTool) { IList <S23HModel> reports = null; GlobalVariable.IsDisplayNewLicenseInfo = false; if (!oRsTool.IsRefresh) { using (var frmParam = new FrmS22H(true, false)) { frmParam.Text = @"Bảng tổng hợp chi tiết nguyên liệu vật liệu, CCDC, SPHH"; if (frmParam.ShowDialog() == DialogResult.OK) { var fromDate = DateTime.Parse(frmParam.FromDate); var toDate = DateTime.Parse(frmParam.ToDate); if (!oRsTool.Parameters.ContainsKey("FromDate")) { oRsTool.Parameters.Add("FromDate", fromDate.ToShortDateString()); } if (!oRsTool.Parameters.ContainsKey("ToDate")) { oRsTool.Parameters.Add("ToDate", toDate.ToShortDateString()); } string _InventoryItem = frmParam.InventoryItemIds == "" ? frmParam.AllInventoryItemIds : frmParam.InventoryItemIds; reports = Model.GetReportS23H(fromDate, toDate, _InventoryItem, frmParam.AccountNumber); } } } return(reports); }
/// <summary> /// Reports the S11 h. /// </summary> /// <param name="reportParameter">The report parameter.</param> /// <param name="oRsTool">The o rs tool.</param> /// <returns>IList<S22HModel>.</returns> public IList <S22HModel> GetReportS22H(ReportParameter reportParameter, ReportSharpHelper oRsTool) { IList <S22HModel> reports = null; GlobalVariable.IsDisplayNewLicenseInfo = false; if (!oRsTool.IsRefresh) { using (var frmParam = new FrmS22H(true, true)) { frmParam.Text = @"Sổ chi tiết nguyên liệu, vật liệu, CCDC"; if (frmParam.ShowDialog() == DialogResult.OK) { var fromDate = DateTime.Parse(frmParam.FromDate); var toDate = DateTime.Parse(frmParam.ToDate); if (!oRsTool.Parameters.ContainsKey("isGroupByInventoryItem")) { oRsTool.Parameters.Add("isGroupByInventoryItem", frmParam.isGroupByInventoryItem); } if (!oRsTool.Parameters.ContainsKey("FromDate")) { oRsTool.Parameters.Add("FromDate", fromDate.ToShortDateString()); } if (!oRsTool.Parameters.ContainsKey("ToDate")) { oRsTool.Parameters.Add("ToDate", toDate.ToShortDateString()); } string _InventoryItem = frmParam.InventoryItemIds == "" ? frmParam.AllInventoryItemIds : frmParam.InventoryItemIds; reports = Model.GetReportS22H(fromDate, toDate, frmParam.StockId, _InventoryItem, frmParam.AccountNumber, GlobalVariable.AmountTypeViewReport, GlobalVariable.CurrencyViewReport); // check để group theo đối tượng if (frmParam.isGroupByInventoryItem) { foreach (var report in reports) { report.GroupName = report.AccountNumber + report.StockCode + report.InventoryItemCode; report.GroupDetail = "1"; } } else { foreach (var report in reports) { report.GroupName = report.AccountNumber + report.StockCode; report.GroupDetail = report.InventoryItemCode; } } } } } return(reports); }
/// <summary> /// Gets the report estimate detail statement. /// </summary> /// <param name="frmParent">The FRM parent.</param> /// <param name="commonVariable">The common variable.</param> /// <param name="oRsTool">The o rs tool.</param> /// <returns></returns> public List <EstimateDetailStatementModel> GetReportEstimateDetailStatement(XtraForm frmParent, GlobalVariable commonVariable, ReportSharpHelper oRsTool) { var estimateDetailStatementModel = new List <EstimateDetailStatementModel>(); if (!oRsTool.IsRefresh) { using (var frmXtraEstimateDetailStatement = new FrmXtraEstimateDetailStatement()) { frmXtraEstimateDetailStatement.ReporDate = _globalVariable.PostedDate; if (frmXtraEstimateDetailStatement.ShowDialog() == DialogResult.OK) { var yearOfEstimate = frmXtraEstimateDetailStatement.YearOfEstimate; var generalDescription = frmXtraEstimateDetailStatement.GeneralDescription; var employeeLeasingDescription = frmXtraEstimateDetailStatement.EmployeeLeasingDescription; var employeeContractDescription = frmXtraEstimateDetailStatement.EmployeeContractDescription; var buildingOfFixedAssetDescription = frmXtraEstimateDetailStatement.BuildingOfFixedAssetDescription; var descriptionForBuilding = frmXtraEstimateDetailStatement.DescriptionForBuilding; var carDescription = frmXtraEstimateDetailStatement.CarDescription; var inventoryDescription = frmXtraEstimateDetailStatement.InventoryDescription; var partC = frmXtraEstimateDetailStatement.PartC; var partC1 = frmXtraEstimateDetailStatement.PartC1; var reportDate = frmXtraEstimateDetailStatement.ReporDate; oRsTool.Parameters.Add("YearOfEstimate", yearOfEstimate); oRsTool.Parameters.Add("PartC", partC); oRsTool.Parameters.Add("PartC1", partC1); oRsTool.Parameters.Add("GeneralDescription", generalDescription); oRsTool.Parameters.Add("EmployeeLeasingDescription", employeeLeasingDescription); oRsTool.Parameters.Add("EmployeeContractDescription", employeeContractDescription); oRsTool.Parameters.Add("BuildingOfFixedAssetDescription", buildingOfFixedAssetDescription); oRsTool.Parameters.Add("DescriptionForBuilding", descriptionForBuilding); oRsTool.Parameters.Add("CarDescription", carDescription); oRsTool.Parameters.Add("InventoryDescription", inventoryDescription); oRsTool.Parameters.Add("ReportDate", reportDate); oRsTool.Parameters.Add("CompanyProvince", _globalVariable.CompanyProvince); estimateDetailStatementModel.Add(Model.GetEstimateDetailStatement(yearOfEstimate, false)); } else { estimateDetailStatementModel = null; } } } else { var yearOfEstimate = short.Parse(oRsTool.Parameters["YearOfEstimate"].ToString()); estimateDetailStatementModel.Add(Model.GetEstimateDetailStatement(yearOfEstimate, false)); } return(estimateDetailStatementModel); }
/// <summary> /// Gets the report S26 h. /// </summary> /// <param name="reportParameter">The report parameter.</param> /// <param name="oRsTool">The o rs tool.</param> /// <returns>IList<S26HModel>.</returns> public IList <S26HModel> GetReportS26H(ReportParameter reportParameter, ReportSharpHelper oRsTool) { IList <S26HModel> reports = null; GlobalVariable.IsDisplayNewLicenseInfo = false; if (!oRsTool.IsRefresh) { using (var frmParam = new FrmS26H()) { frmParam.Text = @"S26-H: Sổ theo dõi CCDC tại nơi sử dụng"; if (frmParam.ShowDialog() == DialogResult.OK) { var fromDate = DateTime.Parse(frmParam.FromDate); var toDate = DateTime.Parse(frmParam.ToDate); if (!oRsTool.Parameters.ContainsKey("FromDate")) { oRsTool.Parameters.Add("FromDate", fromDate.ToShortDateString()); } if (!oRsTool.Parameters.ContainsKey("ToDate")) { oRsTool.Parameters.Add("ToDate", toDate.ToShortDateString()); } if (!oRsTool.Parameters.ContainsKey("ReportDate")) { oRsTool.Parameters.Add("ReportDate", GlobalVariable.PostedDate); } if (!oRsTool.Parameters.ContainsKey("CompanyProvince")) { oRsTool.Parameters.Add("CompanyProvince", string.IsNullOrEmpty(GlobalVariable.CompanyProvince) ? string.Empty : GlobalVariable.CompanyProvince); } if (!oRsTool.Parameters.ContainsKey("GroupByFACategory")) { oRsTool.Parameters.Add("GroupByFACategory", frmParam.GroupByFACategory); } reports = Model.GetReportS26H(fromDate, toDate, frmParam.InventoryItemCategoryId, frmParam.InventoryIDs, GlobalVariable.AmountTypeViewReport, GlobalVariable.CurrencyViewReport); } } } return(reports); }
/// <summary> /// Reports the S21 h. /// </summary> /// <param name="reportParameter">The report parameter.</param> /// <param name="oRsTool">The o rs tool.</param> /// <returns>IList<S22HModel>.</returns> public IList <S21HModel> GetReportS21H(ReportParameter reportParameter, ReportSharpHelper oRsTool) { IList <S21HModel> reports = null; GlobalVariable.IsDisplayNewLicenseInfo = false; if (!oRsTool.IsRefresh) { using (var frmParam = new FrmS21H(false, true)) { frmParam.Text = @"Sổ kho"; if (frmParam.ShowDialog() == DialogResult.OK) { var fromDate = DateTime.Parse(frmParam.FromDate); var toDate = DateTime.Parse(frmParam.ToDate); if (!oRsTool.Parameters.ContainsKey("FromDate")) { oRsTool.Parameters.Add("FromDate", fromDate.ToShortDateString()); } if (!oRsTool.Parameters.ContainsKey("ToDate")) { oRsTool.Parameters.Add("ToDate", toDate.ToShortDateString()); } if (!oRsTool.Parameters.ContainsKey("ReportDate")) { oRsTool.Parameters.Add("ReportDate", GlobalVariable.PostedDate); } if (!oRsTool.Parameters.ContainsKey("CompanyProvince")) { oRsTool.Parameters.Add("CompanyProvince", string.IsNullOrEmpty(GlobalVariable.CompanyProvince) ? string.Empty : GlobalVariable.CompanyProvince); } if (!oRsTool.Parameters.ContainsKey("IsDetailMonth")) { oRsTool.Parameters.Add("IsDetailMonth", frmParam.IsDetailMonth); } reports = Model.GetReportS21H(fromDate, toDate, frmParam.StockId, frmParam.InventoryIDs, frmParam.IsDetailMonth); } } } return(reports); }
/// <summary> /// Initializes a new instance of the <see cref="ReportHelper" /> class. /// </summary> public ReportHelper() { //ReportSharpTool = new ReportSharpHelper(); //var a = new NumberFormatInfo(); //// Định dạng số tiền trên report //ReportSharpTool.RssObject.Nfi.CurrencyDecimalDigits = GlobalVariable.CurrencyDecimalDigitsInReport; try { //var dbOptionHelper = new GlobalVariable(); System.Globalization.NumberFormatInfo Nfi = Thread.CurrentThread.CurrentCulture.NumberFormat; Nfi.CurrencyNegativePattern = Convert.ToInt32(GlobalVariable.CurrencyNegativePatternInReport); //Nfi.NumberDecimalDigits = Convert.ToInt32(GlobalVariable.ExchangeRateDecimalDigits); Nfi.NumberDecimalDigits = Convert.ToInt32(GlobalVariable.NumberDecimalDigits); Nfi.CurrencyDecimalDigits = Convert.ToInt32(GlobalVariable.CurrencyDecimalDigits); ReportSharpTool = new ReportSharpHelper(Nfi); } catch { ReportSharpTool = new ReportSharpHelper(); } }
public IList <S11HDetailModel> ReportS11HDetail(ReportParameter reportParameter, ReportSharpHelper oRsTool) { IList <S11HDetailModel> reports = null; GlobalVariable.IsDisplayNewLicenseInfo = false; //var amountType = GlobalVariable.AmountTypeViewReport; //var currencyCode = GlobalVariable.CurrencyViewReport; //var isTotalBandInNewPage = false; if (!oRsTool.IsRefresh) { using (var frmParam = new FrmS11HDetail()) { frmParam.Text = @"S11-H: Sổ chi tiết tiền mặt"; if (frmParam.ShowDialog() == DialogResult.OK) { var startDate = DateTime.Parse(frmParam.StartDate); var fromDate = DateTime.Parse(frmParam.FromDate); var toDate = DateTime.Parse(frmParam.ToDate); var isbudgetchapter = ""; if (frmParam.IsSummaryBudgetChapter != true) { isbudgetchapter = "0"; } else { isbudgetchapter = "1"; } if (!oRsTool.Parameters.ContainsKey("FromDate")) { oRsTool.Parameters.Add("FromDate", fromDate.ToShortDateString()); } if (!oRsTool.Parameters.ContainsKey("ToDate")) { oRsTool.Parameters.Add("ToDate", toDate.ToShortDateString()); } if (!oRsTool.Parameters.ContainsKey("ReportDate")) { oRsTool.Parameters.Add("ReportDate", GlobalVariable.PostedDate); } if (!oRsTool.Parameters.ContainsKey("CompanyProvince")) { oRsTool.Parameters.Add("CompanyProvince", string.IsNullOrEmpty(GlobalVariable.CompanyProvince) ? string.Empty : GlobalVariable.CompanyProvince); } if (!oRsTool.Parameters.ContainsKey("IsBudgetChapter")) { oRsTool.Parameters.Add("IsBudgetChapter", isbudgetchapter); } reports = Model.ReportS11HDetail(startDate, fromDate, toDate, frmParam.BudgetChapterCode, frmParam.BudgetSubKindItemCode, frmParam.AccountNumber, frmParam.IsSummaryBudgetChapter, frmParam.IsSummaryBudgetSubKindItem); } } } return(reports); }
/// <summary> /// Gets the fixed asset category list. /// </summary> /// <param name="frmParent">The FRM parent.</param> /// <param name="commonVariable">The common variable.</param> /// <param name="oRsTool">The o rs tool.</param> /// <returns></returns> public IList <BudgetCategoryModel> GetBudgetCategoryList(XtraForm frmParent, Session.GlobalVariable commonVariable, ReportSharpHelper oRsTool) { return(Model.GetBudgetCategories()); }
/// <summary> /// Gets the budget chapter list. /// </summary> /// <param name="frmParent">The FRM parent.</param> /// <param name="commonVariable">The common variable.</param> /// <param name="oRsTool">The o rs tool.</param> /// <returns></returns> public IList <InventoryItemModel> GetInventoryItemList(XtraForm frmParent, Session.GlobalVariable commonVariable, ReportSharpHelper oRsTool) { return(Model.GetInventoryItems()); }
/// <summary> /// Gets the budget chapter list. /// </summary> /// <param name="frmParent">The FRM parent.</param> /// <param name="commonVariable">The common variable.</param> /// <param name="oRsTool">The o rs tool.</param> /// <returns></returns> public IList <CustomerModel> GetCustomerList(XtraForm frmParent, Session.GlobalVariable commonVariable, ReportSharpHelper oRsTool) { return(Model.GetCustomers()); }
public IList <CapitalAllocateModel> GetCapitalAllocateList(XtraForm frmParent, Session.GlobalVariable commonVariable, ReportSharpHelper oRsTool) { return(Model.GetCapitalAllocates()); }
/// <summary> /// Sổ chi Cái tài khoản /// Gets the report S03 bh. /// LinhMC thêm code kiểm tra nếu là xem báo cáo bằng cách truy xuất từ báo cáo khác thì không cần mở form lấy tham số báo cáo /// </summary> /// <param name="frmParent">The FRM parent.</param> /// <param name="commonVariable">The common variable.</param> /// <param name="oRsTool">The o rs tool.</param> /// <returns></returns> public IList <S03BHModel> GetReportS03BH(XtraForm frmParent, GlobalVariable commonVariable, ReportSharpHelper oRsTool) { IList <S03BHModel> list = null; var amountType = GlobalVariable.AmountTypeViewReport; var currencyCode = GlobalVariable.CurrencyViewReport; var isTotalBandInNewPage = false; if (commonVariable.IsDrillDownReport) { GlobalVariable.FromDate = DateTime.Parse(commonVariable.DrillDownParram[9].ToString()); GlobalVariable.ToDate = DateTime.Parse(commonVariable.DrillDownParram[10].ToString()); var accountNumber = commonVariable.DrillDownParram[4].ToString(); const string correspondingAccountNumber = ""; amountType = int.Parse(commonVariable.DrillDownParram[2].ToString()); currencyCode = commonVariable.DrillDownParram[3].ToString(); list = Model.GetS03BHWithStoreProdure(commonVariable.ReportList.ProcedureName, GlobalVariable.FromDate.ToShortDateString(), GlobalVariable.ToDate.ToShortDateString(), amountType, accountNumber, correspondingAccountNumber, currencyCode); var accountName = Model.GetAccountByCode(accountNumber).AccountName; if (!oRsTool.Parameters.ContainsKey("Account")) { oRsTool.Parameters.Add("Account", "Tài khoản: " + accountNumber + " - " + accountName); } if (!oRsTool.Parameters.ContainsKey("AccountNumber")) { oRsTool.Parameters.Add("AccountNumber", accountNumber); } if (!oRsTool.Parameters.ContainsKey("CorrespondingAccountNumber")) { oRsTool.Parameters.Add("CorrespondingAccountNumber", correspondingAccountNumber); } } else { if (!oRsTool.IsRefresh) { using (var frmParam = new FrmS03BH()) { frmParam.Text = @"Sổ cái"; if (frmParam.ShowDialog() == DialogResult.OK) { GlobalVariable.FromDate = DateTime.Parse(frmParam.FromDate); GlobalVariable.ToDate = DateTime.Parse(frmParam.ToDate); isTotalBandInNewPage = frmParam.IsTotalBandInNewPage; var accountNumber = frmParam.AccountCode; if (!oRsTool.Parameters.ContainsKey("Account")) { oRsTool.Parameters.Add("Account", "Tài khoản: " + accountNumber + " - " + frmParam.AccountName); } if (!oRsTool.Parameters.ContainsKey("AccountNumber")) { oRsTool.Parameters.Add("AccountNumber", accountNumber); } var correspondingAccountNumber = frmParam.CorrespondingAccountNumber; if (!oRsTool.Parameters.ContainsKey("CorrespondingAccountNumber")) { oRsTool.Parameters.Add("CorrespondingAccountNumber", correspondingAccountNumber); } if (!oRsTool.Parameters.ContainsKey("IsTotalBandInNewPage")) { oRsTool.Parameters.Add("IsTotalBandInNewPage", isTotalBandInNewPage); } list = Model.GetS03BHWithStoreProdure(commonVariable.ReportList.ProcedureName, GlobalVariable.FromDate.ToShortDateString(), GlobalVariable.ToDate.ToShortDateString(), amountType, accountNumber, correspondingAccountNumber, currencyCode); } } } else { var accountNumber = oRsTool.Parameters["AccountNumber"].ToString(); var correspondingAccountNumber = oRsTool.Parameters["CorrespondingAccountNumber"].ToString(); list = Model.GetS03BHWithStoreProdure(commonVariable.ReportList.ProcedureName, GlobalVariable.FromDate.ToShortDateString(), GlobalVariable.ToDate.ToShortDateString(), amountType, accountNumber, correspondingAccountNumber, currencyCode); } } if (list != null && list.Count > 0) { if (!oRsTool.Parameters.ContainsKey("Year")) { oRsTool.Parameters.Add("Year", "Năm:" + GlobalVariable.ToDate.Year); } if (!oRsTool.Parameters.ContainsKey("CurrencyCodeUnit")) { oRsTool.Parameters.Add("CurrencyCodeUnit", "Đơn vị tính " + (amountType == 2 ? "(nguyên tệ): " : "(tính quy đổi): ") + currencyCode); } if (!oRsTool.Parameters.ContainsKey("FromDate")) { oRsTool.Parameters.Add("FromDate", GlobalVariable.FromDate.ToShortDateString()); } if (!oRsTool.Parameters.ContainsKey("ToDate")) { oRsTool.Parameters.Add("ToDate", GlobalVariable.ToDate.ToShortDateString()); } if (!oRsTool.Parameters.ContainsKey("Province")) { oRsTool.Parameters.Add("Province", _globalVariable.CompanyProvince); } if (!oRsTool.Parameters.ContainsKey("ReportDate")) { oRsTool.Parameters.Add("ReportDate", _globalVariable.PostedDate); } } return(list); }
/// <summary> /// Gets the report C30 bb. /// </summary> /// <param name="frmParent">The FRM parent.</param> /// <param name="commonVariable">The common variable.</param> /// <param name="oRsTool">The o rs tool.</param> /// <returns></returns> public IList <C30BBModel> GetReportC30BB(XtraForm frmParent, GlobalVariable commonVariable, ReportSharpHelper oRsTool) { IList <C30BBModel> list = new List <C30BBModel>(); using (var frmParam = new FrmC30BB2()) { frmParam.Text = @"In Phiếu thu"; if (frmParam.ShowDialog() == DialogResult.OK) { var currencyCode = GlobalVariable.CurrencyViewReport; list = frmParam.C30BBList; list = list.Where(x => x.IsSelect).ToList(); oRsTool.Parameters.Add("CurrencyCodeUnit", currencyCode); } } if (list != null && list.Count > 0) { string exchangeRate = Math.Round(list[0].ExchangeRate, int.Parse(commonVariable.ExchangeRateDecimalDigits)).ToString("G", CultureInfo.CreateSpecificCulture("fr-FR")); if (!oRsTool.Parameters.ContainsKey("ExchangeRate10")) { oRsTool.Parameters.Add("ExchangeRate10", exchangeRate); } return(list); } return(null); }
/// <summary> /// Gets the cash report S11 h. /// </summary> /// <param name="frmParent">The FRM parent.</param> /// <param name="commonVariable">The common variable.</param> /// <param name="oRsTool">The o rs tool.</param> /// <returns></returns> public IList <CashReportModel> GetCashReportS11H(XtraForm frmParent, GlobalVariable commonVariable, ReportSharpHelper oRsTool) { IList <CashReportModel> list = null; var amountType = GlobalVariable.AmountTypeViewReport; var currencyCode = GlobalVariable.CurrencyViewReport; var isTotalBandInNewPage = false; if (!oRsTool.IsRefresh) { using (var frmParam = new FrmS11H()) { frmParam.Text = @"Sổ chi quỹ tiền mặt"; if (frmParam.ShowDialog() == DialogResult.OK) { GlobalVariable.FromDate = DateTime.Parse(frmParam.FromDate); GlobalVariable.ToDate = DateTime.Parse(frmParam.ToDate); isTotalBandInNewPage = frmParam.IsTotalBandInNewPage; var accountNumber = frmParam.AccountCode; if (!oRsTool.Parameters.ContainsKey("Account")) { oRsTool.Parameters.Add("Account", "Tài khoản: " + accountNumber + " - " + frmParam.AccountName); } if (!oRsTool.Parameters.ContainsKey("AccountNumber")) { oRsTool.Parameters.Add("AccountNumber", accountNumber); } list = Model.GetCashS12HWithStoreProdure(commonVariable.ReportList.ProcedureName, GlobalVariable.FromDate.ToShortDateString(), GlobalVariable.ToDate.ToShortDateString(), amountType, accountNumber, currencyCode, false, null); } } } else { var accountNumber = oRsTool.Parameters["AccountNumber"].ToString(); list = Model.GetCashS12HWithStoreProdure(commonVariable.ReportList.ProcedureName, GlobalVariable.FromDate.ToShortDateString(), GlobalVariable.ToDate.ToShortDateString(), amountType, accountNumber, currencyCode, false, null); } if (list != null && list.Count > 0) { if (!oRsTool.Parameters.ContainsKey("CurrencyCodeUnit")) { oRsTool.Parameters.Add("CurrencyCodeUnit", "Đơn vị tính " + (amountType == 2 ? "(nguyên tệ): " : "(quy đổi): ") + currencyCode); } if (!oRsTool.Parameters.ContainsKey("Year")) { oRsTool.Parameters.Add("Year", "Năm:" + GlobalVariable.ToDate.Year); } if (!oRsTool.Parameters.ContainsKey("FromDate")) { oRsTool.Parameters.Add("FromDate", GlobalVariable.FromDate.ToShortDateString()); } if (!oRsTool.Parameters.ContainsKey("ToDate")) { oRsTool.Parameters.Add("ToDate", GlobalVariable.ToDate.ToShortDateString()); } if (!oRsTool.Parameters.ContainsKey("Province")) { oRsTool.Parameters.Add("Province", _globalVariable.CompanyProvince); } if (!oRsTool.Parameters.ContainsKey("ReportDate")) { oRsTool.Parameters.Add("ReportDate", _globalVariable.PostedDate); } // ThoDD add trạng thái chuyển sang trang sau if (!oRsTool.Parameters.ContainsKey("IsTotalBandInNewPage")) { oRsTool.Parameters.Add("IsTotalBandInNewPage", isTotalBandInNewPage); } //làm Footer để có cấu trúc sang trang if (!oRsTool.Parameters.ContainsKey("footClosing")) { oRsTool.Parameters.Add("footClosing", list[list.Count - 1].RestAmount); } list.RemoveAt(list.Count - 1); if (!oRsTool.Parameters.ContainsKey("footReceipt")) { oRsTool.Parameters.Add("footReceipt", list[list.Count - 1].ReceiptAmount); } if (!oRsTool.Parameters.ContainsKey("footPay")) { oRsTool.Parameters.Add("footPay", list[list.Count - 1].PayAmount); } if (!oRsTool.Parameters.ContainsKey("footExist")) { oRsTool.Parameters.Add("footExist", list[list.Count - 1].RestAmount); } //list.RemoveAt(list.Count - 1); //list.RemoveAt(list.Count - 1); } return(list); }
public IList <ReportB01CIModel> GetReportB01CI(XtraForm frmParent, GlobalVariable commonVariable, ReportSharpHelper oRsTool) { IList <ReportB01CIModel> lstResult = new List <ReportB01CIModel>(); if (!oRsTool.IsRefresh) { using (var frmParam = new FrmB01CI()) { if (frmParam.ShowDialog() == DialogResult.OK) { lstResult = Model.GetB01CIWithStoreProdure(commonVariable.ReportList.ProcedureName, frmParam.FromDate, frmParam.ToDate); if (lstResult != null) { decimal defaultExchange = 1; if (!oRsTool.Parameters.ContainsKey("PostedDate")) { oRsTool.Parameters.Add("PostedDate", Convert.ToDateTime(_globalVariable.PostedDate).ToString("dd/MM/yyyy")); } if (!oRsTool.Parameters.ContainsKey("FromDate")) { oRsTool.Parameters.Add("FromDate", frmParam.FromDate.ToString("dd/MM/yyyy")); } if (!oRsTool.Parameters.ContainsKey("ToDate")) { oRsTool.Parameters.Add("ToDate", frmParam.ToDate.ToString("dd/MM/yyyy")); } if (!oRsTool.Parameters.ContainsKey("PeriodName")) { oRsTool.Parameters.Add("PeriodName", frmParam.PeriodName); } if (!oRsTool.Parameters.ContainsKey("ExchangeRateLastYear")) { oRsTool.Parameters.Add("ExchangeRateLastYear", lstResult.FirstOrDefault().ExchangeRateLastYear == defaultExchange ? 0 : lstResult.FirstOrDefault().ExchangeRateLastYear); } if (!oRsTool.Parameters.ContainsKey("ExchangeRateThisYear")) { oRsTool.Parameters.Add("ExchangeRateThisYear", lstResult.FirstOrDefault().ExchangeRateThisYear == defaultExchange ? 0 : lstResult.FirstOrDefault().ExchangeRateThisYear); } } } else { return(null); } } } return(lstResult); }
/// <summary> /// Gets the budget chapter list. /// </summary> /// <param name="frmParent">The FRM parent.</param> /// <param name="commonVariable">The common variable.</param> /// <param name="oRsTool">The o rs tool.</param> /// <returns></returns> public IList <MergerFundModel> GetMergerFundList(XtraForm frmParent, Session.GlobalVariable commonVariable, ReportSharpHelper oRsTool) { return(Model.GetMergerFunds()); }
/// <summary> /// Gets the budget chapter list. /// </summary> /// <param name="frmParent">The FRM parent.</param> /// <param name="commonVariable">The common variable.</param> /// <param name="oRsTool">The o rs tool.</param> /// <returns></returns> public IList <PlanTemplateListModel> GetPlanTemplateListList(XtraForm frmParent, Session.GlobalVariable commonVariable, ReportSharpHelper oRsTool) { return(Model.GetPlanTemplateLists()); }
/// <summary> /// Sổ chi tiết tài khoản /// </summary> /// <param name="frmParent">The FRM parent.</param> /// <param name="commonVariable">The common variable.</param> /// <param name="oRsTool">The o rs tool.</param> /// <returns></returns> public IList <S33HModel> GetReportS33H(XtraForm frmParent, GlobalVariable commonVariable, ReportSharpHelper oRsTool) { IList <S33HModel> list; var amountType = GlobalVariable.AmountTypeViewReport; var isTotalBandInNewPage = false; if (!oRsTool.IsRefresh) { using (var frmParam = new FrmS33H()) { if (frmParam.ShowDialog() == DialogResult.OK) { string FromDate = DateTime.Parse(frmParam.FromDate).ToShortDateString(); string ToDate = DateTime.Parse(frmParam.ToDate).ToShortDateString(); string whereClause = frmParam.WhereClause; string accountCode = frmParam.AccountCode; string accountName = frmParam.AccountName; string currencyCode = GlobalVariable.CurrencyViewReport; //string currencyCode = frmParam.CurrencyCode; string fixedAssetCode = frmParam.FixedAssetCode; string budgetGroupCode = frmParam.BudgetGroupCode; string departmentCode = frmParam.DepartmentCode; isTotalBandInNewPage = frmParam.IsTotalBandInNewPage; string selectedField = frmParam.SelectedField; string selectedAllValueField = frmParam.SelectedAllValueField; if (amountType == 1) { if (!oRsTool.Parameters.ContainsKey("CurrencyCodeUnit")) { oRsTool.Parameters.Add("CurrencyCodeUnit", "Đơn vị tính (qui đổi): " + currencyCode); } } else { if (!oRsTool.Parameters.ContainsKey("CurrencyCodeUnit")) { oRsTool.Parameters.Add("CurrencyCodeUnit", "Đơn vị tính (nguyên tệ): " + currencyCode); } } if (!oRsTool.Parameters.ContainsKey("EmployeeName")) { oRsTool.Parameters.Add("EmployeeName", frmParam.EmployeeName); } if (!oRsTool.Parameters.ContainsKey("VendorId")) { oRsTool.Parameters.Add("VendorId", frmParam.VendorId); } if (!oRsTool.Parameters.ContainsKey("VendorName")) { oRsTool.Parameters.Add("VendorName", frmParam.VendorName); } if (!oRsTool.Parameters.ContainsKey("AccountingObjectId")) { oRsTool.Parameters.Add("AccountingObjectId", frmParam.AccountingObjectId); } if (!oRsTool.Parameters.ContainsKey("FullName")) { oRsTool.Parameters.Add("FullName", frmParam.FullName); } if (!oRsTool.Parameters.ContainsKey("AccountCode")) { oRsTool.Parameters.Add("AccountCode", "Tên tài khoản: " + accountName + " Số hiệu: " + accountCode); } if (!oRsTool.Parameters.ContainsKey("FromDate")) { oRsTool.Parameters.Add("FromDate", FromDate); } if (!oRsTool.Parameters.ContainsKey("ToDate")) { oRsTool.Parameters.Add("ToDate", ToDate); } // ThoDD add chuyển dòng sang trang sau if (!oRsTool.Parameters.ContainsKey("IsTotalBandInNewPage")) { oRsTool.Parameters.Add("IsTotalBandInNewPage", isTotalBandInNewPage); } /*=== LinhMC add thêm 1 số biến lưu giữ giá trị, để Refresh dữ liệu ===*/ if (!oRsTool.Parameters.ContainsKey("WhereClause")) { oRsTool.Parameters.Add("WhereClause", frmParam.WhereClause); } if (!oRsTool.Parameters.ContainsKey("AccountNumber")) { oRsTool.Parameters.Add("AccountNumber", accountCode); } if (!oRsTool.Parameters.ContainsKey("BudgetGroupCode")) { oRsTool.Parameters.Add("BudgetGroupCode", budgetGroupCode); } if (!oRsTool.Parameters.ContainsKey("FixedAssetCode")) { oRsTool.Parameters.Add("FixedAssetCode", fixedAssetCode); } if (!oRsTool.Parameters.ContainsKey("DepartmentCode")) { oRsTool.Parameters.Add("DepartmentCode", departmentCode); } if (!oRsTool.Parameters.ContainsKey("SelectedField")) { oRsTool.Parameters.Add("SelectedField", frmParam.SelectedField); } if (!oRsTool.Parameters.ContainsKey("SelectedAllValueField")) { oRsTool.Parameters.Add("SelectedAllValueField", frmParam.SelectedAllValueField); } if (!oRsTool.Parameters.ContainsKey("ObjectName")) { oRsTool.Parameters.Add("ObjectName", frmParam.ObjectName); } if (!oRsTool.Parameters.ContainsKey("Province")) { oRsTool.Parameters.Add("Province", _globalVariable.CompanyProvince); } if (!oRsTool.Parameters.ContainsKey("ObjectName")) { oRsTool.Parameters.Add("ObjectName", frmParam.ObjectName); } if (!oRsTool.Parameters.ContainsKey("ReportDate")) { oRsTool.Parameters.Add("ReportDate", _globalVariable.PostedDate); } list = Model.GetS33HWithStoreProdure(commonVariable.ReportList.ProcedureName, accountCode, FromDate, ToDate, currencyCode, budgetGroupCode, fixedAssetCode, departmentCode, amountType, whereClause); if (!oRsTool.Parameters.ContainsKey("ckAccountNumber")) { oRsTool.Parameters.Add("ckAccountNumber", list[list.Count - 1].DebitAmountBalance); } if (!oRsTool.Parameters.ContainsKey("ckCorrAccountNumber")) { oRsTool.Parameters.Add("ckCorrAccountNumber", list[list.Count - 1].CreditAmountBalance); } list.RemoveAt(list.Count - 1); } else { list = null; } } } else { var accountCode = oRsTool.Parameters["AccountNumber"].ToString(); var currencyCode = oRsTool.Parameters["CurrencyCode"].ToString(); var whereClause = oRsTool.Parameters["WhereClause"].ToString(); var budgetGroupCode = oRsTool.Parameters["BudgetGroupCode"].ToString(); var fixedAssetCode = oRsTool.Parameters["FixedAssetCode"].ToString(); var selectedField = oRsTool.Parameters["SelectedField"].ToString(); var selectedAllValueField = oRsTool.Parameters["SelectedAllValueField"].ToString(); string departmentCode = oRsTool.Parameters["DepartmentCode"].ToString(); string fromDate = oRsTool.Parameters["FromDate"].ToString(); string toDate = oRsTool.Parameters["ToDate"].ToString(); list = Model.GetS33HWithStoreProdure(commonVariable.ReportList.ProcedureName, accountCode, fromDate, toDate, currencyCode, budgetGroupCode, fixedAssetCode, departmentCode, amountType, whereClause, selectedField, selectedAllValueField); } return(list); }
/// <summary> /// Gets the budget chapter list. /// </summary> /// <param name="frmParent">The FRM parent.</param> /// <param name="commonVariable">The common variable.</param> /// <param name="oRsTool">The o rs tool.</param> /// <returns></returns> public IList <EmployeeModel> GetEmployeeList(XtraForm frmParent, Session.GlobalVariable commonVariable, ReportSharpHelper oRsTool) { return(Model.GetEmployees()); }
public IList <S05HGroupModel> GetReportS05H(XtraForm frmParent, GlobalVariable commonVariable, ReportSharpHelper oRsTool) { try { IList <S05HModel> list = null; S05HGroupModel s05HGroup = new S05HGroupModel(); var amountType = GlobalVariable.AmountTypeViewReport; var currencyCode = GlobalVariable.CurrencyViewReport; var reportDate = _globalVariable.PostedDate; var isTotalBandInNewPage = false; if (!oRsTool.IsRefresh) { using (var frmParam = new FrmB01H()) { if (frmParam.ShowDialog() == DialogResult.OK) { GlobalVariable.FromDate = DateTime.Parse(frmParam.FromDate); GlobalVariable.ToDate = DateTime.Parse(frmParam.ToDate); isTotalBandInNewPage = frmParam.IsTotalBandInNewPage; list = Model.GetS05HWithStoreProdure(commonVariable.ReportList.ProcedureName, GlobalVariable.FromDate.ToShortDateString(), GlobalVariable.ToDate.ToShortDateString(), currencyCode, amountType); } else { return(null); } } } else { list = Model.GetS05HWithStoreProdure(commonVariable.ReportList.ProcedureName, GlobalVariable.FromDate.ToShortDateString(), GlobalVariable.ToDate.ToShortDateString(), currencyCode, amountType); } if (list != null && list.Count > 0) { foreach (var obj in list.ToList()) { if (obj.ClosingCredit == 0 && obj.ClosingDebit == 0 && obj.MovementAccumCredit == 0 && obj.MovementAccumDebit == 0 && obj.MovementCredit == 0 && obj.MovementDebit == 0 && obj.OpeningCredit == 0 && obj.OpeningDebit == 0) { list.Remove(obj); } } s05HGroup.GroupA = list.Where(w => !w.AccountCode.StartsWith("0")).ToList() ?? new List <S05HModel>(); s05HGroup.GroupB = list.Where(w => w.AccountCode.StartsWith("0")).ToList() ?? new List <S05HModel>(); if (!oRsTool.Parameters.ContainsKey("IsTotalBandInNewPage")) { oRsTool.Parameters.Add("IsTotalBandInNewPage", isTotalBandInNewPage); } if (!oRsTool.Parameters.ContainsKey("CompanyProvince")) { oRsTool.Parameters.Add("CompanyProvince", _globalVariable.CompanyProvince); } if (!oRsTool.Parameters.ContainsKey("ReportDate")) { oRsTool.Parameters.Add("ReportDate", reportDate); } if (amountType == 1) { if (!oRsTool.Parameters.ContainsKey("CurrencyCodeUnit")) { oRsTool.Parameters.Add("CurrencyCodeUnit", "Đơn vị tính (qui đổi): " + currencyCode); } } else { if (!oRsTool.Parameters.ContainsKey("CurrencyCodeUnit")) { oRsTool.Parameters.Add("CurrencyCodeUnit", "Đơn vị tính (nguyên tệ): " + currencyCode); } } if (!oRsTool.Parameters.ContainsKey("FromDate")) { oRsTool.Parameters.Add("FromDate", GlobalVariable.FromDate.ToShortDateString()); } if (!oRsTool.Parameters.ContainsKey("ToDate")) { oRsTool.Parameters.Add("ToDate", GlobalVariable.ToDate.ToShortDateString()); } //decimal TotalOpeningCredit = list.Where(x => x.Grade == 1).Sum(x => x.OpeningCredit); //decimal TotalOpeningDebit = list.Where(x => x.Grade == 1).Sum(x => x.OpeningDebit); //decimal TotalMovementAccumCredit = list.Where(x => x.Grade == 1).Sum(x => x.MovementAccumCredit); //decimal TotalMovementAccumDebit = list.Where(x => x.Grade == 1).Sum(x => x.MovementAccumDebit); //decimal TotalMovementCredit = list.Where(x => x.Grade == 1).Sum(x => x.MovementCredit); //decimal TotalMovementDebit = list.Where(x => x.Grade == 1).Sum(x => x.MovementDebit); //decimal TotalClosingCredit = list.Where(x => x.Grade == 1).Sum(x => x.ClosingCredit); //decimal TotalClosingDebit = list.Where(x => x.Grade == 1).Sum(x => x.ClosingDebit); decimal TotalOpeningCredit = s05HGroup.GroupA.Where(x => x.Grade == 1).Sum(x => x.OpeningCredit); decimal TotalOpeningDebit = s05HGroup.GroupA.Where(x => x.Grade == 1).Sum(x => x.OpeningDebit); decimal TotalMovementAccumCredit = s05HGroup.GroupA.Where(x => x.Grade == 1).Sum(x => x.MovementAccumCredit); decimal TotalMovementAccumDebit = s05HGroup.GroupA.Where(x => x.Grade == 1).Sum(x => x.MovementAccumDebit); decimal TotalMovementCredit = s05HGroup.GroupA.Where(x => x.Grade == 1).Sum(x => x.MovementCredit); decimal TotalMovementDebit = s05HGroup.GroupA.Where(x => x.Grade == 1).Sum(x => x.MovementDebit); decimal TotalClosingCredit = s05HGroup.GroupA.Where(x => x.Grade == 1).Sum(x => x.ClosingCredit); decimal TotalClosingDebit = s05HGroup.GroupA.Where(x => x.Grade == 1).Sum(x => x.ClosingDebit); if (!oRsTool.Parameters.ContainsKey("TotalMovementCredit")) { oRsTool.Parameters.Add("TotalMovementCredit", TotalMovementCredit); } if (!oRsTool.Parameters.ContainsKey("TotalMovementDebit")) { oRsTool.Parameters.Add("TotalMovementDebit", TotalMovementDebit); } if (!oRsTool.Parameters.ContainsKey("TotalClosingCredit")) { oRsTool.Parameters.Add("TotalClosingCredit", TotalClosingCredit); } if (!oRsTool.Parameters.ContainsKey("TotalClosingDebit")) { oRsTool.Parameters.Add("TotalClosingDebit", TotalClosingDebit); } if (!oRsTool.Parameters.ContainsKey("TotalOpeningCredit")) { oRsTool.Parameters.Add("TotalOpeningCredit", TotalOpeningCredit); } if (!oRsTool.Parameters.ContainsKey("TotalOpeningDebit")) { oRsTool.Parameters.Add("TotalOpeningDebit", TotalOpeningDebit); } if (!oRsTool.Parameters.ContainsKey("TotalMovementAccumCredit")) { oRsTool.Parameters.Add("TotalMovementAccumCredit", TotalMovementAccumCredit); } if (!oRsTool.Parameters.ContainsKey("TotalMovementAccumDebit")) { oRsTool.Parameters.Add("TotalMovementAccumDebit", TotalMovementAccumDebit); } TotalOpeningCredit = s05HGroup.GroupB.Where(x => x.Grade == 1).Sum(x => x.OpeningCredit); TotalOpeningDebit = s05HGroup.GroupB.Where(x => x.Grade == 1).Sum(x => x.OpeningDebit); TotalMovementAccumCredit = s05HGroup.GroupB.Where(x => x.Grade == 1).Sum(x => x.MovementAccumCredit); TotalMovementAccumDebit = s05HGroup.GroupB.Where(x => x.Grade == 1).Sum(x => x.MovementAccumDebit); TotalMovementCredit = s05HGroup.GroupB.Where(x => x.Grade == 1).Sum(x => x.MovementCredit); TotalMovementDebit = s05HGroup.GroupB.Where(x => x.Grade == 1).Sum(x => x.MovementDebit); TotalClosingCredit = s05HGroup.GroupB.Where(x => x.Grade == 1).Sum(x => x.ClosingCredit); TotalClosingDebit = s05HGroup.GroupB.Where(x => x.Grade == 1).Sum(x => x.ClosingDebit); if (!oRsTool.Parameters.ContainsKey("TotalMovementCreditGroupB")) { oRsTool.Parameters.Add("TotalMovementCreditGroupB", TotalMovementCredit); } if (!oRsTool.Parameters.ContainsKey("TotalMovementDebitGroupB")) { oRsTool.Parameters.Add("TotalMovementDebitGroupB", TotalMovementDebit); } if (!oRsTool.Parameters.ContainsKey("TotalClosingCreditGroupB")) { oRsTool.Parameters.Add("TotalClosingCreditGroupB", TotalClosingCredit); } if (!oRsTool.Parameters.ContainsKey("TotalClosingDebitGroupB")) { oRsTool.Parameters.Add("TotalClosingDebitGroupB", TotalClosingDebit); } if (!oRsTool.Parameters.ContainsKey("TotalOpeningCreditGroupB")) { oRsTool.Parameters.Add("TotalOpeningCreditGroupB", TotalOpeningCredit); } if (!oRsTool.Parameters.ContainsKey("TotalOpeningDebitGroupB")) { oRsTool.Parameters.Add("TotalOpeningDebitGroupB", TotalOpeningDebit); } if (!oRsTool.Parameters.ContainsKey("TotalMovementAccumCreditGroupB")) { oRsTool.Parameters.Add("TotalMovementAccumCreditGroupB", TotalMovementAccumCredit); } if (!oRsTool.Parameters.ContainsKey("TotalMovementAccumDebitGroupB")) { oRsTool.Parameters.Add("TotalMovementAccumDebitGroupB", TotalMovementAccumDebit); } } else { return(new List <S05HGroupModel>()); } return(new List <S05HGroupModel> { s05HGroup }); } catch (Exception ex) { XtraMessageBox.Show("Lỗi ở chỗ này " + ex.InnerException + ex.Message + ex.StackTrace); return(null); } }
/// <summary> /// Gets the budget chapter list. /// </summary> /// <param name="frmParent">The FRM parent.</param> /// <param name="commonVariable">The common variable.</param> /// <param name="oRsTool">The o rs tool.</param> /// <returns></returns> public IList <StockModel> GetStockList(XtraForm frmParent, Session.GlobalVariable commonVariable, ReportSharpHelper oRsTool) { return(Model.GetStocks()); }
/// <summary> /// Sổ nhật ký chung /// Gets the report S03 ah. /// </summary> /// <param name="frmParent">The FRM parent.</param> /// <param name="commonVariable">The common variable.</param> /// <param name="oRsTool">The o rs tool.</param> /// <returns></returns> public IList <S03AHModel> GetReportS03AH(XtraForm frmParent, GlobalVariable commonVariable, ReportSharpHelper oRsTool) { IList <S03AHModel> list; var amountType = GlobalVariable.AmountTypeViewReport; var currencyCode = GlobalVariable.CurrencyViewReport; var reportDate = _globalVariable.PostedDate; var isTotalBandInNewPage = false; if (!oRsTool.IsRefresh) { using (var frmParam = new FrmS03a_H()) { frmParam.ReporDate = _globalVariable.PostedDate; if (frmParam.ShowDialog() == DialogResult.OK) { GlobalVariable.FromDate = DateTime.Parse(frmParam.FromDate); GlobalVariable.ToDate = DateTime.Parse(frmParam.ToDate); isTotalBandInNewPage = frmParam.IsTotalBandInNewPage; list = Model.GetS03AHWithStoreProdure(commonVariable.ReportList.ProcedureName, GlobalVariable.FromDate.ToShortDateString(), GlobalVariable.ToDate.ToShortDateString(), currencyCode, amountType); } else { list = null; } } } else { list = Model.GetS03AHWithStoreProdure(commonVariable.ReportList.ProcedureName, GlobalVariable.FromDate.ToShortDateString(), GlobalVariable.ToDate.ToShortDateString(), currencyCode, amountType); } if (list != null) { list = list.Where(w => !string.IsNullOrEmpty(w.RefNo)).Select(s => { if (s.AccountNumber.StartsWith("0")) { s.AccountGroupCode = "B"; } else { s.AccountGroupCode = "A"; } return(s); }).ToList(); if (!oRsTool.Parameters.ContainsKey("CompanyProvince")) { oRsTool.Parameters.Add("CompanyProvince", _globalVariable.CompanyProvince); } if (!oRsTool.Parameters.ContainsKey("ReportDate")) { oRsTool.Parameters.Add("ReportDate", reportDate); } if (amountType == 1) { if (!oRsTool.Parameters.ContainsKey("CurrencyCodeUnit")) { oRsTool.Parameters.Add("CurrencyCodeUnit", "Đơn vị tính (qui đổi): " + currencyCode); } } else { if (!oRsTool.Parameters.ContainsKey("CurrencyCodeUnit")) { oRsTool.Parameters.Add("CurrencyCodeUnit", "Đơn vị tính (nguyên tệ): " + currencyCode); } } if (!oRsTool.Parameters.ContainsKey("FromDate")) { oRsTool.Parameters.Add("FromDate", GlobalVariable.FromDate.ToShortDateString()); } if (!oRsTool.Parameters.ContainsKey("ToDate")) { oRsTool.Parameters.Add("ToDate", GlobalVariable.ToDate.ToShortDateString()); } if (!oRsTool.Parameters.ContainsKey("Province")) { oRsTool.Parameters.Add("Province", _globalVariable.CompanyProvince); } if (!oRsTool.Parameters.ContainsKey("IsTotalBandInNewPage")) { oRsTool.Parameters.Add("IsTotalBandInNewPage", isTotalBandInNewPage); } if (!oRsTool.Parameters.ContainsKey("ReportDate")) { oRsTool.Parameters.Add("ReportDate", _globalVariable.PostedDate); } } return(list); }
/// <summary> /// Gets the fixed asset list. /// </summary> /// <param name="frmParent">The FRM parent.</param> /// <param name="commonVariable">The common variable.</param> /// <param name="oRsTool">The o rs tool.</param> /// <returns></returns> public IList <FixedAssetModel> GetFixedAssetList(XtraForm frmParent, Session.GlobalVariable commonVariable, ReportSharpHelper oRsTool) { //return Model.GetAllFixedAssetsWithStoreProdure(commonVariable.ReportList.ProcedureName); return(Model.GetFixedAsset()); }
public IList <AdvancePaymentModel> GetReportAdvancePayment(XtraForm frmParent, GlobalVariable commonVariable, ReportSharpHelper oRsTool) { try { IList <AdvancePaymentModel> list = null; var amountType = GlobalVariable.AmountTypeViewReport; var currencyCode = GlobalVariable.CurrencyViewReport; var reportDate = _globalVariable.PostedDate; var isTotalBandInNewPage = false; var accountType = 0; if (!oRsTool.IsRefresh) { using (var frmParam = new FrmB01H()) { if (frmParam.ShowDialog() == DialogResult.OK) { GlobalVariable.FromDate = DateTime.Parse(frmParam.FromDate); GlobalVariable.ToDate = DateTime.Parse(frmParam.ToDate); isTotalBandInNewPage = frmParam.IsTotalBandInNewPage; accountType = frmParam.AccountType; list = Model.GetAdvancePaymentWithStoreProdure(commonVariable.ReportList.ProcedureName, GlobalVariable.FromDate.ToShortDateString(), GlobalVariable.ToDate.ToShortDateString(), GlobalVariable.CurrencyViewReport, GlobalVariable.AmountTypeViewReport, accountType); } } } else { list = Model.GetAdvancePaymentWithStoreProdure(commonVariable.ReportList.ProcedureName, GlobalVariable.FromDate.ToShortDateString(), GlobalVariable.ToDate.ToShortDateString(), GlobalVariable.CurrencyViewReport, GlobalVariable.AmountTypeViewReport, accountType); } if (list != null && list.Count > 0) { if (!oRsTool.Parameters.ContainsKey("IsTotalBandInNewPage")) { oRsTool.Parameters.Add("IsTotalBandInNewPage", isTotalBandInNewPage); } //if (!oRsTool.Parameters.ContainsKey("AmountType")) // oRsTool.Parameters.Add("AmountType", amountType); if (!oRsTool.Parameters.ContainsKey("CompanyProvince")) { oRsTool.Parameters.Add("CompanyProvince", _globalVariable.CompanyProvince); } if (!oRsTool.Parameters.ContainsKey("ReportDate")) { oRsTool.Parameters.Add("ReportDate", reportDate); } if (amountType == 1) { if (!oRsTool.Parameters.ContainsKey("CurrencyCodeUnit")) { oRsTool.Parameters.Add("CurrencyCodeUnit", "Đơn vị tính (qui đổi): " + currencyCode); } } else { if (!oRsTool.Parameters.ContainsKey("CurrencyCodeUnit")) { oRsTool.Parameters.Add("CurrencyCodeUnit", "Đơn vị tính (nguyên tệ): " + currencyCode); } } if (!oRsTool.Parameters.ContainsKey("FromDate")) { oRsTool.Parameters.Add("FromDate", GlobalVariable.FromDate.ToShortDateString()); } if (!oRsTool.Parameters.ContainsKey("ToDate")) { oRsTool.Parameters.Add("ToDate", GlobalVariable.ToDate.ToShortDateString()); } } return(list); } catch (Exception ex) { XtraMessageBox.Show("Lỗi ở chỗ này " + ex.InnerException + ex.Message + ex.StackTrace); return(null); } }
/// <summary> /// Gets the fixed asset category list. /// </summary> /// <param name="frmParent">The FRM parent.</param> /// <param name="commonVariable">The common variable.</param> /// <param name="oRsTool">The o rs tool.</param> /// <returns></returns> public IList <AccountModel> GetAccountList(XtraForm frmParent, Session.GlobalVariable commonVariable, ReportSharpHelper oRsTool) { return(Model.GetAccounts()); }
public IList <TSD.AccountingSoft.Model.BusinessObjects.Report.LedgerAccounting.ReportS104HModel> GetReportS104H(XtraForm frmParent, GlobalVariable commonVariable, ReportSharpHelper oRsTool) { try { IList <TSD.AccountingSoft.Model.BusinessObjects.Report.LedgerAccounting.ReportS104HModel> lstResults = null; var amountType = GlobalVariable.AmountTypeViewReport; var currencyCode = GlobalVariable.CurrencyViewReport; var reportDate = _globalVariable.PostedDate; var isTotalBandInNewPage = false; DateTime fromDate = GlobalVariable.FromDate; DateTime toDate = GlobalVariable.ToDate; DateTime?openDate = null; string selectedBudgetSourceCodes = ""; string expenseName = "NSNN"; if (!oRsTool.IsRefresh) { using (var frmParam = new FrmLedgerAccountingS104H()) { frmParam.Text = "Sổ theo dõi kinh phí NSNN cấp bằng lệnh chi tiền"; if (frmParam.ShowDialog() == DialogResult.OK) { fromDate = frmParam.FromDate; toDate = frmParam.ToDate; openDate = frmParam.OpenDate; selectedBudgetSourceCodes = frmParam.SelectedBudgetSourceCodes; expenseName = frmParam.ExpenseName; } else { return(null); } } } lstResults = Model.LedgerAccountingS104H(commonVariable.ReportList.ProcedureName, fromDate.ToShortDateString(), toDate.ToShortDateString(), selectedBudgetSourceCodes, currencyCode, amountType); if (lstResults != null && lstResults.Count > 0) { if (!oRsTool.Parameters.ContainsKey("IsTotalBandInNewPage")) { oRsTool.Parameters.Add("IsTotalBandInNewPage", isTotalBandInNewPage); } if (!oRsTool.Parameters.ContainsKey("CompanyProvince")) { oRsTool.Parameters.Add("CompanyProvince", _globalVariable.CompanyProvince); } if (!oRsTool.Parameters.ContainsKey("ReportDate")) { oRsTool.Parameters.Add("ReportDate", reportDate); } if (amountType == 1) { if (!oRsTool.Parameters.ContainsKey("CurrencyCodeUnit")) { oRsTool.Parameters.Add("CurrencyCodeUnit", "Đơn vị tính (qui đổi): " + currencyCode); } } else { if (!oRsTool.Parameters.ContainsKey("CurrencyCodeUnit")) { oRsTool.Parameters.Add("CurrencyCodeUnit", "Đơn vị tính (nguyên tệ): " + currencyCode); } } if (!oRsTool.Parameters.ContainsKey("FromDate")) { oRsTool.Parameters.Add("FromDate", fromDate.ToShortDateString()); } if (!oRsTool.Parameters.ContainsKey("ToDate")) { oRsTool.Parameters.Add("ToDate", toDate.ToShortDateString()); } if (!oRsTool.Parameters.ContainsKey("ExpenseName")) { oRsTool.Parameters.Add("ExpenseName", expenseName); } if (!oRsTool.Parameters.ContainsKey("OpenDate")) { oRsTool.Parameters.Add("OpenDate", openDate); } } return(lstResults); } catch (Exception ex) { XtraMessageBox.Show("Lỗi ở chỗ này " + ex.InnerException + ex.Message + ex.StackTrace); return(null); } }
/// <summary> /// Gets the cash report S11 h. /// </summary> /// <param name="reportParameter">The report parameter.</param> /// <param name="oRsTool">The o rs tool.</param> /// <returns>IList<CashReportModel>.</returns> public IList <S12HModel> ReportS12H(ReportParameter reportParameter, ReportSharpHelper oRsTool) { IList <S12HModel> reports = null; GlobalVariable.IsDisplayNewLicenseInfo = false; var amountType = GlobalVariable.AmountTypeViewReport; var currencyCode = GlobalVariable.CurrencyViewReport; //var isTotalBandInNewPage = false; var fromDate = DateTime.Now; var toDate = DateTime.Now; if (!oRsTool.IsRefresh) { using (var frmParam = new FrmS12H()) { frmParam.Text = @"S12-H: Sổ tiền gửi ngân hàng, kho bạc"; if (frmParam.ShowDialog() == DialogResult.OK) { var startDate = DateTime.Parse(frmParam.StartDate); fromDate = DateTime.Parse(frmParam.FromDate); toDate = DateTime.Parse(frmParam.ToDate); //isTotalBandInNewPage = frmParam.IsTotalBandInNewPage; //var accountNumber = frmParam.AccountCode; //if (!oRsTool.Parameters.ContainsKey("Account")) // oRsTool.Parameters.Add("Account", // "Tài khoản: " + accountNumber + " - " + frmParam.AccountName); //if (!oRsTool.Parameters.ContainsKey("AccountNumber")) // oRsTool.Parameters.Add("AccountNumber", accountNumber); if (!oRsTool.Parameters.ContainsKey("IsDetail")) { oRsTool.Parameters.Add("IsDetail", frmParam.IsDetail); } reports = Model.ReportS12H(startDate, fromDate, toDate, frmParam.BudgetChapterCode, frmParam.BudgetSubKindItemCode, frmParam.AccountNumber, frmParam.BankId, frmParam.IsSummaryBankId, frmParam.IsSummaryBudgetChapter, frmParam.IsSummaryBudgetSubKindItem, frmParam.IsDetail, amountType, currencyCode); } } } //else //{ // var accountNumber = oRsTool.Parameters["AccountNumber"].ToString(); // list = Model.GetCashS12HWithStoreProdure(commonVariable.ReportList.ProcedureName, GlobalVariable.FromDate.ToShortDateString(), // GlobalVariable.ToDate.ToShortDateString(), amountType, accountNumber, currencyCode, false, null); //} if (reports != null && reports.Count > 0) { //if (!oRsTool.Parameters.ContainsKey("CurrencyCodeUnit")) // oRsTool.Parameters.Add("CurrencyCodeUnit", // "Đơn vị tính " + (amountType == 2 ? "(nguyên tệ): " : "(quy đổi): ") + currencyCode); //if (!oRsTool.Parameters.ContainsKey("Year")) // oRsTool.Parameters.Add("Year", "Năm:" + GlobalVariable.ToDate.Year); if (!oRsTool.Parameters.ContainsKey("FromDate")) { oRsTool.Parameters.Add("FromDate", fromDate.ToShortDateString()); } if (!oRsTool.Parameters.ContainsKey("ToDate")) { oRsTool.Parameters.Add("ToDate", toDate.ToShortDateString()); } //if (!oRsTool.Parameters.ContainsKey("Province")) // oRsTool.Parameters.Add("Province", _globalVariable.CompanyProvince); //if (!oRsTool.Parameters.ContainsKey("ReportDate")) // oRsTool.Parameters.Add("ReportDate", _globalVariable.PostedDate); //// ThoDD add trạng thái chuyển sang trang sau //if (!oRsTool.Parameters.ContainsKey("IsTotalBandInNewPage")) // oRsTool.Parameters.Add("IsTotalBandInNewPage", isTotalBandInNewPage); ////làm Footer để có cấu trúc sang trang //if (!oRsTool.Parameters.ContainsKey("footClosing")) // oRsTool.Parameters.Add("footClosing", list[list.Count - 1].RestAmount); //list.RemoveAt(list.Count - 1); //if (!oRsTool.Parameters.ContainsKey("footReceipt")) // oRsTool.Parameters.Add("footReceipt", list[list.Count - 1].ReceiptAmount); //if (!oRsTool.Parameters.ContainsKey("footPay")) // oRsTool.Parameters.Add("footPay", list[list.Count - 1].PayAmount); //if (!oRsTool.Parameters.ContainsKey("footExist")) // oRsTool.Parameters.Add("footExist", list[list.Count - 1].RestAmount); //list.RemoveAt(list.Count - 1); //list.RemoveAt(list.Count - 1); } return(reports); }
/// <summary> /// Bảng sinh hoạt phí /// Gets the report a02 LDTL. /// </summary> /// <param name="frmParent">The FRM parent.</param> /// <param name="commonVariable">The common variable.</param> /// <param name="oRsTool">The o rs tool.</param> /// <returns></returns> public IList <A02LDTLModel> GetReportA02LDTL(XtraForm frmParent, GlobalVariable commonVariable, ReportSharpHelper oRsTool) { IList <A02LDTLModel> list = null; decimal numbershp = 0; decimal pckiemnhiem = 0; decimal pcvs = 0; decimal shp = 0; decimal trocapct = 0; if (!oRsTool.IsRefresh) { using (var frmParam = new FrmA02LDTL()) { frmParam.ReporDate = _globalVariable.PostedDate; if (frmParam.ShowDialog() == DialogResult.OK) { GlobalVariable.FromDate = DateTime.Parse(frmParam.FromDate); GlobalVariable.ToDate = DateTime.Parse(frmParam.ToDate); list = Model.Get02LdtlWithStoreProdure(commonVariable.ReportList.ProcedureName, GlobalVariable.FromDate.ToShortDateString(), GlobalVariable.ToDate.ToShortDateString()); } if (!oRsTool.Parameters.ContainsKey("IsTotalBandInNewPage")) { oRsTool.Parameters.Add("IsTotalBandInNewPage", frmParam.IsTotalBandInNewPage); } } } else { list = Model.Get02LdtlWithStoreProdure(commonVariable.ReportList.ProcedureName, GlobalVariable.FromDate.ToShortDateString(), GlobalVariable.ToDate.ToShortDateString()); } if (list != null && list.Count > 0) { decimal baseOfSalary = Math.Round(list[0].BaseOfSalary, int.Parse(commonVariable.CurrencyDecimalDigits)); if (!oRsTool.Parameters.ContainsKey("CompanyProvince")) { oRsTool.Parameters.Add("CompanyProvince", _globalVariable.CompanyProvince); } if (!oRsTool.Parameters.ContainsKey("FromDate")) { oRsTool.Parameters.Add("FromDate", GlobalVariable.FromDate.ToShortDateString()); } if (!oRsTool.Parameters.ContainsKey("ToDate")) { oRsTool.Parameters.Add("ToDate", GlobalVariable.ToDate.ToShortDateString()); } if (!oRsTool.Parameters.ContainsKey("BaseOfSalary")) { oRsTool.Parameters.Add("BaseOfSalary", baseOfSalary); } if (!oRsTool.Parameters.ContainsKey("CoefficientOfSalaryByArea")) { oRsTool.Parameters.Add("CoefficientOfSalaryByArea", commonVariable.CoefficientOfSalaryByArea); } if (!oRsTool.Parameters.ContainsKey("ReportDate")) { oRsTool.Parameters.Add("ReportDate", list[0].CalcDate.ToShortDateString()); } if (!oRsTool.Parameters.ContainsKey("ExchangeRate")) { oRsTool.Parameters.Add("ExchangeRate", list[0].ExchangeRate); } if (!oRsTool.Parameters.ContainsKey("CurrencyAccounting")) { oRsTool.Parameters.Add("CurrencyAccounting", list[0].CurrencyCode); } //Luon hieen tien DP if (!oRsTool.Parameters.ContainsKey("CurrencyLocal")) { oRsTool.Parameters.Add("CurrencyLocal", _globalVariable.CurrencyLocal); } if (!oRsTool.Parameters.ContainsKey("CurrencyLocal")) { oRsTool.Parameters.Add("CurrencyLocal", _globalVariable.CurrencyLocal); } foreach (var it in list) { numbershp = numbershp + it.NumberSHP; pckiemnhiem = pckiemnhiem + it.PCKiemNhiem; pcvs = pcvs + it.PCVS; shp = shp + it.SHP; trocapct = trocapct + it.TroCapCT; } numbershp = Math.Round(numbershp * list[0].ExchangeRate, int.Parse(commonVariable.CurrencyDecimalDigits)); pckiemnhiem = Math.Round(pckiemnhiem * list[0].ExchangeRate, int.Parse(commonVariable.CurrencyDecimalDigits)); pcvs = Math.Round(pcvs * list[0].ExchangeRate, int.Parse(commonVariable.CurrencyDecimalDigits)); shp = Math.Round(shp * list[0].ExchangeRate, int.Parse(commonVariable.CurrencyDecimalDigits)); trocapct = Math.Round(trocapct * list[0].ExchangeRate, int.Parse(commonVariable.CurrencyDecimalDigits)); if (!oRsTool.Parameters.ContainsKey("NumberSHP")) { oRsTool.Parameters.Add("NumberSHP", numbershp); } if (!oRsTool.Parameters.ContainsKey("PCKiemNhiem")) { oRsTool.Parameters.Add("PCKiemNhiem", pckiemnhiem); } if (!oRsTool.Parameters.ContainsKey("PCVS")) { oRsTool.Parameters.Add("PCVS", pcvs); } if (!oRsTool.Parameters.ContainsKey("SHP")) { oRsTool.Parameters.Add("SHP", shp); } if (!oRsTool.Parameters.ContainsKey("TroCapCT")) { oRsTool.Parameters.Add("TroCapCT", trocapct); } if (!oRsTool.Parameters.ContainsKey("TotalSHP")) { oRsTool.Parameters.Add("TotalSHP", trocapct + shp + pcvs + pckiemnhiem); } if (!oRsTool.Parameters.ContainsKey("CurrencyDecimalDigits")) { oRsTool.Parameters.Add("CurrencyDecimalDigits", commonVariable.CurrencyDecimalDigits); } var globalVariable = new GlobalVariable(); if (globalVariable.CurrencyCodeOfSalary != list[0].CurrencyCode) //if (GlobalVariable.CurrencyViewReport != list[0].CurrencyCode) { list = new List <A02LDTLModel>(); } } return(list); }
/// <summary> /// Initializes a new instance of the <see cref="ReportHelper" /> class. /// </summary> public ReportHelper() { ReportSharpTool = new ReportSharpHelper(); }
/// <summary> /// Tồn kho /// Gets the report B14 q. /// </summary> /// <param name="frmParent">The FRM parent.</param> /// <param name="commonVariable">The common variable.</param> /// <param name="oRsTool">The o rs tool.</param> /// <returns></returns> public IList <B14QModel> GetReportB14Q(XtraForm frmParent, GlobalVariable commonVariable, ReportSharpHelper oRsTool) { IList <B14QModel> list = null; var currencyCode = GlobalVariable.CurrencyViewReport; var amountType = GlobalVariable.AmountTypeViewReport; var reportDate = _globalVariable.PostedDate; if (!oRsTool.IsRefresh) { using (var frmParam = new FrmB14Q()) { if (frmParam.ShowDialog() == DialogResult.OK) { GlobalVariable.FromDate = DateTime.Parse(frmParam.FromDate); GlobalVariable.ToDate = DateTime.Parse(frmParam.ToDate); var listStockId = frmParam.ListStockId; var stockName = frmParam.StockName; var accountCode = frmParam.AccountCode; if (accountCode == " ") { if (!oRsTool.Parameters.ContainsKey("AccountCode")) { oRsTool.Parameters.Add("AccountCode", "152,153"); } } else {// cần xử lý nhiều tền nhiều kho } if (!oRsTool.Parameters.ContainsKey("StockName")) { oRsTool.Parameters.Add("StockName", stockName); } if (!oRsTool.Parameters.ContainsKey("ListStockId")) { oRsTool.Parameters.Add("ListStockId", listStockId); } if (!oRsTool.Parameters.ContainsKey("IsTotalBandInNewPage")) { oRsTool.Parameters.Add("IsTotalBandInNewPage", frmParam.IsTotalBandInNewPage); } list = Model.GetB14QWithStoreProdure(commonVariable.ReportList.ProcedureName, GlobalVariable.FromDate.ToShortDateString(), GlobalVariable.ToDate.ToShortDateString(), currencyCode, accountCode, listStockId, amountType); accountCode = accountCode + " - " + frmParam.AccountName; if (!oRsTool.Parameters.ContainsKey("AccountCode")) { oRsTool.Parameters.Add("AccountCode", accountCode); } } } } else { var listStockId = oRsTool.Parameters["ListStockId"].ToString(); var accountCode = oRsTool.Parameters["AccountCode"].ToString(); list = Model.GetB14QWithStoreProdure(commonVariable.ReportList.ProcedureName, GlobalVariable.FromDate.ToShortDateString(), GlobalVariable.ToDate.ToShortDateString(), currencyCode, accountCode, listStockId, amountType); } if (list != null && list.Count > 0) { if (!oRsTool.Parameters.ContainsKey("CompanyProvince")) { oRsTool.Parameters.Add("CompanyProvince", _globalVariable.CompanyProvince); } if (!oRsTool.Parameters.ContainsKey("ReportDate")) { oRsTool.Parameters.Add("ReportDate", reportDate); } if (amountType == 1) { if (!oRsTool.Parameters.ContainsKey("CurrencyCodeUnit")) { oRsTool.Parameters.Add("CurrencyCodeUnit", "Đơn vị tính (qui đổi): " + currencyCode); } } else { if (!oRsTool.Parameters.ContainsKey("CurrencyCodeUnit")) { oRsTool.Parameters.Add("CurrencyCodeUnit", "Đơn vị tính (nguyên tệ): " + currencyCode); } } if (!oRsTool.Parameters.ContainsKey("FromDate")) { oRsTool.Parameters.Add("FromDate", GlobalVariable.FromDate.ToShortDateString()); } if (!oRsTool.Parameters.ContainsKey("ToDate")) { oRsTool.Parameters.Add("ToDate", GlobalVariable.ToDate.ToShortDateString()); } } return(list); }