From 73c49a1e8b185f7237a5625fee383b12b1ce54e4 Mon Sep 17 00:00:00 2001 From: Birendra Date: Thu, 18 Nov 2021 11:59:35 +0530 Subject: [PATCH] all reporting changes done --- 400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs | 24 ++++++++++++------------ 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------ 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx | 86 +++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------- 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetCancelledLicenses_Result.cs | 7 +++---- 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetDiscountReport_Result.cs | 7 +++---- 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetExpiringLicenses_Result.cs | 9 ++++----- 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetNetAdSummaryReport_Result.cs | 1 - 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteLicenseUsageReports_Result.cs | 5 ++--- 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSubscribedLicenses_Result.cs | 9 ++++----- 400-SOURCECODE/Admin/src/app/components/Reports/discountcodereport.component.html | 55 ++++++++++++++++++------------------------------------- 400-SOURCECODE/Admin/src/app/components/Reports/discountcodereport.component.ts | 173 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------- 400-SOURCECODE/Admin/src/app/components/Reports/expiringsubscriptionreport.component.html | 50 +++++++++++++++++++++++++------------------------- 400-SOURCECODE/Admin/src/app/components/Reports/expiringsubscriptionreport.component.ts | 210 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------- 400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.ts | 2 +- 400-SOURCECODE/Admin/src/app/components/Reports/netadsubscriptionreport.component.html | 36 +++++++++++++++++++----------------- 400-SOURCECODE/Admin/src/app/components/Reports/netadsubscriptionreport.component.ts | 196 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------------- 400-SOURCECODE/Admin/src/app/components/Reports/report.service.ts | 116 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------- 400-SOURCECODE/Admin/src/app/components/Reports/sitelicenseusagereport.component.html | 55 +++++++++++++++++++------------------------------------ 400-SOURCECODE/Admin/src/app/components/Reports/sitelicenseusagereport.component.ts | 182 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------- 400-SOURCECODE/Admin/src/app/components/Reports/subscriptioncancellationreport.component.html | 66 +++++++++++++++++++++++------------------------------------------- 400-SOURCECODE/Admin/src/app/components/Reports/subscriptioncancellationreport.component.ts | 210 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------- 400-SOURCECODE/Admin/src/app/components/Reports/subscriptionreport.component.html | 46 ++++++++++++++++++++++++---------------------- 400-SOURCECODE/Admin/src/app/components/Reports/subscriptionreport.component.ts | 208 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------- 23 files changed, 1143 insertions(+), 682 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs index 1efd752..c62cb2a 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs @@ -44,39 +44,39 @@ namespace AIAHTML5.ADMIN.API.Controllers [Route("GetExpiringSubscriptionReport")] [HttpGet] - public IHttpActionResult GetExpiringSubscriptionReport(string sFromDate, string sToDate, decimal iStartPrice, decimal iEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId, int pageNo, int pageLength) + public IHttpActionResult GetExpiringSubscriptionReport(string sFromDate, string sToDate, decimal iStartPrice, decimal iEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId, string sortColumn, string sortOrder, int pageNo, int pageLength) { var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); - var lstExpiringSubscriptionReport = dbContext.usp_GetExpiringLicenses(sFromDate, sToDate, iStartPrice, iEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId, pageNo, pageLength, spRecordCount).ToList(); + var lstExpiringSubscriptionReport = dbContext.usp_GetExpiringLicenses(sFromDate, sToDate, iStartPrice, iEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); return Ok(new { ExpiringSubscription = lstExpiringSubscriptionReport, RecordCount = spRecordCount.Value }); } [Route("GetSubscriptionReport")] [HttpGet] - public IHttpActionResult GetSubscriptionReport(string sFromDate, string sToDate, decimal icStartPrice, decimal icEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId, int pageNo, int pageLength) + public IHttpActionResult GetSubscriptionReport(string sFromDate, string sToDate, decimal icStartPrice, decimal icEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId, string sortColumn, string sortOrder, int pageNo, int pageLength) { var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); - var lstExpiringSubscriptionReport = dbContext.usp_GetSubscribedLicenses(sFromDate, sToDate, icStartPrice, icEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId, pageNo, pageLength, spRecordCount).ToList(); + var lstExpiringSubscriptionReport = dbContext.usp_GetSubscribedLicenses(sFromDate, sToDate, icStartPrice, icEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); return Ok(new { Subscription = lstExpiringSubscriptionReport, RecordCount = spRecordCount.Value }); } [Route("GetSubscriptionCancellationReport")] [HttpGet] - public IHttpActionResult GetSubscriptionCancellationReport(string sFromDate, string sToDate, decimal icStartPrice, decimal icEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId, int pageNo, int pageLength) + public IHttpActionResult GetSubscriptionCancellationReport(string sFromDate, string sToDate, decimal icStartPrice, decimal icEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId, string sortColumn, string sortOrder, int pageNo, int pageLength) { var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); - var lstExpiringSubscriptionReport = dbContext.usp_GetCancelledLicenses(sFromDate, sToDate, icStartPrice, icEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId, pageNo, pageLength, spRecordCount).ToList(); + var lstExpiringSubscriptionReport = dbContext.usp_GetCancelledLicenses(sFromDate, sToDate, icStartPrice, icEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); return Ok(new { SubscriptionCancel = lstExpiringSubscriptionReport, RecordCount = spRecordCount.Value }); } [Route("GetNetAdSummaryReport")] [HttpGet] - public IHttpActionResult GetNetAdSummaryReport(string sFromDate, string sToDate, decimal iStartPrice, decimal iEndPrice, int iLicenseTypeId, int pageNo, int pageLength) + public IHttpActionResult GetNetAdSummaryReport(string sFromDate, string sToDate, decimal iStartPrice, decimal iEndPrice, int iLicenseTypeId,string sortColumn, string sortOrder, int pageNo, int pageLength) { try { var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); - var lstNetAdSummaryReport = dbContext.usp_GetNetAdSummaryReport(sFromDate, sToDate, iStartPrice, iEndPrice, (byte)iLicenseTypeId, pageNo, pageLength, spRecordCount).ToList(); + var lstNetAdSummaryReport = dbContext.usp_GetNetAdSummaryReport(sFromDate, sToDate, iStartPrice, iEndPrice, (byte)iLicenseTypeId, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); return Ok(new { NetAdSubscriptionList = lstNetAdSummaryReport, RecordCount = spRecordCount.Value }); } catch (Exception ex) @@ -88,12 +88,12 @@ namespace AIAHTML5.ADMIN.API.Controllers [Route("GetSiteLicenseUsageReport")] [HttpGet] - public IHttpActionResult GetSiteLicenseUsageReport(string sFromDate, string sToDate, string sAccountNumber, int iEdition, int iloginTypeId, int pageNo, int pageLength) + public IHttpActionResult GetSiteLicenseUsageReport(string sFromDate, string sToDate, string sAccountNumber, int iEdition, int iloginTypeId, string sortColumn, string sortOrder, int pageNo, int pageLength) { try { var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); - var lstSiteLicenseUsageReport = dbContext.usp_GetSiteLicenseUsageReports(sFromDate, sToDate, sAccountNumber, (byte)iEdition, (byte)iloginTypeId, pageNo, pageLength, spRecordCount).ToList(); + var lstSiteLicenseUsageReport = dbContext.usp_GetSiteLicenseUsageReports(sFromDate, sToDate, sAccountNumber, (byte)iEdition, (byte)iloginTypeId, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); return Ok(new { SiteLicenseUsageList = lstSiteLicenseUsageReport, RecordCount = spRecordCount.Value }); } catch (Exception ex) @@ -104,12 +104,12 @@ namespace AIAHTML5.ADMIN.API.Controllers [Route("GetDiscountReport")] [HttpGet] - public IHttpActionResult GetDiscountReport(string sFromDate, string sToDate, int iDiscountCode, string sAccountNumber, int pageNo, int pageLength) + public IHttpActionResult GetDiscountReport(string sFromDate, string sToDate, int iDiscountCode, string sAccountNumber, string sortColumn, string sortOrder, int pageNo, int pageLength) { try { var spRecordCount = new System.Data.Objects.ObjectParameter("recordCount", 0); - var lstDiscountReport = dbContext.usp_GetDiscountReport(sFromDate, sToDate, iDiscountCode, sAccountNumber, pageNo, pageLength, spRecordCount).ToList(); + var lstDiscountReport = dbContext.usp_GetDiscountReport(sFromDate, sToDate, iDiscountCode, sAccountNumber, sortColumn, sortOrder, pageNo, pageLength, spRecordCount).ToList(); return Ok(new { DiscountReportList = lstDiscountReport, RecordCount = spRecordCount.Value }); } catch (Exception ex) diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs index c50e14b..005c9f6 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs @@ -3891,7 +3891,7 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetBlockedUserByAccNoAndType", iUserTypeIdParameter, iLicenseIdParameter); } - public virtual ObjectResult usp_GetCancelledLicenses(string sFromDate, string sToDate, Nullable iStartPrice, Nullable iEndPrice, Nullable iLicenseTypeId, Nullable iAccountTypeId, string sZip, Nullable iStateId, Nullable iCountryId, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetCancelledLicenses(string sFromDate, string sToDate, Nullable iStartPrice, Nullable iEndPrice, Nullable iLicenseTypeId, Nullable iAccountTypeId, string sZip, Nullable iStateId, Nullable iCountryId, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sFromDateParameter = sFromDate != null ? new ObjectParameter("sFromDate", sFromDate) : @@ -3929,6 +3929,14 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("iCountryId", iCountryId) : new ObjectParameter("iCountryId", typeof(int)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -3937,7 +3945,7 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetCancelledLicenses", sFromDateParameter, sToDateParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeIdParameter, iAccountTypeIdParameter, sZipParameter, iStateIdParameter, iCountryIdParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetCancelledLicenses", sFromDateParameter, sToDateParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeIdParameter, iAccountTypeIdParameter, sZipParameter, iStateIdParameter, iCountryIdParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } public virtual ObjectResult usp_GetCustomerSummary(string sAccoutNumber, string sLicenseeFullName, Nullable iStartPrice, Nullable iEndPrice, Nullable iLicenseType, Nullable iAccountType, string sZip, Nullable iState, Nullable iCountry, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) @@ -4030,7 +4038,7 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetDiscountCodes", sDiscountCodeParameter, sStartDateParameter, sEndDateParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } - public virtual ObjectResult usp_GetDiscountReport(string sStartDate, string sEndDate, Nullable intDiscountID, string sAccoutNumber, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetDiscountReport(string sStartDate, string sEndDate, Nullable intDiscountID, string sAccoutNumber, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sStartDateParameter = sStartDate != null ? new ObjectParameter("sStartDate", sStartDate) : @@ -4048,6 +4056,14 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("sAccoutNumber", sAccoutNumber) : new ObjectParameter("sAccoutNumber", typeof(string)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -4056,10 +4072,10 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetDiscountReport", sStartDateParameter, sEndDateParameter, intDiscountIDParameter, sAccoutNumberParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetDiscountReport", sStartDateParameter, sEndDateParameter, intDiscountIDParameter, sAccoutNumberParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } - public virtual ObjectResult usp_GetExpiringLicenses(string sFromDate, string sToDate, Nullable iStartPrice, Nullable iEndPrice, Nullable iLicenseTypeId, Nullable iAccountTypeId, string sZip, Nullable iStateId, Nullable iCountryId, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetExpiringLicenses(string sFromDate, string sToDate, Nullable iStartPrice, Nullable iEndPrice, Nullable iLicenseTypeId, Nullable iAccountTypeId, string sZip, Nullable iStateId, Nullable iCountryId, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sFromDateParameter = sFromDate != null ? new ObjectParameter("sFromDate", sFromDate) : @@ -4097,6 +4113,14 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("iCountryId", iCountryId) : new ObjectParameter("iCountryId", typeof(int)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -4105,7 +4129,7 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetExpiringLicenses", sFromDateParameter, sToDateParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeIdParameter, iAccountTypeIdParameter, sZipParameter, iStateIdParameter, iCountryIdParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetExpiringLicenses", sFromDateParameter, sToDateParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeIdParameter, iAccountTypeIdParameter, sZipParameter, iStateIdParameter, iCountryIdParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } public virtual ObjectResult usp_GetExportedImageDetails(string sStartDate, string sEndDate, string sAccoutNumber, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) @@ -4190,7 +4214,7 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetModuleStatusByLicenseId", iLicenseIdParameter); } - public virtual ObjectResult usp_GetNetAdSummaryReport(string sFromDate, string sToDate, Nullable iStartPrice, Nullable iEndPrice, Nullable iLicenseTypeId, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetNetAdSummaryReport(string sFromDate, string sToDate, Nullable iStartPrice, Nullable iEndPrice, Nullable iLicenseTypeId, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sFromDateParameter = sFromDate != null ? new ObjectParameter("sFromDate", sFromDate) : @@ -4212,6 +4236,14 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("iLicenseTypeId", iLicenseTypeId) : new ObjectParameter("iLicenseTypeId", typeof(byte)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -4220,7 +4252,7 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetNetAdSummaryReport", sFromDateParameter, sToDateParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeIdParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetNetAdSummaryReport", sFromDateParameter, sToDateParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeIdParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } public virtual ObjectResult usp_GetSearchUser(string sFirstName, string sLastName, string sEmailId, string sAccoutNumber, Nullable iUserTypeId, Nullable iAccountTypeId, Nullable iLoginUserType, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) @@ -4323,7 +4355,7 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetSiteLicenseUsageReport", sFromDateParameter, sToDateParameter, sAccoutNumberParameter, iEditionIdParameter, pageNoParameter, pageLengthParameter, recordCount); } - public virtual ObjectResult usp_GetSiteLicenseUsageReports(string sFromDate, string sToDate, string sAccoutNumber, Nullable iEditionId, Nullable iloginTypeId, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetSiteLicenseUsageReports(string sFromDate, string sToDate, string sAccoutNumber, Nullable iEditionId, Nullable iloginTypeId, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sFromDateParameter = sFromDate != null ? new ObjectParameter("sFromDate", sFromDate) : @@ -4345,6 +4377,14 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("iloginTypeId", iloginTypeId) : new ObjectParameter("iloginTypeId", typeof(byte)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -4353,10 +4393,10 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetSiteLicenseUsageReports", sFromDateParameter, sToDateParameter, sAccoutNumberParameter, iEditionIdParameter, iloginTypeIdParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetSiteLicenseUsageReports", sFromDateParameter, sToDateParameter, sAccoutNumberParameter, iEditionIdParameter, iloginTypeIdParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } - public virtual ObjectResult usp_GetSubscribedLicenses(string sFromDate, string sToDate, Nullable iStartPrice, Nullable iEndPrice, Nullable iLicenseTypeId, Nullable iAccountTypeId, string sZip, Nullable iStateId, Nullable iCountryId, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + public virtual ObjectResult usp_GetSubscribedLicenses(string sFromDate, string sToDate, Nullable iStartPrice, Nullable iEndPrice, Nullable iLicenseTypeId, Nullable iAccountTypeId, string sZip, Nullable iStateId, Nullable iCountryId, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) { var sFromDateParameter = sFromDate != null ? new ObjectParameter("sFromDate", sFromDate) : @@ -4394,6 +4434,14 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("iCountryId", iCountryId) : new ObjectParameter("iCountryId", typeof(int)); + var sortColumnParameter = sortColumn != null ? + new ObjectParameter("sortColumn", sortColumn) : + new ObjectParameter("sortColumn", typeof(string)); + + var sortOrderParameter = sortOrder != null ? + new ObjectParameter("sortOrder", sortOrder) : + new ObjectParameter("sortOrder", typeof(string)); + var pageNoParameter = pageNo.HasValue ? new ObjectParameter("pageNo", pageNo) : new ObjectParameter("pageNo", typeof(int)); @@ -4402,7 +4450,7 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("pageLength", pageLength) : new ObjectParameter("pageLength", typeof(int)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetSubscribedLicenses", sFromDateParameter, sToDateParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeIdParameter, iAccountTypeIdParameter, sZipParameter, iStateIdParameter, iCountryIdParameter, pageNoParameter, pageLengthParameter, recordCount); + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetSubscribedLicenses", sFromDateParameter, sToDateParameter, iStartPriceParameter, iEndPriceParameter, iLicenseTypeIdParameter, iAccountTypeIdParameter, sZipParameter, iStateIdParameter, iCountryIdParameter, sortColumnParameter, sortOrderParameter, pageNoParameter, pageLengthParameter, recordCount); } public virtual ObjectResult usp_GetUsageReport(string sFromDate, string sToDate, string sAccoutNumber, string sZip, Nullable iState, Nullable iCountry, string sortColumn, string sortOrder, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx index 2267912..1295ad2 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx @@ -976,6 +976,8 @@ + + @@ -1011,6 +1013,8 @@ + + @@ -1026,6 +1030,8 @@ + + @@ -1126,6 +1132,8 @@ + + @@ -1188,6 +1196,8 @@ + + @@ -1202,6 +1212,8 @@ + + @@ -2721,6 +2733,8 @@ + + @@ -2756,6 +2770,8 @@ + + @@ -2770,6 +2786,8 @@ + + @@ -2806,6 +2824,8 @@ + + @@ -2847,6 +2867,8 @@ + + @@ -2861,6 +2883,8 @@ + + @@ -4165,16 +4189,15 @@ - - + - - - + + + @@ -4205,28 +4228,26 @@ - - - - - - + + + + + - - + - - - + + + - + @@ -4279,11 +4300,10 @@ - - + @@ -4322,28 +4342,26 @@ - - - + + - - + + - + - - + - - - + + + - + @@ -6060,7 +6078,6 @@ - @@ -6112,7 +6129,6 @@ - @@ -6125,7 +6141,6 @@ - @@ -6212,7 +6227,6 @@ - @@ -6272,7 +6286,6 @@ - @@ -6286,7 +6299,6 @@ - diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetCancelledLicenses_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetCancelledLicenses_Result.cs index 082f426..c9d9885 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetCancelledLicenses_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetCancelledLicenses_Result.cs @@ -13,16 +13,15 @@ namespace AIAHTML5.ADMIN.API.Entity public partial class usp_GetCancelledLicenses_Result { - public Nullable Serial_No { get; set; } public string AccountNumber { get; set; } public string LicenseeName { get; set; } public string LicenseType { get; set; } public string InstitutionName { get; set; } public string AccountType { get; set; } public string Edition { get; set; } - public string StartDate { get; set; } - public string EndDate { get; set; } - public string LicenseCreationDate { get; set; } + public Nullable StartDate { get; set; } + public Nullable EndDate { get; set; } + public Nullable LicenseCreationDate { get; set; } public Nullable SubscriptionPrice { get; set; } public Nullable CardNumber { get; set; } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetDiscountReport_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetDiscountReport_Result.cs index 795e3e7..37d055c 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetDiscountReport_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetDiscountReport_Result.cs @@ -13,11 +13,10 @@ namespace AIAHTML5.ADMIN.API.Entity public partial class usp_GetDiscountReport_Result { - public Nullable RowNum { get; set; } public string DiscountCode { get; set; } - public decimal Percentage { get; set; } - public string StartDate { get; set; } - public string EndDate { get; set; } + public Nullable Percentage { get; set; } + public Nullable StartDate { get; set; } + public Nullable EndDate { get; set; } public string DiscountStatus { get; set; } public Nullable TotalLicenses { get; set; } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetExpiringLicenses_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetExpiringLicenses_Result.cs index b6b09c5..443740a 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetExpiringLicenses_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetExpiringLicenses_Result.cs @@ -13,18 +13,17 @@ namespace AIAHTML5.ADMIN.API.Entity public partial class usp_GetExpiringLicenses_Result { - public Nullable Serial_No { get; set; } public string AccountNumber { get; set; } public string LicenseeName { get; set; } public string LicenseType { get; set; } public string InstitutionName { get; set; } public string Edition { get; set; } - public string StartDate { get; set; } - public string EndDate { get; set; } - public string LicenseCreationDate { get; set; } + public Nullable StartDate { get; set; } + public Nullable EndDate { get; set; } + public Nullable LicenseCreationDate { get; set; } public Nullable SubscriptionPrice { get; set; } public string AccountType { get; set; } public Nullable DaysRemaining { get; set; } - public int CardNumber { get; set; } + public Nullable CardNumber { get; set; } } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetNetAdSummaryReport_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetNetAdSummaryReport_Result.cs index 13bcb56..4b2f295 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetNetAdSummaryReport_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetNetAdSummaryReport_Result.cs @@ -13,7 +13,6 @@ namespace AIAHTML5.ADMIN.API.Entity public partial class usp_GetNetAdSummaryReport_Result { - public Nullable Serial_No { get; set; } public string LicenseType { get; set; } public string AccountType { get; set; } public string InstitutionName { get; set; } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteLicenseUsageReports_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteLicenseUsageReports_Result.cs index f189ac0..7eddf8f 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteLicenseUsageReports_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteLicenseUsageReports_Result.cs @@ -13,13 +13,12 @@ namespace AIAHTML5.ADMIN.API.Entity public partial class usp_GetSiteLicenseUsageReports_Result { - public Nullable Serial_No { get; set; } public string AccountNumber { get; set; } public string EditionTitle { get; set; } public string ReferalUrl { get; set; } public string InstitutionName { get; set; } - public string LicenseCreationDate { get; set; } + public Nullable LicenseCreationDate { get; set; } public Nullable TotalLogins { get; set; } - public string LastLogin { get; set; } + public Nullable LastLogin { get; set; } } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSubscribedLicenses_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSubscribedLicenses_Result.cs index 9864887..43742bf 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSubscribedLicenses_Result.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSubscribedLicenses_Result.cs @@ -13,17 +13,16 @@ namespace AIAHTML5.ADMIN.API.Entity public partial class usp_GetSubscribedLicenses_Result { - public Nullable Serial_No { get; set; } public string AccountNumber { get; set; } public string LicenseeName { get; set; } public string LicenseType { get; set; } public string InstitutionName { get; set; } public string AccountType { get; set; } public string Edition { get; set; } - public string StartDate { get; set; } - public string EndDate { get; set; } - public string LicenseCreationDate { get; set; } + public Nullable StartDate { get; set; } + public Nullable EndDate { get; set; } + public Nullable LicenseCreationDate { get; set; } public Nullable SubscriptionPrice { get; set; } - public int CardNumber { get; set; } + public Nullable CardNumber { get; set; } } } diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/discountcodereport.component.html b/400-SOURCECODE/Admin/src/app/components/Reports/discountcodereport.component.html index 807282c..42ef7ff 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/discountcodereport.component.html +++ b/400-SOURCECODE/Admin/src/app/components/Reports/discountcodereport.component.html @@ -17,10 +17,11 @@
- +
-
- +
+ @@ -32,10 +33,11 @@
- +
-
- +
+ @@ -89,28 +91,7 @@
- - - - +
@@ -122,15 +103,15 @@
- +
- - - - - - + + + + + + @@ -141,8 +122,8 @@ - - + + diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/discountcodereport.component.ts b/400-SOURCECODE/Admin/src/app/components/Reports/discountcodereport.component.ts index 1430aaa..e213afb 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/discountcodereport.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/Reports/discountcodereport.component.ts @@ -55,6 +55,18 @@ export class DiscountCodeReport implements OnInit { recordCount: number; pageNo: number; pageLength: number; + actualPageNo: number; + actualPageLength: number; + SearchField:any={ + sFromDate:new Date(), + sToDate:new Date(), + iDiscountCode:0, + iAccountNumber:'', + sortColumn:'StartDate', + sortOrder:'asc', + pageNo:1, + pageLength:10 + }; // Declare height and width variables scrHeight:any; scrWidth:any; @@ -69,6 +81,9 @@ export class DiscountCodeReport implements OnInit { { this.scrHeight = window.innerHeight-400; } + if(this.scrHeight<=360) this.scrHeight=360; + + $(".ft_container").css("height",this.scrHeight); } constructor(private router: Router, private reportservice: ReportService, private manageDiscountCodeService: ManageDiscountCodeService, @@ -99,25 +114,12 @@ export class DiscountCodeReport implements OnInit { width: "100%", height: this.scrHeight, colModal: [ - { width: 200, align: 'center' }, + { width: 300, align: 'center' }, { width: 230, align: 'center' }, { width: 250, align: 'Center' }, { width: 250, align: 'Center' }, { width: 350, align: 'Center' }, - { width: 500, align: 'Center' }, - // { width: 130, align: 'Center' }, - // { width: 120, align: 'center' }, - // { width: 280, align: 'Center' }, - // { width: 180, align: 'center' }, - // { width: 200, align: 'center' }, - // { width: 170, align: 'center' }, - // { width: 80, align: 'center' }, - // { width: 150, align: 'center' }, - // { width: 150, align: 'center' }, - // { width: 180, align: 'Center' }, - //{ width: 400, align: 'Center' }, - //{ width: 150, align: 'center' }, - //{ width: 110, align: 'center' }, + { width: 400, align: 'Center' } ], sort: true }); @@ -127,16 +129,54 @@ export class DiscountCodeReport implements OnInit { this.recordCount = 0; this.pagerComponent = new PagerComponent(); - if(document.getElementById("fixed_table_rc") != null){ - document.getElementById("fixed_table_rc").remove(); - var testScript = document.createElement("script"); - testScript.setAttribute("id", "fixed_table_rc"); - testScript.setAttribute("src", "../assets/scripts/fixed_table_rc.js"); - testScript.setAttribute("type", "text/javascript"); - document.body.appendChild(testScript); - } + var thisObject=this;//class object + $(".ft_rwrapper table thead tr th").on("click",function(event){ + + if(event.currentTarget.id!=undefined && event.currentTarget.id!="" && event.currentTarget.id!=null) + { + var fieldName=event.currentTarget.id; + var sortType='' + var isAscSort = $(".ft_rwrapper table thead tr #"+fieldName).hasClass('fx_sort_asc'); + $(".ft_rwrapper table thead tr th").removeClass('fx_sort_asc fx_sort_desc'); + + if (isAscSort) { + $(".ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_desc').removeClass('fx_sort_asc'); + sortType="desc"; + } else { + $(".ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_asc').removeClass('fx_sort_desc'); + sortType="asc"; + } + + thisObject.SortTableRecords(fieldName,sortType); + + } + + }); } + + FromDateChange(dateValue: any){ + this.alerts = ''; + this.global.compareTwoDates(this.DiscountCodeReportForm.controls['sToDate'].value, dateValue._bsValue); + if (this.global.ValidationMsg != '') { + this.alerts = this.global.ValidationMsg; + } + } + + ToDateChange(dateValue: any){ + this.alerts = ''; + this.global.compareTwoDates(dateValue._bsValue, this.DiscountCodeReportForm.controls['sFromDate'].value); + if (this.global.ValidationMsg != '') { + this.alerts = this.global.ValidationMsg; + } + } + + SortTableRecords(fieldName:string,sortType:string) { + this.SearchField.sortColumn=fieldName; + this.SearchField.sortOrder=sortType; + + this.GetSubscriptionReportList(); + } GetDiscountCode() { this.reportservice.GetDiscountCodes().subscribe(st => { this.lstDiscountCode = st; }, error => this.error = error); @@ -155,34 +195,56 @@ export class DiscountCodeReport implements OnInit { } GetDiscountReport(evt: any) { - var tempArr = evt.split(','); - this.pageNo = parseInt(tempArr[0]); - var actulalength=this.pageLength; + this.actualPageNo = this.pageNo; + this.actualPageLength =this.pageLength; + + var tempArr = evt.split(','); + this.pageNo = parseInt(tempArr[0]); this.pageLength = parseInt(tempArr[1]); - this.alerts = ''; - this.global.compareTwoDates(this.DiscountCodeReportForm.controls['sToDate'].value, this.DiscountCodeReportForm.controls['sFromDate'].value); - if (this.global.ValidationMsg != '') { - this.alerts = this.global.ValidationMsg + + this.SearchField.pageNo=this.pageNo; + this.SearchField.pageLength=this.pageLength; + + this.GetSubscriptionReportList(); + } + + GetSubscriptionReportList() { + this._loadingService.ShowLoading("global-loading"); + $(".ft_rwrapper table thead tr th").removeClass('fx_sort_asc fx_sort_desc'); + + if (this.SearchField.sortOrder=='asc') { + $(".ft_rwrapper table thead tr #"+this.SearchField.sortColumn).addClass('fx_sort_asc').removeClass('fx_sort_desc'); + } else + { + $(".ft_rwrapper table thead tr #"+this.SearchField.sortColumn).addClass('fx_sort_desc').removeClass('fx_sort_asc'); + } + if (this.ExportingStart) { + this.reportservice.GetDiscountReport(this.SearchField).subscribe((DiscountCodeReports: DiscountCodeReports[]) => { + //reset length after csvexport + this.pageNo = this.actualPageNo; + this.pageLength=this.actualPageLength; + + this.SearchField.pageNo=this.pageNo; + this.SearchField.pageLength=this.pageLength; + this.ExportService(DiscountCodeReports); }, error => this.error = error); } - if (this.alerts == '') { - this._loadingService.ShowLoading("global-loading"); - this.NewSubscription = this.DiscountCodeReportForm.value; - var obj = this.NewSubscription; - if (this.ExportingStart) { - this.reportservice.GetDiscountReport(obj, this.pageNo, this.pageLength).subscribe((DiscountCodeReports: DiscountCodeReports[]) => { - //reset length after csvexport - this.pageLength=actulalength; - this.ExportService(DiscountCodeReports); }, error => this.error = error); - } - else { - this.reportservice.GetDiscountReport(obj, this.pageNo, this.pageLength).subscribe((DiscountCodeReports: DiscountCodeReports[]) => { this.BindFormFields(DiscountCodeReports); }, error => this.error = error); - } + else { + this.reportservice.GetDiscountReport(this.SearchField).subscribe((DiscountCodeReports: DiscountCodeReports[]) => { this.BindFormFields(DiscountCodeReports); }, error => this.error = error); } - } - - SearchRecords() { + this.ExportingStart = false; - this.GetDiscountReport('1, ' + this.pageLength); + } + SearchRecords() { + this.ExportingStart = false; + this.pageNo=1; + this.SearchField.sFromDate=this.DiscountCodeReportForm.controls['sFromDate'].value; + this.SearchField.sToDate=this.DiscountCodeReportForm.controls['sToDate'].value; + this.SearchField.iDiscountCode=this.DiscountCodeReportForm.controls['iDiscountCode'].value; + this.SearchField.iAccountNumber=this.DiscountCodeReportForm.controls['iAccountNumber'].value; + + this.SearchField.pageNo=this.pageNo; + + this.GetSubscriptionReportList(); } BindFormFields(data) { @@ -205,18 +267,19 @@ export class DiscountCodeReport implements OnInit { if (this.buttonStatus) { this.ExportingStart = true; this.GetDiscountReport('1, ' + this.recordCount); - this.ExportingStart = false; } } ExportService(data: any) { - for (let c = 0; c < this.global.RemoveColumns.length; c++) { - for (let i = 0; i < data.DiscountReportList.length; i++) { - delete data.DiscountReportList[i][this.global.RemoveColumns[c].toString()]; - } - } - this._loadingService.HideLoading("global-loading"); - this.global.ExportToCSV(data.DiscountReportList, "DiscountReport-" + this.date.getDay() + "-" + this.date.getMonth() + "-" + this.date.getSeconds()) + + for (let i = 0; i < data.DiscountReportList.length; i++) { + data.DiscountReportList[i]['StartDate']= this.datePipe.transform(data.DiscountReportList[i]['StartDate'], 'MM/dd/yyyy'); + data.DiscountReportList[i]['EndDate']= this.datePipe.transform(data.DiscountReportList[i]['EndDate'], 'MM/dd/yyyy'); + } + + var reportname=+ this.date.getDay() + "-" + (this.date.getMonth()+1) + "-" + this.date.getSeconds() + this.global.ExportToCSV(data.DiscountReportList, "DiscountReport-"+reportname); + this._loadingService.HideLoading("global-loading"); } } diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/expiringsubscriptionreport.component.html b/400-SOURCECODE/Admin/src/app/components/Reports/expiringsubscriptionreport.component.html index d6b0367..15f2900 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/expiringsubscriptionreport.component.html +++ b/400-SOURCECODE/Admin/src/app/components/Reports/expiringsubscriptionreport.component.html @@ -22,10 +22,11 @@
- +
-
- +
+ @@ -37,10 +38,11 @@
- +
-
- +
+ @@ -140,7 +142,7 @@
- +
@@ -152,21 +154,20 @@
-
Discount CodePercentageStart DateEnd DateStatusTotal LicenseDiscount CodePercentageStart DateEnd DateStatusTotal License
{{item.DiscountCode}} {{item.Percentage}}%{{item.StartDate}}{{item.EndDate}}{{item.StartDate | date: 'MM/dd/yyyy'}}{{item.EndDate | date: 'MM/dd/yyyy'}} {{item.DiscountStatus}} {{item.TotalLicenses}}
+
- - - - - - - - - - - - + + + + + + + + + + + @@ -179,11 +180,10 @@ - - - - - + + + + diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/expiringsubscriptionreport.component.ts b/400-SOURCECODE/Admin/src/app/components/Reports/expiringsubscriptionreport.component.ts index 7d3086d..8287bf1 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/expiringsubscriptionreport.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/Reports/expiringsubscriptionreport.component.ts @@ -58,10 +58,25 @@ export class ExpiringSubscriptionReport implements OnInit, AfterViewChecked { recordCount: number; pageNo: number; pageLength: number; - key: string = 'AccountNumber'; //set default - reverse: boolean = false; - ExpiringSubscription = new ExpiringSubscriptionReports(); + actualPageNo: number; + actualPageLength: number; + SearchField:any={ + sFromDate:new Date(), + sToDate:new Date(), + iLicenseTypeId:0, + iAccountTypeId:0, + sZip:'', + iStateId:0, + iCountryId:0, + iStartPrice:0, + iEndPrice:-1, + sortColumn:'AccountNumber', + sortOrder:'asc', + pageNo:1, + pageLength:10 + }; + // Declare height and width variables scrHeight:any; scrWidth:any; @@ -76,6 +91,9 @@ export class ExpiringSubscriptionReport implements OnInit, AfterViewChecked { { this.scrHeight = window.innerHeight-480; } + if(this.scrHeight<=360) this.scrHeight=360; + + $(".ft_container").css("height",this.scrHeight); } constructor(private router: Router, private reportservice: ReportService, @@ -87,16 +105,15 @@ export class ExpiringSubscriptionReport implements OnInit, AfterViewChecked { this.ExportingStart = false; this.bsConfig = Object.assign({}, { containerClass: 'theme-dark-blue' }); this.NoRecord = this.global.NoRecords; - let ExpiringSubscriptionReport = new ExpiringSubscriptionReports(); this.previousdate.setDate(this.previousdate.getDate()); this.ExpiringSubscriptionReportForm = this.fb.group({ - sFromDate: [this.previousdate], - sToDate: [this.date], + sFromDate: [this.previousdate,[Validators.required]], + sToDate: [this.date,[Validators.required]], sZip: [''], iLicenseTypeId: [0], iAccountTypeId: [0], iStateId: [0], - iStartPrice: [0.00], + iStartPrice: [''], iEndPrice: [''], iCountryId: [0] }); @@ -116,38 +133,71 @@ export class ExpiringSubscriptionReport implements OnInit, AfterViewChecked { width: "100%", height: this.scrHeight, colModal: [ - { width: 160, align: 'center' }, + { width: 150, align: 'center' }, { width: 180, align: 'center' }, { width: 150, align: 'Center' }, { width: 250, align: 'Center' }, { width: 160, align: 'Center' }, { width: 130, align: 'Center' }, { width: 130, align: 'Center' }, - { width: 150, align: 'center' }, + { width: 160, align: 'center' }, { width: 160, align: 'Center' }, { width: 150, align: 'center' }, - { width: 160, align: 'center' }, - // { width: 170, align: 'center' }, - // { width: 80, align: 'center' }, - // { width: 150, align: 'center' }, - // { width: 150, align: 'center' }, - // { width: 180, align: 'Center' }, - //{ width: 400, align: 'Center' }, - //{ width: 150, align: 'center' }, - //{ width: 110, align: 'center' }, + { width: 140, align: 'center' }, + ], sort: true }); - if(document.getElementById("fixed_table_rc") != null){ - document.getElementById("fixed_table_rc").remove(); - var testScript = document.createElement("script"); - testScript.setAttribute("id", "fixed_table_rc"); - testScript.setAttribute("src", "../assets/scripts/fixed_table_rc.js"); - testScript.setAttribute("type", "text/javascript"); - document.body.appendChild(testScript); - } + var thisObject=this;//class object + $(".ft_rwrapper table thead tr th").on("click",function(event){ + + if(event.currentTarget.id!=undefined && event.currentTarget.id!="" && event.currentTarget.id!=null) + { + var fieldName=event.currentTarget.id; + var sortType='' + var isAscSort = $(".ft_rwrapper table thead tr #"+fieldName).hasClass('fx_sort_asc'); + $(".ft_rwrapper table thead tr th").removeClass('fx_sort_asc fx_sort_desc'); + + if (isAscSort) { + $(".ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_desc').removeClass('fx_sort_asc'); + sortType="desc"; + } else { + $(".ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_asc').removeClass('fx_sort_desc'); + sortType="asc"; + } + + thisObject.SortTableRecords(fieldName,sortType); + + } + + }); + } + + FromDateChange(dateValue: any){ + this.alerts = ''; + this.global.compareTwoDates(this.ExpiringSubscriptionReportForm.controls['sToDate'].value, dateValue._bsValue); + if (this.global.ValidationMsg != '') { + this.alerts = this.global.ValidationMsg; + } + } + + ToDateChange(dateValue: any){ + this.alerts = ''; + this.global.compareTwoDates(dateValue._bsValue, this.ExpiringSubscriptionReportForm.controls['sFromDate'].value); + if (this.global.ValidationMsg != '') { + this.alerts = this.global.ValidationMsg; + } + } + + SortTableRecords(fieldName:string,sortType:string) { + this.SearchField.sortColumn=fieldName; + this.SearchField.sortOrder=sortType; + + this.GetExpiringSubscriptionReportList(); + } + ngAfterViewChecked() { $('#fixed_hdr2 thead').css('width', $('#fixed_hdr2 tbody tr:eq(0)').width()); } @@ -168,58 +218,84 @@ export class ExpiringSubscriptionReport implements OnInit, AfterViewChecked { } GetExpiringSubscriptionReport(evt: any) { - var tempArr = evt.split(','); - this.pageNo = parseInt(tempArr[0]); - var actulalength=this.pageLength; + this.actualPageNo = this.pageNo; + this.actualPageLength =this.pageLength; + + var tempArr = evt.split(','); + this.pageNo = parseInt(tempArr[0]); this.pageLength = parseInt(tempArr[1]); - this.alerts = ''; - this.global.compareTwoDates(this.ExpiringSubscriptionReportForm.controls['sToDate'].value, this.ExpiringSubscriptionReportForm.controls['sFromDate'].value); - if (this.global.ValidationMsg != '') { - this.alerts = this.global.ValidationMsg - } - if (this.alerts == '') { - this._loadingService.ShowLoading("global-loading"); - this.ExpiringSubscription = this.ExpiringSubscriptionReportForm.value; - var obj = this.ExpiringSubscription; - if (this.ExportingStart) { - this.reportservice.GetExpiringSubscriptionReport(obj, this.pageNo, this.pageLength).subscribe((ExpiringSubscriptionReports: ExpiringSubscriptionReports[]) => { - //reset length after csvexport - this.pageLength=actulalength; - this.ExportService(ExpiringSubscriptionReports); }, error => this.error = error); - } - else { - this.reportservice.GetExpiringSubscriptionReport(obj, this.pageNo, this.pageLength).subscribe((ExpiringSubscriptionReports: ExpiringSubscriptionReports[]) => { this.BindFormFields(ExpiringSubscriptionReports); }, error => this.error = error); - } - - } - + + this.SearchField.pageNo=this.pageNo; + this.SearchField.pageLength=this.pageLength; + + this.GetExpiringSubscriptionReportList(); } - SearchRecords() { + + GetExpiringSubscriptionReportList() { + this._loadingService.ShowLoading("global-loading"); + $(".ft_rwrapper table thead tr th").removeClass('fx_sort_asc fx_sort_desc'); + + if (this.SearchField.sortOrder=='asc') { + $(".ft_rwrapper table thead tr #"+this.SearchField.sortColumn).addClass('fx_sort_asc').removeClass('fx_sort_desc'); + } else + { + $(".ft_rwrapper table thead tr #"+this.SearchField.sortColumn).addClass('fx_sort_desc').removeClass('fx_sort_asc'); + } + if (this.ExportingStart) { + this.reportservice.GetExpiringSubscriptionReport(this.SearchField).subscribe((ExpiringSubscriptionReports: ExpiringSubscriptionReports[]) => { + //reset length after csvexport + this.pageNo = this.actualPageNo; + this.pageLength=this.actualPageLength; + + this.SearchField.pageNo=this.pageNo; + this.SearchField.pageLength=this.pageLength; + this.ExportService(ExpiringSubscriptionReports); }, error => this.error = error); + } + else { + this.reportservice.GetExpiringSubscriptionReport(this.SearchField).subscribe((ExpiringSubscriptionReports: ExpiringSubscriptionReports[]) => { this.BindFormFields(ExpiringSubscriptionReports); }, error => this.error = error); + } + this.ExportingStart = false; - this.GetExpiringSubscriptionReport('1, ' + this.pageLength); + } + + + SearchRecords() { + this.ExportingStart = false; + this.pageNo=1; + this.SearchField.sFromDate=this.ExpiringSubscriptionReportForm.controls['sFromDate'].value; + this.SearchField.sToDate=this.ExpiringSubscriptionReportForm.controls['sToDate'].value; + this.SearchField.iLicenseTypeId=this.ExpiringSubscriptionReportForm.controls['iLicenseTypeId'].value; + this.SearchField.iAccountTypeId=this.ExpiringSubscriptionReportForm.controls['iAccountTypeId'].value; + this.SearchField.sZip=this.ExpiringSubscriptionReportForm.controls['sZip'].value; + this.SearchField.iStateId=this.ExpiringSubscriptionReportForm.controls['iStateId'].value; + this.SearchField.iCountryId=this.ExpiringSubscriptionReportForm.controls['iCountryId'].value; + this.SearchField.iStartPrice=this.ExpiringSubscriptionReportForm.controls['iStartPrice'].value; + this.SearchField.iEndPrice=this.ExpiringSubscriptionReportForm.controls['iEndPrice'].value; + + this.SearchField.pageNo=this.pageNo; + + this.GetExpiringSubscriptionReportList(); + } + ExportEvent() { if (this.buttonStatus) { this.ExportingStart = true; - this.GetExpiringSubscriptionReport('1, ' + this.recordCount); - this.ExportingStart = false; + this.GetExpiringSubscriptionReport('1, ' + this.recordCount); } } ExportService(data: any) { - for (let c = 0; c < this.global.RemoveColumns.length; c++) { - for (let i = 0; i < data.ExpiringSubscription.length; i++) { - delete data.ExpiringSubscription[i][this.global.RemoveColumns[c].toString()]; - } - } + for (let i = 0; i < data.ExpiringSubscription.length; i++) { + data.ExpiringSubscription[i]['StartDate']= this.datePipe.transform(data.ExpiringSubscription[i]['StartDate'], 'MM/dd/yyyy'); + data.ExpiringSubscription[i]['EndDate']= this.datePipe.transform(data.ExpiringSubscription[i]['EndDate'], 'MM/dd/yyyy'); + data.ExpiringSubscription[i]['LicenseCreationDate']= this.datePipe.transform(data.ExpiringSubscription[i]['LicenseCreationDate'], 'MM/dd/yyyy'); + } + + var reportname=+ this.date.getDay() + "-" + (this.date.getMonth()+1) + "-" + this.date.getSeconds() + this.global.ExportToCSV(data.ExpiringSubscription, "ExpiringSubscriptionReport-"+reportname); + this._loadingService.HideLoading("global-loading"); - this.global.ExportToCSV(data.ExpiringSubscription, "ExpiringSubscriptionReport-" + this.date.getDay() + "-" + this.date.getMonth() + "-" + this.date.getSeconds()) - - } - - sort(key) { - debugger;; - this.key = key; - this.reverse = !this.reverse; + } BindFormFields(datas) { diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.ts b/400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.ts index ff42e16..2ce6a19 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.ts @@ -247,7 +247,7 @@ export class ImageExportReport implements OnInit { } var reportname=+ this.date.getDay() + "-" + (this.date.getMonth()+1) + "-" + this.date.getSeconds() - this.global.ExportToCSV(data.ImageExportList, "UsageReport-"+reportname); + this.global.ExportToCSV(data.ImageExportList, "ImageExportReport-"+reportname); this._loadingService.HideLoading("global-loading"); diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/netadsubscriptionreport.component.html b/400-SOURCECODE/Admin/src/app/components/Reports/netadsubscriptionreport.component.html index 57ff162..873553b 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/netadsubscriptionreport.component.html +++ b/400-SOURCECODE/Admin/src/app/components/Reports/netadsubscriptionreport.component.html @@ -16,10 +16,11 @@
- +
-
- +
+ @@ -31,10 +32,11 @@
- +
-
- +
+ @@ -83,7 +85,7 @@
- +
@@ -93,17 +95,17 @@
-
Account NumberLicensee NameLicense TypeInstitution NameAccount TypeStart DateEnd DateOriginal Entry DateSubscription PriceTime PeriodCredit Card NumberAccount NumberLicensee NameLicense TypeInstitution NameAccount TypeStart DateEnd DateOriginal Entry DateSubscription PriceTime PeriodCard Number
{{esr.LicenseeName}} {{esr.LicenseType}} {{esr.InstitutionName}}{{esr.AccountType}}{{esr.StartDate}}{{esr.EndDate}}{{esr.LicenseCreationDate}}{{esr.AccountType}}{{esr.StartDate | date: 'MM/dd/yyyy'}}{{esr.EndDate | date: 'MM/dd/yyyy'}}{{esr.LicenseCreationDate | date: 'MM/dd/yyyy'}} {{esr.SubscriptionPrice}} {{esr.DaysRemaining}} {{esr.CardNumber}}
+
- - - - - - - - + + + + + + + + @@ -114,7 +116,7 @@ - + diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/netadsubscriptionreport.component.ts b/400-SOURCECODE/Admin/src/app/components/Reports/netadsubscriptionreport.component.ts index 688bdc4..b05918e 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/netadsubscriptionreport.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/Reports/netadsubscriptionreport.component.ts @@ -54,6 +54,19 @@ export class NetAdSubscriptionReport implements OnInit { recordCount: number; pageNo: number; pageLength: number; + actualPageNo: number; + actualPageLength: number; + SearchField:any={ + sFromDate:new Date(), + sToDate:new Date(), + iLicenseTypeId:0, + iStartPrice:0, + iEndPrice:-1, + sortColumn:'LicenseCreationDate', + sortOrder:'asc', + pageNo:1, + pageLength:10 + }; // Declare height and width variables scrHeight:any; scrWidth:any; @@ -68,6 +81,9 @@ export class NetAdSubscriptionReport implements OnInit { { this.scrHeight = window.innerHeight-405; } + if(this.scrHeight<=360) this.scrHeight=360; + + $(".ft_container").css("height",this.scrHeight); } constructor(private router: Router, private reportservice: ReportService, private fb: FormBuilder, private modalService: BsModalService, public global: GlobalService, @@ -84,7 +100,7 @@ export class NetAdSubscriptionReport implements OnInit { sFromDate: [this.previousdate], sToDate: [this.date], iLicenseTypeId: [0], - iStartPrice: [0], + iStartPrice: [''], iEndPrice: [''], }); this.alerts = ''; @@ -101,67 +117,121 @@ export class NetAdSubscriptionReport implements OnInit { colModal: [ { width: 180, align: 'center' }, { width: 230, align: 'center' }, - { width: 250, align: 'Center' }, - { width: 150, align: 'Center' }, - { width: 350, align: 'Center' }, + { width: 300, align: 'Center' }, + { width: 200, align: 'Center' }, + { width: 300, align: 'Center' }, { width: 200, align: 'Center' }, { width: 250, align: 'Center' }, - { width: 120, align: 'center' }, - // { width: 280, align: 'Center' }, - // { width: 180, align: 'center' }, - // { width: 200, align: 'center' }, - // { width: 170, align: 'center' }, - // { width: 80, align: 'center' }, - // { width: 150, align: 'center' }, - // { width: 150, align: 'center' }, - // { width: 180, align: 'Center' }, + { width: 130, align: 'center' } ], sort: true }); - if(document.getElementById("fixed_table_rc") != null){ - document.getElementById("fixed_table_rc").remove(); - var testScript = document.createElement("script"); - testScript.setAttribute("id", "fixed_table_rc"); - testScript.setAttribute("src", "../assets/scripts/fixed_table_rc.js"); - testScript.setAttribute("type", "text/javascript"); - document.body.appendChild(testScript); - } + + var thisObject=this;//class object + $(".ft_rwrapper table thead tr th").on("click",function(event){ + + if(event.currentTarget.id!=undefined && event.currentTarget.id!="" && event.currentTarget.id!=null) + { + var fieldName=event.currentTarget.id; + var sortType='' + var isAscSort = $(".ft_rwrapper table thead tr #"+fieldName).hasClass('fx_sort_asc'); + $(".ft_rwrapper table thead tr th").removeClass('fx_sort_asc fx_sort_desc'); + + if (isAscSort) { + $(".ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_desc').removeClass('fx_sort_asc'); + sortType="desc"; + } else { + $(".ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_asc').removeClass('fx_sort_desc'); + sortType="asc"; + } + + thisObject.SortTableRecords(fieldName,sortType); + + } + + }); } + + FromDateChange(dateValue: any){ + this.alerts = ''; + this.global.compareTwoDates(this.NetAdSubscriptionReportForm.controls['sToDate'].value, dateValue._bsValue); + if (this.global.ValidationMsg != '') { + this.alerts = this.global.ValidationMsg; + } + } + + ToDateChange(dateValue: any){ + this.alerts = ''; + this.global.compareTwoDates(dateValue._bsValue, this.NetAdSubscriptionReportForm.controls['sFromDate'].value); + if (this.global.ValidationMsg != '') { + this.alerts = this.global.ValidationMsg; + } + } + + SortTableRecords(fieldName:string,sortType:string) { + this.SearchField.sortColumn=fieldName; + this.SearchField.sortOrder=sortType; + + this.GetNetAdSummaryReportList(); + } GetLicenceType() { this.reportservice.GetLicenceType().subscribe(st => { this.lstLicenceType = st; }, error => this.error = error); } - - GetNetAdSummaryReport(evt: any) { - this.alerts = ''; - this.global.compareTwoDates(this.NetAdSubscriptionReportForm.controls['sToDate'].value, this.NetAdSubscriptionReportForm.controls['sFromDate'].value); - if (this.global.ValidationMsg != '') { - this.alerts = this.global.ValidationMsg - } - if (this.alerts == '') { - this._loadingService.ShowLoading("global-loading"); - var tempArr = evt.split(','); - this.pageNo = parseInt(tempArr[0]); - var actulalength=this.pageLength; - this.pageLength = parseInt(tempArr[1]); - this._loadingService.ShowLoading("global-loading"); - this.NetAdSubscriptionReport = this.NetAdSubscriptionReportForm.value; - var obj = this.NetAdSubscriptionReport; - if (this.ExportingStart) { - this.reportservice.GetNetAdSummaryReport(obj, this.pageNo, this.pageLength).subscribe((NetAdSubscriptionReports: NetAdSubscriptionReports[]) => { - //reset length after csvexport - this.pageLength=actulalength; - this.ExportService(NetAdSubscriptionReports); }, error => this.error = error); - } - else { - this.reportservice.GetNetAdSummaryReport(obj, this.pageNo, this.pageLength).subscribe((NetAdSubscriptionReports: NetAdSubscriptionReports[]) => { this.BindFormFields(NetAdSubscriptionReports); }, error => this.error = error); - } - } + + GetNetAdSummaryReport(evt: any) { + this.actualPageNo = this.pageNo; + this.actualPageLength =this.pageLength; + + var tempArr = evt.split(','); + this.pageNo = parseInt(tempArr[0]); + this.pageLength = parseInt(tempArr[1]); + + this.SearchField.pageNo=this.pageNo; + this.SearchField.pageLength=this.pageLength; + + this.GetNetAdSummaryReportList(); } + + GetNetAdSummaryReportList() { + this._loadingService.ShowLoading("global-loading"); + $(".ft_rwrapper table thead tr th").removeClass('fx_sort_asc fx_sort_desc'); + + if (this.SearchField.sortOrder=='asc') { + $(".ft_rwrapper table thead tr #"+this.SearchField.sortColumn).addClass('fx_sort_asc').removeClass('fx_sort_desc'); + } else + { + $(".ft_rwrapper table thead tr #"+this.SearchField.sortColumn).addClass('fx_sort_desc').removeClass('fx_sort_asc'); + } + if (this.ExportingStart) { + this.reportservice.GetNetAdSummaryReport(this.SearchField).subscribe((NetAdSubscriptionReports: NetAdSubscriptionReports[]) => { + //reset length after csvexport + this.pageNo = this.actualPageNo; + this.pageLength=this.actualPageLength; + + this.SearchField.pageNo=this.pageNo; + this.SearchField.pageLength=this.pageLength; + this.ExportService(NetAdSubscriptionReports); }, error => this.error = error); + } + else { + this.reportservice.GetNetAdSummaryReport(this.SearchField).subscribe((NetAdSubscriptionReports: NetAdSubscriptionReports[]) => { this.BindFormFields(NetAdSubscriptionReports); }, error => this.error = error); + } + + this.ExportingStart = false; + } SearchRecords() { - this.ExportingStart = false; - this.GetNetAdSummaryReport('1, ' + this.pageLength); + this.ExportingStart = false; + this.pageNo=1; + this.SearchField.sFromDate=this.NetAdSubscriptionReportForm.controls['sFromDate'].value; + this.SearchField.sToDate=this.NetAdSubscriptionReportForm.controls['sToDate'].value; + this.SearchField.iLicenseTypeId=this.NetAdSubscriptionReportForm.controls['iLicenseTypeId'].value; + this.SearchField.iStartPrice=this.NetAdSubscriptionReportForm.controls['iStartPrice'].value; + this.SearchField.iEndPrice=this.NetAdSubscriptionReportForm.controls['iEndPrice'].value; + + this.SearchField.pageNo=this.pageNo; + + this.GetNetAdSummaryReportList(); } BindFormFields(data) { @@ -175,22 +245,22 @@ export class NetAdSubscriptionReport implements OnInit { this.TotalNetAdSubscription=[{ AccountType:lastentry.AccountType, ActiveSubscription:lastentry.ActiveSubscription, - AccounInActiveSubscriptiontType:lastentry.InActiveSubscription, + InActiveSubscription:lastentry.InActiveSubscription, InstitutionName:lastentry.InstitutionName, LicenseType:lastentry.LicenseType, NetAdSubscription:lastentry.NetAdSubscription, RenewSubscription:lastentry.RenewSubscription, }] + this.lstNetAdSubscriptionReport.splice(index-1,1); } - this.lstNetAdSubscriptionReport.splice(index-1,1) - if (this.lstNetAdSubscriptionReport.length > 0) { this.NoRecord = ''; this.buttonStatus = true; this._loadingService.HideLoading("global-loading"); } + if (this.lstNetAdSubscriptionReport.length == 0) { this.NoRecord = this.global.NoRecords; this._loadingService.HideLoading("global-loading"); @@ -202,20 +272,18 @@ export class NetAdSubscriptionReport implements OnInit { if (this.buttonStatus) { this.ExportingStart = true; this.GetNetAdSummaryReport('1, ' + this.recordCount); - this.ExportingStart = false; } } - ExportService(data: any) { - - for (let c = 0; c < this.global.RemoveColumns.length; c++) { - for (let i = 0; i < data.NetAdSubscriptionList.length; i++) { - delete data.NetAdSubscriptionList[i][this.global.RemoveColumns[c].toString()]; - } - } - - this._loadingService.HideLoading("global-loading"); - this.global.ExportToCSV(data.NetAdSubscriptionList, "NetAdSummaryReport-" + this.date.getDay() + "-" + this.date.getMonth() + "-" + this.date.getSeconds()) - + ExportService(data: any) { + for (let i = 0; i < data.NetAdSubscriptionList.length; i++) { + if( data.NetAdSubscriptionList[i]['LicenseType']!='Total') + data.NetAdSubscriptionList[i]['LicenseCreationDate']= this.datePipe.transform(data.NetAdSubscriptionList[i]['LicenseCreationDate'], 'MM/dd/yyyy'); + } + + var reportname=+ this.date.getDay() + "-" + (this.date.getMonth()+1) + "-" + this.date.getSeconds() + this.global.ExportToCSV(data.NetAdSubscriptionList, "NetAdSummaryReport-"+reportname); + + this._loadingService.HideLoading("global-loading"); } } diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/report.service.ts b/400-SOURCECODE/Admin/src/app/components/Reports/report.service.ts index 7cd317c..bb09e75 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/report.service.ts +++ b/400-SOURCECODE/Admin/src/app/components/Reports/report.service.ts @@ -102,13 +102,14 @@ export class ReportService { } - GetExpiringSubscriptionReport(obj: any, pageNo: number, pageLength: number) { - if (obj.sFromDate == '') { + GetExpiringSubscriptionReport(obj: any) { + if (obj.sFromDate == '' || obj.sFromDate == null) { obj.sFromDate = '1/1/1'; } - if (obj.sToDate == '') { + if (obj.sToDate == '' || obj.sToDate == null) { obj.sToDate = '1/1/9999'; - } + } + if (obj.iStartPrice == undefined || obj.iStartPrice==='') obj.iStartPrice = -1; @@ -127,17 +128,19 @@ export class ReportService { "&sZip=" + obj.sZip + "&iStateId=" + obj.iStateId + "&iCountryId=" + obj.iCountryId + - "&pageNo=" + pageNo + - "&pageLength=" + pageLength) + "&sortColumn=" + obj.sortColumn + + "&sortOrder=" + obj.sortOrder + + "&pageNo=" + obj.pageNo + + "&pageLength=" + obj.pageLength) .map(this.extractData) .catch((res: Response) => this.handleError(res)); } - GetSubscriptionReport(obj: any, pageNo: number, pageLength: number) { - if (obj.sFromDate == '') { + GetSubscriptionReport(obj: any) { + if (obj.sFromDate == '' || obj.sFromDate == null) { obj.sFromDate = '1/1/1'; } - if (obj.sToDate == '') { + if (obj.sToDate == '' || obj.sToDate == null) { obj.sToDate = '1/1/9999'; } obj.sFromDate = this.datePipe.transform(obj.sFromDate, 'MM/dd/yyyy'); @@ -155,23 +158,26 @@ export class ReportService { "&iAccountTypeId=" + obj.iAccountTypeId + "&sZip=" + obj.sZip + "&iStateId=" + obj.iStateId + - "&iCountryId=" + obj.iCountryId + - "&pageNo=" + pageNo + - "&pageLength=" + pageLength) + "&iCountryId=" + obj.iCountryId + + "&sortColumn=" + obj.sortColumn + + "&sortOrder=" + obj.sortOrder + + "&pageNo=" + obj.pageNo + + "&pageLength=" + obj.pageLength) .map(this.extractData) .catch((res: Response) => this.handleError(res)); } - GetSubscriptionCancellationReport(obj: any, pageNo: number, pageLength: number) { - if (obj.sFromDate == '') { + GetSubscriptionCancellationReport(obj: any) { + if (obj.sFromDate == '' || obj.sFromDate == null) { obj.sFromDate = '1/1/1'; } - if (obj.sToDate == '') { + if (obj.sToDate == '' || obj.sToDate == null) { obj.sToDate = '1/1/9999'; } obj.sFromDate = this.datePipe.transform(obj.sFromDate, 'MM/dd/yyyy'); obj.sToDate = this.datePipe.transform(obj.sToDate, 'MM/dd/yyyy'); - if (obj.icStartPrice == undefined || obj.icStartPrice === '') + + if (obj.icStartPrice == undefined || obj.icStartPrice === '') obj.icStartPrice = -1; if (obj.icEndPrice == undefined || obj.icEndPrice === '') obj.icEndPrice = -1; @@ -185,46 +191,50 @@ export class ReportService { "&sZip=" + obj.sZip + "&iStateId=" + obj.iStateId + "&iCountryId=" + obj.iCountryId + - "&pageNo=" + pageNo + - "&pageLength=" + pageLength) + "&sortColumn=" + obj.sortColumn + + "&sortOrder=" + obj.sortOrder + + "&pageNo=" + obj.pageNo + + "&pageLength=" + obj.pageLength) .map(this.extractData) .catch((res: Response) => this.handleError(res)); } - GetNetAdSummaryReport(obj: any, pageNo: number, pageLength: number) { - if (obj.sFromDate == '') { - obj.sFromDate = '1/1/1'; - } - if (obj.sToDate == '') { - obj.sToDate = '1/1/9999'; - } + GetNetAdSummaryReport(obj: any) { + if (obj.sFromDate == '' || obj.sFromDate == null) { + obj.sFromDate = '1/1/1'; + } + if (obj.sToDate == '' || obj.sToDate == null) { + obj.sToDate = '1/1/9999'; + } obj.sFromDate = this.datePipe.transform(obj.sFromDate, 'MM/dd/yyyy'); obj.sToDate = this.datePipe.transform(obj.sToDate, 'MM/dd/yyyy'); - if (obj.icStartPrice == undefined || obj.icStartPrice == '') - obj.icStartPrice = -1; - if (obj.icEndPrice == undefined || obj.icEndPrice == '') - obj.icEndPrice = -1; + if (obj.iStartPrice == undefined || obj.iStartPrice == '') + obj.iStartPrice = -1; + if (obj.iEndPrice == undefined || obj.iEndPrice == '') + obj.iEndPrice = -1; return this.http.get(this.commonService.resourceBaseUrl + "Report/GetNetAdSummaryReport?sFromDate=" + obj.sFromDate + "&sToDate=" + obj.sToDate + - "&iStartPrice=" + obj.icStartPrice + - "&iEndPrice=" + obj.icEndPrice + + "&iStartPrice=" + obj.iStartPrice + + "&iEndPrice=" + obj.iEndPrice + "&iLicenseTypeId=" + obj.iLicenseTypeId + - "&pageNo=" + pageNo + - "&pageLength=" + pageLength) + "&sortColumn=" + obj.sortColumn + + "&sortOrder=" + obj.sortOrder + + "&pageNo=" + obj.pageNo + + "&pageLength=" + obj.pageLength) .map(this.extractData) .catch((res: Response) => this.handleError(res)); } - GetSiteLicenseUsageReport(obj: any, pageNo: number, pageLength: number) { - if (obj.sFromDate == '') { - obj.sFromDate = '1/1/1'; - } - if (obj.sToDate == '') { - obj.sToDate = '1/1/9999'; - } + GetSiteLicenseUsageReport(obj: any) { + if (obj.sFromDate == '' || obj.sFromDate == null) { + obj.sFromDate = '1/1/1'; + } + if (obj.sToDate == '' || obj.sToDate == null) { + obj.sToDate = '1/1/9999'; + } obj.sFromDate = this.datePipe.transform(obj.sFromDate, 'MM/dd/yyyy'); obj.sToDate = this.datePipe.transform(obj.sToDate, 'MM/dd/yyyy'); if (obj.sAccountNumber == null) @@ -235,20 +245,22 @@ export class ReportService { "&sAccountNumber=" + obj.sAccountNumber + "&iEdition=" + obj.iEdition + "&iLoginTypeId=" + obj.iLoginTypeId + - "&pageNo=" + pageNo + - "&pageLength=" + pageLength) + "&sortColumn=" + obj.sortColumn + + "&sortOrder=" + obj.sortOrder + + "&pageNo=" + obj.pageNo + + "&pageLength=" + obj.pageLength) .map(this.extractData) .catch((res: Response) => this.handleError(res)); } - GetDiscountReport(obj: any, pageNo: number, pageLength: number) { - if (obj.sFromDate == '') { - obj.sFromDate = '1/1/1'; - } - if (obj.sToDate == '') { - obj.sToDate = '1/1/9999'; - } + GetDiscountReport(obj: any) { + if (obj.sFromDate == '' || obj.sFromDate == null) { + obj.sFromDate = '1/1/1'; + } + if (obj.sToDate == '' || obj.sToDate == null) { + obj.sToDate = '1/1/9999'; + } obj.sFromDate = this.datePipe.transform(obj.sFromDate, 'MM/dd/yyyy'); obj.sToDate = this.datePipe.transform(obj.sToDate, 'MM/dd/yyyy'); if (obj.sAccountNumber == null) @@ -258,8 +270,10 @@ export class ReportService { "&sToDate=" + obj.sToDate + "&iDiscountCode=" + obj.iDiscountCode + "&sAccountNumber=" + obj.sAccountNumber + - "&pageNo=" + pageNo + - "&pageLength=" + pageLength) + "&sortColumn=" + obj.sortColumn + + "&sortOrder=" + obj.sortOrder + + "&pageNo=" + obj.pageNo + + "&pageLength=" + obj.pageLength) .map(this.extractData) .catch((res: Response) => this.handleError(res)); } diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/sitelicenseusagereport.component.html b/400-SOURCECODE/Admin/src/app/components/Reports/sitelicenseusagereport.component.html index 599daa1..daf7256 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/sitelicenseusagereport.component.html +++ b/400-SOURCECODE/Admin/src/app/components/Reports/sitelicenseusagereport.component.html @@ -16,10 +16,11 @@
- +
-
- +
+ @@ -31,10 +32,11 @@
- +
-
- +
+ @@ -102,26 +104,7 @@
- - +
@@ -131,16 +114,16 @@
-
License TypeAccount TypeInstitution NameOriginal Entry DateTotal Active SubscriptionsTotal Renew SubscriptionsNo. of Cancelled SubscriptionNet AdsLicense TypeAccount TypeInstitution NameOriginal Entry DateTotal Active SubscriptionsTotal Renew SubscriptionsNo. of Cancelled SubscriptionNet Ads
{{item.LicenseType}} {{item.AccountType}} {{item.InstitutionName}}{{item.LicenseCreationDate=='01/01/9999'?'':item.LicenseCreationDate| date: 'MM/dd/yyyy'}}{{item.LicenseCreationDate| date: 'MM/dd/yyyy'}} {{item.ActiveSubscription}} {{item.RenewSubscription}} {{item.InActiveSubscription}}
+
- - - - - - - + + + + + + + @@ -152,10 +135,10 @@ - + - +
Account NumberEditionInstitution NameOriginal Entry DateReferel URLTotal LoginLast Login DateAccount NumberEditionInstitution NameOriginal Entry DateReferel URLTotal LoginLast Login Date
{{item.AccountNumber}} {{item.EditionTitle}} {{item.InstitutionName}}{{item.LicenseCreationDate}}{{item.LicenseCreationDate | date: 'MM/dd/yyyy'}} {{item.ReferalUrl}} {{item.TotalLogins}}{{item.LastLogin}}{{item.LastLogin | date: 'MM/dd/yyyy'}}
diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/sitelicenseusagereport.component.ts b/400-SOURCECODE/Admin/src/app/components/Reports/sitelicenseusagereport.component.ts index 06eabef..a59e83f 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/sitelicenseusagereport.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/Reports/sitelicenseusagereport.component.ts @@ -54,6 +54,19 @@ export class SiteLicenseUsageReport implements OnInit { pageNo: number; pageLength: number; DisableAccountNumberControl: boolean; + actualPageNo: number; + actualPageLength: number; + SearchField:any={ + sFromDate:new Date(), + sToDate:new Date(), + sAccountNumber:'', + iEdition:0, + iLoginTypeId:0, + sortColumn:'AccountNumber', + sortOrder:'asc', + pageNo:1, + pageLength:10 + }; // Declare height and width variables scrHeight:any; scrWidth:any; @@ -68,6 +81,9 @@ export class SiteLicenseUsageReport implements OnInit { { this.scrHeight = window.innerHeight-430; } + if(this.scrHeight<=360) this.scrHeight=360; + + $(".ft_container").css("height",this.scrHeight); } constructor(private router: Router, private reportservice: ReportService, private fb: FormBuilder, private modalService: BsModalService, public global: GlobalService, @@ -101,19 +117,10 @@ export class SiteLicenseUsageReport implements OnInit { { width: 180, align: 'center' }, { width: 250, align: 'center' }, { width: 250, align: 'Center' }, - { width: 150, align: 'Center' }, + { width: 250, align: 'Center' }, + { width: 350, align: 'Center' }, { width: 350, align: 'Center' }, - { width: 500, align: 'Center' }, - { width: 130, align: 'Center' }, - // { width: 120, align: 'center' }, - // { width: 280, align: 'Center' }, - // { width: 180, align: 'center' }, - // { width: 200, align: 'center' }, - // { width: 170, align: 'center' }, - // { width: 80, align: 'center' }, - // { width: 150, align: 'center' }, - // { width: 150, align: 'center' }, - // { width: 180, align: 'Center' }, + { width: 160, align: 'Center' } ], sort: true }); @@ -123,47 +130,100 @@ export class SiteLicenseUsageReport implements OnInit { this.recordCount = 0; this.pagerComponent = new PagerComponent(); - if(document.getElementById("fixed_table_rc") != null){ - document.getElementById("fixed_table_rc").remove(); - var testScript = document.createElement("script"); - testScript.setAttribute("id", "fixed_table_rc"); - testScript.setAttribute("src", "../assets/scripts/fixed_table_rc.js"); - testScript.setAttribute("type", "text/javascript"); - document.body.appendChild(testScript); - } + var thisObject=this;//class object + $(".ft_rwrapper table thead tr th").on("click",function(event){ + + if(event.currentTarget.id!=undefined && event.currentTarget.id!="" && event.currentTarget.id!=null) + { + var fieldName=event.currentTarget.id; + var sortType='' + var isAscSort = $(".ft_rwrapper table thead tr #"+fieldName).hasClass('fx_sort_asc'); + $(".ft_rwrapper table thead tr th").removeClass('fx_sort_asc fx_sort_desc'); + + if (isAscSort) { + $(".ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_desc').removeClass('fx_sort_asc'); + sortType="desc"; + } else { + $(".ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_asc').removeClass('fx_sort_desc'); + sortType="asc"; + } + + thisObject.SortTableRecords(fieldName,sortType); + + } + + }); } + + FromDateChange(dateValue: any){ + this.alerts = ''; + this.global.compareTwoDates(this.SiteLicenseUsageReportForm.controls['sToDate'].value, dateValue._bsValue); + if (this.global.ValidationMsg != '') { + this.alerts = this.global.ValidationMsg; + } + } + + ToDateChange(dateValue: any){ + this.alerts = ''; + this.global.compareTwoDates(dateValue._bsValue, this.SiteLicenseUsageReportForm.controls['sFromDate'].value); + if (this.global.ValidationMsg != '') { + this.alerts = this.global.ValidationMsg; + } + } + + SortTableRecords(fieldName:string,sortType:string) { + this.SearchField.sortColumn=fieldName; + this.SearchField.sortOrder=sortType; + + this.GetSiteLicenseUsageReportList(); + } GetEdition() { this.reportservice.GetEdition().subscribe(st => { this.lstEdition = st; }, error => this.error = error); } - + + GetSiteLicenseUsageReport(evt: any) { - this.alerts = ''; - this.global.compareTwoDates(this.SiteLicenseUsageReportForm.controls['sToDate'].value, this.SiteLicenseUsageReportForm.controls['sFromDate'].value); - if (this.global.ValidationMsg != '') { - this.alerts = this.global.ValidationMsg - } - if (this.alerts == '') { - this._loadingService.ShowLoading("global-loading"); - var tempArr = evt.split(','); - this.pageNo = parseInt(tempArr[0]); - var actulalength=this.pageLength; - this.pageLength = parseInt(tempArr[1]); - this._loadingService.ShowLoading("global-loading"); - this.SiteLicenseUsageReport = this.SiteLicenseUsageReportForm.value; - var obj = this.SiteLicenseUsageReport; - if (this.ExportingStart) { - this.reportservice.GetSiteLicenseUsageReport(obj, this.pageNo, this.pageLength).subscribe((SiteLicenseUsageReports: SiteLicenseUsageReports[]) => { - //reset length after csvexport - this.pageLength=actulalength; - this.ExportService(SiteLicenseUsageReports); }, error => this.error = error); - } - else { - this.reportservice.GetSiteLicenseUsageReport(obj, this.pageNo, this.pageLength).subscribe((SiteLicenseUsageReports: SiteLicenseUsageReports[]) => { this.BindFormFields(SiteLicenseUsageReports); }, error => this.error = error); - } - } + this.actualPageNo = this.pageNo; + this.actualPageLength =this.pageLength; + + var tempArr = evt.split(','); + this.pageNo = parseInt(tempArr[0]); + this.pageLength = parseInt(tempArr[1]); + + this.SearchField.pageNo=this.pageNo; + this.SearchField.pageLength=this.pageLength; + + this.GetSiteLicenseUsageReportList(); } - + + GetSiteLicenseUsageReportList() { + this._loadingService.ShowLoading("global-loading"); + $(".ft_rwrapper table thead tr th").removeClass('fx_sort_asc fx_sort_desc'); + + if (this.SearchField.sortOrder=='asc') { + $(".ft_rwrapper table thead tr #"+this.SearchField.sortColumn).addClass('fx_sort_asc').removeClass('fx_sort_desc'); + } else + { + $(".ft_rwrapper table thead tr #"+this.SearchField.sortColumn).addClass('fx_sort_desc').removeClass('fx_sort_asc'); + } + if (this.ExportingStart) { + this.reportservice.GetSiteLicenseUsageReport(this.SearchField).subscribe((SiteLicenseUsageReports: SiteLicenseUsageReports[]) => { + //reset length after csvexport + this.pageNo = this.actualPageNo; + this.pageLength=this.actualPageLength; + + this.SearchField.pageNo=this.pageNo; + this.SearchField.pageLength=this.pageLength; + this.ExportService(SiteLicenseUsageReports); }, error => this.error = error); + } + else { + this.reportservice.GetSiteLicenseUsageReport(this.SearchField).subscribe((SiteLicenseUsageReports: SiteLicenseUsageReports[]) => { this.BindFormFields(SiteLicenseUsageReports); }, error => this.error = error); + } + + this.ExportingStart = false; + } + BindFormFields(data) { this.recordCount = data.RecordCount; this.lstSiteLicenseUsageReport = data.SiteLicenseUsageList; @@ -181,25 +241,35 @@ export class SiteLicenseUsageReport implements OnInit { } SearchRecords() { - this.ExportingStart = false; - this.GetSiteLicenseUsageReport('1, ' + this.pageLength); + this.ExportingStart = false; + this.pageNo=1; + this.SearchField.sFromDate=this.SiteLicenseUsageReportForm.controls['sFromDate'].value; + this.SearchField.sToDate=this.SiteLicenseUsageReportForm.controls['sToDate'].value; + this.SearchField.sAccountNumber=this.SiteLicenseUsageReportForm.controls['sAccountNumber'].value; + this.SearchField.iEdition=this.SiteLicenseUsageReportForm.controls['iEdition'].value; + this.SearchField.iLoginTypeId=this.SiteLicenseUsageReportForm.controls['iLoginTypeId'].value; + + this.SearchField.pageNo=this.pageNo; + + this.GetSiteLicenseUsageReportList(); } ExportEvent() { if (this.buttonStatus) { this.ExportingStart = true; this.GetSiteLicenseUsageReport('1, ' + this.recordCount); - this.ExportingStart = false; } } ExportService(data: any) { - for (let c = 0; c < this.global.RemoveColumns.length; c++) { - for (let i = 0; i < data.SiteLicenseUsageList.length; i++) { - delete data.SiteLicenseUsageList[i][this.global.RemoveColumns[c].toString()]; - } - } + for (let i = 0; i < data.SiteLicenseUsageList.length; i++) { + data.SiteLicenseUsageList[i]['LastLogin']= this.datePipe.transform(data.SiteLicenseUsageList[i]['LastLogin'], 'MM/dd/yyyy'); + data.SiteLicenseUsageList[i]['LicenseCreationDate']= this.datePipe.transform(data.SiteLicenseUsageList[i]['LicenseCreationDate'], 'MM/dd/yyyy'); + } + + var reportname=+ this.date.getDay() + "-" + (this.date.getMonth()+1) + "-" + this.date.getSeconds() + this.global.ExportToCSV(data.SiteLicenseUsageList, "SiteLicenseUsageReport-"+reportname); + this._loadingService.HideLoading("global-loading"); - this.global.ExportToCSV(data.SiteLicenseUsageList, "SiteLicenseUsageReport-" + this.date.getDay() + "-" + this.date.getMonth() + "-" + this.date.getSeconds()) - + } } diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/subscriptioncancellationreport.component.html b/400-SOURCECODE/Admin/src/app/components/Reports/subscriptioncancellationreport.component.html index 72f69d6..8963236 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/subscriptioncancellationreport.component.html +++ b/400-SOURCECODE/Admin/src/app/components/Reports/subscriptioncancellationreport.component.html @@ -16,10 +16,11 @@
- +
-
- +
+ @@ -31,10 +32,11 @@
- +
-
- +
+ @@ -134,29 +136,7 @@
- - - +
@@ -170,17 +150,17 @@ - - - - - - - - - - - + + + + + + + + + + + @@ -195,9 +175,9 @@ - - - + + + diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/subscriptioncancellationreport.component.ts b/400-SOURCECODE/Admin/src/app/components/Reports/subscriptioncancellationreport.component.ts index 19de678..f3101fd 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/subscriptioncancellationreport.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/Reports/subscriptioncancellationreport.component.ts @@ -56,6 +56,23 @@ export class SubscriptionCancellationReport implements OnInit { pageNo: number; pageLength: number; NewSubscription = new SubscriptionCancellationReports(); + actualPageNo: number; + actualPageLength: number; + SearchField:any={ + sFromDate:new Date(), + sToDate:new Date(), + iLicenseTypeId:0, + iAccountTypeId:0, + sZip:'', + iStateId:0, + iCountryId:0, + icStartPrice:0, + icEndPrice:-1, + sortColumn:'AccountNumber', + sortOrder:'asc', + pageNo:1, + pageLength:10 + }; // Declare height and width variables scrHeight:any; scrWidth:any; @@ -70,6 +87,9 @@ export class SubscriptionCancellationReport implements OnInit { { this.scrHeight = window.innerHeight-490; } + if(this.scrHeight<=360) this.scrHeight=360; + + $(".ft_container").css("height",this.scrHeight); } constructor(private router: Router, private reportservice: ReportService, @@ -84,13 +104,13 @@ export class SubscriptionCancellationReport implements OnInit { let SubscriptionCancellationReport = new SubscriptionCancellationReports(); this.previousdate.setDate(this.previousdate.getDate()); this.SubscriptionCancellationReportForm = this.fb.group({ - sFromDate: [this.previousdate], - sToDate: [this.date], + sFromDate: [this.previousdate,[Validators.required]], + sToDate: [this.date,[Validators.required]], sZip: [''], iLicenseTypeId: [0], iAccountTypeId: [0], iStateId: [0], - icStartPrice: [0], + icStartPrice: [''], icEndPrice: [''], iCountryId: [0], }); @@ -111,36 +131,66 @@ export class SubscriptionCancellationReport implements OnInit { { width: 140, align: 'center' }, { width: 170, align: 'center' }, { width: 150, align: 'Center' }, - { width: 160, align: 'Center' }, + { width: 150, align: 'Center' }, { width: 130, align: 'Center' }, - { width: 400, align: 'Center' }, - { width: 100, align: 'Center' }, - { width: 140, align: 'center' }, - { width: 100, align: 'Center' }, - { width: 140, align: 'center' }, + { width: 350, align: 'Center' }, + { width: 110, align: 'Center' }, { width: 150, align: 'center' }, - // { width: 170, align: 'center' }, - // { width: 80, align: 'center' }, - // { width: 150, align: 'center' }, - // { width: 150, align: 'center' }, - // { width: 180, align: 'Center' }, - //{ width: 400, align: 'Center' }, - //{ width: 150, align: 'center' }, - //{ width: 110, align: 'center' }, + { width: 110, align: 'Center' }, + { width: 140, align: 'center' }, + { width: 130, align: 'center' }, + ], sort: true }); - if(document.getElementById("fixed_table_rc") != null){ - document.getElementById("fixed_table_rc").remove(); - var testScript = document.createElement("script"); - testScript.setAttribute("id", "fixed_table_rc"); - testScript.setAttribute("src", "../assets/scripts/fixed_table_rc.js"); - testScript.setAttribute("type", "text/javascript"); - document.body.appendChild(testScript); - } + var thisObject=this;//class object + $(".ft_rwrapper table thead tr th").on("click",function(event){ + + if(event.currentTarget.id!=undefined && event.currentTarget.id!="" && event.currentTarget.id!=null) + { + var fieldName=event.currentTarget.id; + var sortType='' + var isAscSort = $(".ft_rwrapper table thead tr #"+fieldName).hasClass('fx_sort_asc'); + $(".ft_rwrapper table thead tr th").removeClass('fx_sort_asc fx_sort_desc'); + + if (isAscSort) { + $(".ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_desc').removeClass('fx_sort_asc'); + sortType="desc"; + } else { + $(".ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_asc').removeClass('fx_sort_desc'); + sortType="asc"; + } + + thisObject.SortTableRecords(fieldName,sortType); + + } + + }); } + FromDateChange(dateValue: any){ + this.alerts = ''; + this.global.compareTwoDates(this.SubscriptionCancellationReportForm.controls['sToDate'].value, dateValue._bsValue); + if (this.global.ValidationMsg != '') { + this.alerts = this.global.ValidationMsg; + } + } + + ToDateChange(dateValue: any){ + this.alerts = ''; + this.global.compareTwoDates(dateValue._bsValue, this.SubscriptionCancellationReportForm.controls['sFromDate'].value); + if (this.global.ValidationMsg != '') { + this.alerts = this.global.ValidationMsg; + } + } + + SortTableRecords(fieldName:string,sortType:string) { + this.SearchField.sortColumn=fieldName; + this.SearchField.sortOrder=sortType; + + this.GetCancellationReportList(); + } GetCountry() { this.reportservice.GetCountry().subscribe(y => { this.lstCountry = y; }, error => this.error = error); @@ -156,34 +206,68 @@ export class SubscriptionCancellationReport implements OnInit { GetAccountType() { this.reportservice.GetAccountType().subscribe(st => { this.lstAccountType = st; }, error => this.error = error); } - - GetSubscriptionCancellationReport(evt: any) { - this.alerts = ''; - this.global.compareTwoDates(this.SubscriptionCancellationReportForm.controls['sToDate'].value, this.SubscriptionCancellationReportForm.controls['sFromDate'].value); - if (this.global.ValidationMsg != '') { - this.alerts = this.global.ValidationMsg - } - if (this.alerts == '') { - this._loadingService.ShowLoading("global-loading"); - var tempArr = evt.split(','); - this.pageNo = parseInt(tempArr[0]); - var actulalength=this.pageLength; - this.pageLength = parseInt(tempArr[1]); - this.NewSubscription = this.SubscriptionCancellationReportForm.value; - var obj = this.NewSubscription; - if (this.ExportingStart) { - this.reportservice.GetSubscriptionCancellationReport(obj, this.pageNo, this.pageLength).subscribe((SubscriptionCancellationReports: SubscriptionCancellationReports[]) => { - //reset length after csvexport - this.pageLength=actulalength; - this.ExportService(SubscriptionCancellationReports); }, error => this.error = error); - } - else { - this.reportservice.GetSubscriptionCancellationReport(obj, this.pageNo, this.pageLength).subscribe((SubscriptionCancellationReports: SubscriptionCancellationReports[]) => { this.BindFormFields(SubscriptionCancellationReports); }, error => this.error = error); - } + + GetSubscriptionCancellationReport(evt: any) { + this.actualPageNo = this.pageNo; + this.actualPageLength =this.pageLength; + + var tempArr = evt.split(','); + this.pageNo = parseInt(tempArr[0]); + this.pageLength = parseInt(tempArr[1]); + + this.SearchField.pageNo=this.pageNo; + this.SearchField.pageLength=this.pageLength; + + this.GetCancellationReportList(); + } + + GetCancellationReportList() { + this._loadingService.ShowLoading("global-loading"); + $(".ft_rwrapper table thead tr th").removeClass('fx_sort_asc fx_sort_desc'); + + if (this.SearchField.sortOrder=='asc') { + $(".ft_rwrapper table thead tr #"+this.SearchField.sortColumn).addClass('fx_sort_asc').removeClass('fx_sort_desc'); + } else + { + $(".ft_rwrapper table thead tr #"+this.SearchField.sortColumn).addClass('fx_sort_desc').removeClass('fx_sort_asc'); + } + if (this.ExportingStart) { + this.reportservice.GetSubscriptionCancellationReport(this.SearchField).subscribe((SubscriptionCancellationReports: SubscriptionCancellationReports[]) => { + //reset length after csvexport + this.pageNo = this.actualPageNo; + this.pageLength=this.actualPageLength; + + this.SearchField.pageNo=this.pageNo; + this.SearchField.pageLength=this.pageLength; + this.ExportService(SubscriptionCancellationReports); }, error => this.error = error); } - + else { + this.reportservice.GetSubscriptionCancellationReport(this.SearchField).subscribe((SubscriptionCancellationReports: SubscriptionCancellationReports[]) => { this.BindFormFields(SubscriptionCancellationReports); }, error => this.error = error); + } + + this.ExportingStart = false; + } + + SearchRecords() { + this.ExportingStart = false; + this.pageNo=1; + this.SearchField.sFromDate=this.SubscriptionCancellationReportForm.controls['sFromDate'].value; + this.SearchField.sToDate=this.SubscriptionCancellationReportForm.controls['sToDate'].value; + this.SearchField.iLicenseTypeId=this.SubscriptionCancellationReportForm.controls['iLicenseTypeId'].value; + this.SearchField.iAccountTypeId=this.SubscriptionCancellationReportForm.controls['iAccountTypeId'].value; + this.SearchField.sZip=this.SubscriptionCancellationReportForm.controls['sZip'].value; + this.SearchField.iStateId=this.SubscriptionCancellationReportForm.controls['iStateId'].value; + this.SearchField.iCountryId=this.SubscriptionCancellationReportForm.controls['iCountryId'].value; + this.SearchField.icStartPrice=this.SubscriptionCancellationReportForm.controls['icStartPrice'].value; + this.SearchField.icEndPrice=this.SubscriptionCancellationReportForm.controls['icEndPrice'].value; + + this.SearchField.pageNo=this.pageNo; + + this.GetCancellationReportList(); + } - BindFormFields(data) { + + BindFormFields(data) { this.recordCount = data.RecordCount; this.lstSubscriptionCancellationReport = data.SubscriptionCancel @@ -199,25 +283,25 @@ export class SubscriptionCancellationReport implements OnInit { this.buttonStatus = false; } } - SearchRecords() { - this.ExportingStart = false; - this.GetSubscriptionCancellationReport('1, ' + this.pageLength); - } + ExportEvent() { if (this.buttonStatus) { this.ExportingStart = true; this.GetSubscriptionCancellationReport('1, ' + this.recordCount); - this.ExportingStart = false; } } + ExportService(data: any) { - for (let c = 0; c < this.global.RemoveColumns.length; c++) { - for (let i = 0; i < data.SubscriptionCancel.length; i++) { - delete data.SubscriptionCancel[i][this.global.RemoveColumns[c].toString()]; - } - } + for (let i = 0; i < data.SubscriptionCancel.length; i++) { + data.SubscriptionCancel[i]['StartDate']= this.datePipe.transform(data.SubscriptionCancel[i]['StartDate'], 'MM/dd/yyyy'); + data.SubscriptionCancel[i]['EndDate']= this.datePipe.transform(data.SubscriptionCancel[i]['EndDate'], 'MM/dd/yyyy'); + data.SubscriptionCancel[i]['LicenseCreationDate']= this.datePipe.transform(data.SubscriptionCancel[i]['LicenseCreationDate'], 'MM/dd/yyyy'); + } + + var reportname=+ this.date.getDay() + "-" + (this.date.getMonth()+1) + "-" + this.date.getSeconds() + this.global.ExportToCSV(data.SubscriptionCancel, "SubscriptionCancellationReport-"+reportname); + this._loadingService.HideLoading("global-loading"); - this.global.ExportToCSV(data.SubscriptionCancel, "SubscriptionCancellationReport-" + this.date.getDay() + "-" + this.date.getMonth() + "-" + this.date.getSeconds()) - + } } diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/subscriptionreport.component.html b/400-SOURCECODE/Admin/src/app/components/Reports/subscriptionreport.component.html index 7fa4150..0a04566 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/subscriptionreport.component.html +++ b/400-SOURCECODE/Admin/src/app/components/Reports/subscriptionreport.component.html @@ -16,10 +16,11 @@
- +
-
- +
+ @@ -31,10 +32,11 @@
- +
-
- +
+ @@ -134,7 +136,7 @@
- +
@@ -146,20 +148,20 @@
-
Account NumberLicensee NameLicense TypeInstitution NameAccount TypeEditionStart DateOriginal Entry DateEnd DateSubscription PriceCredit Card NumberAccount NumberLicensee NameLicense TypeInstitution NameAccount TypeEditionStart DateOriginal Entry DateEnd DateSubscription PriceCard Number
{{sr.InstitutionName}} {{sr.AccountType}} {{sr.Edition}}{{sr.StartDate}}{{sr.LicenseCreationDate}}{{sr.EndDate}}{{sr.StartDate | date: 'MM/dd/yyyy'}}{{sr.LicenseCreationDate | date: 'MM/dd/yyyy'}}{{sr.EndDate | date: 'MM/dd/yyyy'}} {{sr.SubscriptionPrice | number:'1.2'}} {{sr.CardNumber}}
+
- - - - - - - - - - - + + + + + + + + + + + @@ -174,9 +176,9 @@ - - - + + + diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/subscriptionreport.component.ts b/400-SOURCECODE/Admin/src/app/components/Reports/subscriptionreport.component.ts index f3edb75..4c1ef19 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/subscriptionreport.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/Reports/subscriptionreport.component.ts @@ -56,6 +56,24 @@ export class SubscriptionReport implements OnInit { pageNo: number; pageLength: number; NewSubscription = new SubscriptionReports(); + actualPageNo: number; + actualPageLength: number; + SearchField:any={ + sFromDate:new Date(), + sToDate:new Date(), + iLicenseTypeId:0, + iAccountTypeId:0, + sZip:'', + iStateId:0, + iCountryId:0, + icStartPrice:0, + icEndPrice:-1, + sortColumn:'AccountNumber', + sortOrder:'asc', + pageNo:1, + pageLength:10 + }; + // Declare height and width variables scrHeight:any; scrWidth:any; @@ -70,6 +88,9 @@ export class SubscriptionReport implements OnInit { { this.scrHeight = window.innerHeight-480; } + if(this.scrHeight<=360) this.scrHeight=360; + + $(".ft_container").css("height",this.scrHeight); } constructor(private router: Router, private reportservice: ReportService, @@ -84,13 +105,13 @@ export class SubscriptionReport implements OnInit { let SubscriptionReport = new SubscriptionReports(); this.previousdate.setDate(this.previousdate.getDate()); this.SubscriptionReportForm = this.fb.group({ - sFromDate: [this.previousdate], - sToDate: [this.date], + sFromDate: [this.previousdate,[Validators.required]], + sToDate: [this.date,[Validators.required]], sZip: [''], iLicenseTypeId: [0], iAccountTypeId: [0], iStateId: [0], - icStartPrice: [0], + icStartPrice: [''], icEndPrice: [''], iCountryId: [0], }); @@ -104,7 +125,6 @@ export class SubscriptionReport implements OnInit { this.pageLength = 10; this.pagerComponent = new PagerComponent(); this._loadingService.HideLoading("global-loading"); - //this.GetSubscriptionReport(); $('#fixed_hdr2').fxdHdrCol({ fixedCols: 0, width: "100%", @@ -115,34 +135,63 @@ export class SubscriptionReport implements OnInit { { width: 150, align: 'Center' }, { width: 150, align: 'Center' }, { width: 140, align: 'Center' }, - { width: 400, align: 'Center' }, - { width: 100, align: 'Center' }, + { width: 350, align: 'Center' }, + { width: 110, align: 'Center' }, { width: 150, align: 'center' }, - { width: 100, align: 'Center' }, - { width: 140, align: 'center' }, + { width: 110, align: 'Center' }, { width: 150, align: 'center' }, - // { width: 170, align: 'center' }, - // { width: 80, align: 'center' }, - // { width: 150, align: 'center' }, - // { width: 150, align: 'center' }, - // { width: 180, align: 'Center' }, - //{ width: 400, align: 'Center' }, - //{ width: 150, align: 'center' }, - //{ width: 110, align: 'center' }, + { width: 140, align: 'center' }, ], sort: true }); - if(document.getElementById("fixed_table_rc") != null){ - document.getElementById("fixed_table_rc").remove(); - var testScript = document.createElement("script"); - testScript.setAttribute("id", "fixed_table_rc"); - testScript.setAttribute("src", "../assets/scripts/fixed_table_rc.js"); - testScript.setAttribute("type", "text/javascript"); - document.body.appendChild(testScript); - } - + + var thisObject=this;//class object + $(".ft_rwrapper table thead tr th").on("click",function(event){ + + if(event.currentTarget.id!=undefined && event.currentTarget.id!="" && event.currentTarget.id!=null) + { + var fieldName=event.currentTarget.id; + var sortType='' + var isAscSort = $(".ft_rwrapper table thead tr #"+fieldName).hasClass('fx_sort_asc'); + $(".ft_rwrapper table thead tr th").removeClass('fx_sort_asc fx_sort_desc'); + + if (isAscSort) { + $(".ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_desc').removeClass('fx_sort_asc'); + sortType="desc"; + } else { + $(".ft_rwrapper table thead tr #"+fieldName).addClass('fx_sort_asc').removeClass('fx_sort_desc'); + sortType="asc"; + } + + thisObject.SortTableRecords(fieldName,sortType); + + } + + }); } + FromDateChange(dateValue: any){ + this.alerts = ''; + this.global.compareTwoDates(this.SubscriptionReportForm.controls['sToDate'].value, dateValue._bsValue); + if (this.global.ValidationMsg != '') { + this.alerts = this.global.ValidationMsg; + } + } + + ToDateChange(dateValue: any){ + this.alerts = ''; + this.global.compareTwoDates(dateValue._bsValue, this.SubscriptionReportForm.controls['sFromDate'].value); + if (this.global.ValidationMsg != '') { + this.alerts = this.global.ValidationMsg; + } + } + + SortTableRecords(fieldName:string,sortType:string) { + this.SearchField.sortColumn=fieldName; + this.SearchField.sortOrder=sortType; + + this.GetSubscriptionReportList(); + } GetCountry() { this.reportservice.GetCountry().subscribe(y => { this.lstCountry = y; }, error => this.error = error); @@ -158,34 +207,69 @@ export class SubscriptionReport implements OnInit { GetAccountType() { this.reportservice.GetAccountType().subscribe(st => { this.lstAccountType = st; }, error => this.error = error); } - + + GetSubscriptionReport(evt: any) { - this.alerts = ''; - this.global.compareTwoDates(this.SubscriptionReportForm.controls['sToDate'].value, this.SubscriptionReportForm.controls['sFromDate'].value); - if (this.global.ValidationMsg != '') { - this.alerts = this.global.ValidationMsg - } - if (this.alerts == '') { - this._loadingService.ShowLoading("global-loading"); - var tempArr = evt.split(','); - this.pageNo = parseInt(tempArr[0]); - var actulalength=this.pageLength; - this.pageLength = parseInt(tempArr[1]); - this.NewSubscription = this.SubscriptionReportForm.value; - var obj = this.NewSubscription; - if (this.ExportingStart) { - this.reportservice.GetSubscriptionReport(obj, this.pageNo, this.pageLength).subscribe((SubscriptionReports: SubscriptionReports[]) => { - //reset length after csvexport - this.pageLength=actulalength; - this.ExportService(SubscriptionReports); }, error => this.error = error); - } - else { - this.reportservice.GetSubscriptionReport(obj, this.pageNo, this.pageLength).subscribe((SubscriptionReports: SubscriptionReports[]) => { this.BindFormFields(SubscriptionReports); }, error => this.error = error); - } + this.actualPageNo = this.pageNo; + this.actualPageLength =this.pageLength; + + var tempArr = evt.split(','); + this.pageNo = parseInt(tempArr[0]); + this.pageLength = parseInt(tempArr[1]); + + this.SearchField.pageNo=this.pageNo; + this.SearchField.pageLength=this.pageLength; + + this.GetSubscriptionReportList(); + } + + GetSubscriptionReportList() { + this._loadingService.ShowLoading("global-loading"); + $(".ft_rwrapper table thead tr th").removeClass('fx_sort_asc fx_sort_desc'); + + if (this.SearchField.sortOrder=='asc') { + $(".ft_rwrapper table thead tr #"+this.SearchField.sortColumn).addClass('fx_sort_asc').removeClass('fx_sort_desc'); + } else + { + $(".ft_rwrapper table thead tr #"+this.SearchField.sortColumn).addClass('fx_sort_desc').removeClass('fx_sort_asc'); + } + if (this.ExportingStart) { + this.reportservice.GetSubscriptionReport(this.SearchField).subscribe((SubscriptionReports: SubscriptionReports[]) => { + //reset length after csvexport + this.pageNo = this.actualPageNo; + this.pageLength=this.actualPageLength; + + this.SearchField.pageNo=this.pageNo; + this.SearchField.pageLength=this.pageLength; + this.ExportService(SubscriptionReports); }, error => this.error = error); } - + else { + this.reportservice.GetSubscriptionReport(this.SearchField).subscribe((SubscriptionReports: SubscriptionReports[]) => { this.BindFormFields(SubscriptionReports); }, error => this.error = error); + } + + this.ExportingStart = false; + } + + SearchRecords() { + this.ExportingStart = false; + this.pageNo=1; + this.SearchField.sFromDate=this.SubscriptionReportForm.controls['sFromDate'].value; + this.SearchField.sToDate=this.SubscriptionReportForm.controls['sToDate'].value; + this.SearchField.iLicenseTypeId=this.SubscriptionReportForm.controls['iLicenseTypeId'].value; + this.SearchField.iAccountTypeId=this.SubscriptionReportForm.controls['iAccountTypeId'].value; + this.SearchField.sZip=this.SubscriptionReportForm.controls['sZip'].value; + this.SearchField.iStateId=this.SubscriptionReportForm.controls['iStateId'].value; + this.SearchField.iCountryId=this.SubscriptionReportForm.controls['iCountryId'].value; + this.SearchField.icStartPrice=this.SubscriptionReportForm.controls['icStartPrice'].value; + this.SearchField.icEndPrice=this.SubscriptionReportForm.controls['icEndPrice'].value; + + this.SearchField.pageNo=this.pageNo; + + this.GetSubscriptionReportList(); + } - BindFormFields(data) { + + BindFormFields(data) { this.recordCount = data.RecordCount; this.lstSubscriptionReport = data.Subscription this.numberOfSubscriptionReport = this.lstSubscriptionReport.length; this.limit = this.lstSubscriptionReport.length; @@ -200,24 +284,24 @@ export class SubscriptionReport implements OnInit { this.buttonStatus = false; } } - SearchRecords() { - this.ExportingStart = false; - this.GetSubscriptionReport('1, ' + this.pageLength); - } + ExportEvent() { if (this.buttonStatus) { this.ExportingStart = true; this.GetSubscriptionReport('1, ' + this.recordCount); - this.ExportingStart = false; } } ExportService(data: any) { - for (let c = 0; c < this.global.RemoveColumns.length; c++) { - for (let i = 0; i < data.Subscription.length; i++) { - delete data.Subscription[i][this.global.RemoveColumns[c].toString()]; - } - } + for (let i = 0; i < data.Subscription.length; i++) { + data.Subscription[i]['StartDate']= this.datePipe.transform(data.Subscription[i]['StartDate'], 'MM/dd/yyyy'); + data.Subscription[i]['EndDate']= this.datePipe.transform(data.Subscription[i]['EndDate'], 'MM/dd/yyyy'); + data.Subscription[i]['LicenseCreationDate']= this.datePipe.transform(data.Subscription[i]['LicenseCreationDate'], 'MM/dd/yyyy'); + } + + var reportname=+ this.date.getDay() + "-" + (this.date.getMonth()+1) + "-" + this.date.getSeconds() + this.global.ExportToCSV(data.Subscription, "SubscriptionReport-"+reportname); + this._loadingService.HideLoading("global-loading"); - this.global.ExportToCSV(data.Subscription, "SubscriptionReport-" + this.date.getDay() + "-" + this.date.getMonth() + "-" + this.date.getSeconds()) - } + + } } -- libgit2 0.21.4
Account NumberLicensee NameLicense TypeInstitution NameAccount TypeEditionStart DateOriginal Entry DateEnd DateSubscription PriceCredit Card NumberAccount NumberLicensee NameLicense TypeInstitution NameAccount TypeEditionStart DateOriginal Entry DateEnd DateSubscription PriceCard Number
{{sr.InstitutionName}} {{sr.AccountType}} {{sr.Edition}}{{sr.StartDate}}{{sr.LicenseCreationDate}}{{sr.EndDate}}{{sr.StartDate | date: 'MM/dd/yyyy'}}{{sr.LicenseCreationDate | date: 'MM/dd/yyyy'}}{{sr.EndDate | date: 'MM/dd/yyyy'}} {{sr.SubscriptionPrice | number:'1.2'}} {{sr.CardNumber}}