From db24ea4aa5f412820c703d6ebc3266559b66a1d2 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 15 Dec 2021 18:21:58 +0000 Subject: [PATCH] --- .vscode/launch.json | 5 +- server/AyaNova/generator/CoreJobBackup.cs | 62 +++++++++---------- ...N Charges Summary Grouped By Customer.ayrt | 2 +- server/AyaNova/util/RunProgram.cs | 2 + 4 files changed, 36 insertions(+), 35 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 7f199adf..9c16be4d 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -58,10 +58,11 @@ //"AYANOVA_TEMP_FILES_PATH": "c:\\temp\\RavenTestData\\tempfiles", "AYANOVA_SERVER_TEST_MODE": "false", //"AYANOVA_LOG_PATH": "c:\\temp\\RavenTestData\\logs", - // "AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small", // "AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-8", - "AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_14\\bin\\" + //"AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_14\\bin\\" + "AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\Program Files\\ayanova\\local-postgres\\bin" + }, "sourceFileMap": { "/Views": "${workspaceFolder}/Views" diff --git a/server/AyaNova/generator/CoreJobBackup.cs b/server/AyaNova/generator/CoreJobBackup.cs index acf896e5..a1b933fc 100644 --- a/server/AyaNova/generator/CoreJobBackup.cs +++ b/server/AyaNova/generator/CoreJobBackup.cs @@ -43,7 +43,7 @@ namespace AyaNova.Biz } } AyaNova.Api.ControllerHelpers.ApiServerState apiServerState = null; - + try { BackupIsRunning = true; @@ -53,8 +53,8 @@ namespace AyaNova.Biz apiServerState.SetClosed("BACKUP RUNNING"); var jobstartmessage = $"LT:Backup LT:StartJob {(OnDemand ? "manual / on demand" : "scheduled") } "; await JobsBiz.LogJobAsync(Guid.Empty, jobstartmessage); - - DateTime dtStartBackup=DateTime.Now; + + DateTime dtStartBackup = DateTime.Now; log.LogDebug("Backup starting"); var DemandFileNamePrepend = OnDemand ? "manual-" : string.Empty; //************* @@ -63,7 +63,7 @@ namespace AyaNova.Biz //this is valid on windows //C:\data\code\PostgreSQLPortable_12.0\App\PgSQL\bin\pg_dump --dbname=postgresql://postgres:raven@127.0.0.1:5432/AyaNova -Fc > huge_new.backup - // await JobsBiz.LogJobAsync(Guid.Empty, $"Data backup starting"); + // await JobsBiz.LogJobAsync(Guid.Empty, $"Data backup starting"); Npgsql.NpgsqlConnectionStringBuilder PostgresConnectionString = new Npgsql.NpgsqlConnectionStringBuilder(ServerBootConfig.AYANOVA_DB_CONNECTION); var DBNameParameter = $"--dbname=postgresql://{PostgresConnectionString.Username}:{PostgresConnectionString.Password}@{PostgresConnectionString.Host}:{PostgresConnectionString.Port}/{PostgresConnectionString.Database}"; @@ -71,53 +71,51 @@ namespace AyaNova.Biz DataBackupFile = FileUtil.GetFullPathForBackupFile(DataBackupFile); var BackupUtilityCommand = "pg_dump"; + + if (!string.IsNullOrWhiteSpace(ServerBootConfig.AYANOVA_BACKUP_PG_DUMP_PATH)) BackupUtilityCommand = Path.Combine(ServerBootConfig.AYANOVA_BACKUP_PG_DUMP_PATH, BackupUtilityCommand); var Arguments = $"{DBNameParameter} -Fc > {DataBackupFile}"; var Result = RunProgram.Run(BackupUtilityCommand, Arguments, log, MAXIMUM_MS_ALLOWED_FOR_PROCESSING); - if (string.IsNullOrWhiteSpace(Result)) - { - var ms = "Backup of database completed OK"; - log.LogDebug(ms); - - } - else + if (!string.IsNullOrWhiteSpace(Result)) { var msg = $"Error during data backup \"{Result}\""; await JobsBiz.LogJobAsync(Guid.Empty, msg); log.LogError($"BACKUP ERROR: {Result}"); - await NotifyEventHelper.AddGeneralNotifyEvent(NotifyEventType.BackupStatus, msg,"Backup"); + await NotifyEventHelper.AddGeneralNotifyEvent(NotifyEventType.BackupStatus, msg, "Backup"); } + else + { + log.LogDebug("Backup of database completed OK"); - //DO FILE BACKUP IF ATTACHMENTS BACKED UP - if (ServerGlobalOpsSettingsCache.Backup.BackupAttachments) - { - await JobsBiz.LogJobAsync(Guid.Empty, $"LT:Backup LT:Attachments"); - FileUtil.BackupAttachments(DemandFileNamePrepend); - var ms = "Backup of file attachments completed OK"; - log.LogDebug(ms); + //DO FILE BACKUP IF ATTACHMENTS BACKED UP + if (ServerGlobalOpsSettingsCache.Backup.BackupAttachments) + { + await JobsBiz.LogJobAsync(Guid.Empty, $"LT:Backup LT:Attachments"); + FileUtil.BackupAttachments(DemandFileNamePrepend); + log.LogDebug("Backup of file attachments completed OK"); + } + //PRUNE DATA BACKUP SETS NOT KEPT + await JobsBiz.LogJobAsync(Guid.Empty, $"LT:BackupDeleteOld"); + FileUtil.DatabaseBackupCleanUp(ServerGlobalOpsSettingsCache.Backup.BackupSetsToKeep); + + //v.next - COPY TO ONLINE STORAGE + //*************** + + log.LogDebug("Backup completed"); + var duration = DateTime.Now - dtStartBackup; + await NotifyEventHelper.AddGeneralNotifyEvent(NotifyEventType.BackupStatus, $"Backup ({(OnDemand ? "manual / on demand" : "scheduled")}) completed successfully, duration (h:m:s.ms): {duration.ToString()}, server re-opened", "Backup"); } - - //PRUNE DATA BACKUP SETS NOT KEPT - await JobsBiz.LogJobAsync(Guid.Empty, $"LT:BackupDeleteOld"); - FileUtil.DatabaseBackupCleanUp(ServerGlobalOpsSettingsCache.Backup.BackupSetsToKeep); - - //v.next - COPY TO ONLINE STORAGE - //*************** - - log.LogDebug("Backup completed"); - var duration=DateTime.Now - dtStartBackup; - await NotifyEventHelper.AddGeneralNotifyEvent(NotifyEventType.BackupStatus, $"Backup ({(OnDemand ? "manual / on demand" : "scheduled")}) completed successfully, duration (h:m:s.ms): {duration.ToString()}, server re-opened","Backup"); } catch (Exception ex) { await JobsBiz.LogJobAsync(Guid.Empty, "LT:JobFailed"); await JobsBiz.LogJobAsync(Guid.Empty, ExceptionUtil.ExtractAllExceptionMessages(ex)); log.LogError(ex, "Backup failed"); - await NotifyEventHelper.AddGeneralNotifyEvent(NotifyEventType.BackupStatus, "Backup failed","Backup", ex); + await NotifyEventHelper.AddGeneralNotifyEvent(NotifyEventType.BackupStatus, "Backup failed", "Backup", ex); throw; } finally @@ -128,7 +126,7 @@ namespace AyaNova.Biz apiServerState.ResumePriorState(); BackupIsRunning = false; await JobsBiz.LogJobAsync(Guid.Empty, "LT:JobCompleted"); - + } } diff --git a/server/AyaNova/resource/rpt/stock-report-templates/PRODUCTION Charges Summary Grouped By Customer.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/PRODUCTION Charges Summary Grouped By Customer.ayrt index c4d8c52c..4e72915e 100644 --- a/server/AyaNova/resource/rpt/stock-report-templates/PRODUCTION Charges Summary Grouped By Customer.ayrt +++ b/server/AyaNova/resource/rpt/stock-report-templates/PRODUCTION Charges Summary Grouped By Customer.ayrt @@ -1 +1 @@ -{"Name":"Charges Summary Grouped By Customer","Active":true,"Notes":"Custom Prepare to display each WO total nets, taxes and grand total","Roles":50538,"AType":34,"IncludeWoItemDescendants":false,"Template":"\n\n\n
\n
\n\t\t\t

Nets Taxes & Totals for each {{ayT 'Customer'}}

\n\t\t
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {{#each ayReportData}}\n \n \n \n {{#each items}}\n \n \n \n {{#if ServiceDate }}{{else}}{{/if}}\n {{#if ThisWOAllLaborsNetViz }}{{else}}{{/if}}\n {{#if ThisWOAllPartsNetViz }}{{else}}{{/if}}\n {{#if ThisWOAllTravelsNetViz }}{{else}}{{/if}}\n {{#if ThisWOAllExpsNetChargeAmount }}{{else}}{{/if}}\n {{#if ThisWOAllLoansNetViz }}{{else}}{{/if}}\n {{#if ThisWOAllOutsidesNetViz }}{{else}}{{/if}}\n {{#if ThisWOTotalNets }} {{else}} {{/if}}\n {{#if ThisWOTotalTaxAs }} {{else}} {{/if}}\n {{#if ThisWOTotalTaxBs }} {{else}} {{/if}}\n {{#if ThisWOTotalGrand }} {{else}} {{/if}} \n \n {{/each}}\n \n \n \n \n \n {{#if GroupWOLaborsNetViz }}{{else}}{{/if}}\n {{#if GroupWOPartsNetViz }}{{else}}{{/if}}\n {{#if GroupWOTravelsNetViz }}{{else}}{{/if}}\n {{#if GroupWOExpsNetChargeAmount }}{{else}}{{/if}}\n {{#if GroupWOLoansNetViz }}{{else}}{{/if}}\n {{#if GroupWOOutsidesNetViz }}{{else}}{{/if}}\n {{#if GroupWOTotalNets }} {{else}} {{/if}}\n {{#if GroupWOTotalTaxAs }} {{else}} {{/if}}\n {{#if GroupWOTotalTaxBs }} {{else}} {{/if}}\n {{#if GroupWOTotalGrand }} {{else}} {{/if}} \n \n \n \n \n {{/each}}\n \n
{{ayT 'Customer'}}{{ayT 'WorkOrder'}}{{ayT 'WorkOrderServiceDate'}}{{ayT 'WorkOrderItemLaborList'}}{{ayT 'WorkOrderItemPartList'}}{{ayT 'WorkOrderItemTravelList'}}{{ayT 'WorkOrderItemExpenseList'}}{{ayT 'WorkOrderItemLoanList'}}{{ayT 'WorkOrderItemOutsideService'}}{{ayT 'NetValue'}}{{ayT 'TaxCodeTaxA'}}{{ayT 'TaxCodeTaxB'}}{{ayT 'Total'}}
{{group}}
 {{Serial}}{{ayDate ServiceDate}}no Service Date specified{{ayCurrency ThisWOAllLaborsNetViz}}none billable{{ayCurrency ThisWOAllPartsNetViz}}none billable{{ayCurrency ThisWOAllTravelsNetViz}}none billable{{ayCurrency ThisWOAllExpsNetChargeAmount}}none billable{{ayCurrency ThisWOAllLoansNetViz}}none billable{{ayCurrency ThisWOAllOutsidesNetViz}}none billable{{ayCurrency ThisWOTotalNets}}none billable{{ayCurrency ThisWOTotalTaxAs}}none{{ayCurrency ThisWOTotalTaxBs}}none{{ayCurrency ThisWOTotalGrand}}none billable
 
{{group}} Totals{{ayCurrency GroupWOLaborsNetViz}}none billable{{ayCurrency GroupWOPartsNetViz}}none billable{{ayCurrency GroupWOTravelsNetViz}}none billable{{ayCurrency GroupWOExpsNetChargeAmount}}none billable{{ayCurrency GroupWOLoansNetViz}}none billable{{ayCurrency GroupWOOutsidesNetViz}}none billable{{ayCurrency GroupWOTotalNets}}none billable{{ayCurrency GroupWOTotalTaxAs}}none{{ayCurrency GroupWOTotalTaxBs}}none{{ayCurrency GroupWOTotalGrand}}none billable
 
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {{#if AllWOLaborsNetViz}} {{else}} {{/if}}\n {{#if AllWOPartsNetViz}} {{else}} {{/if}}\n {{#if AllWOTravelsNetViz}} {{else}} {{/if}}\n {{#if AllWOExpsNetChargeAmount}} {{else}} {{/if}}\n {{#if AllWOLoansNetViz}} {{else}} {{/if}}\n {{#if AllWOOutsidesNetViz}} {{else}} {{/if}}\n {{#if AllWOTotalNets}} {{else}} {{/if}}\n {{#if AllWOTotalTaxAs}} {{else}} {{/if}}\n {{#if AllWOTotalTaxBs }} {{else}} {{/if}}\n {{#if AllWOTotalGrand}} {{else}} {{/if}}\n \n \n
Totals for all{{ayT 'WorkOrderItemLaborList'}}{{ayT 'WorkOrderItemPartList'}}{{ayT 'WorkOrderItemTravelList'}}{{ayT 'WorkOrderItemExpenseList'}}{{ayT 'WorkOrderItemLoanList'}}{{ayT 'WorkOrderItemOutsideService'}}{{ayT 'NetValue'}}{{ayT 'TaxCodeTaxA'}}{{ayT 'TaxCodeTaxB'}}{{ayT 'Total'}}
{{ ayCurrency AllWOLaborsNetViz }}$0.00{{ ayCurrency AllWOPartsNetViz }}$0.00{{ ayCurrency AllWOTravelsNetViz }}$0.00{{ ayCurrency AllWOExpsNetChargeAmount }}$0.00{{ ayCurrency AllWOLoansNetViz }}$0.00{{ ayCurrency AllWOOutsidesNetViz }}$0.00{{ ayCurrency AllWOTotalNets }}$0.00{{ ayCurrency AllWOTotalTaxAs }}$0.00{{ ayCurrency AllWOTotalTaxBs }}$0.00{{ ayCurrency AllWOTotalGrand }}$0.00
\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 /* border-bottom: solid 1pt #9e9e9e; */\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\", \"NetValue\", \"WorkOrderItemLaborList\", \"WorkOrderItemPartList\", \"WorkOrderItemTravelList\", \"WorkOrderItemExpenseList\", \"WorkOrderItemLoanList\", \"WorkOrderItemOutsideService\", \"TaxCodeTaxA\", \"TaxCodeTaxB\", \"Total\" ]);\n\n\n//********************//NOTE if you customize this report template and do NOT need a function or key identified below, remove to increase report performance\n\n//below declares a key on the entire wo to hold all Labor Net Viz from all workorders reported on in this report so it exists\nreportData.AllWOLaborsNetViz = 0;\n//below declares a key on the entire wo to hold all Part Net Viz from all workorders so it exists\nreportData.AllWOPartsNetViz = 0;\n//below declares a key on the entire wo to hold all Travel Net Viz from all workorders so it exists\nreportData.AllWOTravelsNetViz = 0;\n//below declares a key on the entire wo to hold all Exp Net ChargeAmount from all workorders so it exists\nreportData.AllWOExpsNetChargeAmount = 0;\n//below declares a key on the entire wo to hold all Loan Net Viz from all workorders so it exists\nreportData.AllWOLoansNetViz = 0;\n//below declares a key on the entire wo to hold all OutsideServices Net Viz from all workorders so it exists\nreportData.AllWOOutsidesNetViz = 0;\n\n//below declares a key to hold all Nets from all workorders in this list so it exists\nreportData.AllWOTotalNets = 0;\n\n//below declares a key to hold all Tax As from all workorders in this list so it exists\nreportData.AllWOTotalTaxAs = 0;\n//below declares a key to hold all Tax Bs from all workorders in this list so it exists\nreportData.AllWOTotalTaxBs = 0;\n//below declares a key to hold all GrandTotal from all workorders in this list so it exists\nreportData.AllWOTotalGrand = 0;\n\n\nfor (EachGroup of reportData.ayReportData) {\n\n\t//below declares a key on the entire wo to hold all Labor Net Viz from all workorders reported on in this report so it exists\n\tEachGroup.GroupWOLaborsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Part Net Viz from all workorders so it exists\n\tEachGroup.GroupWOPartsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Travel Net Viz from all workorders so it exists\n\tEachGroup.GroupWOTravelsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Exp Net ChargeAmount from all workorders so it exists\n\tEachGroup.GroupWOExpsNetChargeAmount = 0;\n\t//below declares a key on the entire wo to hold all Loan Net Viz from all workorders so it exists\n\tEachGroup.GroupWOLoansNetViz = 0;\n\t//below declares a key on the entire wo to hold all OutsideServices Net Viz from all workorders so it exists\n\tEachGroup.GroupWOOutsidesNetViz = 0;\n\n\t//below declares a key to hold all Nets from all workorders in this list so it exists\n\tEachGroup.GroupWOTotalNets = 0;\n\n\t//below declares a key to hold all Tax As from all workorders in this list so it exists\n\tEachGroup.GroupWOTotalTaxAs = 0;\n\t//below declares a key to hold all Tax Bs from all workorders in this list so it exists\n\tEachGroup.GroupWOTotalTaxBs = 0;\n\t//below declares a key to hold all GrandTotal from all workorders in this list so it exists\n\tEachGroup.GroupWOTotalGrand = 0;\n\nfor (EachWO of EachGroup.items) \n\t{\n\t//below declares a key on the entire wo to hold all Labor Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllLaborsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Part Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllPartsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Travel Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllTravelsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Exp Net ChargeAmount from all Items in this wo so it exists\n\tEachWO.ThisWOAllExpsNetChargeAmount = 0;\n\t//below declares a key on the entire wo to hold all Loan Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllLoansNetViz = 0;\n\t//below declares a key on the entire wo to hold all Outside Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllOutsidesNetViz = 0;\t\n\n\t//below declares a key on the entire wo to hold ALL of THIS workorder's Nets so it exists\n\tEachWO.ThisWOTotalNets = 0;\n\n\t//below declares a key on the entire wo to hold THIS workorder's Tax A (for all items) so it exists \n\tEachWO.ThisWOTotalTaxAs = 0;\n\t//below declares a key on the entire wo to hold THIS workorder's Tax B (for all items) so it exists\n\tEachWO.ThisWOTotalTaxBs = 0;\t\n\t//below declares a key on the entire wo to hold THIS workorder's Grand Total so it exists\n\tEachWO.ThisWOTotalGrand = 0;\n\n\t//below is to Iterate through each item of the wo's Items\n\tfor (Item of EachWO.Items)\n\t\t{\n\t\t\tItem.ThisItemAllLaborsNetViz = 0; //declare a key on the Item to hold all of this item's labor nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each labor record of the wo's Item\n\t\t\tfor (Labor of Item.Labors)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Labor.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllLaborsNetViz += Labor.NetViz; //this IS where the actual adding to running total for this WOItem's Net Labors\n\t\t\t\t\t\tEachWO.ThisWOAllLaborsNetViz += Labor.NetViz; //this IS where the actual adding to the running total for this entire WO's Net Labors\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Labor.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\t\n\n\t\t\t\t\t\tEachGroup.GroupWOLaborsNetViz += Labor.NetViz; //this IS where the actual adding to the running total for this Group's entire WO's Net Labors\n\t\t\t\t\t\tEachGroup.GroupWOTotalNets += Labor.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS Group's workorders in this report data\n\t\t\t\t\t\tEachGroup.GroupWOTotalGrand += Labor.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS Group's workorders in this report data\t\n\t\t\t\t\t\t\n\t\t\t\t\t\treportData.AllWOLaborsNetViz += Labor.NetViz;\t//this IS where the actual adding to the running total for all labor for ALL workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Labor.NetViz; //this is where the actual adding to the running total for ALL workorders Nets in this report data\t\t\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalGrand += Labor.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Labor.TaxAViz; //this IS where the actual adding of Labor's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.TaxAViz; //this IS where the actual adding of Labor's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Labor.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Labor.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Labor.TaxBViz; //this IS where the actual adding of Labor's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.TaxBViz; //this IS where the actual adding of Labor's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Labor.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Labor.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllPartsNetViz = 0; //declare a key on the Item to hold all of this item's parts nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Part record of the wo's Item\n\t\t\tfor (Part of Item.Parts)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Part.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllPartsNetViz += Part.NetViz; //this IS where the actual adding to running total for this WOItem's Net Parts\n\t\t\t\t\t\tEachWO.ThisWOAllPartsNetViz += Part.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Parts\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Part.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\t\t\t\t\t\t\n\t\t\t\t\t\treportData.AllWOPartsNetViz += Part.NetViz; //this IS where the actual adding to the running total for all Parts for all workorders in this report data\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Part.NetViz; //this is where the actual adding to the running total for all workorder Nets in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Part.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\n\t\t\t\t\t\tEachGroup.GroupWOPartsNetViz += Part.NetViz;//this IS where the actual adding to the running total for this entire Groups WO's Net Parts\n\t\t\t\t\t\tEachGroup.GroupWOTotalNets += Part.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS Groups workorders in this report data\n\t\t\t\t\t\tEachGroup.GroupWOTotalGrand += Part.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS Groups workorders in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Part.TaxAViz; //this IS where the actual adding of Part's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.TaxAViz; //this IS where the actual adding of Part's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Part.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Part.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Part.TaxBViz; //this IS where the actual adding of Part's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.TaxBViz; //this IS where the actual adding of Part's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Part.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Part.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllTravelsNetViz = 0; //declare a key on the Item to hold all of this item's travel nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Travel record of the wo's Item\n\t\t\tfor (Travel of Item.Travels)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Travel.NetViz != null) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllTravelsNetViz += Travel.NetViz;//this IS where the actual adding to running total for this WOItem's Net Travels\n\t\t\t\t\t\tEachWO.ThisWOAllTravelsNetViz += Travel.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Travels\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Travel.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTravelsNetViz += Travel.NetViz;\t//this IS where the actual adding to the running total for all Travels for all workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Travel.NetViz; //this is where the actual adding to the running total for all workorder Nets in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Travel.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\n\t\t\t\t\t\tEachGroup.GroupWOTravelsNetViz += Travel.NetViz;//this IS where the actual adding to the running total for this entire Groups WO's Net Travels\n\t\t\t\t\t\tEachGroup.GroupWOTotalNets += Travel.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS Groups workorders in this report data\n\t\t\t\t\t\tEachGroup.GroupWOTotalGrand += Travel.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS Groups workorders in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Travel.TaxAViz; //this IS where the actual adding of Travel's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.TaxAViz; //this IS where the actual adding of Travel's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Travel.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Travel.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Travel.TaxBViz; //this IS where the actual adding of Travel's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.TaxBViz; //this IS where the actual adding of Travel's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Travel.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Travel.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\t//note additional statements for misc expense to ONLY add to running totals if ChargeToCustomer is true\n\t\t\t\n\t\t\tItem.ThisItemAllExpsNetChargeAmount = 0; //declare a key on the Item to hold all of this item's misc nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Exp record of the wo's Item\n\t\t\tfor (Exp of Item.Expenses)\n\t\t\t{\n\t\t\t//if this expense has a ChargeAmount value AND the ChargeToCustomer is true then adds the ChargeAmount to running totals\n \tif (Exp.ChargeAmount != null && Exp.ChargeToCustomer == true) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to running total for this WOItem's Net Exps\n\t\t\t\t\t\tEachWO.ThisWOAllExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to the running total for this entire WO's Net ChargeAmounts\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Exp.ChargeAmount;//this IS where the actual adding to the running total for ALL NET ChargeAmountS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.ChargeAmount; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\n\t\t\t\t\t\tEachGroup.GroupWOExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to the running total for this entire Groups WO's Net ChargeAmounts\n\t\t\t\t\t\tEachGroup.GroupWOTotalNets += Exp.ChargeAmount;//this IS where the actual adding to the running total for ALL NET ChargeAmountS for THIS Groups workorders in this report data\n\t\t\t\t\t\tEachGroup.GroupWOTotalGrand += Exp.ChargeAmount; //this IS where the actual adding to the running total for GrandTotal for THIS Groups workorders in this report data\n\n\t\t\t\t\t\treportData.AllWOExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to the running total for all Exp ChargeAmount for all workorders in this report data\t\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Exp.ChargeAmount;//this is where the actual adding to the running total for all workorder Net ChargeAmount in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Exp.ChargeAmount; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\n\t\t\t//if this expense the ChargeToCustomer is true AND ChargeTaxCode has a value then adds the TaxAViz and TaxBViz to running totals\t\t\n\t\t\t\t\tif (Exp.ChargeToCustomer == true && Exp.ChargeTaxCodeId != null ) \n \t \t{\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Exp.TaxAViz; //this IS where the actual adding of Exp's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxAViz; //this IS where the actual adding of Exp's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Exp.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Exp.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Exp.TaxBViz; //this IS where the actual adding of Exp's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxBViz; //this IS where the actual adding of Exp's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\n\t\t\t\t\t\tEachGroup.GroupWOTotalTaxBs += Exp.TaxBViz; //this IS where the actual adding of Exp's Tax B to the running total for ALL Tax B for THIS Groups workorders in this report data\n\t\t\t\t\t\tEachGroup.GroupWOTotalGrand += Exp.TaxBViz; //this IS where the actual adding of Exp's Tax B to the running total for GrandTotal for THIS Groups workorders in this report data\n\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Exp.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Exp.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t\t\telse if (Exp.ChargeToCustomer == true && Exp.ChargeTaxCodeId == null ) //else if ChargeToCustomer is true AND ChargeTaxCodeID is null, then add TaxPaid to TaxA running total and Grand Total\t\t\n\t\t\t\t\t\t{\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Exp.TaxPaid; //this IS where the actual adding of Exp's TaxPaid to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxPaid; //this IS where the actual adding of Exp's TaxPaid to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Exp.TaxPaid; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Exp.TaxPaid; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\n\t\t\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t\n\t\t\tItem.ThisItemAllLoansNetViz = 0; //declare a key on the Item to hold all of this item's loans nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Loan record of the wo's Item\n\t\t\tfor (Loan of Item.Loans)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Loan.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllLoansNetViz += Loan.NetViz;//this IS where the actual adding to running total for this WOItem's Net Loans\n\t\t\t\t\t\tEachWO.ThisWOAllLoansNetViz += Loan.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Loans\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Loan.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\n\t\t\t\t\t\tEachGroup.GroupWOLoansNetViz += Loan.NetViz;//this IS where the actual adding to the running total for this entire Groups WO's Net Loans\n\t\t\t\t\t\tEachGroup.GroupWOTotalNets += Loan.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS Groups workorders in this report data\n\t\t\t\t\t\tEachGroup.GroupWOTotalGrand += Loan.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS Groups workorders in this report data\n\n\t\t\t\t\t\treportData.AllWOLoansNetViz += Loan.NetViz;\t\t//this IS where the actual adding to the running total for all Loans for all workorders in this report data\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Loan.NetViz;//this is where the actual adding to the running total for all workorder Nets in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Loan.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Loan.TaxAViz; //this IS where the actual adding of Loan's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.TaxAViz; //this IS where the actual adding of Loan's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Loan.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Loan.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Loan.TaxBViz; //this IS where the actual adding of Loan's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.TaxBViz; //this IS where the actual adding of Loan's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Loan.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Loan.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllOutsidesNetViz = 0; //declare a key on the Item to hold all of this item's Outsie nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Outside record of the wo's Item\n\t\t\tfor (Outside of Item.OutsideServices)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Outside.NetViz != null) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllOutsidesNetViz += Outside.NetViz;//this IS where the actual adding to running total for this WOItem's Net Outside\n\t\t\t\t\t\tEachWO.ThisWOAllOutsidesNetViz += Outside.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Outsides\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Outside.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\n\t\t\t\t\t\tEachGroup.GroupWOOutsidesNetViz += Outside.NetViz;//this IS where the actual adding to the running total for this entire Groups WO's Net Outsides\n\t\t\t\t\t\tEachGroup.GroupWOTotalNets += Outside.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS Groups workorders in this report data\n\t\t\t\t\t\tEachGroup.GroupWOTotalGrand += Outside.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS Groups workorders in this report data\n\n\t\t\t\t\t\treportData.AllWOOutsidesNetViz += Outside.NetViz;\t//this IS where the actual adding to the running total for all Outside for all workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Outside.NetViz;//this is where the actual adding to the running total for all workorder Nets in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Outside.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Outside.TaxAViz; //this IS where the actual adding of Outside's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.TaxAViz; //this IS where the actual adding of Outside's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Outside.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Outside.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Outside.TaxBViz; //this IS where the actual adding of Outside's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.TaxBViz; //this IS where the actual adding of Outside's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Outside.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Outside.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\t\t}\n\t}\n}\n\t\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 +{"Name":"Charges Summary Grouped By Customer","Active":true,"Notes":"Custom Prepare to display each WO total nets, taxes and grand total","Roles":50538,"AType":34,"IncludeWoItemDescendants":false,"Template":"\n\n\n
\n
\n\t\t\t

Nets Taxes & Totals for each {{ayT 'Customer'}}

\n\t\t
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {{#each ayReportData}}\n \n \n \n {{#each items}}\n \n \n \n {{#if ServiceDate }}{{else}}{{/if}}\n {{#if ThisWOAllLaborsNetViz }}{{else}}{{/if}}\n {{#if ThisWOAllPartsNetViz }}{{else}}{{/if}}\n {{#if ThisWOAllTravelsNetViz }}{{else}}{{/if}}\n {{#if ThisWOAllExpsNetChargeAmount }}{{else}}{{/if}}\n {{#if ThisWOAllLoansNetViz }}{{else}}{{/if}}\n {{#if ThisWOAllOutsidesNetViz }}{{else}}{{/if}}\n {{#if ThisWOTotalNets }} {{else}} {{/if}}\n {{#if ThisWOTotalTaxAs }} {{else}} {{/if}}\n {{#if ThisWOTotalTaxBs }} {{else}} {{/if}}\n {{#if ThisWOTotalGrand }} {{else}} {{/if}} \n \n {{/each}}\n \n \n \n \n \n {{#if GroupWOLaborsNetViz }}{{else}}{{/if}}\n {{#if GroupWOPartsNetViz }}{{else}}{{/if}}\n {{#if GroupWOTravelsNetViz }}{{else}}{{/if}}\n {{#if GroupWOExpsNetChargeAmount }}{{else}}{{/if}}\n {{#if GroupWOLoansNetViz }}{{else}}{{/if}}\n {{#if GroupWOOutsidesNetViz }}{{else}}{{/if}}\n {{#if GroupWOTotalNets }} {{else}} {{/if}}\n {{#if GroupWOTotalTaxAs }} {{else}} {{/if}}\n {{#if GroupWOTotalTaxBs }} {{else}} {{/if}}\n {{#if GroupWOTotalGrand }} {{else}} {{/if}} \n \n \n \n \n {{/each}}\n \n
{{ayT 'Customer'}}{{ayT 'WorkOrder'}}{{ayT 'WorkOrderServiceDate'}}{{ayT 'WorkOrderItemLaborList'}}{{ayT 'WorkOrderItemPartList'}}{{ayT 'WorkOrderItemTravelList'}}{{ayT 'WorkOrderItemExpenseList'}}{{ayT 'WorkOrderItemLoanList'}}{{ayT 'WorkOrderItemOutsideService'}}{{ayT 'NetValue'}}{{ayT 'TaxCodeTaxA'}}{{ayT 'TaxCodeTaxB'}}{{ayT 'Total'}}
{{group}}
 {{Serial}}{{ayDate ServiceDate}}no Service Date specified{{ayCurrency ThisWOAllLaborsNetViz}}none billable{{ayCurrency ThisWOAllPartsNetViz}}none billable{{ayCurrency ThisWOAllTravelsNetViz}}none billable{{ayCurrency ThisWOAllExpsNetChargeAmount}}none billable{{ayCurrency ThisWOAllLoansNetViz}}none billable{{ayCurrency ThisWOAllOutsidesNetViz}}none billable{{ayCurrency ThisWOTotalNets}}none billable{{ayCurrency ThisWOTotalTaxAs}}none{{ayCurrency ThisWOTotalTaxBs}}none{{ayCurrency ThisWOTotalGrand}}none billable
 
{{group}} Totals{{ayCurrency GroupWOLaborsNetViz}}none billable{{ayCurrency GroupWOPartsNetViz}}none billable{{ayCurrency GroupWOTravelsNetViz}}none billable{{ayCurrency GroupWOExpsNetChargeAmount}}none billable{{ayCurrency GroupWOLoansNetViz}}none billable{{ayCurrency GroupWOOutsidesNetViz}}none billable{{ayCurrency GroupWOTotalNets}}none billable{{ayCurrency GroupWOTotalTaxAs}}none{{ayCurrency GroupWOTotalTaxBs}}none{{ayCurrency GroupWOTotalGrand}}none billable
 
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {{#if AllWOLaborsNetViz}} {{else}} {{/if}}\n {{#if AllWOPartsNetViz}} {{else}} {{/if}}\n {{#if AllWOTravelsNetViz}} {{else}} {{/if}}\n {{#if AllWOExpsNetChargeAmount}} {{else}} {{/if}}\n {{#if AllWOLoansNetViz}} {{else}} {{/if}}\n {{#if AllWOOutsidesNetViz}} {{else}} {{/if}}\n {{#if AllWOTotalNets}} {{else}} {{/if}}\n {{#if AllWOTotalTaxAs}} {{else}} {{/if}}\n {{#if AllWOTotalTaxBs }} {{else}} {{/if}}\n {{#if AllWOTotalGrand}} {{else}} {{/if}}\n \n \n
Totals for all{{ayT 'WorkOrderItemLaborList'}}{{ayT 'WorkOrderItemPartList'}}{{ayT 'WorkOrderItemTravelList'}}{{ayT 'WorkOrderItemExpenseList'}}{{ayT 'WorkOrderItemLoanList'}}{{ayT 'WorkOrderItemOutsideService'}}{{ayT 'NetValue'}}{{ayT 'TaxCodeTaxA'}}{{ayT 'TaxCodeTaxB'}}{{ayT 'Total'}}
{{ ayCurrency AllWOLaborsNetViz }}$0.00{{ ayCurrency AllWOPartsNetViz }}$0.00{{ ayCurrency AllWOTravelsNetViz }}$0.00{{ ayCurrency AllWOExpsNetChargeAmount }}$0.00{{ ayCurrency AllWOLoansNetViz }}$0.00{{ ayCurrency AllWOOutsidesNetViz }}$0.00{{ ayCurrency AllWOTotalNets }}$0.00{{ ayCurrency AllWOTotalTaxAs }}$0.00{{ ayCurrency AllWOTotalTaxBs }}$0.00{{ ayCurrency AllWOTotalGrand }}$0.00
\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 /* border-bottom: solid 1pt #9e9e9e; */\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\", \"NetValue\", \"WorkOrderItemLaborList\", \"WorkOrderItemPartList\", \"WorkOrderItemTravelList\", \"WorkOrderItemExpenseList\", \"WorkOrderItemLoanList\", \"WorkOrderItemOutsideService\", \"TaxCodeTaxA\", \"TaxCodeTaxB\", \"Total\" ]);\n\n\n//********************//NOTE if you customize this report template and do NOT need a function or key identified below, remove to increase report performance\n\n//below declares a key on the entire wo to hold all Labor Net Viz from all workorders reported on in this report so it exists\nreportData.AllWOLaborsNetViz = 0;\n//below declares a key on the entire wo to hold all Part Net Viz from all workorders so it exists\nreportData.AllWOPartsNetViz = 0;\n//below declares a key on the entire wo to hold all Travel Net Viz from all workorders so it exists\nreportData.AllWOTravelsNetViz = 0;\n//below declares a key on the entire wo to hold all Exp Net ChargeAmount from all workorders so it exists\nreportData.AllWOExpsNetChargeAmount = 0;\n//below declares a key on the entire wo to hold all Loan Net Viz from all workorders so it exists\nreportData.AllWOLoansNetViz = 0;\n//below declares a key on the entire wo to hold all OutsideServices Net Viz from all workorders so it exists\nreportData.AllWOOutsidesNetViz = 0;\n\n//below declares a key to hold all Nets from all workorders in this list so it exists\nreportData.AllWOTotalNets = 0;\n\n//below declares a key to hold all Tax As from all workorders in this list so it exists\nreportData.AllWOTotalTaxAs = 0;\n//below declares a key to hold all Tax Bs from all workorders in this list so it exists\nreportData.AllWOTotalTaxBs = 0;\n//below declares a key to hold all GrandTotal from all workorders in this list so it exists\nreportData.AllWOTotalGrand = 0;\n\n\nfor (EachGroup of reportData.ayReportData) {\n\n\t//below declares a key on the entire wo to hold all Labor Net Viz from all workorders reported on in this report so it exists\n\tEachGroup.GroupWOLaborsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Part Net Viz from all workorders so it exists\n\tEachGroup.GroupWOPartsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Travel Net Viz from all workorders so it exists\n\tEachGroup.GroupWOTravelsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Exp Net ChargeAmount from all workorders so it exists\n\tEachGroup.GroupWOExpsNetChargeAmount = 0;\n\t//below declares a key on the entire wo to hold all Loan Net Viz from all workorders so it exists\n\tEachGroup.GroupWOLoansNetViz = 0;\n\t//below declares a key on the entire wo to hold all OutsideServices Net Viz from all workorders so it exists\n\tEachGroup.GroupWOOutsidesNetViz = 0;\n\n\t//below declares a key to hold all Nets from all workorders in this list so it exists\n\tEachGroup.GroupWOTotalNets = 0;\n\n\t//below declares a key to hold all Tax As from all workorders in this list so it exists\n\tEachGroup.GroupWOTotalTaxAs = 0;\n\t//below declares a key to hold all Tax Bs from all workorders in this list so it exists\n\tEachGroup.GroupWOTotalTaxBs = 0;\n\t//below declares a key to hold all GrandTotal from all workorders in this list so it exists\n\tEachGroup.GroupWOTotalGrand = 0;\n\nfor (EachWO of EachGroup.items) \n\t{\n\t//below declares a key on the entire wo to hold all Labor Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllLaborsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Part Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllPartsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Travel Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllTravelsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Exp Net ChargeAmount from all Items in this wo so it exists\n\tEachWO.ThisWOAllExpsNetChargeAmount = 0;\n\t//below declares a key on the entire wo to hold all Loan Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllLoansNetViz = 0;\n\t//below declares a key on the entire wo to hold all Outside Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllOutsidesNetViz = 0;\t\n\n\t//below declares a key on the entire wo to hold ALL of THIS workorder's Nets so it exists\n\tEachWO.ThisWOTotalNets = 0;\n\n\t//below declares a key on the entire wo to hold THIS workorder's Tax A (for all items) so it exists \n\tEachWO.ThisWOTotalTaxAs = 0;\n\t//below declares a key on the entire wo to hold THIS workorder's Tax B (for all items) so it exists\n\tEachWO.ThisWOTotalTaxBs = 0;\t\n\t//below declares a key on the entire wo to hold THIS workorder's Grand Total so it exists\n\tEachWO.ThisWOTotalGrand = 0;\n\n\t//below is to Iterate through each item of the wo's Items\n\tfor (Item of EachWO.Items)\n\t\t{\n\t\t\tItem.ThisItemAllLaborsNetViz = 0; //declare a key on the Item to hold all of this item's labor nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each labor record of the wo's Item\n\t\t\tfor (Labor of Item.Labors)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Labor.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllLaborsNetViz += Labor.NetViz; //this IS where the actual adding to running total for this WOItem's Net Labors\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOAllLaborsNetViz += Labor.NetViz; //this IS where the actual adding to the running total for this entire WO's Net Labors\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Labor.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Labor.TaxAViz; //this IS where the actual adding of Labor's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.TaxAViz; //this IS where the actual adding of Labor's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Labor.TaxBViz; //this IS where the actual adding of Labor's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.TaxBViz; //this IS where the actual adding of Labor's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\t\n\n\t\t\t\t\t\tEachGroup.GroupWOLaborsNetViz += Labor.NetViz; //this IS where the actual adding to the running total for this Group's entire WO's Net Labors\n\t\t\t\t\t\tEachGroup.GroupWOTotalNets += Labor.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS Group's workorders in this report data\n\t\t\t\t\t\tEachGroup.GroupWOTotalTaxAs += Labor.TaxAViz;\n\t\t\t\t\t\tEachGroup.GroupWOTotalTaxBs += Labor.TaxBViz;\n\t\t\t\t\t\tEachGroup.GroupWOTotalGrand += Labor.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS Group's workorders in this report data\n\t\t\t\t\t\tEachGroup.GroupWOTotalGrand += Labor.TaxAViz;\n\t\t\t\t\t\tEachGroup.GroupWOTotalGrand += Labor.TaxBViz;\n\t\t\t\t\t\t\n\t\t\t\t\t\treportData.AllWOLaborsNetViz += Labor.NetViz;\t//this IS where the actual adding to the running total for all labor for ALL workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Labor.NetViz; //this is where the actual adding to the running total for ALL workorders Nets in this report data\t\t\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalGrand += Labor.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Labor.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Labor.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Labor.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Labor.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllPartsNetViz = 0; //declare a key on the Item to hold all of this item's parts nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Part record of the wo's Item\n\t\t\tfor (Part of Item.Parts)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Part.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllPartsNetViz += Part.NetViz; //this IS where the actual adding to running total for this WOItem's Net Parts\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOAllPartsNetViz += Part.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Parts\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Part.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Part.TaxAViz; //this IS where the actual adding of Part's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Part.TaxBViz; //this IS where the actual adding of Part's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.TaxAViz; //this IS where the actual adding of Part's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.TaxBViz; //this IS where the actual adding of Part's Tax B to the running total for GrandTotal for THIS workorders in this report data\t\t\t\t\t\t\n\n\t\t\t\t\t\tEachGroup.GroupWOPartsNetViz += Part.NetViz;//this IS where the actual adding to the running total for this entire Groups WO's Net Parts\n\t\t\t\t\t\tEachGroup.GroupWOTotalNets += Part.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS Groups workorders in this report data\n\t\t\t\t\t\tEachGroup.GroupWOTotalTaxAs += Part.TaxAViz;\n\t\t\t\t\t\tEachGroup.GroupWOTotalTaxBs += Part.TaxBViz;\n\t\t\t\t\t\tEachGroup.GroupWOTotalGrand += Part.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS Groups workorders in this report data\t\n\t\t\t\t\t\tEachGroup.GroupWOTotalGrand += Part.TaxAViz;\n\t\t\t\t\t\tEachGroup.GroupWOTotalGrand += Part.TaxBViz;\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\treportData.AllWOPartsNetViz += Part.NetViz; //this IS where the actual adding to the running total for all Parts for all workorders in this report data\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Part.NetViz; //this is where the actual adding to the running total for all workorder Nets in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Part.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Part.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Part.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Part.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Part.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllTravelsNetViz = 0; //declare a key on the Item to hold all of this item's travel nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Travel record of the wo's Item\n\t\t\tfor (Travel of Item.Travels)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Travel.NetViz != null) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllTravelsNetViz += Travel.NetViz;//this IS where the actual adding to running total for this WOItem's Net Travels\n\n\t\t\t\t\t\tEachWO.ThisWOAllTravelsNetViz += Travel.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Travels\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Travel.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Travel.TaxAViz; //this IS where the actual adding of Travel's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Travel.TaxBViz; //this IS where the actual adding of Travel's Tax B to the running total for ALL Tax B for THIS workorders in this report data\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.TaxAViz; //this IS where the actual adding of Travel's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.TaxBViz; //this IS where the actual adding of Travel's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\n\t\t\t\t\t\tEachGroup.GroupWOTravelsNetViz += Travel.NetViz;//this IS where the actual adding to the running total for this entire Groups WO's Net Travels\n\t\t\t\t\t\tEachGroup.GroupWOTotalNets += Travel.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS Groups workorders in this report data\n\t\t\t\t\t\tEachGroup.GroupWOTotalTaxAs += Travel.TaxAViz;\n\t\t\t\t\t\tEachGroup.GroupWOTotalTaxBs += Travel.TaxBViz;\n\t\t\t\t\t\tEachGroup.GroupWOTotalGrand += Travel.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS Groups workorders in this report data\n\t\t\t\t\t\tEachGroup.GroupWOTotalGrand += Travel.TaxAViz;\n\t\t\t\t\t\tEachGroup.GroupWOTotalGrand += Travel.TaxBViz;\n\n\t\t\t\t\t\treportData.AllWOTravelsNetViz += Travel.NetViz;\t//this IS where the actual adding to the running total for all Travels for all workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Travel.NetViz; //this is where the actual adding to the running total for all workorder Nets in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Travel.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Travel.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Travel.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Travel.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Travel.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\t//note additional statements for misc expense to ONLY add to running totals if ChargeToCustomer is true\n\t\t\t\n\t\t\tItem.ThisItemAllExpsNetChargeAmount = 0; //declare a key on the Item to hold all of this item's misc nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Exp record of the wo's Item\n\t\t\tfor (Exp of Item.Expenses)\n\t\t\t{\n\t\t\t//if this expense has a ChargeAmount value AND the ChargeToCustomer is true then adds the ChargeAmount to running totals\n \tif (Exp.ChargeAmount != null && Exp.ChargeToCustomer == true) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to running total for this WOItem's Net Exps\n\t\t\t\t\t\tEachWO.ThisWOAllExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to the running total for this entire WO's Net ChargeAmounts\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Exp.ChargeAmount;//this IS where the actual adding to the running total for ALL NET ChargeAmountS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.ChargeAmount; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\n\t\t\t\t\t\tEachGroup.GroupWOExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to the running total for this entire Groups WO's Net ChargeAmounts\n\t\t\t\t\t\tEachGroup.GroupWOTotalNets += Exp.ChargeAmount;//this IS where the actual adding to the running total for ALL NET ChargeAmountS for THIS Groups workorders in this report data\n\t\t\t\t\t\tEachGroup.GroupWOTotalGrand += Exp.ChargeAmount; //this IS where the actual adding to the running total for GrandTotal for THIS Groups workorders in this report data\n\n\t\t\t\t\t\treportData.AllWOExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to the running total for all Exp ChargeAmount for all workorders in this report data\t\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Exp.ChargeAmount;//this is where the actual adding to the running total for all workorder Net ChargeAmount in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Exp.ChargeAmount; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t\t\n\n\t\t\t//if this expense the ChargeToCustomer is true AND ChargeTaxCode has a value then adds the TaxAViz and TaxBViz to running totals\t\t\n\t\t\t\t\tif (Exp.ChargeToCustomer == true && Exp.ChargeTaxCodeId != null ) \n \t \t{\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Exp.TaxAViz; //this IS where the actual adding of Exp's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxAViz; //this IS where the actual adding of Exp's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Exp.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Exp.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\tEachGroup.GroupWOTotalTaxAs += Exp.TaxAViz; //this IS where the actual adding of Exp's Tax A to the running total for ALL Tax As for THIS Groups workorders in this report data\n\t\t\t\t\t\tEachGroup.GroupWOTotalGrand += Exp.TaxAViz; //this IS where the actual adding of Exp's Tax A to the running total for GrandTotal for THIS Groups workorders in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Exp.TaxBViz; //this IS where the actual adding of Exp's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxBViz; //this IS where the actual adding of Exp's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Exp.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Exp.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\tEachGroup.GroupWOTotalTaxBs += Exp.TaxBViz; //this IS where the actual adding of Exp's Tax B to the running total for ALL Tax B for THIS Groups workorders in this report data\n\t\t\t\t\t\tEachGroup.GroupWOTotalGrand += Exp.TaxBViz; //this IS where the actual adding of Exp's Tax B to the running total for GrandTotal for THIS Groups workorders in this report data\n \t \t\t}\t\t\t\t\n\t\t\t\t\telse if (Exp.ChargeToCustomer == true && Exp.ChargeTaxCodeId == null ) //else if ChargeToCustomer is true AND ChargeTaxCodeID is null, then add TaxPaid to TaxA running total and Grand Total\t\t\n\t\t\t\t\t\t{\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Exp.TaxPaid; //this IS where the actual adding of Exp's TaxPaid to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxPaid; //this IS where the actual adding of Exp's TaxPaid to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\tEachGroup.GroupWOTotalTaxAs += Exp.TaxPaid; \n\t\t\t\t\t\tEachGroup.GroupWOTotalGrand += Exp.TaxPaid;\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Exp.TaxPaid; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Exp.TaxPaid; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\n\t\t\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t\n\t\t\tItem.ThisItemAllLoansNetViz = 0; //declare a key on the Item to hold all of this item's loans nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Loan record of the wo's Item\n\t\t\tfor (Loan of Item.Loans)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Loan.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllLoansNetViz += Loan.NetViz;//this IS where the actual adding to running total for this WOItem's Net Loans\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOAllLoansNetViz += Loan.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Loans\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Loan.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Loan.TaxBViz; //this IS where the actual adding of Loan's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.TaxBViz; //this IS where the actual adding of Loan's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Loan.TaxAViz; //this IS where the actual adding of Loan's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.TaxAViz; //this IS where the actual adding of Loan's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\n\t\t\t\t\t\tEachGroup.GroupWOLoansNetViz += Loan.NetViz;//this IS where the actual adding to the running total for this entire Groups WO's Net Loans\t\t\t\t\t\t\n\t\t\t\t\t\tEachGroup.GroupWOTotalNets += Loan.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS Groups workorders in this report data\n\t\t\t\t\t\tEachGroup.GroupWOTotalGrand += Loan.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS Groups workorders in this report data\t\n\t\t\t\t\t\tEachGroup.GroupWOTotalTaxAs += Loan.TaxAViz;\n\t\t\t\t\t\tEachGroup.GroupWOTotalGrand += Loan.TaxAViz;\n\t\t\t\t\t\tEachGroup.GroupWOTotalTaxBs += Loan.TaxBViz;\n\t\t\t\t\t\tEachGroup.GroupWOTotalGrand += Loan.TaxBViz;\t\t\t\t\t\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Loan.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Loan.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\t\n\t\t\t\t\t\treportData.AllWOLoansNetViz += Loan.NetViz;\t\t//this IS where the actual adding to the running total for all Loans for all workorders in this report data\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Loan.NetViz;//this is where the actual adding to the running total for all workorder Nets in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Loan.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Loan.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Loan.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllOutsidesNetViz = 0; //declare a key on the Item to hold all of this item's Outsie nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Outside record of the wo's Item\n\t\t\tfor (Outside of Item.OutsideServices)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Outside.NetViz != null) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllOutsidesNetViz += Outside.NetViz;//this IS where the actual adding to running total for this WOItem's Net Outside\n\t\t\t\t\t\tEachWO.ThisWOAllOutsidesNetViz += Outside.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Outsides\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Outside.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Outside.TaxAViz; //this IS where the actual adding of Outside's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.TaxAViz; //this IS where the actual adding of Outside's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Outside.TaxBViz; //this IS where the actual adding of Outside's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.TaxBViz; //this IS where the actual adding of Outside's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\n\t\t\t\t\t\tEachGroup.GroupWOOutsidesNetViz += Outside.NetViz;//this IS where the actual adding to the running total for this entire Groups WO's Net Outsides\n\t\t\t\t\t\tEachGroup.GroupWOTotalNets += Outside.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS Groups workorders in this report data\n\t\t\t\t\t\tEachGroup.GroupWOTotalTaxAs += Outside.TaxAViz;\n\t\t\t\t\t\tEachGroup.GroupWOTotalTaxBs += Outside.TaxBViz;\n\t\t\t\t\t\tEachGroup.GroupWOTotalGrand += Outside.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS Groups workorders in this report data\n\t\t\t\t\t\tEachGroup.GroupWOTotalGrand += Outside.TaxAViz;\n\t\t\t\t\t\tEachGroup.GroupWOTotalGrand += Outside.TaxBViz;\n\n\t\t\t\t\t\treportData.AllWOOutsidesNetViz += Outside.NetViz;\t//this IS where the actual adding to the running total for all Outside for all workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Outside.NetViz;//this is where the actual adding to the running total for all workorder Nets in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Outside.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\t\t\t\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Outside.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Outside.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\t\t\t\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Outside.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Outside.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\t\t}\n\t}\n}\n\t\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/util/RunProgram.cs b/server/AyaNova/util/RunProgram.cs index a5b63367..b17a638b 100644 --- a/server/AyaNova/util/RunProgram.cs +++ b/server/AyaNova/util/RunProgram.cs @@ -52,6 +52,8 @@ namespace AyaNova.Util // var FullRunCommand=$"/C {BackupUtilityCommand} {Arguments}"; //for Windows need to pass to cmd.exe because often have command line piping etc + + //todo: make this work when there are spaces with quotes etc var args = $"/C {cmd} {arguments}"; using (var process = new Process()) {