From 71fa9e5ef555b2830f85fc8614352fb55cb29e2e Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 24 Dec 2021 22:57:45 +0000 Subject: [PATCH] --- .vscode/launch.json | 6 +- devdocs/deploy.txt | 2 +- server/AyaNova/Startup.cs | 52 +++++++------- server/AyaNova/biz/JobsBiz.cs | 12 ++-- server/AyaNova/biz/PMBiz.cs | 4 +- server/AyaNova/biz/ReportBiz.cs | 70 +++++++++++-------- server/AyaNova/generator/CoreJobBackup.cs | 4 +- server/AyaNova/generator/CoreJobLicense.cs | 6 +- .../generator/CoreJobMetricsSnapshot.cs | 4 +- server/AyaNova/generator/CoreJobNotify.cs | 24 +++---- server/AyaNova/generator/CoreJobPMGenerate.cs | 10 +-- .../generator/CoreJobPMInventoryCheck.cs | 10 +-- ...CoreJobReportRenderEngineProcessCleanup.cs | 2 +- server/AyaNova/generator/CoreJobSweeper.cs | 8 +-- .../generator/CoreJobTempFolderCleanup.cs | 2 +- .../generator/CoreNotificationSweeper.cs | 2 +- server/AyaNova/generator/Generate.cs | 2 +- .../stock-report-templates/Clients list.ayrt | 1 + .../stock-report-templates/Contacts list.ayrt | 1 + .../Contracts list.ayrt | 1 + .../Customer Notes.ayrt | 1 + ... Service Requests grouped by Customer.ayrt | 1 + ...LE replace carriage return with space.ayrt | 1 - .../Head Offices list.ayrt | 1 + ...nventory transactions grouped by Part.ayrt | 1 + .../rpt/stock-report-templates/Memos.ayrt | 1 + .../PM Item Tasks .ayrt | 1 + .../PM Scheduled Users.ayrt | 1 + .../PM Units grouped by Customer.ayrt | 1 + .../Part Assemblies list.ayrt | 1 + .../stock-report-templates/Projects list.ayrt | 1 + .../Quote Item Tasks.ayrt | 1 + .../Quote Scheduled Users.ayrt | 1 + .../Quote Units grouped by Customer.ayrt | 1 + .../rpt/stock-report-templates/Reminders.ayrt | 1 + .../Reviews grouped by user.ayrt | 1 + .../Service Rates list.ayrt | 1 + .../Tax Codes List.ayrt | 1 + .../Travel Rates list.ayrt | 1 + .../Users Grouped By User Type.ayrt | 1 + .../Warehouses list.ayrt | 1 + .../Work Order Item Tasks.ayrt | 1 + .../Work Order Scheduled Users.ayrt | 1 + .../Workorder Units grouped by Customer.ayrt | 1 + .../z_replace carriage return with space.ayrt | 1 + server/AyaNova/util/License.cs | 2 +- server/AyaNova/util/ReportProcessManager.cs | 4 +- 47 files changed, 145 insertions(+), 109 deletions(-) create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Clients list.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Contacts list.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Contracts list.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Customer Notes.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Customer Service Requests grouped by Customer.ayrt delete mode 100644 server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE replace carriage return with space.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Head Offices list.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Inventory transactions grouped by Part.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Memos.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/PM Item Tasks .ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/PM Scheduled Users.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/PM Units grouped by Customer.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Part Assemblies list.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Projects list.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Quote Item Tasks.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Quote Scheduled Users.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Quote Units grouped by Customer.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Reminders.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Reviews grouped by user.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Service Rates list.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Tax Codes List.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Travel Rates list.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Users Grouped By User Type.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Warehouses list.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Work Order Item Tasks.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Work Order Scheduled Users.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Workorder Units grouped by Customer.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/z_replace carriage return with space.ayrt diff --git a/.vscode/launch.json b/.vscode/launch.json index c67f0642..e717556e 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -40,15 +40,15 @@ "env": { // "ASPNETCORE_ENVIRONMENT": "Development", "AYANOVA_JWT_SECRET": "1111111MyRandom32CharacterSecret", - "AYANOVA_LOG_LEVEL": "Info", - // //"AYANOVA_LOG_LEVEL": "Debug", + //"AYANOVA_LOG_LEVEL": "Info", + "AYANOVA_LOG_LEVEL": "Debug", // // "AYANOVA_LOG_LEVEL": "Trace", "AYANOVA_DEFAULT_TRANSLATION": "en", "AYANOVA_DB_CONNECTION": "Server=localhost;Username=postgres;Password=raven;Database=AyaNova;CommandTimeout=120;", "AYANOVA_DATA_PATH": "c:\\temp\\ravendata", "AYANOVA_USE_URLS": "http://*:7575;", "AYANOVA_SERVER_TEST_MODE": "false", - "AYANOVA_REPORT_RENDERING_TIMEOUT":"5", + //"AYANOVA_REPORT_RENDERING_TIMEOUT":"5", "AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "large", "AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_14\\bin\\" }, diff --git a/devdocs/deploy.txt b/devdocs/deploy.txt index c282d722..09d00546 100644 --- a/devdocs/deploy.txt +++ b/devdocs/deploy.txt @@ -112,7 +112,7 @@ rm -r ./wwwroot unzip -o ayanova-linux-x64-server.zip -x "config.json" sudo systemctl start ayanova.service -Single liner (untested): +Single liner (tested, works, so fast it's surprising): sudo systemctl stop ayanova.service && rm *.dll && rm -r ./resource && rm -r ./wwwroot && unzip -o ayanova-linux-x64-server.zip -x "config.json" && sudo systemctl start ayanova.service diff --git a/server/AyaNova/Startup.cs b/server/AyaNova/Startup.cs index 5bff37bc..ec07dd3a 100644 --- a/server/AyaNova/Startup.cs +++ b/server/AyaNova/Startup.cs @@ -51,12 +51,12 @@ namespace AyaNova // public void ConfigureServices(IServiceCollection services) { - _newLog.LogTrace("Initializing services..."); + _newLog.LogDebug("Initializing services..."); - _newLog.LogTrace("Health"); + _newLog.LogDebug("Health"); services.AddHealthChecks().AddDbContextCheck(); ; - _newLog.LogTrace("Profiler"); + _newLog.LogDebug("Profiler"); //https://dotnetthoughts.net/using-miniprofiler-in-aspnetcore-webapi/ services.AddMemoryCache(); services.AddMiniProfiler(options => @@ -75,15 +75,15 @@ namespace AyaNova //Server state service for shutting people out of api - _newLog.LogTrace("ServerState service"); + _newLog.LogDebug("ServerState service"); services.AddSingleton(new AyaNova.Api.ControllerHelpers.ApiServerState()); - _newLog.LogTrace("Mail service"); + _newLog.LogDebug("Mail service"); services.AddSingleton(); //Init controllers - _newLog.LogTrace("Controllers"); + _newLog.LogDebug("Controllers"); var MvcBuilder = services.AddControllers(config => { // config.Filters.Add(new AyaNova.Api.ControllerHelpers.ApiCustomExceptionFilter(AyaNova.Util.ApplicationLogging.LoggerFactory)); @@ -100,7 +100,7 @@ namespace AyaNova options.SuppressModelStateInvalidFilter = true; }); - _newLog.LogTrace("JSON"); + _newLog.LogDebug("JSON"); MvcBuilder.AddNewtonsoftJson(options => { @@ -112,7 +112,7 @@ namespace AyaNova //HTTP CLIENT FACTORY USED BY LICENSE.CS //https://docs.microsoft.com/en-us/aspnet/core/fundamentals/http-requests?view=aspnetcore-3.1 - _newLog.LogTrace("HTTPClientFactory"); + _newLog.LogDebug("HTTPClientFactory"); services.AddHttpClient(); @@ -157,7 +157,7 @@ namespace AyaNova #endif - _newLog.LogTrace("EF Core"); + _newLog.LogDebug("EF Core"); //change to resolve error: @@ -180,7 +180,7 @@ namespace AyaNova // Add service and create Policy with options - _newLog.LogTrace("CORS"); + _newLog.LogDebug("CORS"); services.AddCors(options => { options.AddPolicy("CorsPolicy", @@ -271,7 +271,7 @@ namespace AyaNova ServerBootConfig.AYANOVA_JWT_SECRET = secretKey; var signingKey = new SymmetricSecurityKey(System.Text.Encoding.ASCII.GetBytes(ServerBootConfig.AYANOVA_JWT_SECRET)); - _newLog.LogTrace("Authorization"); + _newLog.LogDebug("Authorization"); services.AddAuthentication(options => { options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; @@ -305,7 +305,7 @@ namespace AyaNova - _newLog.LogTrace("Generator"); + _newLog.LogDebug("Generator"); services.AddSingleton(); } @@ -319,7 +319,7 @@ namespace AyaNova AyContext dbContext, IApiVersionDescriptionProvider provider, AyaNova.Api.ControllerHelpers.ApiServerState apiServerState, IServiceProvider serviceProvider) { - _newLog.LogTrace("Configuring request pipeline..."); + _newLog.LogDebug("Configuring request pipeline..."); //this *may* be useful in the event of an issue so uncomment if necessary but errors during dev are handled equally by the logging, I think // if (env.IsDevelopment()) @@ -346,7 +346,7 @@ namespace AyaNova #region STATIC FILES - _newLog.LogTrace("Static files"); + _newLog.LogDebug("Static files"); app.UseDefaultFiles(); app.UseStaticFiles(); //Might need the following if the page doesn't update in the client properly @@ -364,19 +364,19 @@ namespace AyaNova // }); #endregion - _newLog.LogTrace("Routing pipeline"); + _newLog.LogDebug("Routing pipeline"); app.UseRouting();//this wasn't here for 2.2 but added for 3.0, needs to come before the stuff after - _newLog.LogTrace("CORS pipeline"); + _newLog.LogDebug("CORS pipeline"); app.UseCors("CorsPolicy"); #region AUTH / ROLES CUSTOM MIDDLEWARE - _newLog.LogTrace("Authentication pipeline"); + _newLog.LogDebug("Authentication pipeline"); //Use authentication middleware app.UseAuthentication(); - _newLog.LogTrace("Authorization pipeline"); + _newLog.LogDebug("Authorization pipeline"); app.UseAuthorization(); @@ -496,12 +496,12 @@ namespace AyaNova #endregion - _newLog.LogTrace("Profiler"); + _newLog.LogDebug("Profiler"); app.UseMiniProfiler(); - _newLog.LogTrace("Endpoints pipeline"); + _newLog.LogDebug("Endpoints pipeline"); app.UseEndpoints(endpoints => { endpoints.MapHealthChecks("/health"); @@ -510,7 +510,7 @@ namespace AyaNova #region SWAGGER - _newLog.LogTrace("API explorer pipeline"); + _newLog.LogDebug("API explorer pipeline"); // Enable middleware to serve generated Swagger as a JSON endpoint. app.UseSwagger(); app.UseSwaggerUI( @@ -570,13 +570,13 @@ namespace AyaNova //Check schema - _newLog.LogTrace("DB schema check"); + _newLog.LogDebug("DB schema check"); AySchema.CheckAndUpdateAsync(dbContext, _newLog).Wait(); //Check database integrity - _newLog.LogTrace("DB integrity check"); + _newLog.LogDebug("DB integrity check"); DbUtil.CheckFingerPrintAsync(AySchema.EXPECTED_COLUMN_COUNT, AySchema.EXPECTED_INDEX_COUNT, AySchema.EXPECTED_CHECK_CONSTRAINTS, @@ -589,10 +589,10 @@ namespace AyaNova AyaNova.Core.License.InitializeAsync(apiServerState, dbContext, _newLog).Wait(); //Set static global biz settings - _newLog.LogTrace("Global settings"); + _newLog.LogDebug("Global settings"); ServerGlobalBizSettings.Initialize(null, dbContext); - _newLog.LogTrace("Ops settings"); + _newLog.LogDebug("Ops settings"); ServerGlobalOpsSettingsCache.Initialize(dbContext); //Ensure translations are present, not missing any keys and that there is a server default translation that exists @@ -650,7 +650,7 @@ namespace AyaNova ServerGlobalOpsSettingsCache.BOOTING = false; //Open up the server for visitors - _newLog.LogTrace("Setting server state open"); + _newLog.LogDebug("Setting server state open"); apiServerState.SetOpen(); //final startup log diff --git a/server/AyaNova/biz/JobsBiz.cs b/server/AyaNova/biz/JobsBiz.cs index 0065f4c1..48d0fcb9 100644 --- a/server/AyaNova/biz/JobsBiz.cs +++ b/server/AyaNova/biz/JobsBiz.cs @@ -182,7 +182,7 @@ namespace AyaNova.Biz if (ActivelyProcessing) { //System.Diagnostics.Debug.WriteLine("ProcessJobs called but actively processing other jobs so returning"); - log.LogTrace("ProcessJobs called but actively processing other jobs so returning"); + log.LogDebug("ProcessJobs called but actively processing other jobs so returning"); return; } if (!KeepOnWorking()) return; @@ -190,7 +190,7 @@ namespace AyaNova.Biz log.LogDebug("Processing internal jobs"); try { - log.LogTrace("Processing level 1 internal jobs"); + log.LogDebug("Processing level 1 internal jobs"); //### Critical internal jobs, these run even if there is a license related serverlock //LICENSE FETCH await CoreJobLicense.DoWorkAsync(); @@ -202,7 +202,7 @@ namespace AyaNova.Biz ApiServerState serverState = ServiceProviderProvider.ServerState; if (!KeepOnWorking()) return; - log.LogTrace("Processing level 2 internal jobs"); + log.LogDebug("Processing level 2 internal jobs"); // #if (DEBUG) // log.LogInformation("Processing semi-critical internal jobs (backup, pm, notification etc)"); @@ -239,7 +239,7 @@ namespace AyaNova.Biz if (!KeepOnWorking()) return; - log.LogTrace("Processing exclusive dynamic jobs"); + log.LogDebug("Processing exclusive dynamic jobs"); //BIZOBJECT DYNAMIC JOBS //get a list of exclusive jobs that are due to happen @@ -264,14 +264,14 @@ namespace AyaNova.Biz //### API Open only jobs if (!serverState.IsOpen) { - log.LogTrace("Server state is NOT open, skipping processing non-exclusive dynamic jobs"); + log.LogDebug("Server state is NOT open, skipping processing non-exclusive dynamic jobs"); return; } /////////////////////////////////////// //NON-EXCLUSIVE JOBS // - log.LogTrace("Processing non-exclusive dynamic jobs"); + log.LogDebug("Processing non-exclusive dynamic jobs"); if (!KeepOnWorking()) return; //These fire and forget but use a technique to bubble up exceptions anyway List sharedJobs = await GetReadyJobsNotExlusiveOnlyAsync(); diff --git a/server/AyaNova/biz/PMBiz.cs b/server/AyaNova/biz/PMBiz.cs index 912e6b8b..54806f19 100644 --- a/server/AyaNova/biz/PMBiz.cs +++ b/server/AyaNova/biz/PMBiz.cs @@ -5099,7 +5099,7 @@ namespace AyaNova.Biz //confirm customer is active before proceeding if (!await ct.Customer.AsNoTracking().Where(x => x.Id == p.CustomerId).Select(x => x.Active).FirstOrDefaultAsync()) { - log.LogTrace($"PM {p.Serial} has an Inactive customer selected so it will be skipped for generation"); + log.LogDebug($"PM {p.Serial} has an Inactive customer selected so it will be skipped for generation"); continue; } @@ -5138,7 +5138,7 @@ namespace AyaNova.Biz { p.Active = false; await ct.SaveChangesAsync(); - log.LogTrace($"PM {p.Serial} has reached it's stop generating date and has been automatically deactivated"); + log.LogDebug($"PM {p.Serial} has reached it's stop generating date and has been automatically deactivated"); continue; } diff --git a/server/AyaNova/biz/ReportBiz.cs b/server/AyaNova/biz/ReportBiz.cs index 441e3763..7bac6bf4 100644 --- a/server/AyaNova/biz/ReportBiz.cs +++ b/server/AyaNova/biz/ReportBiz.cs @@ -58,7 +58,7 @@ namespace AyaNova.Biz } } - + //////////////////////////////////////////////////////////////////////////////////////////////// //IMPORT // @@ -82,7 +82,7 @@ namespace AyaNova.Biz } while (NotUnique); newObject.Name = newUniqueName; - + await ValidateAsync(newObject, null); if (HasErrors) return false; await ct.Report.AddAsync(newObject); @@ -332,7 +332,7 @@ namespace AyaNova.Biz bool RequestIsCustomerWorkOrderReport = false; if (reportRequest.ReportId == -100) { - log.LogTrace("customer user report requested"); + log.LogDebug("customer user report requested"); //get the user and workorder data and set the actual report id or return null if not found var woTags = await ct.WorkOrder.AsNoTracking().Where(x => x.Id == reportRequest.SelectedRowIds[0]).Select(x => x.Tags).FirstOrDefaultAsync(); if (woTags == null) return null; @@ -346,7 +346,7 @@ namespace AyaNova.Biz throw new ReportRenderTimeOutException(); //get report, vet security, see what we need before init in case of issue - log.LogTrace($"get report from db"); + log.LogDebug($"get report from db"); var report = await ct.Report.FirstOrDefaultAsync(z => z.Id == reportRequest.ReportId); if (report == null) { @@ -366,7 +366,7 @@ namespace AyaNova.Biz if (!RequestIsCustomerWorkOrderReport && !AyaNova.Api.ControllerHelpers.Authorized.HasReadFullRole(effectiveRoles, report.AType)) { - log.LogTrace($"bail: user unauthorized"); + log.LogDebug($"bail: user unauthorized"); AddError(ApiErrorCode.NOT_AUTHORIZED, null, $"User not authorized for {report.AType} type object"); return null; } @@ -374,7 +374,7 @@ namespace AyaNova.Biz //Client meta data is required if (reportRequest.ClientMeta == null) { - log.LogTrace($"bail: ClientMeta parameter is missing"); + log.LogDebug($"bail: ClientMeta parameter is missing"); AddError(ApiErrorCode.VALIDATION_MISSING_PROPERTY, null, "ClientMeta parameter is missing and required to render report"); return null; } @@ -393,7 +393,7 @@ namespace AyaNova.Biz //if GetReportData errored then will return null so need to return that as well here if (ReportData == null) { - log.LogTrace($"bail: ReportData == null"); + log.LogDebug($"bail: ReportData == null"); return null; } // #if (DEBUG) @@ -406,11 +406,11 @@ namespace AyaNova.Biz bool AutoDownloadChromium = true; if (string.IsNullOrWhiteSpace(ServerBootConfig.AYANOVA_REPORT_RENDER_BROWSER_PATH)) { - log.LogTrace($"Using default Chromium browser (downloaded)"); + log.LogDebug($"Using default Chromium browser (downloaded)"); } else { - log.LogTrace($"Using user specified Chromium browser at {ServerBootConfig.AYANOVA_REPORT_RENDER_BROWSER_PATH}"); + log.LogDebug($"Using user specified Chromium browser at {ServerBootConfig.AYANOVA_REPORT_RENDER_BROWSER_PATH}"); AutoDownloadChromium = false; } @@ -441,7 +441,7 @@ namespace AyaNova.Biz // #if (DEBUG) // log.LogInformation($"DBG: ReportBiz::calling browserfetcher"); // #endif - log.LogTrace($"Windows: Calling browserFetcher download async now:"); + log.LogDebug($"Windows: Calling browserFetcher download async now:"); await new BrowserFetcher().DownloadAsync(BrowserFetcher.DefaultChromiumRevision); } @@ -463,9 +463,10 @@ namespace AyaNova.Biz throw new ReportRenderTimeOutException(); //API DOCS http://www.puppeteersharp.com/api/index.html - log.LogTrace($"Launching headless Browser now:"); + log.LogDebug($"Launching headless Browser and new page now:"); using (var browser = await Puppeteer.LaunchAsync(lo)) using (var page = (await browser.PagesAsync())[0]) + // using (var page = await browser.NewPageAsync()) { //track this process for timeout purposes ReportRenderManager.AddProcess(browser.Process.Id, renderTimeOutExpiry, log); @@ -496,7 +497,7 @@ namespace AyaNova.Biz } }; - log.LogTrace($"Preparing page: adding base reporting scripts to page"); + log.LogDebug($"Preparing page: adding base reporting scripts to page"); if (DateTime.UtcNow > renderTimeOutExpiry) throw new ReportRenderTimeOutException(); @@ -524,7 +525,7 @@ namespace AyaNova.Biz await page.EvaluateExpressionAsync("ayRegisterHelpers();"); if (DateTime.UtcNow > renderTimeOutExpiry) throw new ReportRenderTimeOutException(); - log.LogTrace($"Preparing page: adding this report's scripts, style and templates to page"); + log.LogDebug($"Preparing page: adding this report's scripts, style and templates to page"); //add report pre-render, helpers and style if (string.IsNullOrWhiteSpace(report.JsPrerender)) @@ -539,12 +540,12 @@ namespace AyaNova.Biz if (!string.IsNullOrWhiteSpace(report.Style)) await page.AddStyleTagAsync(new AddTagOptions() { Content = report.Style }); - log.LogTrace($"Preparing page: adding Client meta data"); + log.LogDebug($"Preparing page: adding Client meta data"); //Client meta data to JSON string var clientMeta = reportRequest.ClientMeta.ToString(); - log.LogTrace($"Preparing page: adding Server meta data"); + log.LogDebug($"Preparing page: adding Server meta data"); //Server meta data var logo = await ct.Logo.AsNoTracking().SingleOrDefaultAsync(); @@ -561,7 +562,7 @@ namespace AyaNova.Biz var HasStreetAddress = !string.IsNullOrWhiteSpace(ServerGlobalBizSettings.Cache.Address) ? "true" : "false"; var serverMeta = $"{{ayApiUrl:`{apiUrl}`, HasSmallLogo:{HasSmallLogo}, HasMediumLogo:{HasMediumLogo}, HasLargeLogo:{HasLargeLogo},CompanyName: `{AyaNova.Core.License.ActiveKey.RegisteredTo}`,CompanyWebAddress:`{ServerGlobalBizSettings.Cache.WebAddress}`,CompanyEmailAddress:`{ServerGlobalBizSettings.Cache.EmailAddress}`,CompanyPhone1:`{ServerGlobalBizSettings.Cache.Phone1}`,CompanyPhone2:`{ServerGlobalBizSettings.Cache.Phone2}`,HasPostalAddress:{HasPostalAddress},CompanyPostAddress:`{ServerGlobalBizSettings.Cache.PostAddress}`,CompanyPostCity:`{ServerGlobalBizSettings.Cache.PostCity}`,CompanyPostRegion:`{ServerGlobalBizSettings.Cache.PostRegion}`,CompanyPostCountry:`{ServerGlobalBizSettings.Cache.PostCountry}`,CompanyPostCode:`{ServerGlobalBizSettings.Cache.PostCode}`,HasStreetAddress:{HasStreetAddress},CompanyAddress:`{ServerGlobalBizSettings.Cache.Address}`,CompanyCity:`{ServerGlobalBizSettings.Cache.City}`,CompanyRegion:`{ServerGlobalBizSettings.Cache.Region}`,CompanyCountry:`{ServerGlobalBizSettings.Cache.Country}`,CompanyLatitude:{ServerGlobalBizSettings.Cache.Latitude},CompanyLongitude:{ServerGlobalBizSettings.Cache.Longitude}}}"; - log.LogTrace($"Preparing page: adding Report meta data"); + log.LogDebug($"Preparing page: adding Report meta data"); //Custom fields definition for report usage string CustomFieldsTemplate = "null"; @@ -587,13 +588,16 @@ namespace AyaNova.Biz //prePareData / preRender var ReportDataObject = $"{{ ayReportData:{ReportData}, ayReportMetaData:{reportMeta}, ayClientMetaData:{clientMeta}, ayServerMetaData:{serverMeta} }}"; - log.LogTrace($"Calling ayPreRender..."); - + + log.LogDebug($"PageLog before render:{PageLog.ToString()}"); + log.LogDebug($"Calling ayPreRender..."); await page.WaitForExpressionAsync($"ayPreRender({ReportDataObject})"); + log.LogDebug($"ayPreRender completed"); + if (DateTime.UtcNow > renderTimeOutExpiry) throw new ReportRenderTimeOutException(); //compile the template - log.LogTrace($"Calling Handlebars.compile..."); + log.LogDebug($"Calling Handlebars.compile..."); var compileScript = $"Handlebars.compile(`{report.Template}`)(PreParedReportDataObject);"; if (DateTime.UtcNow > renderTimeOutExpiry) @@ -602,14 +606,14 @@ namespace AyaNova.Biz if (DateTime.UtcNow > renderTimeOutExpiry) throw new ReportRenderTimeOutException(); //render report as HTML - log.LogTrace($"Setting page content to compiled HTML"); + log.LogDebug($"Setting page content to compiled HTML"); await page.SetContentAsync(compiledHTML); //add style (after page or it won't work) if (!string.IsNullOrWhiteSpace(report.Style)) { - log.LogTrace($"Adding report template Style CSS"); + log.LogDebug($"Adding report template Style CSS"); await page.AddStyleTagAsync(new AddTagOptions { Content = report.Style }); } @@ -619,7 +623,7 @@ namespace AyaNova.Biz //Set PDF options //https://pptr.dev/#?product=Puppeteer&version=v5.3.0&show=api-pagepdfoptions - log.LogTrace($"Resolving PDF Options from report settings"); + log.LogDebug($"Resolving PDF Options from report settings"); var PdfOptions = new PdfOptions() { }; @@ -697,22 +701,25 @@ namespace AyaNova.Biz if (DateTime.UtcNow > renderTimeOutExpiry) throw new ReportRenderTimeOutException(); //render to pdf and return - log.LogTrace($"Calling render page contents to PDF"); + log.LogDebug($"Calling render page contents to PDF"); await page.PdfAsync(outputFullPath, PdfOptions);//###### TODO: SLOW NEEDS TIMEOUT HERE ONCE SUPPORTED, open bug: https://github.com/hardkoded/puppeteer-sharp/issues/1710 - log.LogTrace($"Closing Page and Browser"); + log.LogDebug($"Closing Page"); await page.CloseAsync(); + log.LogDebug($"Closing Browser"); await browser.CloseAsync(); - log.LogTrace($"Completed, returning results"); + log.LogDebug($"Render completed, returning results"); return outputFileName; } catch (ReportRenderTimeOutException) { + log.LogDebug("Caught ReportRendertimeOutException, re-throwing"); throw; } catch (PuppeteerSharp.TargetClosedException) { + log.LogDebug("Caught PuppeteerSharp.TargetClosedException throwing as ReportRendertimeOutException (timed out and closed from process sweeper)"); //we closed it because the timeout hit and the CoreJobReportRenderEngineProcessCleanup job cleaned it out //so return the error the client expects in this scenario throw new ReportRenderTimeOutException(); @@ -734,15 +741,18 @@ namespace AyaNova.Biz } finally { - // #if (DEBUG) - // log.LogInformation($"DBG: ReportBiz::RenderReport - closing browser"); - // #endif - log.LogTrace($"Closing Page and Browser"); + log.LogDebug($"reached finally block"); if (!page.IsClosed) + { + log.LogDebug($"Page not closed in finally block, closing now"); await page.CloseAsync(); + } if (!browser.IsClosed) + { + log.LogDebug($"Browser not closed in finally block, closing now"); await browser.CloseAsync(); - log.LogTrace($"Calling ReportRenderManager.RemoveProcess to stop tracking this process"); + } + log.LogDebug($"Calling ReportRenderManager.RemoveProcess to stop tracking this process"); ReportRenderManager.RemoveProcess(browser.Process.Id, log); } } diff --git a/server/AyaNova/generator/CoreJobBackup.cs b/server/AyaNova/generator/CoreJobBackup.cs index efc96d08..217f7237 100644 --- a/server/AyaNova/generator/CoreJobBackup.cs +++ b/server/AyaNova/generator/CoreJobBackup.cs @@ -29,7 +29,7 @@ namespace AyaNova.Biz if (BackupIsRunning) return; if (!OnDemand) { - log.LogTrace("Checking if backup should run"); + log.LogDebug("Checking if backup should run"); if (!ServerGlobalOpsSettingsCache.Backup.Active) { log.LogDebug("Automatic backup is set to INACTIVE - not backing up"); @@ -38,7 +38,7 @@ namespace AyaNova.Biz if (DateTime.UtcNow < ServerGlobalOpsSettingsCache.NextBackup) { - log.LogTrace("Not past backup time yet"); + log.LogDebug("Not past backup time yet"); return; } } diff --git a/server/AyaNova/generator/CoreJobLicense.cs b/server/AyaNova/generator/CoreJobLicense.cs index efb27879..81fb6487 100644 --- a/server/AyaNova/generator/CoreJobLicense.cs +++ b/server/AyaNova/generator/CoreJobLicense.cs @@ -33,7 +33,7 @@ namespace AyaNova.Biz // public static async Task DoWorkAsync() { - log.LogTrace("Job starting"); + log.LogDebug("Job starting"); var tsSinceLastCheck = DateTime.UtcNow - _lastCheck; //which track are we on? /* @@ -56,10 +56,10 @@ namespace AyaNova.Biz tsCheckFrequency = SLOW_TRACK; break; } - log.LogTrace($"Check frequency{tsCheckFrequency}"); + log.LogDebug($"Check frequency{tsCheckFrequency}"); if (tsSinceLastCheck < tsCheckFrequency) { - log.LogTrace($"Not yet"); + log.LogDebug($"Not yet"); return; } diff --git a/server/AyaNova/generator/CoreJobMetricsSnapshot.cs b/server/AyaNova/generator/CoreJobMetricsSnapshot.cs index 6385a812..3385efd4 100644 --- a/server/AyaNova/generator/CoreJobMetricsSnapshot.cs +++ b/server/AyaNova/generator/CoreJobMetricsSnapshot.cs @@ -44,7 +44,7 @@ namespace AyaNova.Biz ///////////////////////////////////////////// //ONE MINUTE SNAPS // - log.LogTrace("MM metrics snapshot"); + log.LogDebug("MM metrics snapshot"); var now = DateTime.UtcNow; _process.Refresh(); @@ -97,7 +97,7 @@ namespace AyaNova.Biz // if (DateUtil.IsAfterDuration(_lastDDSnapshot, ts24Hours)) { - log.LogTrace("DD metrics snapshot"); + log.LogDebug("DD metrics snapshot"); var now = DateTime.UtcNow; //FILES ON DISK var UtilFilesInfo = FileUtil.GetBackupFolderSizeInfo(); diff --git a/server/AyaNova/generator/CoreJobNotify.cs b/server/AyaNova/generator/CoreJobNotify.cs index e91c7955..a76d8e7a 100644 --- a/server/AyaNova/generator/CoreJobNotify.cs +++ b/server/AyaNova/generator/CoreJobNotify.cs @@ -34,22 +34,22 @@ namespace AyaNova.Biz // public static async Task DoWorkAsync() { - log.LogTrace("Checking if Notify should run"); + log.LogDebug("Checking if Notify should run"); if (NotifyIsRunning) { - log.LogTrace("Notify is running already exiting this cycle"); + log.LogDebug("Notify is running already exiting this cycle"); return; } //This will get triggered roughly every minute, but we don't want to deliver that frequently if (DateTime.UtcNow - lastRun < RUN_EVERY_INTERVAL) { - log.LogTrace($"Notify ran less than {RUN_EVERY_INTERVAL} ago, exiting this cycle"); + log.LogDebug($"Notify ran less than {RUN_EVERY_INTERVAL} ago, exiting this cycle"); return; } try { NotifyIsRunning = true; - log.LogTrace("Notify set to RUNNING state and starting now"); + log.LogDebug("Notify set to RUNNING state and starting now"); //NotifyHealthCheck processing //Note this deliberately uses LOCAL time in effort to deliver the health check first thing in the morning for workers @@ -60,7 +60,7 @@ namespace AyaNova.Biz //are we in the 7th to 9th hour? if (dtNowLocal.Hour > 6 && dtNowLocal.Hour < 10) { - log.LogTrace("Notify health check submitted to subscribers"); + log.LogDebug("Notify health check submitted to subscribers"); await NotifyEventHelper.AddGeneralNotifyEvent(NotifyEventType.NotifyHealthCheck, "OK", ""); lastNotifyHealthCheckSentLocal = dtNowLocal; } @@ -69,7 +69,7 @@ namespace AyaNova.Biz using (AyContext ct = AyaNova.Util.ServiceProviderProvider.DBContext) { var events = await ct.NotifyEvent.AsNoTracking().ToListAsync(); - log.LogTrace($"Found {events.Count} NotifyEvents to examine for potential delivery"); + log.LogDebug($"Found {events.Count} NotifyEvents to examine for potential delivery"); //iterate and deliver foreach (var notifyevent in events) @@ -78,7 +78,7 @@ namespace AyaNova.Biz var UserInfo = await ct.User.AsNoTracking().Where(x => x.Id == notifyevent.UserId).Select(x => new { Active = x.Active, Name = x.Name }).FirstOrDefaultAsync(); if (!UserInfo.Active) { - log.LogTrace($"Inactive user {UserInfo.Name}, removing notify rather than delivering it: {notifyevent}"); + log.LogDebug($"Inactive user {UserInfo.Name}, removing notify rather than delivering it: {notifyevent}"); ct.NotifyEvent.Remove(notifyevent); await ct.SaveChangesAsync(); continue; @@ -115,7 +115,7 @@ namespace AyaNova.Biz //look for same delivery less than last12hours ago if (await ct.NotifyDeliveryLog.AnyAsync(z => z.Processed > twelvehoursago && z.NotifySubscriptionId == notifyevent.NotifySubscriptionId && z.ObjectId == notifyevent.ObjectId)) { - log.LogTrace($"Notification event will not be delivered: repetitive (server system event type and delivered at least once in the last 12 hours to this subscriber: {notifyevent})"); + log.LogDebug($"Notification event will not be delivered: repetitive (server system event type and delivered at least once in the last 12 hours to this subscriber: {notifyevent})"); ct.NotifyEvent.Remove(notifyevent); await ct.SaveChangesAsync(); #if (DEBUG) @@ -142,7 +142,7 @@ namespace AyaNova.Biz } finally { - log.LogTrace("Notify is done setting to not running state and tagging lastRun timestamp"); + log.LogDebug("Notify is done setting to not running state and tagging lastRun timestamp"); lastRun = DateTime.UtcNow; NotifyIsRunning = false; @@ -152,7 +152,7 @@ namespace AyaNova.Biz private static async Task DeliverInApp(NotifyEvent ne, TimeSpan ageValue, AyContext ct) { - log.LogTrace($"DeliverInApp notify event: {ne}"); + log.LogDebug($"DeliverInApp notify event: {ne}"); //Place in the In-app notification table for user to view await ct.InAppNotification.AddAsync( @@ -195,7 +195,7 @@ namespace AyaNova.Biz try { - log.LogTrace($"DeliverSMTP delivering notify event: {ne}"); + log.LogDebug($"DeliverSMTP delivering notify event: {ne}"); if (string.IsNullOrWhiteSpace(deliveryAddress)) { await NotifyEventHelper.AddGeneralNotifyEvent(NotifyEventType.GeneralNotification, $"No email address is set in subscription to deliver email notification. This event will be removed from the delivery queue as undeliverable: {ne}", "Error", null, ne.UserId); @@ -314,7 +314,7 @@ namespace AyaNova.Biz await NotifyEventHelper.AddGeneralNotifyEvent(NotifyEventType.GeneralNotification, $"An error prevented delivering the following notification via email. System operator users have been notified:{ne}", "Error", null, ne.UserId); DeliveryLogItem.Fail = true; DeliveryLogItem.Error = $"SMTP Notification failed to deliver for this event: {ne}, message: {ex.Message}"; - log.LogTrace(ex, $"DeliverSMTP Failure delivering notify event: {ne}"); + log.LogDebug(ex, $"DeliverSMTP Failure delivering notify event: {ne}"); } finally { diff --git a/server/AyaNova/generator/CoreJobPMGenerate.cs b/server/AyaNova/generator/CoreJobPMGenerate.cs index 8bc3dfb4..f530a372 100644 --- a/server/AyaNova/generator/CoreJobPMGenerate.cs +++ b/server/AyaNova/generator/CoreJobPMGenerate.cs @@ -31,22 +31,22 @@ namespace AyaNova.Biz public static async Task DoWorkAsync() { - log.LogTrace("Checking if PMGenerate should run"); + log.LogDebug("Checking if PMGenerate should run"); if (IsRunning) { - log.LogTrace("PMGenerate is running already exiting this cycle"); + log.LogDebug("PMGenerate is running already exiting this cycle"); return; } //This will get triggered roughly every minute, but we don't want to deliver that frequently if (DateTime.UtcNow - lastRun < RUN_EVERY_INTERVAL) { - log.LogTrace($"PMGenerate ran less than {RUN_EVERY_INTERVAL} ago, exiting this cycle"); + log.LogDebug($"PMGenerate ran less than {RUN_EVERY_INTERVAL} ago, exiting this cycle"); return; } try { IsRunning = true; - log.LogTrace("PMGenerate set to RUNNING state and starting now"); + log.LogDebug("PMGenerate set to RUNNING state and starting now"); using (AyContext ct = AyaNova.Util.ServiceProviderProvider.DBContext) { @@ -60,7 +60,7 @@ namespace AyaNova.Biz } finally { - log.LogTrace("PMGenerate has completed; setting to not running state and tagging lastRun timestamp"); + log.LogDebug("PMGenerate has completed; setting to not running state and tagging lastRun timestamp"); lastRun = DateTime.UtcNow; IsRunning = false; diff --git a/server/AyaNova/generator/CoreJobPMInventoryCheck.cs b/server/AyaNova/generator/CoreJobPMInventoryCheck.cs index 0a9058c3..7e9c1eb2 100644 --- a/server/AyaNova/generator/CoreJobPMInventoryCheck.cs +++ b/server/AyaNova/generator/CoreJobPMInventoryCheck.cs @@ -31,16 +31,16 @@ namespace AyaNova.Biz public static async Task DoWorkAsync() { - log.LogTrace("Checking if CoreJobPMInventoryCheck should run"); + log.LogDebug("Checking if CoreJobPMInventoryCheck should run"); if (IsRunning) { - log.LogTrace("CoreJobPMInventoryCheck is running already exiting this cycle"); + log.LogDebug("CoreJobPMInventoryCheck is running already exiting this cycle"); return; } //This will get triggered roughly every minute, but we don't want to deliver that frequently if (DateTime.UtcNow - lastRun < RUN_EVERY_INTERVAL) { - log.LogTrace($"CoreJobPMInventoryCheck ran less than {RUN_EVERY_INTERVAL} ago, exiting this cycle"); + log.LogDebug($"CoreJobPMInventoryCheck ran less than {RUN_EVERY_INTERVAL} ago, exiting this cycle"); return; } @@ -48,7 +48,7 @@ namespace AyaNova.Biz try { IsRunning = true; - log.LogTrace("CoreJobPMInventoryCheck set to RUNNING state and starting now"); + log.LogDebug("CoreJobPMInventoryCheck set to RUNNING state and starting now"); using (AyContext ct = AyaNova.Util.ServiceProviderProvider.DBContext) { @@ -62,7 +62,7 @@ namespace AyaNova.Biz } finally { - log.LogTrace("CoreJobPMInventoryCheck has completed; setting to not running state and tagging lastRun timestamp"); + log.LogDebug("CoreJobPMInventoryCheck has completed; setting to not running state and tagging lastRun timestamp"); lastRun = DateTime.UtcNow; IsRunning = false; } diff --git a/server/AyaNova/generator/CoreJobReportRenderEngineProcessCleanup.cs b/server/AyaNova/generator/CoreJobReportRenderEngineProcessCleanup.cs index 84fc5094..ab9fa85c 100644 --- a/server/AyaNova/generator/CoreJobReportRenderEngineProcessCleanup.cs +++ b/server/AyaNova/generator/CoreJobReportRenderEngineProcessCleanup.cs @@ -23,7 +23,7 @@ namespace AyaNova.Biz { if (DateUtil.IsAfterDuration(_lastRun, tsRunEvery)) { - log.LogTrace("Checking for expired processes"); + log.LogDebug("Checking for expired processes"); Util.ReportRenderManager.KillExpiredRenders(log); //FileUtil.CleanTemporaryFilesFolder(new TimeSpan(0,5,0));//erase any files found to be older than 5 minutes var now = DateTime.UtcNow; diff --git a/server/AyaNova/generator/CoreJobSweeper.cs b/server/AyaNova/generator/CoreJobSweeper.cs index 6737ef92..4e7cab28 100644 --- a/server/AyaNova/generator/CoreJobSweeper.cs +++ b/server/AyaNova/generator/CoreJobSweeper.cs @@ -33,7 +33,7 @@ namespace AyaNova.Biz if (DateTime.UtcNow - lastSweep < SWEEP_EVERY_INTERVAL) return; - log.LogTrace("Sweep starting"); + log.LogDebug("Sweep starting"); using (AyContext ct = AyaNova.Util.ServiceProviderProvider.DBContext) { //SWEEP SUCCESSFUL JOBS @@ -82,7 +82,7 @@ namespace AyaNova.Biz .OrderBy(z => z.Created) .ToListAsync(); - log.LogTrace($"SweepAsync processing: cutoff={dtDeleteCutoff.ToString()}, for {jobs.Count.ToString()} jobs of status {jobStatus.ToString()}"); + log.LogDebug($"SweepAsync processing: cutoff={dtDeleteCutoff.ToString()}, for {jobs.Count.ToString()} jobs of status {jobStatus.ToString()}"); foreach (OpsJob j in jobs) { @@ -113,7 +113,7 @@ namespace AyaNova.Biz .OrderBy(z => z.Created) .ToListAsync(); - log.LogTrace($"killStuckJobsAsync processing: cutoff={dtRunningDeadline.ToString()}, for {jobs.Count.ToString()} jobs of status {JobStatus.Running.ToString()}"); + log.LogDebug($"killStuckJobsAsync processing: cutoff={dtRunningDeadline.ToString()}, for {jobs.Count.ToString()} jobs of status {JobStatus.Running.ToString()}"); foreach (OpsJob j in jobs) { @@ -134,7 +134,7 @@ namespace AyaNova.Biz .OrderBy(z => z.Created) .ToListAsync(); - log.LogTrace($"SweepInternalJobsLogsAsync processing: cutoff={dtDeleteCutoff.ToString()}, for {logs.Count.ToString()} log entries"); + log.LogDebug($"SweepInternalJobsLogsAsync processing: cutoff={dtDeleteCutoff.ToString()}, for {logs.Count.ToString()} log entries"); foreach (OpsJobLog l in logs) { diff --git a/server/AyaNova/generator/CoreJobTempFolderCleanup.cs b/server/AyaNova/generator/CoreJobTempFolderCleanup.cs index c627d8ef..81f38bef 100644 --- a/server/AyaNova/generator/CoreJobTempFolderCleanup.cs +++ b/server/AyaNova/generator/CoreJobTempFolderCleanup.cs @@ -22,7 +22,7 @@ namespace AyaNova.Biz { if (DateUtil.IsAfterDuration(_lastRun, tsRunEvery)) { - log.LogTrace("Temp cleanup now"); + log.LogDebug("Temp cleanup now"); FileUtil.CleanTemporaryFilesFolder(new TimeSpan(0,15,0));//erase any files found to be older than 15 minutes (which coincides with max report rendering timeout) var now = DateTime.UtcNow; _lastRun = now; diff --git a/server/AyaNova/generator/CoreNotificationSweeper.cs b/server/AyaNova/generator/CoreNotificationSweeper.cs index f5054376..55e95b30 100644 --- a/server/AyaNova/generator/CoreNotificationSweeper.cs +++ b/server/AyaNova/generator/CoreNotificationSweeper.cs @@ -28,7 +28,7 @@ namespace AyaNova.Biz DateTime dtDeleteCutoff = DateTime.UtcNow - DELETE_AFTER_AGE; DateTime dtPastEventCutoff = DateTime.UtcNow - SWEEP_EVERY_INTERVAL; - log.LogTrace("Sweep starting"); + log.LogDebug("Sweep starting"); using (AyContext ct = AyaNova.Util.ServiceProviderProvider.DBContext) { //Notification (in-App notifications table) - deletes all APP notifications older than 90 days (if they want to keep it then can turn it into a reminder or SAVE it somehow) diff --git a/server/AyaNova/generator/Generate.cs b/server/AyaNova/generator/Generate.cs index f2ea8840..55810591 100644 --- a/server/AyaNova/generator/Generate.cs +++ b/server/AyaNova/generator/Generate.cs @@ -48,7 +48,7 @@ namespace AyaNova.Generator { if (!ServerGlobalOpsSettingsCache.BOOTING) { - log.LogTrace($"GeneratorService running jobs"); + log.LogDebug($"GeneratorService running jobs"); //================================================================= try diff --git a/server/AyaNova/resource/rpt/stock-report-templates/Clients list.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Clients list.ayrt new file mode 100644 index 00000000..d13cb9ec --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Clients list.ayrt @@ -0,0 +1 @@ +{"Name":"Clients list","Active":true,"Notes":"","Roles":50538,"AType":8,"IncludeWoItemDescendants":false,"Template":"\n\n\n
\n
\n

{{ayT 'CustomerList'}} List

\n
\n\n \n\n \n \n\n \n {{#each ayReportData}}\n \n \n \n \n \n \n \n \n \n {{#if LastServiceDateViz}}{{else}}{{/if}}\n \n \n \n \n \n \n \n \n \n \n \n {{#if BillHeadOffice}}\n \n \n \n \n {{else}}{{/if}}\n {{#if ContractViz}}\n \n \n \n \n {{else}}{{/if}}\n {{#if AlertNotes}}\n \n \n \n \n {{else}}{{/if}}\n {{#if TechNotes}}\n \n \n \n \n {{else}}{{/if}}\n\n \n \n \n\n {{/each}}\n \n\n \n \n\n
{{ayT 'Customer'}}:{{Name}} 
{{ayT 'CustomerAccountNumber'}}:{{AccountNumber}}{{ayT 'LastServiceWorkOrder'}}:#{{LastWorkOrderViz}} on {{ayDateTime LastServiceDateViz}}
{{ayT 'CustomerPhone1'}}:{{Phone1}}{{ayT 'CustomerEmail'}}:{{EmailAddress}}
{{ayT 'AddressTypePhysical'}}:{{Address}} {{City}}, {{Region}}
{{ayT 'CustomerBillHeadOffice'}}:{{HeadOfficeViz}}
{{ayT 'Contract'}}:{{ContractViz}} Expires: {{ContractExpires}}
{{ayT 'CustomerAlertNotes'}}:{{AlertNotes}} Expires: {{ContractExpires}}
{{ayT 'CustomerTechNotes'}}:{{TechNotes}}
 
\n\n\n
\n\n\n","Style":"body {\r\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \r\n}\r\n\r\n.reporttitle { \r\n margin-bottom: 20pt; \r\n font-weight: bold; \r\n font-size: 13pt; \r\n color: #9e9e9e;\r\n} \r\n\r\ntable { \r\n border-collapse: collapse;\r\n white-space: pre-wrap;\r\n width: 100%;\r\n table-layout: fixed;\r\n }\r\n\r\nth {\r\n height: 20px;\r\n font-size: 10pt; \r\n color: #9e9e9e;\r\n text-align: right;\r\n}\r\n\r\n.lrgtext {\r\n height: 20px;\r\n font-size: 10pt; \r\n}\r\n\r\ntbody td {\r\n padding: 10px;\r\n word-wrap: break-word;\r\n font-size: 8pt;\r\n}\r\n\r\n\r\ntbody tr:nth-child(even) {\r\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\r\n}\r\n\r\n\r\n.rightlean {\r\n text-align: right;\r\n}\r\n.leftlean {\r\n text-align: left;\r\n}\r\n.centerlean {\r\n text-align: center;\r\n}\r\n\r\n\r\n.fontgreen {\r\n color: green;\r\n font-size: 16pt;\r\n}\r\n.fontblue {\r\n color: blue;\r\n}\r\n.fontred {\r\n color:red;\r\n}\r\n\r\n","JsPrerender":" \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //see the help documentation for details\n\nasync function ayPrepareData(ayData) { \n\n await ayGetTranslations([ \"Name\", \"CustomerList\", \"Customer\", \"CustomerAccountNumber\", \"CustomerBillHeadOffice\", \"AddressTypePhysical\", \"CustomerPhone1\", \"CustomerEmail\", \"ContractExpires\", \"Contract\", \"LastServiceWorkOrder\", \"CustomerAlertNotes\", \"CustomerTechNotes\" ]);\n\n \n return ayData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\r\n//https://handlebarsjs.com/guide/#custom-helpers","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":0,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/Contacts list.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Contacts list.ayrt new file mode 100644 index 00000000..754576af --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Contacts list.ayrt @@ -0,0 +1 @@ +{"Name":"Contacts list","Active":true,"Notes":"HTML example of using multiple nested #if else statements for display of value","Roles":50538,"AType":3,"IncludeWoItemDescendants":false,"Template":"\n\n\n
\n
\n

{{ayT 'UserList'}} & {{ayT 'Contacts'}} List

\n
\n\n \n \n \n \n \n \n \n \n \n \n\n \n {{#each ayReportData}}\n \n \n \n {{#if CustomerViz}}{{else}} {{#if HeadOfficeViz}}{{else}}{{/if}}{{/if}}\n \n \n \n \n {{/each}}\n \n\n \n \n\n
{{ayT 'Name'}} & {{ayT 'UserType'}} {{ayT 'LastLogin'}}{{ayT 'UserPhone1'}}{{ayT 'UserEmailAddress'}}
{{Name}}Customer: {{CustomerViz}}Headoffice: {{HeadOfficeViz}}Employee: {{UserTypeViz}}{{ayDateTime LastLogin}}{{UserOptions.Phone1}}{{UserOptions.EmailAddress}}
\n\n\n\n
\n\n\n","Style":"body {\r\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \r\n}\r\n\r\n.reporttitle { \r\n margin-bottom: 20pt; \r\n font-weight: bold; \r\n font-size: 13pt; \r\n color: #9e9e9e;\r\n} \r\n\r\ntable { \r\n border-collapse: collapse;\r\n white-space: pre-wrap;\r\n width: 100%;\r\n table-layout: fixed;\r\n }\r\n\r\nth {\r\n height: 20px;\r\n font-size: 10pt; \r\n color: #9e9e9e;\r\n}\r\n\r\ntbody td {\r\n padding: 10px;\r\n word-wrap: break-word;\r\n font-size: 8pt;\r\n}\r\n\r\n\r\ntbody tr:nth-child(even) {\r\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\r\n}\r\n\r\n\r\n.rightlean {\r\n text-align: right;\r\n}\r\n.leftlean {\r\n text-align: left;\r\n}\r\n.centerlean {\r\n text-align: center;\r\n}\r\n\r\n\r\n.fontgreen {\r\n color: green;\r\n font-size: 16pt;\r\n}\r\n.fontblue {\r\n color: blue;\r\n}\r\n.fontred {\r\n color:red;\r\n}\r\n\r\n","JsPrerender":" \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //see the help documentation for details\n\nasync function ayPrepareData(ayData) { \n\n await ayGetTranslations([ \"UserList\", \"Contacts\", \"UserType\", \"User\", \"Contact\", \"Name\", \"Customer\", \"HeadOffice\", \"User\", \"LastLogin\", \"UserPhone1\", \"UserEmailAddress\" ]);\n\n \n return ayData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\r\n//https://handlebarsjs.com/guide/#custom-helpers","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":0,"Landscape":true,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/Contracts list.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Contracts list.ayrt new file mode 100644 index 00000000..963c419d --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Contracts list.ayrt @@ -0,0 +1 @@ +{"Name":"Contracts list","Active":true,"Notes":"","Roles":50554,"AType":10,"IncludeWoItemDescendants":false,"Template":"\n\n\n
\n\n {{#each ayReportData}}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {{#if ContractPartOverrideItems}}\n {{#each ContractPartOverrideItems}}\n \n \n \n \n {{/each}}\n {{else}}\n \n \n \n \n {{/if}}\n \n \n \n\n \n \n \n \n {{#if ContractServiceRateOverrideItems}}\n {{#each ContractServiceRateOverrideItems}}\n \n \n \n \n {{/each}}\n {{else}}\n \n \n \n \n {{/if}}\n {{#if ContractServiceRatesOnly}}\n \n \n \n \n {{else}} \n \n \n \n \n {{/if}}\n \n \n \n\n \n \n \n \n {{#if ContractTravelRateOverrideItems}}\n {{#each ContractTravelRateOverrideItems}}\n \n \n \n \n {{/each}}\n {{else}}\n \n \n \n \n {{/if}}\n \n {{#if ContractTravelRatesOnly}} \n \n \n \n \n {{else}} \n \n \n \n \n {{/if}}\n \n \n \n \n \n
{{ayT 'ContractName'}}:{{Name}}
 
{{ayT 'ContractDefaultResponseTime'}}:{{ResponseTimeViz}}
{{ayT 'AlertNotes'}}:{{AlertNotes}}
{{ayT 'ContractNotes'}}:{{Notes}}
{{ayT 'PartList'}} {{ayT 'ContractDefaultAdjustments'}}:{{PartsOverridePct}}% {{PartsOverrideTypeViz}}
Additional {{ayT 'ContractTaggedAdjustments'}}:If part sold to customer tagged with "{{Tags}}" adjust {{OverridePct}}% {{OverrideTypeViz}}
Additional {{ayT 'ContractTaggedAdjustments'}}:None
 
{{ayT 'ServiceRate'}} {{ayT 'ContractDefaultAdjustments'}}:{{ServiceRatesOverridePct}}% {{ServiceRatesOverrideTypeViz}}
Additional {{ayT 'ContractTaggedAdjustments'}}:If service charged to customer with this contract is tagged with "{{Tags}}" adjust {{OverridePct}}% {{OverrideTypeViz}}
Additional {{ayT 'ContractTaggedAdjustments'}}:None
{{ayT 'ContractServiceRatesOnly'}}:{{#each ServiceRateItems}}{{ServiceRateViz}}, {{/each}}
{{ayT 'ServiceRateList'}}:{{#each ServiceRateItems}}{{ServiceRateViz}}, {{/each}}
 
{{ayT 'TravelRate'}} {{ayT 'ContractDefaultAdjustments'}}:{{TravelRatesOverridePct}}% {{TravelRatesOverrideTypeViz}}
Additional {{ayT 'ContractTaggedAdjustments'}}:If travel charged to customer with this contract is tagged with "{{Tags}}" adjust {{OverridePct}}% {{OverrideTypeViz}}
Additional {{ayT 'ContractTaggedAdjustments'}}:None
{{ayT 'ContractTravelRatesOnly'}}:{{#each TravelRateItems}}{{TravelRateViz}}, {{/each}}
{{ayT 'TravelRateList'}}:{{#each TravelRateItems}}{{TravelRateViz}}, {{/each}}
\n {{/each}}\n\n
\n\n\n","Style":"body {\r\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \r\n}\r\n\r\n.singlePage\r\n{\r\npage-break-after: always;\r\n}\r\n\r\n.reporttitle { \r\n margin-bottom: 20pt; \r\n font-weight: bold; \r\n font-size: 13pt; \r\n color: #9e9e9e;\r\n} \r\n\r\n.bigFont{\r\n font-size: 13pt; \r\n}\r\n\r\ntable { \r\n border-collapse: collapse;\r\n white-space: pre-wrap;\r\n width: 100%;\r\n table-layout: fixed;\r\n }\r\n\r\nth {\r\n color: #9e9e9e;\r\n text-align: right;\r\n font-size: 10pt;\r\n}\r\n\r\ntbody td {\r\n padding: 5px;\r\n/* word-wrap: break-word; */\r\n font-size: 9pt;\r\n}\r\n\r\n\r\ntbody tr:nth-child(even) {\r\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\r\n}\r\n\r\n\r\n.rightlean {\r\n text-align: right;\r\n}\r\n.leftlean {\r\n text-align: left;\r\n}\r\n.centerlean {\r\n text-align: center;\r\n}\r\n\r\n\r\n.fontgreen {\r\n color: green;\r\n font-size: 16pt;\r\n}\r\n.fontblue {\r\n color: blue;\r\n}\r\n.fontred {\r\n color:red;\r\n}","JsPrerender":"async function ayPrepareData(ayData){ \n\n await ayGetTranslations([\"ContractRateList\", \"ContractName\", \"ContractNotes\", \"AlertNotes\", \"Tags\", \"ContractDefaultResponseTime\", \"ContractDefaultAdjustments\", \"ContractTaggedAdjustments\", \"ContractServiceRatesOnly\", \"ContractTravelRatesOnly\", \"ContractDiscountParts\", \"PartList\", \"ServiceRateList\", \"TravelRateList\", \"TravelRate\", \"ServiceRate\" ]);\n\n return ayData;\n}","JsHelpers":"","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":true,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/Customer Notes.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Customer Notes.ayrt new file mode 100644 index 00000000..be870570 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Customer Notes.ayrt @@ -0,0 +1 @@ +{"Name":"Customer Notes","Active":true,"Notes":"","Roles":50538,"AType":59,"IncludeWoItemDescendants":false,"Template":"\n\n\n
\n \n {{#each ayReportData}}\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n\n {{#each items}}\n\n \n \n \n \n \n \n {{/each}}\n\n \n\n \n \n {{/each}}\n
{{ayT 'CustomerNoteList'}} for {{ayT 'Customer'}}:{{group}}
 
Who entered:{{ayT 'CustomerNoteNoteDate'}}{{ayT 'Tags'}}{{ayT 'CustomerNoteList'}}
 
{{UserViz}}{{ayDateTime NoteDate}}{{Tags}}{{Notes}}
\n\n \n\n\n
\n\n\n","Style":"body {\r\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \r\n}\r\n\r\n.reporttitle { \r\n margin-bottom: 20pt; \r\n font-weight: bold; \r\n font-size: 13pt; \r\n color: #9e9e9e;\r\n} \r\n\r\ntable { \r\n border-collapse: collapse;\r\n white-space: pre-wrap;\r\n width: 100%;\r\n table-layout: fixed;\r\n }\r\n\r\nth {\r\n height: 20px;\r\n font-size: 10pt; \r\n color: #9e9e9e;\r\n\r\n}\r\n\r\ntbody td {\r\n padding: 10px;\r\n word-wrap: break-word;\r\n font-size: 8pt;\r\n}\r\n\r\n\r\ntbody tr:nth-child(even) {\r\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\r\n}\r\n\r\n\r\n.rightlean {\r\n text-align: right;\r\n}\r\n.leftlean {\r\n text-align: left;\r\n}\r\n.centerlean {\r\n text-align: center;\r\n}\r\n\r\n\r\n.fontgreen {\r\n color: green;\r\n font-size: 16pt;\r\n}\r\n.fontblue {\r\n color: blue;\r\n}\r\n.fontred {\r\n color:red;\r\n}\r\n\r\n","JsPrerender":" \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //see the help documentation for details\n\nasync function ayPrepareData(ayData) { \n\n await ayGetTranslations([ \"CustomerNoteNotes\", \"CustomerNoteList\", \"Customer\", \"CustomerNoteNoteDate\", \"Tags\" ]);\n\n ayData.ayReportData = ayGroupByKey(ayData.ayReportData, 'CustomerViz')\n \n return ayData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\r\n//https://handlebarsjs.com/guide/#custom-helpers","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":0,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/Customer Service Requests grouped by Customer.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Customer Service Requests grouped by Customer.ayrt new file mode 100644 index 00000000..3ae96a6f --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Customer Service Requests grouped by Customer.ayrt @@ -0,0 +1 @@ +{"Name":"Customer Service Requests grouped by Customer","Active":true,"Notes":"","Roles":50666,"AType":54,"IncludeWoItemDescendants":false,"Template":"\n\n\n\t
\n\t\t
\n\t\t\t

{{ayT 'CustomerServiceRequestList'}} grouped by {{ayT 'Customer'}}

\n\t\t
\n\t\t\n\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\t\t{{#each ayReportData}}\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t{{#each items}}\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t{{#if_eq Status \"0\"}}{{else}}{{/if_eq}}\n\t\t\t\t\t\n\t\t\t\t\t{{#if WorkOrderSerialViz}}{{else}}{{/if}}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t{{/each}}\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t{{/each}}\n\t\t\t\n\t\t
{{ayT 'Customer'}}: {{group}}
 Date Requested{{ayT 'CustomerServiceRequestStatus'}}{{ayT 'CustomerServiceRequestPriority'}}{{ayT 'WorkOrder'}}{{ayT 'CustomerServiceRequestRequestedBy'}}
 {{ayDateTime DateRequested}}{{StatusViz}}{{StatusViz}}{{PriorityViz}}{{WorkOrderSerialViz}}Not yet assigned{{RequestedByUserViz}}
{{count}} {{ayT 'CustomerServiceRequestList'}} for {{ayT 'Customer'}} {{group}}
 
\n\t
\n\n","Style":".singlePage\r\n{\r\npage-break-after: always;\r\n\r\n}\r\nbody {\r\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \r\n}\r\n\r\n.bigfont {\r\n font-size: 13pt;\r\n}\r\n\r\n.reporttitle { \r\n margin-bottom: 20pt; \r\n font-weight: bold; \r\n font-size: 13pt; \r\n color: #9e9e9e;\r\n} \r\n\r\ntable { \r\n border-collapse: collapse;\r\n white-space: pre-wrap;\r\n width: 100%;\r\n table-layout: fixed; /* the # of columns set in the first row of the thead will be fixed and applied throughout table and rows */\r\n }\r\n\r\nth {\r\n height: 10px;\r\n font-size: 11pt; \r\n color: #9e9e9e;\r\n \r\n}\r\n\r\ntbody td {\r\n padding: 5px;\r\n word-wrap: break-word;\r\n font-size: 10pt;\r\n text-align: center;\r\n}\r\n\r\n\r\ntbody tr:nth-child(even) {\r\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\r\n}\r\n\r\n\r\n.rightlean {\r\n text-align: right;\r\n}\r\n.leftlean {\r\n text-align: left;\r\n}\r\n.centerlean {\r\n text-align: center;\r\n}\r\n\r\n\r\n.fontgreen {\r\n color: green;\r\n font-size: 16pt;\r\n}\r\n.fontblue {\r\n color: blue;\r\n}\r\n.fontred {\r\n color:red;\r\n}\r\n\r\n","JsPrerender":"async function ayPrepareData(ayData) {\n\n //send the raw report data to the groupByKey function which will return a new array grouped by the key name provided\n ayData.ayReportData = ayGroupByKey(ayData.ayReportData, 'CustomerViz')\n\n await ayGetTranslations([\"CustomerServiceRequestList\", \"Customer\", \"CustomerServiceRequestRequestedBy\", \"WorkOrder\", \"CustomerServiceRequestPriority\", \"CustomerServiceRequestStatus\" ]);\n\n\n //return the data into the pipeline to send to the report template\n return ayData;\n}","JsHelpers":"//custom helper so can do a direct comparison - i.e. if value equals xxxx, then show, else show yyyyy\r\n//note that this HAS to be added here in Helpers, is NOT built in\r\nHandlebars.registerHelper('if_eq', function(a, b, opts) {\r\n if(a == b) // Or === depending on your needs\r\n return opts.fn(this);\r\n else\r\n return opts.inverse(this);\r\n});\r\n","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":true,"MarginOptionsBottom":"20mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"15mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE replace carriage return with space.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE replace carriage return with space.ayrt deleted file mode 100644 index 954c5e69..00000000 --- a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE replace carriage return with space.ayrt +++ /dev/null @@ -1 +0,0 @@ -{"Name":"z_replace carriage return with space","Active":true,"Notes":"Example custom Prepare to replace carriage return with space for a specific key of this object ","Roles":124927,"AType":8,"IncludeWoItemDescendants":false,"Template":"\n\n\n\t
\n\t\t
\n\t\t\t

Custom Prepare to remove carriage returns

\n\t\t
\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\t\t{{#each ayReportData}}\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t{{/each}}\n\t\t\t\n\t\t
{{ayT 'Customer'}} {{ayT 'CustomerNotes'}} Customized {{ayT 'CustomerNotes'}}
{{Name}} {{Notes}} {{NotesNoCarriage}}
 
\n\n\t\t\n {{#each ayReportData}}\n \n\t\t\t \t\n\t\t\t\t\t\n\t\t\t\t\n \n \n \n \n\t\t\t \n \n \n {{/each}}\n
 
This is a printout of the data returned from the Custom Prepare that this report now uses, each \"group\" is an object. Compare against the data that shows in the \"Sample Data\" when editing this report template.
{{ayJSON this}}
\n\t
\n\n","Style":"\r\n.singlePage\r\n{\r\npage-break-after: always;\r\n}\r\n\r\nbody {\r\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \r\n}\r\n\r\n.reporttitle { \r\n margin-bottom: 20pt; \r\n font-weight: bold; \r\n font-size: 13pt; \r\n text-align: center;\r\n color: #9e9e9e;\r\n} \r\n\r\n\r\ntable { \r\n table-layout: fixed; //setting this to fixed causes columns to be evenly spaced for the entire table regardless of cell content, and then colspan then \"works\" as expected\r\n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\r\n border-collapse: collapse;\r\n white-space: pre-wrap;\r\n font-size: 8pt;\r\n width: 100%;\r\n }\r\n\r\n\r\nth {\r\n height: 30px;\r\n text-align: left;\r\n color: #9e9e9e;\r\n}\r\n\r\n\r\ntbody tr {\r\n height: 10px;\r\n word-wrap: break-word;\r\n}\r\n\r\ntbody tr:nth-child(even) {\r\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\r\n}\r\n\r\n\r\n.fontgreen {\r\n color: green;\r\n}\r\n.fontblue {\r\n color: blue;\r\n}\r\n.fontred {\r\n color:red;\r\n}\r\n\r\n\r\n.rightlean {\r\n text-align: right;\r\n}\r\n.leftlean {\r\n text-align: left;\r\n}\r\n.centerlean {\r\n text-align: center;\r\n}","JsPrerender":"async function ayPrepareData(ayData){ \n\n await ayGetTranslations([ \"Customer\", \"CustomerNotes\" ]);\n\n //for each Customer, if the General Notes field is NOT null, creates a new key NotesNoCarriage and puts into it the text from Notes replacing ANY carriage returns with a space, so all text is on same line(s)\n for (EachCU of ayData.ayReportData) {\n if (EachCU.Notes != null) {\n n = EachCU.Notes;\n EachCU.NotesNoCarriage = n.replace(/[\\n\\r]+/g, ' ');\n }\n }\n\n return ayData;\n}","JsHelpers":"","RenderType":0,"HeaderTemplate":"                Printed date: PDFDate\nPage of                ","FooterTemplate":"  ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"20mm","MarginOptionsLeft":"15mm","MarginOptionsRight":"15mm","MarginOptionsTop":"15mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/Head Offices list.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Head Offices list.ayrt new file mode 100644 index 00000000..067b4968 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Head Offices list.ayrt @@ -0,0 +1 @@ +{"Name":"Head Offices list","Active":true,"Notes":"","Roles":50538,"AType":15,"IncludeWoItemDescendants":false,"Template":"\n\n\n
\n
\n

{{ayT 'HeadOfficeList'}} List

\n
\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n {{#each ayReportData}}\n \n \n \n \n \n \n \n {{/each}}\n \n\n \n \n\n
{{ayT 'Name'}}{{ayT 'HeadOfficeAccountNumber'}}{{ayT 'AddressTypePostal'}}{{ayT 'HeadOfficePhone1'}}{{ayT 'HeadOfficeEmail'}}
{{Name}}{{AccountNumber}}{{PostAddress}}{{Phone1}}{{EmailAddress}}
\n\n\n
\n\n\n","Style":"body {\r\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \r\n}\r\n\r\n.reporttitle { \r\n margin-bottom: 20pt; \r\n font-weight: bold; \r\n font-size: 13pt; \r\n color: #9e9e9e;\r\n} \r\n\r\ntable { \r\n border-collapse: collapse;\r\n white-space: pre-wrap;\r\n width: 100%;\r\n table-layout: fixed;\r\n }\r\n\r\nth {\r\n height: 20px;\r\n font-size: 10pt; \r\n color: #9e9e9e;\r\n}\r\n\r\ntbody td {\r\n padding: 10px;\r\n word-wrap: break-word;\r\n font-size: 8pt;\r\n}\r\n\r\n\r\ntbody tr:nth-child(even) {\r\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\r\n}\r\n\r\n\r\n.rightlean {\r\n text-align: right;\r\n}\r\n.leftlean {\r\n text-align: left;\r\n}\r\n.centerlean {\r\n text-align: center;\r\n}\r\n\r\n\r\n.fontgreen {\r\n color: green;\r\n font-size: 16pt;\r\n}\r\n.fontblue {\r\n color: blue;\r\n}\r\n.fontred {\r\n color:red;\r\n}\r\n\r\n","JsPrerender":" \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //see the help documentation for details\n\nasync function ayPrepareData(ayData) { \n\n await ayGetTranslations([ \"Contact\", \"Name\", \"HeadOfficeList\", \"HeadOffice\", \"HeadOfficeAccountNumber\", \"AddressTypePostal\", \"HeadOfficePhone1\", \"HeadOfficeEmail\" ]);\n\n \n return ayData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\r\n//https://handlebarsjs.com/guide/#custom-helpers","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":0,"Landscape":true,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/Inventory transactions grouped by Part.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Inventory transactions grouped by Part.ayrt new file mode 100644 index 00000000..ff409a4a --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Inventory transactions grouped by Part.ayrt @@ -0,0 +1 @@ +{"Name":"Inventory transactions grouped by Part","Active":true,"Notes":"","Roles":50538,"AType":67,"IncludeWoItemDescendants":false,"Template":"\n\n\n\t
\n\t\t
\n\t\t\t

{{ayT 'PartInventoryTransactionList'}} grouped by {{ayT 'Part'}}

\n\t\t
\n\n\t\t\n\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\t\t{{#each ayReportData}}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t{{#each items}}\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t{{/each}}\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\n\t\t\t\t{{/each}}\n\t\t\t\n\n\t\t\t\n\t\t\t\n\n\t\t
{{ayT 'Part'}}: {{group}}
 {{ayT 'PartInventoryTransactionEntryDate'}}{{ayT 'PartInventoryTransactionDescription'}}{{ayT 'PartWarehouse'}}{{ayT 'PartInventoryTransactionQuantity'}}{{ayT 'PartInventoryBalance'}}
 {{ayDateTime EntryDate}}{{Description}}{{PartWarehouseViz}}{{Quantity}}{{Balance}}
 
\n\n\n\t
\n\n\n","Style":"body {\r\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \r\n}\r\n\r\n.reporttitle { \r\n margin-bottom: 20pt; \r\n font-weight: bold; \r\n font-size: 13pt; \r\n color: #9e9e9e;\r\n} \r\n\r\ntable { \r\n border-collapse: collapse;\r\n white-space: pre-wrap;\r\n width: 100%;\r\n table-layout: fixed;\r\n }\r\n\r\nth {\r\n padding: 5px;\r\n font-size: 11pt; \r\n color: #9e9e9e;\r\n text-align: left;\r\n}\r\n\r\ntbody td {\r\n padding: 5px;\r\n word-wrap: break-word;\r\n font-size: 9pt;\r\n}\r\n\r\n\r\ntbody tr:nth-child(even) {\r\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\r\n}\r\n\r\n\r\n.rightlean {\r\n text-align: right;\r\n}\r\n.leftlean {\r\n text-align: left;\r\n}\r\n.centerlean {\r\n text-align: center;\r\n}\r\n\r\n\r\n.fontgreen {\r\n color: green;\r\n font-size: 16pt;\r\n}\r\n.fontblue {\r\n color: blue;\r\n}\r\n.fontred {\r\n color:red;\r\n}","JsPrerender":"async function ayPrepareData(ayData){ \n\n ayData.ayReportData = ayGroupByKey(ayData.ayReportData, 'PartNameViz')\n\n await ayGetTranslations([\"PartInventoryTransactionList\", \"PartInventoryTransactionDescription\", \"PartInventoryTransactionEntryDate\", \"PartInventoryTransactionQuantity\", \"PartInventoryBalance\", \"PartWarehouse\", \"Part\" ]);\n\n return ayData;\n}","JsHelpers":"","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":true,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"15mm","MarginOptionsRight":"15mm","MarginOptionsTop":"15mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/Memos.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Memos.ayrt new file mode 100644 index 00000000..eb4eed4e --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Memos.ayrt @@ -0,0 +1 @@ +{"Name":"Memos","Active":true,"Notes":"","Roles":50538,"AType":60,"IncludeWoItemDescendants":false,"Template":"\n\n\n
\n
\n

{{ayT 'MemoList'}} List

\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n\n \n {{#each ayReportData}}\n \n \n\t\t\t\t\t{{#if Viewed}}\n\t\t\t\t\t{{else}}{{/if}}\n\n \n \n \n \n \n \n {{/each}}\n \n\n \n \n\n
{{ayT 'MemoViewed'}}{{ayT 'MemoSent'}}{{ayT 'MemoFromID'}}{{ayT 'MemoSubject'}}{{ayT 'MemoMessage'}}
{{ayDateTime Sent}}{{FromViz}}{{Name}}{{Notes}}
\n\n\n
\n\n\n","Style":"body {\r\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \r\n}\r\n\r\n.reporttitle { \r\n margin-bottom: 20pt; \r\n font-weight: bold; \r\n font-size: 13pt; \r\n color: #9e9e9e;\r\n} \r\n\r\ntable { \r\n border-collapse: collapse;\r\n white-space: pre-wrap;\r\n width: 100%;\r\n table-layout: fixed;\r\n }\r\n\r\nth {\r\n height: 20px;\r\n font-size: 10pt; \r\n color: #9e9e9e;\r\n}\r\n\r\ntbody td {\r\n padding: 10px;\r\n word-wrap: break-word;\r\n font-size: 8pt;\r\n}\r\n\r\n\r\ntbody tr:nth-child(even) {\r\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\r\n}\r\n\r\n\r\n.rightlean {\r\n text-align: right;\r\n}\r\n.leftlean {\r\n text-align: left;\r\n}\r\n.centerlean {\r\n text-align: center;\r\n}\r\n\r\n\r\n.fontgreen {\r\n color: green;\r\n font-size: 16pt;\r\n}\r\n.fontblue {\r\n color: blue;\r\n}\r\n.fontred {\r\n color:red;\r\n}\r\n\r\n","JsPrerender":" \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //see the help documentation for details\n\nasync function ayPrepareData(ayData) { \n\n await ayGetTranslations([ \"MemoFromID\", \"MemoSent\", \"MemoList\", \"MemoSubject\", \"MemoViewed\", \"MemoMessage\" ]);\n\n \n return ayData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\r\n//https://handlebarsjs.com/guide/#custom-helpers\r\n","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":0,"Landscape":true,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/PM Item Tasks .ayrt b/server/AyaNova/resource/rpt/stock-report-templates/PM Item Tasks .ayrt new file mode 100644 index 00000000..80e855fb --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/PM Item Tasks .ayrt @@ -0,0 +1 @@ +{"Name":"PM Item Tasks ","Active":true,"Notes":"","Roles":50538,"AType":86,"IncludeWoItemDescendants":false,"Template":"\n\n\n
\n
\n

{{ayT 'PreventiveMaintenance'}} {{ayT 'WorkOrderItemList'}} {{ayT 'WorkOrderItemTasks'}} List

\n
\n\n \n \n \n \n \n \n \n\n\n\t\t\t\t\t \n\t\t\t\t\t\n \n \n\n \n {{#each ayReportData}}\n {{#each Items}}\n {{#each Tasks}}\n \n \n \n \n\n\t\t\t\t\t\n\t\t\t\t\t{{#if_eq Status 2}}\n\t\t\t\t\t{{else}}{{/if_eq}}\n\t\t\t\t\t\n \n \n {{/each}}\n {{/each}}\n {{/each}}\n \n\n \n \n\n
{{ayT 'PreventiveMaintenance'}}{{ayT 'PMNextServiceDate'}}{{ayT 'WorkOrderItemSummary'}}{{ayT 'WorkOrderItemTaskWorkOrderItemTaskCompletionType'}}{{ayT 'WorkOrderItemTasks'}}
{{../../Serial}}{{ayDateTime ../../NextServiceDate}}{{../Notes}}{{StatusViz}} {{StatusViz}} {{Task}}
\n\n\n
\n\n\n","Style":"body {\r\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \r\n}\r\n\r\n.reporttitle { \r\n margin-bottom: 20pt; \r\n font-weight: bold; \r\n font-size: 13pt; \r\n color: #9e9e9e;\r\n} \r\n\r\ntable { \r\n border-collapse: collapse;\r\n white-space: pre-wrap;\r\n width: 100%;\r\n table-layout: fixed;\r\n }\r\n\r\nth {\r\n height: 20px;\r\n font-size: 10pt; \r\n color: #9e9e9e;\r\n}\r\n\r\ntbody td {\r\n padding: 10px;\r\n word-wrap: break-word;\r\n font-size: 8pt;\r\n}\r\n\r\n\r\ntbody tr:nth-child(even) {\r\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\r\n}\r\n\r\n\r\n.rightlean {\r\n text-align: right;\r\n}\r\n.leftlean {\r\n text-align: left;\r\n}\r\n.centerlean {\r\n text-align: center;\r\n}\r\n\r\n\r\n.fontgreen {\r\n color: green;\r\n font-size: 16pt;\r\n}\r\n.fontblue {\r\n color: blue;\r\n}\r\n.fontred {\r\n color:red;\r\n}\r\n\r\n","JsPrerender":" \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //see the help documentation for details\n\nasync function ayPrepareData(ayData) { \n\n await ayGetTranslations([ \"WorkOrderItemTasks\", \"PreventiveMaintenance\", \"WorkOrderItemList\", \"PMNextServiceDate\", \"WorkOrderItemSummary\", \"WorkOrderItemTaskWorkOrderItemTask\", \"WorkOrderItemTaskWorkOrderItemTaskCompletionType\" ]);\n\n\n \n return ayData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\r\n//https://handlebarsjs.com/guide/#custom-helpers\r\n\r\n//custom helper so can do a direct comparison - i.e. if value equals xxxx, then show, else show yyyyy\r\n//note that this HAS to be added here in Helpers, is NOT built in\r\nHandlebars.registerHelper('if_eq', function(a, b, opts) {\r\n if(a == b) // Or === depending on your needs\r\n return opts.fn(this);\r\n else\r\n return opts.inverse(this);\r\n});","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":0,"Landscape":true,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/PM Scheduled Users.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/PM Scheduled Users.ayrt new file mode 100644 index 00000000..ff2d8c8c --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/PM Scheduled Users.ayrt @@ -0,0 +1 @@ +{"Name":"PM Scheduled Users","Active":true,"Notes":"","Roles":50538,"AType":85,"IncludeWoItemDescendants":false,"Template":"\n\n\n
\n
\n

{{ayT 'PreventiveMaintenance'}} {{ayT 'WorkOrderItemScheduledUserList'}} List

\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n {{#each ayReportData}}\n {{#each Items}}\n {{#each ScheduledUsers}}\n \n \n \n \n \n \n \n \n \n \n {{/each}}\n {{/each}}\n {{/each}}\n \n\n \n \n\n
{{ayT 'PreventiveMaintenance'}}{{ayT 'Customer'}}{{ayT 'WorkOrderItemWorkOrderStatusID'}}{{ayT 'WorkOrderItemSummary'}}{{ayT 'WorkOrderItemScheduledUsers'}}{{ayT 'WorkOrderItemScheduledUserStartDate'}}{{ayT 'WorkOrderItemScheduledUserEstimatedQuantity'}}
{{../../Serial}}{{../../CustomerViz}}{{../WorkOrderItemStatusNameViz}}{{../Notes}}{{UserViz}}{{ayDateTime StartDate}}{{EstimatedQuantity}}
\n\n\n
\n\n\n","Style":"body {\r\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \r\n}\r\n\r\n.reporttitle { \r\n margin-bottom: 20pt; \r\n font-weight: bold; \r\n font-size: 13pt; \r\n color: #9e9e9e;\r\n} \r\n\r\ntable { \r\n border-collapse: collapse;\r\n white-space: pre-wrap;\r\n width: 100%;\r\n table-layout: fixed;\r\n }\r\n\r\nth {\r\n height: 20px;\r\n font-size: 10pt; \r\n color: #9e9e9e;\r\n}\r\n\r\ntbody td {\r\n padding: 10px;\r\n word-wrap: break-word;\r\n font-size: 8pt;\r\n}\r\n\r\n\r\ntbody tr:nth-child(even) {\r\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\r\n}\r\n\r\n\r\n.rightlean {\r\n text-align: right;\r\n}\r\n.leftlean {\r\n text-align: left;\r\n}\r\n.centerlean {\r\n text-align: center;\r\n}\r\n\r\n\r\n.fontgreen {\r\n color: green;\r\n font-size: 16pt;\r\n}\r\n.fontblue {\r\n color: blue;\r\n}\r\n.fontred {\r\n color:red;\r\n}\r\n\r\n","JsPrerender":" \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //see the help documentation for details\n\nasync function ayPrepareData(ayData) { \n\n await ayGetTranslations([ \"PreventiveMaintenance\", \"WorkOrderItemScheduledUsers\", \"WorkOrderItemScheduledUserList\", \"WorkOrder\", \"Customer\", \"WorkOrderItemWorkOrderStatusID\", \"WorkOrderItemSummary\", \"WorkOrderItemScheduledUserStartDate\", \"WorkOrderItemScheduledUserEstimatedQuantity\" ]);\n\n \n return ayData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\r\n//https://handlebarsjs.com/guide/#custom-helpers\r\n","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":0,"Landscape":true,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/PM Units grouped by Customer.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/PM Units grouped by Customer.ayrt new file mode 100644 index 00000000..b9ef27f0 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/PM Units grouped by Customer.ayrt @@ -0,0 +1 @@ +{"Name":"PM Units grouped by Customer","Active":true,"Notes":"","Roles":50538,"AType":88,"IncludeWoItemDescendants":false,"Template":"\n\n\n
\n
\n\t\t\t

{{ayT 'PMList'}} {{ayT 'WorkOrderItemUnitList'}} grouped by {{ayT 'Customer'}}

\n\t\t
\n \n \n \n \n \n \n \n \n \n \n \n \n {{#each ayReportData}}\n \n \n \n {{#each items}}\n {{#each Items}}\n {{#each Units}}\n \n \n \n \n \n \n \n \n {{/each}}\n {{/each}}\n {{/each}}\n \n \n \n\n \n \n \n {{/each}}\n \n
{{ayT 'Customer'}}{{ayT 'PreventiveMaintenance'}}{{ayT 'PMNextServiceDate'}}{{ayT 'WorkOrderItemUnit'}}{{ayT 'WorkOrderItemWorkOrderStatusID'}}{{ayT 'WorkOrderItemSummary'}}
{{group}}
 {{../../Serial}} {{ayDate ../../NextServiceDate}}{{UnitViz}} - {{UnitModelNameViz}}{{../WorkOrderItemStatusNameViz}}{{../Notes}}
 
 
\n
\n\n \n\n\n","Style":".minimum {\n font-size: 6pt;\n}\n\ntfoot {\n border-top: 2px solid #9e9e9e;\n font-size: 7pt;\n text-align: center;\n}\n\n.singlePage\n{\npage-break-after: always;\n}\n\nbody {\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \n}\n\n.reporttitle { \n margin-bottom: 20pt; \n font-weight: bold; \n font-size: 13pt; \n color: #9e9e9e;\n} \n\ntable { \n border-collapse: collapse;\n white-space: pre-wrap;\n width: 100%;\n table-layout: fixed; /* the # of columns set in the first row of the thead will be fixed and applied throughout table and rows */\n }\n\nth {\n height: 30px;\n font-size: 9pt; \n color: #9e9e9e;\n}\n\ntbody td {\n padding: 10px;\n word-wrap: break-word;\n font-size: 7pt;\n}\n\n\ntbody tr:nth-child(even) {\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\n}\n\n\n.rightlean {\n text-align: right;\n}\n.leftlean {\n text-align: left;\n}\n.centerlean {\n text-align: center;\n}\n\n\n.fontgreen {\n color: green;\n}\n.fontblue {\n color: blue;\n}\n.fontred {\n color:red;\n}\n\n","JsPrerender":"async function ayPrepareData(reportData){ \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //see the help documentation for details\n\n\treportData.ayReportData = ayGroupByKey(reportData.ayReportData, 'CustomerViz')\n\t\n\tawait ayGetTranslations([\"PreventiveMaintenance\", \"PMList\", \"Customer\", \"PMNextServiceDate\", \"WorkOrderItemUnit\", \"WorkOrderItemUnitList\", \"WorkOrderStatus\", \"WorkOrderItemWorkOrderStatusID\", \"WorkOrderItemSummary\", \"WorkOrderSummary\" ]);\n\n\n\n return reportData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\n//https://handlebarsjs.com/guide/#custom-helpers\nHandlebars.registerHelper('loud', function (aString) {\n return aString.toUpperCase()\n})","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":true,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"15mm","MarginOptionsRight":"15mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/Part Assemblies list.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Part Assemblies list.ayrt new file mode 100644 index 00000000..f96de9e2 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Part Assemblies list.ayrt @@ -0,0 +1 @@ +{"Name":"Part Assemblies list","Active":true,"Notes":"","Roles":50554,"AType":65,"IncludeWoItemDescendants":false,"Template":"\n\n\n
\n
\n

{{ayT 'PartAssemblyList'}} list

\n
\n\n \n \n \n\n \n {{#each ayReportData}}\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n {{#each Items}}\n \n \n \n \n \n {{/each}}\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n {{/each}}\n \n\n \n \n\n
{{ayT 'PartAssemblyName'}}: {{Name}}
 
 {{ayT 'WorkOrderItemPartQuantity'}}{{ayT 'PartList'}}
 {{Quantity}}{{PartNameViz}}
 {{ayT 'Tags'}}{{Tags}}
 {{ayT 'PartAssemblyNotes'}}{{Notes}}
 
\n\n\n
\n\n\n","Style":"body {\r\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \r\n}\r\n\r\n.reporttitle { \r\n margin-bottom: 20pt; \r\n font-weight: bold; \r\n font-size: 13pt; \r\n color: #9e9e9e;\r\n text-align: center;\r\n} \r\n\r\ntable { \r\n border-collapse: collapse;\r\n white-space: pre-wrap;\r\n width: 100%;\r\n table-layout: fixed;\r\n }\r\n\r\nth {\r\n height: 20px;\r\n font-size: 11pt; \r\n color: #9e9e9e;\r\n text-align: left;\r\n}\r\n\r\ntbody td {\r\n padding: 10px;\r\n word-wrap: break-word;\r\n font-size: 9pt;\r\n}\r\n\r\n\r\ntbody tr:nth-child(even) {\r\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\r\n}\r\n\r\n\r\n.rightlean {\r\n text-align: right;\r\n}\r\n.leftlean {\r\n text-align: left;\r\n}\r\n.centerlean {\r\n text-align: center;\r\n}\r\n\r\n\r\n.fontgreen {\r\n color: green;\r\n font-size: 16pt;\r\n}\r\n.fontblue {\r\n color: blue;\r\n}\r\n.fontred {\r\n color:red;\r\n}","JsPrerender":"async function ayPrepareData(ayData){ \n\n await ayGetTranslations([\"PartAssemblyName\", \"PartAssemblyList\", \"Tags\", \"PartAssemblyNotes\", \"PartList\", \"WorkOrderItemPartQuantity\" ]);\n\n return ayData;\n}","JsHelpers":"","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/Projects list.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Projects list.ayrt new file mode 100644 index 00000000..a7fe49da --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Projects list.ayrt @@ -0,0 +1 @@ +{"Name":"Projects list","Active":true,"Notes":"","Roles":50538,"AType":25,"IncludeWoItemDescendants":false,"Template":"\n\n\n
\n
\n

{{ayT 'ProjectList'}} List

\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n\n \n {{#each ayReportData}}\n \n \n \n \n \n \n \n \n {{/each}}\n \n\n \n \n\n
{{ayT 'Project'}}{{ayT 'ProjectDateStarted'}}{{ayT 'ProjectDateCompleted'}}{{ayT 'ProjectAccountNumber'}}{{ayT 'ProjectProjectOverseerID'}}{{ayT 'ProjectNotes'}}
{{Name}}{{ayDate DateStarted}}{{ayDate DateCompleted}}{{AccountNumber}}{{ProjectOverseerViz}}{{Notes}}
\n\n\n
\n\n\n","Style":"body {\r\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \r\n}\r\n\r\n.reporttitle { \r\n margin-bottom: 20pt; \r\n font-weight: bold; \r\n font-size: 13pt; \r\n color: #9e9e9e;\r\n} \r\n\r\ntable { \r\n border-collapse: collapse;\r\n white-space: pre-wrap;\r\n width: 100%;\r\n table-layout: fixed;\r\n }\r\n\r\nth {\r\n border-bottom: solid 1pt #9e9e9e;\r\n height: 50px;\r\n font-size: 11pt; \r\n color: #9e9e9e;\r\n}\r\n\r\ntbody td {\r\n padding: 10px;\r\n word-wrap: break-word;\r\n font-size: 9pt;\r\n}\r\n\r\n\r\ntbody tr:nth-child(even) {\r\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\r\n}\r\n\r\n\r\n.rightlean {\r\n text-align: right;\r\n}\r\n.leftlean {\r\n text-align: left;\r\n}\r\n.centerlean {\r\n text-align: center;\r\n}\r\n\r\n\r\n.fontgreen {\r\n color: green;\r\n font-size: 16pt;\r\n}\r\n.fontblue {\r\n color: blue;\r\n}\r\n.fontred {\r\n color:red;\r\n}\r\n\r\n","JsPrerender":" \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //see the help documentation for details\n\nasync function ayPrepareData(ayData) { \n\n await ayGetTranslations([ \"ProjectList\", \"Project\", \"ProjectProjectOverseerID\", \"ProjectDateStarted\", \"ProjectDateCompleted\", \"ProjectAccountNumber\", \"ProjectNotes\" ]);\n \n return ayData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\r\n//https://handlebarsjs.com/guide/#custom-helpers","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":true,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/Quote Item Tasks.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Quote Item Tasks.ayrt new file mode 100644 index 00000000..256b0536 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Quote Item Tasks.ayrt @@ -0,0 +1 @@ +{"Name":"Quote Item Tasks","Active":true,"Notes":"","Roles":50538,"AType":46,"IncludeWoItemDescendants":false,"Template":"\n\n\n
\n
\n

{{ayT 'Quote'}} {{ayT 'WorkOrderItemList'}} {{ayT 'WorkOrderItemTasks'}} List

\n
\n\n \n \n \n \n \n \n \n\n\n\t\t\t\t\t \n\t\t\t\t\t\n \n \n\n \n {{#each ayReportData}}\n {{#each Items}}\n {{#each Tasks}}\n \n \n \n \n\n\t\t\t\t\t\n\t\t\t\t\t{{#if_eq Status 2}}\n\t\t\t\t\t{{else}}{{/if_eq}}\n\t\t\t\t\t\n \n \n {{/each}}\n {{/each}}\n {{/each}}\n \n\n \n \n\n
{{ayT 'Quote'}}{{ayT 'QuoteQuoteRequestDate'}}{{ayT 'WorkOrderItemSummary'}}{{ayT 'WorkOrderItemTaskWorkOrderItemTaskCompletionType'}}{{ayT 'WorkOrderItemTasks'}}
{{../../Serial}}{{ayDateTime ../../Requested}}{{../Notes}}{{StatusViz}} {{StatusViz}} {{Task}}
\n\n\n
\n\n\n","Style":"body {\r\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \r\n}\r\n\r\n.reporttitle { \r\n margin-bottom: 20pt; \r\n font-weight: bold; \r\n font-size: 13pt; \r\n color: #9e9e9e;\r\n} \r\n\r\ntable { \r\n border-collapse: collapse;\r\n white-space: pre-wrap;\r\n width: 100%;\r\n table-layout: fixed;\r\n }\r\n\r\nth {\r\n height: 20px;\r\n font-size: 10pt; \r\n color: #9e9e9e;\r\n}\r\n\r\ntbody td {\r\n padding: 10px;\r\n word-wrap: break-word;\r\n font-size: 8pt;\r\n}\r\n\r\n\r\ntbody tr:nth-child(even) {\r\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\r\n}\r\n\r\n\r\n.rightlean {\r\n text-align: right;\r\n}\r\n.leftlean {\r\n text-align: left;\r\n}\r\n.centerlean {\r\n text-align: center;\r\n}\r\n\r\n\r\n.fontgreen {\r\n color: green;\r\n font-size: 16pt;\r\n}\r\n.fontblue {\r\n color: blue;\r\n}\r\n.fontred {\r\n color:red;\r\n}\r\n\r\n","JsPrerender":" \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //see the help documentation for details\n\nasync function ayPrepareData(ayData) { \n\n await ayGetTranslations([ \"WorkOrderItemTasks\", \"Quote\", \"WorkOrderItemList\", \"QuoteQuoteRequestDate\", \"WorkOrderItemSummary\", \"WorkOrderItemTaskWorkOrderItemTask\", \"WorkOrderItemTaskWorkOrderItemTaskCompletionType\" ]);\n\n\n \n return ayData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\r\n//https://handlebarsjs.com/guide/#custom-helpers\r\n\r\n//custom helper so can do a direct comparison - i.e. if value equals xxxx, then show, else show yyyyy\r\n//note that this HAS to be added here in Helpers, is NOT built in\r\nHandlebars.registerHelper('if_eq', function(a, b, opts) {\r\n if(a == b) // Or === depending on your needs\r\n return opts.fn(this);\r\n else\r\n return opts.inverse(this);\r\n});","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":0,"Landscape":true,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/Quote Scheduled Users.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Quote Scheduled Users.ayrt new file mode 100644 index 00000000..d7040661 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Quote Scheduled Users.ayrt @@ -0,0 +1 @@ +{"Name":"Quote Scheduled Users","Active":true,"Notes":"","Roles":50538,"AType":45,"IncludeWoItemDescendants":false,"Template":"\n\n\n
\n
\n

{{ayT 'Quote'}} {{ayT 'WorkOrderItemScheduledUserList'}} List

\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n {{#each ayReportData}}\n {{#each Items}}\n {{#each ScheduledUsers}}\n \n \n \n \n \n \n \n \n \n \n {{/each}}\n {{/each}}\n {{/each}}\n \n\n \n \n\n
{{ayT 'Quote'}}{{ayT 'Customer'}}{{ayT 'WorkOrderItemWorkOrderStatusID'}}{{ayT 'WorkOrderItemSummary'}}{{ayT 'WorkOrderItemScheduledUsers'}}{{ayT 'WorkOrderItemScheduledUserStartDate'}}{{ayT 'WorkOrderItemScheduledUserEstimatedQuantity'}}
{{../../Serial}}{{../../CustomerViz}}{{../WorkOrderItemStatusNameViz}}{{../Notes}}{{UserViz}}{{ayDateTime StartDate}}{{EstimatedQuantity}}
\n\n\n
\n\n\n","Style":"body {\r\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \r\n}\r\n\r\n.reporttitle { \r\n margin-bottom: 20pt; \r\n font-weight: bold; \r\n font-size: 13pt; \r\n color: #9e9e9e;\r\n} \r\n\r\ntable { \r\n border-collapse: collapse;\r\n white-space: pre-wrap;\r\n width: 100%;\r\n table-layout: fixed;\r\n }\r\n\r\nth {\r\n height: 20px;\r\n font-size: 10pt; \r\n color: #9e9e9e;\r\n}\r\n\r\ntbody td {\r\n padding: 10px;\r\n word-wrap: break-word;\r\n font-size: 8pt;\r\n}\r\n\r\n\r\ntbody tr:nth-child(even) {\r\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\r\n}\r\n\r\n\r\n.rightlean {\r\n text-align: right;\r\n}\r\n.leftlean {\r\n text-align: left;\r\n}\r\n.centerlean {\r\n text-align: center;\r\n}\r\n\r\n\r\n.fontgreen {\r\n color: green;\r\n font-size: 16pt;\r\n}\r\n.fontblue {\r\n color: blue;\r\n}\r\n.fontred {\r\n color:red;\r\n}\r\n\r\n","JsPrerender":" \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //see the help documentation for details\n\nasync function ayPrepareData(ayData) { \n\n await ayGetTranslations([ \"Quote\", \"WorkOrderItemScheduledUsers\", \"WorkOrderItemScheduledUserList\", \"WorkOrder\", \"Customer\", \"WorkOrderItemWorkOrderStatusID\", \"WorkOrderItemSummary\", \"WorkOrderItemScheduledUserStartDate\", \"WorkOrderItemScheduledUserEstimatedQuantity\" ]);\n\n \n return ayData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\r\n//https://handlebarsjs.com/guide/#custom-helpers\r\n","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":0,"Landscape":true,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/Quote Units grouped by Customer.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Quote Units grouped by Customer.ayrt new file mode 100644 index 00000000..4acae1c0 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Quote Units grouped by Customer.ayrt @@ -0,0 +1 @@ +{"Name":"Quote Units grouped by Customer","Active":true,"Notes":"","Roles":50538,"AType":77,"IncludeWoItemDescendants":false,"Template":"\n\n\n
\n
\n\t\t\t

{{ayT 'WorkOrderItemUnitList'}} grouped by {{ayT 'Customer'}}

\n\t\t
\n \n \n \n \n \n \n \n \n \n \n \n \n {{#each ayReportData}}\n \n \n \n {{#each items}}\n {{#each Items}}\n {{#each Units}}\n \n \n \n \n \n \n \n \n {{/each}}\n {{/each}}\n {{/each}}\n \n \n \n\n \n \n \n {{/each}}\n \n
{{ayT 'Customer'}}{{ayT 'Quote'}}{{ayT 'QuoteQuoteRequestDate'}}{{ayT 'WorkOrderItemUnit'}}{{ayT 'WorkOrderItemWorkOrderStatusID'}}{{ayT 'WorkOrderItemSummary'}}
{{group}}
 {{../../Serial}} {{ayDate ../../Requested}}{{UnitViz}} - {{UnitModelNameViz}}{{../WorkOrderItemStatusNameViz}}{{../Notes}}
 
 
\n
\n\n \n\n\n","Style":".minimum {\n font-size: 6pt;\n}\n\ntfoot {\n border-top: 2px solid #9e9e9e;\n font-size: 7pt;\n text-align: center;\n}\n\n.singlePage\n{\npage-break-after: always;\n}\n\nbody {\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \n}\n\n.reporttitle { \n margin-bottom: 20pt; \n font-weight: bold; \n font-size: 13pt; \n color: #9e9e9e;\n} \n\ntable { \n border-collapse: collapse;\n white-space: pre-wrap;\n width: 100%;\n table-layout: fixed; /* the # of columns set in the first row of the thead will be fixed and applied throughout table and rows */\n }\n\nth {\n height: 30px;\n font-size: 9pt; \n color: #9e9e9e;\n}\n\ntbody td {\n padding: 10px;\n word-wrap: break-word;\n font-size: 7pt;\n}\n\n\ntbody tr:nth-child(even) {\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\n}\n\n\n.rightlean {\n text-align: right;\n}\n.leftlean {\n text-align: left;\n}\n.centerlean {\n text-align: center;\n}\n\n\n.fontgreen {\n color: green;\n}\n.fontblue {\n color: blue;\n}\n.fontred {\n color:red;\n}\n\n","JsPrerender":"async function ayPrepareData(reportData){ \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //see the help documentation for details\n\n\treportData.ayReportData = ayGroupByKey(reportData.ayReportData, 'CustomerViz')\n\t\n\tawait ayGetTranslations([\"Quote\", \"Customer\", \"QuoteQuoteRequestDate\", \"WorkOrderItemUnit\", \"WorkOrderItemUnitList\", \"WorkOrderItemWorkOrderStatusID\", \"WorkOrderItemSummary\", \"WorkOrderSummary\" ]);\n\n\n\n return reportData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\n//https://handlebarsjs.com/guide/#custom-helpers\nHandlebars.registerHelper('loud', function (aString) {\n return aString.toUpperCase()\n})","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":true,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"15mm","MarginOptionsRight":"15mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/Reminders.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Reminders.ayrt new file mode 100644 index 00000000..7f8ff9ba --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Reminders.ayrt @@ -0,0 +1 @@ +{"Name":"Reminders","Active":true,"Notes":"","Roles":50538,"AType":52,"IncludeWoItemDescendants":false,"Template":"\n\n\n
\n
\n

{{ayT 'ReminderList'}} List

\n
\n\n \n \n \n \n \n \n \n \n \n \n \n\n \n {{#each ayReportData}}\n \n \n \n \n \n \n \n {{/each}}\n \n\n \n \n\n
{{ayT 'ReminderName'}}{{ayT 'ReminderStartDate'}}{{ayT 'ReminderStopDate'}}{{ayT 'Tags'}}{{ayT 'ReminderNotes'}}
{{Name}}{{ayDateTime StartDate}}{{ayDateTime StopDate}}{{Tags}}{{Notes}}
\n\n\n
\n\n\n","Style":"body {\r\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \r\n}\r\n\r\n.reporttitle { \r\n margin-bottom: 20pt; \r\n font-weight: bold; \r\n font-size: 13pt; \r\n color: #9e9e9e;\r\n} \r\n\r\ntable { \r\n border-collapse: collapse;\r\n white-space: pre-wrap;\r\n width: 100%;\r\n table-layout: fixed;\r\n }\r\n\r\nth {\r\n height: 20px;\r\n font-size: 10pt; \r\n color: #9e9e9e;\r\n}\r\n\r\ntbody td {\r\n padding: 10px;\r\n word-wrap: break-word;\r\n font-size: 8pt;\r\n}\r\n\r\n\r\ntbody tr:nth-child(even) {\r\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\r\n}\r\n\r\n\r\n.rightlean {\r\n text-align: right;\r\n}\r\n.leftlean {\r\n text-align: left;\r\n}\r\n.centerlean {\r\n text-align: center;\r\n}\r\n\r\n\r\n.fontgreen {\r\n color: green;\r\n font-size: 16pt;\r\n}\r\n.fontblue {\r\n color: blue;\r\n}\r\n.fontred {\r\n color:red;\r\n}\r\n\r\n","JsPrerender":" \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //see the help documentation for details\n\nasync function ayPrepareData(ayData) { \n\n await ayGetTranslations([ \"Reminder\", \"ReminderName\", \"ReminderList\", \"Tags\", \"Reminder\", \"ReminderStartDate\", \"ReminderStopDate\", \"ReminderRecurrence\", \"ReminderNotes\", \"ReminderSourceType\", \"ReminderSourceID\", \"ReminderColor\" ]);\n\n \n return ayData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\r\n//https://handlebarsjs.com/guide/#custom-helpers","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":0,"Landscape":true,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/Reviews grouped by user.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Reviews grouped by user.ayrt new file mode 100644 index 00000000..f84d5296 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Reviews grouped by user.ayrt @@ -0,0 +1 @@ +{"Name":"Reviews grouped by user","Active":true,"Notes":"","Roles":50538,"AType":61,"IncludeWoItemDescendants":false,"Template":"\n\n\n
\n \n {{#each ayReportData}}\n \n \n\n \n \n \n \n \n \n \n\n {{#each items}}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {{/each}}\n\n \n\n \n \n {{/each}}\n
{{count}} {{ayT 'ReviewList'}} {{ayT 'ReviewUserId'}} {{group}}
 
 {{ayT 'ReviewDate'}}:{{ReviewDate}}{{ayT 'ReviewAssignedByUserId'}}:{{AssignedByUserViz}}
 {{ayT 'ReviewName'}}:{{Name}}
 {{ayT 'ReviewNotes'}}:{{Notes}}
 {{ayT 'ReviewCompletedDate'}}:{{ayDateTime CompletedDate}}
 {{ayT 'ReviewCompletionNotes'}}:{{CompletionNotes}}
 {{ayT 'Tags'}}:{{Tags}}
 Wiki:{{ayWiki Wiki}}
 
 
\n\n \n\n\n
\n\n\n","Style":"body {\r\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \r\n}\r\n\r\n.reporttitle { \r\n margin-bottom: 20pt; \r\n font-weight: bold; \r\n font-size: 13pt; \r\n color: #9e9e9e;\r\n} \r\n\r\ntable { \r\n border-collapse: collapse;\r\n white-space: pre-wrap;\r\n width: 100%;\r\n table-layout: fixed;\r\n }\r\n\r\nth {\r\n height: 20px;\r\n font-size: 10pt; \r\n color: #9e9e9e;\r\n text-align: right;\r\n\r\n}\r\n\r\ntbody td {\r\n padding: 10px;\r\n word-wrap: break-word;\r\n font-size: 8pt;\r\n}\r\n\r\n\r\ntbody tr:nth-child(even) {\r\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\r\n}\r\n\r\n\r\n.rightlean {\r\n text-align: right;\r\n}\r\n.leftlean {\r\n text-align: left;\r\n}\r\n.centerlean {\r\n text-align: center;\r\n}\r\n\r\n\r\n.fontgreen {\r\n color: green;\r\n font-size: 16pt;\r\n}\r\n.fontblue {\r\n color: blue;\r\n}\r\n.fontred {\r\n color:red;\r\n}\r\n\r\n","JsPrerender":" \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //see the help documentation for details\n\nasync function ayPrepareData(ayData) { \n\n await ayGetTranslations([ \"ReviewList\", \"User\", \"ReviewUserId\", \"ReviewName\",\"ReviewDate\", \"ReviewNotes\", \"Tags\", \"ReviewAssignedByUserId\", \"ReviewCompletedDate\", \"ReviewCompletionNotes\" ]);\n\n ayData.ayReportData = ayGroupByKey(ayData.ayReportData, 'UserViz')\n \n return ayData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\r\n//https://handlebarsjs.com/guide/#custom-helpers","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":0,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/Service Rates list.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Service Rates list.ayrt new file mode 100644 index 00000000..6ef12f5b --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Service Rates list.ayrt @@ -0,0 +1 @@ +{"Name":"Service Rates list","Active":true,"Notes":"","Roles":50554,"AType":62,"IncludeWoItemDescendants":false,"Template":"\n\n\n
\n
\n

{{ayT 'ServiceRateList'}} list

\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n {{#each ayReportData}}\n \n \n \n \n \n \n \n \n\t\t {{#if ContractOnly }}{{else}}{{/if}}\n\t\t \n\n \n {{/each}}\n \n\n \n \n\n
{{ayT 'ServiceRate'}}{{ayT 'Tags'}}{{ayT 'RateAccountNumber'}}{{ayT 'Cost'}}{{ayT 'RateCharge'}}{{ayT 'RateUnitChargeDescriptionID'}}{{ayT 'ContractRate'}}
{{Name}}{{Tags}}{{AccountNumber}}{{ayCurrency Cost}}{{ayCurrency Charge}}{{Unit}}
\n\n\n
\n\n\n","Style":"body {\r\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \r\n}\r\n\r\n.reporttitle { \r\n margin-bottom: 20pt; \r\n font-weight: bold; \r\n font-size: 13pt; \r\n color: #9e9e9e;\r\n} \r\n\r\ntable { \r\n border-collapse: collapse;\r\n white-space: pre-wrap;\r\n width: 100%;\r\n table-layout: fixed;\r\n }\r\n\r\nth {\r\n border-bottom: solid 1pt #9e9e9e;\r\n height: 50px;\r\n font-size: 11pt; \r\n color: #9e9e9e;\r\n}\r\n\r\ntbody td {\r\n padding: 10px;\r\n word-wrap: break-word;\r\n font-size: 9pt;\r\n text-align: center;\r\n}\r\n\r\n\r\ntbody tr:nth-child(even) {\r\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\r\n}\r\n\r\n\r\n.rightlean {\r\n text-align: right;\r\n}\r\n.leftlean {\r\n text-align: left;\r\n}\r\n.centerlean {\r\n text-align: center;\r\n}\r\n\r\n\r\n.fontgreen {\r\n color: green;\r\n font-size: 16pt;\r\n}\r\n.fontblue {\r\n color: blue;\r\n}\r\n.fontred {\r\n color:red;\r\n}","JsPrerender":"async function ayPrepareData(ayData){ \n\n await ayGetTranslations([\"ServiceRateList\", \"ServiceRate\", \"Tags\", \"RateAccountNumber\", \"Cost\", \"RateCharge\", \"RateUnitChargeDescriptionID\", \"ContractRate\" ]);\n\n return ayData;\n}","JsHelpers":"","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/Tax Codes List.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Tax Codes List.ayrt new file mode 100644 index 00000000..de836789 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Tax Codes List.ayrt @@ -0,0 +1 @@ +{"Name":"Tax Codes List","Active":true,"Notes":"","Roles":124927,"AType":64,"IncludeWoItemDescendants":false,"Template":"\n\n\n
\n
\n

{{ayT 'TaxCodeList'}} List

\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n\n \n {{#each ayReportData}}\n \n \n \n \n \n \n\t\t {{#if TaxOnTax }}{{else}}{{/if}}\n\t\t \n \n \n {{/each}}\n \n\n \n \n\n
{{ayT 'TaxCodeName'}}{{ayT 'Tags'}}{{ayT 'TaxCodeTaxA'}}{{ayT 'TaxCodeTaxB'}}{{ayT 'TaxCodeTaxOnTax'}}{{ayT 'TaxCodeNotes'}}
{{Name}}{{Tags}}{{TaxAPct}} %{{TaxBPct}} %{{Notes}}
\n\n\n
\n\n\n","Style":"body {\r\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \r\n}\r\n\r\n.reporttitle { \r\n margin-bottom: 20pt; \r\n font-weight: bold; \r\n font-size: 13pt; \r\n color: #9e9e9e;\r\n} \r\n\r\ntable { \r\n border-collapse: collapse;\r\n white-space: pre-wrap;\r\n width: 100%;\r\n table-layout: fixed; /* the # of columns set in the first row of the thead will be fixed and applied throughout table and rows */\r\n }\r\n\r\nth {\r\n border-bottom: solid 1pt #9e9e9e;\r\n height: 50px;\r\n font-size: 11pt; \r\n color: #9e9e9e;\r\n}\r\n\r\ntbody td {\r\n padding: 10px;\r\n word-wrap: break-word;\r\n font-size: 9pt;\r\n}\r\n\r\n\r\ntbody tr:nth-child(even) {\r\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\r\n}\r\n\r\n\r\n.rightlean {\r\n text-align: right;\r\n}\r\n.leftlean {\r\n text-align: left;\r\n}\r\n.centerlean {\r\n text-align: center;\r\n}\r\n\r\n\r\n.fontgreen {\r\n color: green;\r\n font-size: 16pt;\r\n}\r\n.fontblue {\r\n color: blue;\r\n}\r\n.fontred {\r\n color:red;\r\n}\r\n\r\n","JsPrerender":" \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //see the help documentation for details\n\nasync function ayPrepareData(ayData) { \n\n await ayGetTranslations([ \"TaxCodeList\", \"TaxCodeName\", \"Tags\", \"TaxCodeTaxA\", \"TaxCodeTaxB\", \"TaxCodeTaxOnTax\", \"TaxCodeNotes\" ]);\n \n return ayData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\r\n//https://handlebarsjs.com/guide/#custom-helpers","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/Travel Rates list.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Travel Rates list.ayrt new file mode 100644 index 00000000..44ce6202 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Travel Rates list.ayrt @@ -0,0 +1 @@ +{"Name":"Travel Rates list","Active":true,"Notes":"","Roles":50554,"AType":63,"IncludeWoItemDescendants":false,"Template":"\n\n\n
\n
\n

{{ayT 'TravelRateList'}} list

\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n {{#each ayReportData}}\n \n \n \n \n \n \n \n \n\t\t {{#if ContractOnly }}{{else}}{{/if}}\n\t\t \n\n \n {{/each}}\n \n\n \n \n\n
{{ayT 'TravelRate'}}{{ayT 'Tags'}}{{ayT 'RateAccountNumber'}}{{ayT 'Cost'}}{{ayT 'RateCharge'}}{{ayT 'RateUnitChargeDescriptionID'}}{{ayT 'ContractRate'}}
{{Name}}{{Tags}}{{AccountNumber}}{{ayCurrency Cost}}{{ayCurrency Charge}}{{Unit}}
\n\n\n
\n\n\n","Style":"body {\r\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \r\n}\r\n\r\n.reporttitle { \r\n margin-bottom: 20pt; \r\n font-weight: bold; \r\n font-size: 13pt; \r\n color: #9e9e9e;\r\n} \r\n\r\ntable { \r\n border-collapse: collapse;\r\n white-space: pre-wrap;\r\n width: 100%;\r\n table-layout: fixed;\r\n }\r\n\r\nth {\r\n border-bottom: solid 1pt #9e9e9e;\r\n height: 50px;\r\n font-size: 11pt; \r\n color: #9e9e9e;\r\n}\r\n\r\ntbody td {\r\n padding: 10px;\r\n word-wrap: break-word;\r\n font-size: 9pt;\r\n text-align: center;\r\n}\r\n\r\n\r\ntbody tr:nth-child(even) {\r\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\r\n}\r\n\r\n\r\n.rightlean {\r\n text-align: right;\r\n}\r\n.leftlean {\r\n text-align: left;\r\n}\r\n.centerlean {\r\n text-align: center;\r\n}\r\n\r\n\r\n.fontgreen {\r\n color: green;\r\n font-size: 16pt;\r\n}\r\n.fontblue {\r\n color: blue;\r\n}\r\n.fontred {\r\n color:red;\r\n}","JsPrerender":"async function ayPrepareData(ayData){ \n\n await ayGetTranslations([\"TravelRateList\", \"TravelRate\", \"Tags\", \"RateAccountNumber\", \"Cost\", \"RateCharge\", \"RateUnitChargeDescriptionID\", \"ContractRate\" ]);\n\n return ayData;\n}","JsHelpers":"","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/Users Grouped By User Type.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Users Grouped By User Type.ayrt new file mode 100644 index 00000000..55b83169 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Users Grouped By User Type.ayrt @@ -0,0 +1 @@ +{"Name":"Users Grouped By User Type","Active":true,"Notes":"","Roles":124927,"AType":3,"IncludeWoItemDescendants":false,"Template":"\n\t\n\t

{{ayT 'UserList'}} grouped by {{ayT 'UserType'}}

\n\t\n\t\n\t\t\n\t\t\t\n \n \n \n \n \n \n\t\t\n\t\n\n\t\n\t\n {{#each ayReportData}}\n \n \n \n {{#each items}}\n \n \n \n \n {{#if IsTech}}\n\t\t\t\t\t{{else}}{{/if}} \n \n \n \n \t\n {{/each}}\n \n \n \n {{/each}}\n\t\n\t\n \n \n\t
 {{ayT 'Name'}}{{ayT 'UserEmployeeNumber'}}{{ayT 'UserTypeService'}}{{ayT 'UserEmailAddress'}}{{ayT 'UserPhone1'}}{{ayT 'UserVendorID'}}
{{count}} {{ayT 'UserList'}} assigned to {{ayT 'UserType'}} {{group}}
 {{Name}}{{EmployeeNumber}}{{UserOptions.EmailAddress}}{{UserOptions.Phone1}}{{VendorViz}}
 
\n\n","Style":"h2 {\r\n color: #9e9e9e;\r\n}\r\n\r\ntfoot {\r\n border-top: 2px solid #9e9e9e;\r\n font-size: 7pt;\r\n text-align: center;\r\n}\r\n\r\n.singlePage\r\n{\r\npage-break-after: always;\r\n}\r\n\r\nbody {\r\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \r\n}\r\n\r\n.reporttitle { \r\n margin-bottom: 20pt; \r\n font-weight: bold; \r\n font-size: 13pt; \r\n color: #9e9e9e;\r\n} \r\n\r\ntable { \r\n border-collapse: collapse;\r\n white-space: pre-wrap;\r\n width: 100%;\r\n table-layout: fixed; \r\n }\r\n\r\nth {\r\n height: 30px;\r\n font-size: 9pt; \r\n color: #9e9e9e;\r\n}\r\n\r\ntbody td {\r\n padding: 10px;\r\n word-wrap: break-word;\r\n font-size: 7pt;\r\n text-align: center;\r\n}\r\n\r\n\r\ntbody tr:nth-child(even) {\r\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\r\n}\r\n\r\n\r\n.rightlean {\r\n text-align: right;\r\n}\r\n.leftlean {\r\n text-align: left;\r\n}\r\n.centerlean {\r\n text-align: center;\r\n}\r\n\r\n\r\n.fontgreen {\r\n color: green;\r\n}\r\n.fontblue {\r\n color: blue;\r\n}\r\n.fontred {\r\n color:red;\r\n}\r\n\r\n","JsPrerender":"async function ayPrepareData(ayData){ \n\n await ayGetTranslations([ \"UserList\", \"Name\", \"UserType\", \"UserEmployeeNumber\", \"UserPhone1\", \"UserEmailAddress\", \"UserTypeService\", \"UserVendorID\" ]);\n\n ayData.ayReportData = ayGroupByKey(ayData.ayReportData, 'UserTypeViz')\n\n\n return ayData;\n}","JsHelpers":"","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":true,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"15mm","MarginOptionsRight":"15mm","MarginOptionsTop":"15mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/Warehouses list.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Warehouses list.ayrt new file mode 100644 index 00000000..85d91357 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Warehouses list.ayrt @@ -0,0 +1 @@ +{"Name":"Warehouses list","Active":true,"Notes":"","Roles":50554,"AType":66,"IncludeWoItemDescendants":false,"Template":"\n\n\n
\n
\n

{{ayT 'PartWarehouseList'}} list

\n
\n\n \n \n \n \n \n \n \n \n \n\n \n {{#each ayReportData}}\n \n \n \n \n \n {{/each}}\n \n\n \n \n\n
{{ayT 'PartWarehouse'}}{{ayT 'Tags'}}{{ayT 'PartWarehouseNotes'}}
{{Name}}{{Tags}}{{Notes}}
\n\n\n
\n\n\n","Style":"body {\r\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \r\n}\r\n\r\n.reporttitle { \r\n margin-bottom: 20pt; \r\n font-weight: bold; \r\n font-size: 13pt; \r\n color: #9e9e9e;\r\n} \r\n\r\ntable { \r\n border-collapse: collapse;\r\n white-space: pre-wrap;\r\n width: 100%;\r\n table-layout: fixed;\r\n }\r\n\r\nth {\r\n border-bottom: solid 1pt #9e9e9e;\r\n height: 50px;\r\n font-size: 11pt; \r\n color: #9e9e9e;\r\n}\r\n\r\ntbody td {\r\n padding: 10px;\r\n word-wrap: break-word;\r\n font-size: 9pt;\r\n text-align: center;\r\n}\r\n\r\n\r\ntbody tr:nth-child(even) {\r\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\r\n}\r\n\r\n\r\n.rightlean {\r\n text-align: right;\r\n}\r\n.leftlean {\r\n text-align: left;\r\n}\r\n.centerlean {\r\n text-align: center;\r\n}\r\n\r\n\r\n.fontgreen {\r\n color: green;\r\n font-size: 16pt;\r\n}\r\n.fontblue {\r\n color: blue;\r\n}\r\n.fontred {\r\n color:red;\r\n}","JsPrerender":"async function ayPrepareData(ayData){ \n\n await ayGetTranslations([\"PartWarehouseList\", \"PartWarehouse\", \"Tags\", \"PartWarehouseNotes\" ]);\n\n return ayData;\n}","JsHelpers":"","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/Work Order Item Tasks.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Work Order Item Tasks.ayrt new file mode 100644 index 00000000..3d602ed1 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Work Order Item Tasks.ayrt @@ -0,0 +1 @@ +{"Name":"Work Order Item Tasks","Active":true,"Notes":"","Roles":50538,"AType":42,"IncludeWoItemDescendants":false,"Template":"\n\n\n
\n
\n

{{ayT 'WorkOrder'}} {{ayT 'WorkOrderItemList'}} {{ayT 'WorkOrderItemTasks'}} List

\n
\n\n \n \n \n \n \n \n \n\n\n\t\t\t\t\t \n\t\t\t\t\t\n \n \n\n \n {{#each ayReportData}}\n {{#each Items}}\n {{#each Tasks}}\n \n \n \n \n\n\t\t\t\t\t\n\t\t\t\t\t{{#if_eq Status 2}}\n\t\t\t\t\t{{else}}{{/if_eq}}\n\t\t\t\t\t\n \n \n {{/each}}\n {{/each}}\n {{/each}}\n \n\n \n \n\n
{{ayT 'WorkOrder'}}{{ayT 'WorkOrderServiceDate'}}{{ayT 'WorkOrderItemSummary'}}{{ayT 'WorkOrderItemTaskWorkOrderItemTaskCompletionType'}}{{ayT 'WorkOrderItemTasks'}}
{{../../Serial}}{{ayDateTime ../../ServiceDate}}{{../Notes}}{{StatusViz}} {{StatusViz}} {{Task}}
\n\n\n
\n\n\n","Style":"body {\r\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \r\n}\r\n\r\n.reporttitle { \r\n margin-bottom: 20pt; \r\n font-weight: bold; \r\n font-size: 13pt; \r\n color: #9e9e9e;\r\n} \r\n\r\ntable { \r\n border-collapse: collapse;\r\n white-space: pre-wrap;\r\n width: 100%;\r\n table-layout: fixed;\r\n }\r\n\r\nth {\r\n height: 20px;\r\n font-size: 10pt; \r\n color: #9e9e9e;\r\n}\r\n\r\ntbody td {\r\n padding: 10px;\r\n word-wrap: break-word;\r\n font-size: 8pt;\r\n}\r\n\r\n\r\ntbody tr:nth-child(even) {\r\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\r\n}\r\n\r\n\r\n.rightlean {\r\n text-align: right;\r\n}\r\n.leftlean {\r\n text-align: left;\r\n}\r\n.centerlean {\r\n text-align: center;\r\n}\r\n\r\n\r\n.fontgreen {\r\n color: green;\r\n font-size: 16pt;\r\n}\r\n.fontblue {\r\n color: blue;\r\n}\r\n.fontred {\r\n color:red;\r\n}\r\n\r\n","JsPrerender":" \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //see the help documentation for details\n\nasync function ayPrepareData(ayData) { \n\n await ayGetTranslations([ \"WorkOrderItemTasks\", \"WorkOrder\", \"WorkOrderItemList\", \"WorkOrderServiceDate\", \"WorkOrderItemSummary\", \"WorkOrderItemTaskWorkOrderItemTask\", \"WorkOrderItemTaskWorkOrderItemTaskCompletionType\" ]);\n\n\n \n return ayData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\r\n//https://handlebarsjs.com/guide/#custom-helpers\r\n\r\n//custom helper so can do a direct comparison - i.e. if value equals xxxx, then show, else show yyyyy\r\n//note that this HAS to be added here in Helpers, is NOT built in\r\nHandlebars.registerHelper('if_eq', function(a, b, opts) {\r\n if(a == b) // Or === depending on your needs\r\n return opts.fn(this);\r\n else\r\n return opts.inverse(this);\r\n});","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":0,"Landscape":true,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/Work Order Scheduled Users.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Work Order Scheduled Users.ayrt new file mode 100644 index 00000000..7fcf3a9d --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Work Order Scheduled Users.ayrt @@ -0,0 +1 @@ +{"Name":"Work Order Scheduled Users","Active":true,"Notes":"","Roles":50538,"AType":41,"IncludeWoItemDescendants":false,"Template":"\n\n\n
\n
\n

{{ayT 'WorkOrderItemScheduledUserList'}} List

\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n {{#each ayReportData}}\n {{#each Items}}\n {{#each ScheduledUsers}}\n \n \n \n \n \n \n \n \n \n \n {{/each}}\n {{/each}}\n {{/each}}\n \n\n \n \n\n
{{ayT 'WorkOrder'}}{{ayT 'Customer'}}{{ayT 'WorkOrderItemWorkOrderStatusID'}}{{ayT 'WorkOrderItemSummary'}}{{ayT 'WorkOrderItemScheduledUsers'}}{{ayT 'WorkOrderItemScheduledUserStartDate'}}{{ayT 'WorkOrderItemScheduledUserEstimatedQuantity'}}
{{../../Serial}}{{../../CustomerViz}}{{../WorkOrderItemStatusNameViz}}{{../Notes}}{{UserViz}}{{ayDateTime StartDate}}{{EstimatedQuantity}}
\n\n\n
\n\n\n","Style":"body {\r\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \r\n}\r\n\r\n.reporttitle { \r\n margin-bottom: 20pt; \r\n font-weight: bold; \r\n font-size: 13pt; \r\n color: #9e9e9e;\r\n} \r\n\r\ntable { \r\n border-collapse: collapse;\r\n white-space: pre-wrap;\r\n width: 100%;\r\n table-layout: fixed;\r\n }\r\n\r\nth {\r\n height: 20px;\r\n font-size: 10pt; \r\n color: #9e9e9e;\r\n}\r\n\r\ntbody td {\r\n padding: 10px;\r\n word-wrap: break-word;\r\n font-size: 8pt;\r\n}\r\n\r\n\r\ntbody tr:nth-child(even) {\r\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\r\n}\r\n\r\n\r\n.rightlean {\r\n text-align: right;\r\n}\r\n.leftlean {\r\n text-align: left;\r\n}\r\n.centerlean {\r\n text-align: center;\r\n}\r\n\r\n\r\n.fontgreen {\r\n color: green;\r\n font-size: 16pt;\r\n}\r\n.fontblue {\r\n color: blue;\r\n}\r\n.fontred {\r\n color:red;\r\n}\r\n\r\n","JsPrerender":" \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //see the help documentation for details\n\nasync function ayPrepareData(ayData) { \n\n await ayGetTranslations([ \"WorkOrderItemScheduledUsers\", \"WorkOrderItemScheduledUserList\", \"WorkOrder\", \"Customer\", \"WorkOrderItemWorkOrderStatusID\", \"WorkOrderItemSummary\", \"WorkOrderItemScheduledUserStartDate\", \"WorkOrderItemScheduledUserEstimatedQuantity\" ]);\n\n \n return ayData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\r\n//https://handlebarsjs.com/guide/#custom-helpers\r\n","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":0,"Landscape":true,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/Workorder Units grouped by Customer.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Workorder Units grouped by Customer.ayrt new file mode 100644 index 00000000..b7fd04fd --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Workorder Units grouped by Customer.ayrt @@ -0,0 +1 @@ +{"Name":"Workorder Units grouped by Customer","Active":true,"Notes":"","Roles":50538,"AType":44,"IncludeWoItemDescendants":false,"Template":"\n\n\n
\n
\n\t\t\t

{{ayT 'WorkOrder'}} {{ayT 'WorkOrderItemUnitList'}} grouped by {{ayT 'Customer'}}

\n\t\t
\n \n \n \n \n \n \n \n \n \n \n \n \n {{#each ayReportData}}\n \n \n \n {{#each items}}\n {{#each Items}}\n {{#each Units}}\n \n \n \n \n \n \n \n \n {{/each}}\n {{/each}}\n {{/each}}\n \n \n \n\n \n \n \n {{/each}}\n \n
{{ayT 'Customer'}}{{ayT 'WorkOrder'}}{{ayT 'WorkOrderServiceDate'}}{{ayT 'WorkOrderItemUnit'}}{{ayT 'WorkOrderItemWorkOrderStatusID'}}{{ayT 'WorkOrderItemSummary'}}
{{group}}
 {{../../Serial}} {{ayDate ../../ServiceDate}}{{UnitViz}} - {{UnitModelNameViz}}{{../WorkOrderItemStatusNameViz}}{{../Notes}}
 
 
\n
\n\n \n\n\n","Style":".minimum {\n font-size: 6pt;\n}\n\ntfoot {\n border-top: 2px solid #9e9e9e;\n font-size: 7pt;\n text-align: center;\n}\n\n.singlePage\n{\npage-break-after: always;\n}\n\nbody {\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \n}\n\n.reporttitle { \n margin-bottom: 20pt; \n font-weight: bold; \n font-size: 13pt; \n color: #9e9e9e;\n} \n\ntable { \n border-collapse: collapse;\n white-space: pre-wrap;\n width: 100%;\n table-layout: fixed; /* the # of columns set in the first row of the thead will be fixed and applied throughout table and rows */\n }\n\nth {\n height: 30px;\n font-size: 9pt; \n color: #9e9e9e;\n}\n\ntbody td {\n padding: 10px;\n word-wrap: break-word;\n font-size: 7pt;\n}\n\n\ntbody tr:nth-child(even) {\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\n}\n\n\n.rightlean {\n text-align: right;\n}\n.leftlean {\n text-align: left;\n}\n.centerlean {\n text-align: center;\n}\n\n\n.fontgreen {\n color: green;\n}\n.fontblue {\n color: blue;\n}\n.fontred {\n color:red;\n}\n\n","JsPrerender":"async function ayPrepareData(reportData){ \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //see the help documentation for details\n\n\treportData.ayReportData = ayGroupByKey(reportData.ayReportData, 'CustomerViz')\n\t\n\tawait ayGetTranslations([\"WorkOrder\", \"Customer\", \"WorkOrderServiceDate\", \"WorkOrderItemUnit\", \"WorkOrderItemUnitList\", \"WorkOrderStatus\", \"WorkOrderItemWorkOrderStatusID\", \"WorkOrderItemSummary\", \"WorkOrderSummary\" ]);\n\n\n\n return reportData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\n//https://handlebarsjs.com/guide/#custom-helpers\nHandlebars.registerHelper('loud', function (aString) {\n return aString.toUpperCase()\n})","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":true,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"15mm","MarginOptionsRight":"15mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/z_replace carriage return with space.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/z_replace carriage return with space.ayrt new file mode 100644 index 00000000..0a536624 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/z_replace carriage return with space.ayrt @@ -0,0 +1 @@ +{"Name":"z_replace carriage return with space","Active":true,"Notes":"Example custom Prepare to replace carriage return with space for a specific key of this object ","Roles":124927,"AType":8,"IncludeWoItemDescendants":false,"Template":"\n\n\n\t
\n\t\t
\n\t\t\t

Custom Prepare to remove carriage returns in {{ayT 'CustomerNotes'}}

\n\t\t
\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\t\t{{#each ayReportData}}\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t{{/each}}\n\t\t\t\n\t\t
{{ayT 'Customer'}} {{ayT 'CustomerNotes'}} Carriage returns removed in {{ayT 'CustomerNotes'}}
{{Name}} {{Notes}} {{NotesNoCarriage}}
 
\n\n\t\t\n {{#each ayReportData}}\n \n\t\t\t \t\n\t\t\t\t\t\n\t\t\t\t\n \n \n \n \n\t\t\t \n \n \n {{/each}}\n
 
This is a printout of the data returned from the Custom Prepare that this report now uses, each \"group\" is an object. Compare against the data that shows in the \"Sample Data\" when editing this report template.
{{ayJSON this}}
\n\t
\n\n","Style":"\r\n.singlePage\r\n{\r\npage-break-after: always;\r\n}\r\n\r\nbody {\r\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \r\n}\r\n\r\n.reporttitle { \r\n margin-bottom: 20pt; \r\n font-weight: bold; \r\n font-size: 13pt; \r\n text-align: center;\r\n color: #9e9e9e;\r\n} \r\n\r\n\r\ntable { \r\n table-layout: fixed; //setting this to fixed causes columns to be evenly spaced for the entire table regardless of cell content, and then colspan then \"works\" as expected\r\n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\r\n border-collapse: collapse;\r\n white-space: pre-wrap;\r\n font-size: 8pt;\r\n width: 100%;\r\n }\r\n\r\n\r\nth {\r\n height: 30px;\r\n text-align: left;\r\n color: #9e9e9e;\r\n}\r\n\r\n\r\ntbody tr {\r\n height: 10px;\r\n word-wrap: break-word;\r\n}\r\n\r\ntbody tr:nth-child(even) {\r\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\r\n}\r\n\r\n\r\n.fontgreen {\r\n color: green;\r\n}\r\n.fontblue {\r\n color: blue;\r\n}\r\n.fontred {\r\n color:red;\r\n}\r\n\r\n\r\n.rightlean {\r\n text-align: right;\r\n}\r\n.leftlean {\r\n text-align: left;\r\n}\r\n.centerlean {\r\n text-align: center;\r\n}","JsPrerender":"async function ayPrepareData(ayData){ \n\n await ayGetTranslations([ \"Customer\", \"CustomerNotes\" ]);\n\n //for each Customer, if the General Notes field is NOT null, creates a new key NotesNoCarriage and puts into it the text from Notes replacing ANY carriage returns with a space, so all text is on same line(s)\n for (EachCU of ayData.ayReportData) {\n if (EachCU.Notes != null) {\n n = EachCU.Notes;\n EachCU.NotesNoCarriage = n.replace(/[\\n\\r]+/g, ' ');\n }\n }\n\n return ayData;\n}","JsHelpers":"","RenderType":0,"HeaderTemplate":"                Printed date: PDFDate\nPage of                ","FooterTemplate":"  ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"20mm","MarginOptionsLeft":"15mm","MarginOptionsRight":"15mm","MarginOptionsTop":"15mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/util/License.cs b/server/AyaNova/util/License.cs index e413d237..ec41a9e5 100644 --- a/server/AyaNova/util/License.cs +++ b/server/AyaNova/util/License.cs @@ -502,7 +502,7 @@ namespace AyaNova.Core #endif { if (calledFromInternalJob) - log.LogTrace($"Fetching license for DBID {LicenseDbId} (called by job)"); + log.LogDebug($"Fetching license for DBID {LicenseDbId} (called by job)"); else log.LogInformation($"Fetching license for DBID {LicenseDbId}"); diff --git a/server/AyaNova/util/ReportProcessManager.cs b/server/AyaNova/util/ReportProcessManager.cs index e7a3d805..af07fd22 100644 --- a/server/AyaNova/util/ReportProcessManager.cs +++ b/server/AyaNova/util/ReportProcessManager.cs @@ -32,7 +32,7 @@ namespace AyaNova.Util internal static void KillExpiredRenders(ILogger log) { - log.LogTrace("Clear potential expired render jobs check"); + log.LogDebug("Clear potential expired render jobs check"); //check for expired and remove var Instances = _baginstances.ToArray(); var dtNow = DateTime.UtcNow; @@ -85,7 +85,7 @@ namespace AyaNova.Util internal static void AddProcess(int processId, DateTime expires, ILogger log) { - log.LogTrace($"AddProcess - {processId} to the collection"); + log.LogDebug($"AddProcess - {processId} to the collection"); _baginstances.Add(new ReportRenderInstanceInfo(processId, expires)); log.LogInformation($"AddProcess - there are currently {_baginstances.Count} instances in the collection");