From 5b228b1d821351daf8c6c0710eaef41118080c9c Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 13 Oct 2021 17:44:34 +0000 Subject: [PATCH] Report designer refinement and docs --- docs/8.0/ayanova/docs/_placeholder.md | 2 +- docs/8.0/ayanova/docs/acc-service-rates.md | 2 +- docs/8.0/ayanova/docs/acc-tax-codes.md | 2 +- docs/8.0/ayanova/docs/acc-travel-rates.md | 2 +- docs/8.0/ayanova/docs/adm-attachments.md | 2 +- .../docs/adm-global-select-templates.md | 2 +- docs/8.0/ayanova/docs/adm-global-settings.md | 2 +- docs/8.0/ayanova/docs/adm-history.md | 2 +- docs/8.0/ayanova/docs/ay-about.md | 2 +- docs/8.0/ayanova/docs/ay-customize.md | 2 +- .../ayanova/docs/ay-data-list-column-view.md | 2 +- docs/8.0/ayanova/docs/ay-history.md | 2 +- docs/8.0/ayanova/docs/ay-log.md | 2 +- docs/8.0/ayanova/docs/ay-notification.md | 2 +- docs/8.0/ayanova/docs/ay-report-edit.md | 144 ++++++++++-------- docs/8.0/ayanova/docs/ay-review.md | 2 +- docs/8.0/ayanova/docs/cust-contacts.md | 2 +- docs/8.0/ayanova/docs/customer-csr.md | 2 +- docs/8.0/ayanova/docs/customer-notes.md | 2 +- docs/8.0/ayanova/docs/customer-workorders.md | 2 +- docs/8.0/ayanova/docs/customers.md | 2 +- docs/8.0/ayanova/docs/head-offices.md | 2 +- docs/8.0/ayanova/docs/home-dashboard.md | 2 +- docs/8.0/ayanova/docs/home-memos.md | 2 +- docs/8.0/ayanova/docs/home-reminders.md | 2 +- docs/8.0/ayanova/docs/home-reviews.md | 2 +- docs/8.0/ayanova/docs/home-translation.md | 2 +- docs/8.0/ayanova/docs/inv-part-assemblies.md | 2 +- .../docs/inv-part-inventory-transactions.md | 2 +- docs/8.0/ayanova/docs/inv-part-inventory.md | 2 +- docs/8.0/ayanova/docs/inv-part-requests.md | 2 +- docs/8.0/ayanova/docs/inv-part-serials.md | 2 +- .../8.0/ayanova/docs/inv-part-stock-levels.md | 2 +- docs/8.0/ayanova/docs/inv-part-warehouses.md | 2 +- docs/8.0/ayanova/docs/inv-parts.md | 2 +- .../docs/inv-purchase-order-receipts.md | 2 +- docs/8.0/ayanova/docs/inv-purchase-orders.md | 2 +- docs/8.0/ayanova/docs/ops-form-backup.md | 2 +- docs/8.0/ayanova/docs/ops-jobs.md | 2 +- docs/8.0/ayanova/docs/ops-log.md | 2 +- docs/8.0/ayanova/docs/ops-notify-queue.md | 2 +- docs/8.0/ayanova/docs/ops-server-state.md | 2 +- docs/8.0/ayanova/docs/svc-csr.md | 2 +- docs/8.0/ayanova/docs/svc-loaners.md | 2 +- docs/8.0/ayanova/docs/svc-meter-readings.md | 2 +- docs/8.0/ayanova/docs/svc-pms.md | 2 +- docs/8.0/ayanova/docs/svc-projects.md | 2 +- docs/8.0/ayanova/docs/svc-quotes.md | 2 +- docs/8.0/ayanova/docs/svc-task-groups.md | 2 +- docs/8.0/ayanova/docs/svc-unit-models.md | 2 +- docs/8.0/ayanova/docs/svc-units.md | 2 +- .../docs/svc-work-order-item-priority.md | 2 +- .../docs/svc-work-order-item-status.md | 2 +- .../8.0/ayanova/docs/svc-work-order-status.md | 2 +- docs/8.0/ayanova/docs/svc-workorders.md | 2 +- docs/8.0/ayanova/docs/vendors.md | 2 +- server/AyaNova/resource/rpt/ay-report.js | 58 +++++-- 57 files changed, 188 insertions(+), 124 deletions(-) diff --git a/docs/8.0/ayanova/docs/_placeholder.md b/docs/8.0/ayanova/docs/_placeholder.md index ed30ebdb..edc32f52 100644 --- a/docs/8.0/ayanova/docs/_placeholder.md +++ b/docs/8.0/ayanova/docs/_placeholder.md @@ -1,6 +1,6 @@ # PLACEHOLDER -[Incomplete - under construction] +[this document under construction / pre-release] #STANDARDS FOR AYANOVA DOCS diff --git a/docs/8.0/ayanova/docs/acc-service-rates.md b/docs/8.0/ayanova/docs/acc-service-rates.md index 129536e8..e3b64db7 100644 --- a/docs/8.0/ayanova/docs/acc-service-rates.md +++ b/docs/8.0/ayanova/docs/acc-service-rates.md @@ -1,6 +1,6 @@ # SERVICE RATES Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] Notes to include in docs: diff --git a/docs/8.0/ayanova/docs/acc-tax-codes.md b/docs/8.0/ayanova/docs/acc-tax-codes.md index 1860ced6..0d0211a9 100644 --- a/docs/8.0/ayanova/docs/acc-tax-codes.md +++ b/docs/8.0/ayanova/docs/acc-tax-codes.md @@ -1,6 +1,6 @@ # TAX CODES Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] Notes to include in docs: diff --git a/docs/8.0/ayanova/docs/acc-travel-rates.md b/docs/8.0/ayanova/docs/acc-travel-rates.md index 6c1dd6d4..7f50a93f 100644 --- a/docs/8.0/ayanova/docs/acc-travel-rates.md +++ b/docs/8.0/ayanova/docs/acc-travel-rates.md @@ -1,6 +1,6 @@ # TRAVEL RATES Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] Notes to include in docs: diff --git a/docs/8.0/ayanova/docs/adm-attachments.md b/docs/8.0/ayanova/docs/adm-attachments.md index 6447e417..e78685fb 100644 --- a/docs/8.0/ayanova/docs/adm-attachments.md +++ b/docs/8.0/ayanova/docs/adm-attachments.md @@ -1,6 +1,6 @@ # ATTACHMENTS Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] todo: insert note in docs (ops?) if upload won't work from a device and error not evident check in the AyaNova client error log under help-About and see if there is an error 413 related to the recent file (camera image) upload, as it's likely not AyaNova restricting but a intermediary front end setting, e.g. NGinX te about nginx somewhere or any front end when receive error 413 when attempt to upload a large attachment. diff --git a/docs/8.0/ayanova/docs/adm-global-select-templates.md b/docs/8.0/ayanova/docs/adm-global-select-templates.md index e5ab1e1b..6ae4cc39 100644 --- a/docs/8.0/ayanova/docs/adm-global-select-templates.md +++ b/docs/8.0/ayanova/docs/adm-global-select-templates.md @@ -4,5 +4,5 @@ This form is used to set the fields displayed and searched in select lists on fo -[Incomplete - under construction] +[this document under construction / pre-release] This setting is *required* and controls which [translation](adm-translations.md) of AyaNova is used to display program text to the current logged in user. diff --git a/docs/8.0/ayanova/docs/adm-global-settings.md b/docs/8.0/ayanova/docs/adm-global-settings.md index 029df015..a9f2b764 100644 --- a/docs/8.0/ayanova/docs/adm-global-settings.md +++ b/docs/8.0/ayanova/docs/adm-global-settings.md @@ -1,6 +1,6 @@ # ADM-GLOBAL-SETTINGS Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] ## Customer Access diff --git a/docs/8.0/ayanova/docs/adm-history.md b/docs/8.0/ayanova/docs/adm-history.md index 49c50e5e..2f90a861 100644 --- a/docs/8.0/ayanova/docs/adm-history.md +++ b/docs/8.0/ayanova/docs/adm-history.md @@ -1,3 +1,3 @@ # ADM-HISTORY Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/ay-about.md b/docs/8.0/ayanova/docs/ay-about.md index 8fe9a67a..1545bacf 100644 --- a/docs/8.0/ayanova/docs/ay-about.md +++ b/docs/8.0/ayanova/docs/ay-about.md @@ -1,3 +1,3 @@ # MISC-ABOUT Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/ay-customize.md b/docs/8.0/ayanova/docs/ay-customize.md index d68ca378..a3c77f6a 100644 --- a/docs/8.0/ayanova/docs/ay-customize.md +++ b/docs/8.0/ayanova/docs/ay-customize.md @@ -1,6 +1,6 @@ # USER CUSTOMIZE FORM Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] #STANDARDS FOR AYANOVA DOCS diff --git a/docs/8.0/ayanova/docs/ay-data-list-column-view.md b/docs/8.0/ayanova/docs/ay-data-list-column-view.md index 3c71df41..322fd0e5 100644 --- a/docs/8.0/ayanova/docs/ay-data-list-column-view.md +++ b/docs/8.0/ayanova/docs/ay-data-list-column-view.md @@ -1,3 +1,3 @@ # DATA-LIST-COLUMN-VIEW Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/ay-history.md b/docs/8.0/ayanova/docs/ay-history.md index d0bbd6b0..6cdd4226 100644 --- a/docs/8.0/ayanova/docs/ay-history.md +++ b/docs/8.0/ayanova/docs/ay-history.md @@ -1,3 +1,3 @@ # MISC-RECORD HISTORY Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/ay-log.md b/docs/8.0/ayanova/docs/ay-log.md index 5f9687a3..f9b85c15 100644 --- a/docs/8.0/ayanova/docs/ay-log.md +++ b/docs/8.0/ayanova/docs/ay-log.md @@ -1,3 +1,3 @@ # CLIENT LOG FORM HELP Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/ay-notification.md b/docs/8.0/ayanova/docs/ay-notification.md index 63b688cb..4bf2e290 100644 --- a/docs/8.0/ayanova/docs/ay-notification.md +++ b/docs/8.0/ayanova/docs/ay-notification.md @@ -1,3 +1,3 @@ # NOTIFICATION Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/ay-report-edit.md b/docs/8.0/ayanova/docs/ay-report-edit.md index d9cca4c5..3d8785d4 100644 --- a/docs/8.0/ayanova/docs/ay-report-edit.md +++ b/docs/8.0/ayanova/docs/ay-report-edit.md @@ -1,15 +1,15 @@ # REPORT TEMPLATE EDITOR -[Incomplete - under construction] +[this document under construction / pre-release] -AyaNova report templates are html based template documents that are used with the [Handlebars](https://handlebarsjs.com/) templating language to generate html documents that are rendered to .PDF [Portable document format](https://en.wikipedia.org/wiki/PDF) files. +AyaNova report templates are HTML based template documents that are used with the [Handlebars](https://handlebarsjs.com/) templating language to generate HTML documents that are rendered to .PDF [Portable document format](https://en.wikipedia.org/wiki/PDF) files. HTML and Javascript along with Handlebars templates are used to customize the existing reports in AyaNova and make new ones. AyaNova comes with a built in report template editor and reports can be created or customized directly within AyaNova. -## Render process +## How reports are rendered by AyaNova When a report is rendered the following steps take place behind the scenes: @@ -17,26 +17,20 @@ When a report is rendered the following steps take place behind the scenes: * The server retrieves the report template from the database, "re-hydrates" the business objects in memory and feeds the data to the report template to be processed by the Handlebars templating engine * The resulting HTML document is rendered and converted to a .PDF format document and a download URL is sent back to the user's browser to download and open the .pdf document. -### Linking directly to a rendered report - -The AyaNova client supports directly linking to a report in an URL, primarily for Customer notification purposes. Only single objects can be linked to for reporting, not lists of objects. - -The AyaNova client application expects report urls format as follows: `[PATH_TO_AYANOVA_APP_URL]/viewreport?oid=[objectid]&rid=[reportid]` - -If the user is not already logged in, they will be prompted to login first before the report is rendered. ## Report designer template sections -A report template contains several sections: +The report editor has several sections: ### Properties -These are the properties of the report outside of the actual report template itself: +These are the general properties of the report: -* `Name` the name of the report as it is displayed to users for selection. As with all named objects in AyaNova it must be unique, no two reports can have the same name. -* `Active` this controls report availability to users. Set to inactive to keep a report template in the databse but not make it available to users. -* `Roles` this sets which User Roles are allowed to access the report. (*Security note*: no matter what is set here, the server will still not provide data to a report if that data is outside of the Roles of the current user so reporting is not a way to get access to information that is not permitted for a User) -* `Notes` about the template, only displayed in the designer UI, usually reference notes for the people involved in designing the reports. +* `Name` the name of the report as it is displayed to users for selection; no two reports **for the same object type** can have the same name, however you can re-use a name for reports for different AyaNova Types +* `Who can select` this sets which User Roles are allowed to access the report. (*Security note*: no matter what is set here, the server will still not provide data to a report if that data is outside of the Roles of the current user so reporting is not a way to get access to information that is not permitted for a User) +* `Type` this controls the Type of AyaNova object for which this report will be offered as an option. This is useful for duplicating a report for use with a different type of object. For example if you have a report made for a Customer type object you can save a copy and change the Type to HeadOffice for use with a Head Office type object as the fields are almost identical so it will work for either object with only slight changes +* `Active` this controls report availability to users. Set to inactive to keep a report template in the databse but not make it available to users +* `Notes` about the template, only displayed in the designer UI, usually reference notes for the people involved in designing the reports ### PDF Options @@ -87,25 +81,25 @@ In order to get up to speed quickly with report design we recommend looking over ### CSS -This section is provided to define the HTML Cascading Style Sheet for the report document. This section is optional. +This section is provided to optionally define your own HTML Cascading Style Sheet for the report document. ### Prepare This section is provided as a way to change the data provided to the report *before* it is rendered. -Typically this function is used to retrieve and / or alter data that is fed to the report template. +Typically this function is used to retrieve and / or alter data that is fed to the report template. For example changing the data from a list of Customer Units to Group By Customer. Use of the `ayPrepareData` function is optional but the function *must* be present in it's default format even if not used as it is *always* called by the rendering process and will result in an error if missing. This is the minimum required default definition: ``` -async function ayPrepareData(ayAllData) { - return ayAllData; +async function ayPrepareData(ayData) { + return ayData; } ``` -`ayAllData` parameter is an object containing all data provided for the report and is detailed below in the Report Data Objects section. +`ayData` parameter is an object containing all data required to render the report and is detailed below in the [Report Data Objects](#report-data-objects) section. Note that the SAMPLE DATA section of the user interface in the report designer shows the raw data *before* it is passed to this function, not how it would look *after* this function is run. If you need to see how the data is shaped after a ayPrepareData you can make use of the `ayJSON` helper documented below to view the raw data on the rendered report itself. @@ -124,9 +118,10 @@ If you do not see this section it means the report designer was opened directly ## Report data objects -When a report template is processed, business object data is provided to the template along with other data. Some of this data is used internally by the provided helpers and you have full access to these data values in your templates and helper / pre-render scripts. +When a report template is processed, business object data is provided to the template along with other data. Some of this data is used internally by the provided helpers and you have full access to these data values in your templates, Handlebar helpers and PrepareData scripts. -The object provided has the following format: + +In the `ayPrepareData` function on the Prepare Data tab of the report designer the `ayData` parameter contains three properties detailed below you can use in preparing data: ```{ ayReportData:[...array of business object data...], @@ -135,9 +130,11 @@ The object provided has the following format: } ``` +In the report template section you must access these three variables by their names directly in your own Handlebars Helpers or in the report's Template. i.e. they are not contained within an object like they are in ayPrepareData but stand alone. + ### ayReportData -This is the main business object data provided to the template. It will be identical to the object you see in the `SAMPLE DATA` area of the report designer user interface and is fetched from the server using the same method that populates the report when rendered ensuring consistency between design and rendered report. +This is the main business object data provided to the template. It will be identical in format to the object you see in the `SAMPLE DATA` area of the report designer user interface and is fetched from the server using the same method that populates the report when rendered ensuring consistency between design and rendered report. Note that the Report Designer Sample Data section shows only a limited subset of the entire data that will be provided to the report as it is intended to be a quick sample to show the structure of that particular data, not all the records. It is *always* provided as an Array. In the case of a single object it will be an array of one, in the case of multiple objects it will be the same object definition but repeated for each object. @@ -147,6 +144,50 @@ For example if you are reporting off a Customer you would design a report that c The data provided to the report consists of the same fields visible in the user interface when editing that record and in addition, where appropriate, extra fields to bring in commonly required data from other objects that are linked. +### ayClientMetaData + +When a report is rendered some settings from AyaNova running at the User's browser are sent along with the report and are used as required to provide Translations and localized date, time and currency display formats as per the User's preferences as well as the current logged in User's API credential Bearer token and some other Client dependent settings. + +You can see what data is provided by using the ayJson helper as in the example above on the report. As of the time of this writing the current values provided are: + +``` +ayClientMetaData: +{ + "UserName": "AyaNova username", + "Authorization": "Bearer eJhbGciO...token...data...hb9JyjcWl3Tib", + "DownloadToken": "IslXKU....token....data...here....Bg2Vx0yT2rQ", + "TimeZoneName": "America/Los_Angeles", + "LanguageName": "en-US", + "Hour12": true, + "CurrencyName": "USD", + "DefaultLocale": "en" +} +``` +Most of these properties are intended to be used by the translation and localization [Helper utilities](#built-in-handlebars-helpers) we provide for reporting and some are useful for calling API methods via our [API convenience functions](#api-convenience-functions) provided + +### ayServerMetaData + +When a report is rendered some settings from the local AyaNova Server are injected into the report data and are used as required to access local server relative settings. For example the URL path to the local AyaNova server's API so that API methods can be called directly in the report template relative to the server's local path. + +You can see what data is provided by using the ayJson helper as in the example above on the report. As of the time of this writing the current values provided are: + +``` +ayServerMetaData: +{ + "ayApiUrl": "http://127.0.0.1:7575/api/v8/", + "HasSmallLogo": true, + "HasMediumLogo": true, + "HasLargeLogo": true +} +``` + +(Note: this is an example only, your server may be different) + +* ayApiUrl - this is the URL of the server relative to the report generator and is useful for calling AyaNova API methods in your prepare data function to bring in sources of information from other areas of AyaNova that might not be directly available to your report +* HasXXLogo - these keys are set to true if a Logo has been uploaded for each size to AyaNova and are useful for controlling whether or not to show a logo on a report template as can be seen in many of our sample reports + + + #### Custom fields In AyaNova an object can have up to 16 customizable fields of extra data. In the `SAMPLE DATA` area of the reported editor interface you can see the custom field data, for example: @@ -192,44 +233,10 @@ Currency and decimal number values are provided in simple decimal notation and f Translated text is displayed in the current logged in User's default Translation setting using the `ayT` Handlebars helper. -### ayClientMetaData -When a report is rendered some settings from the Client browser are sent along with the report and are used as required to localize date, time and currency display formats as well as the current logged in User's API credential Bearer token and some other Client dependent settings. +## Built in Handlebars helpers -You can see what data is provided by using the ayJson helper as in the example above on the report. As of the time of this writing the current values provided are: - -``` -ayClientMetaData: -{ - "UserName": "AyaNova username", - "Authorization": "Bearer eJhbGciO...token...data...hb9JyjcWl3Tib", - "TimeZoneName": "America/Los_Angeles", - "LanguageName": "en-US", - "Hour12": true, - "CurrencyName": "USD", - "DefaultLocale": "en" -} -``` - -### ayServerMetaData - -When a report is rendered some settings from the local AyaNova Server are injected into the report data and are used as required to access local server relative settings. For example the URL path to the local AyaNova server's API so that API methods can be called directly in the report template relative to the server's local path. - -You can see what data is provided by using the ayJson helper as in the example above on the report. As of the time of this writing the current values provided are: - -``` -ayServerMetaData: -{ - "ayApiUrl": "http://127.0.0.1:7575/api/v8/" -} -``` - -(Note: The value is an example only, your server may report a different value for the api url) - - -## Built in helpers - -Several helpers are pre-defined for use with reports: +Several Handlebars helpers are pre-defined for use with reports: ### ayBC @@ -347,6 +354,16 @@ Format a Wiki Markdown formatted field such as a Wiki field on an object into HT This is what you use to display a Wiki (or any Markdown formatted text) in a report. AyaNova uses the [Marked](https://marked.js.org/) library to turn Markdown into HTML for display both in the user interface and in reports. +## Built in utility functions + +AyaNova comes with some utility functions that you can call from your own helpers or ayPrepareData function. + +### Group by + +ayGroupByKey + + + ## API Usage Note that you can use the full power of the [AyaNova developer's API](api-intro.md) with your reports to incorporate data from anywhere in AyaNova as required. @@ -424,3 +441,10 @@ async function ayPrepareData(reportData) { +## How to link directly to a report + +The AyaNova client supports directly linking to a report in an URL, primarily for Customer notification purposes. Only single objects can be linked to for reporting, not lists of objects. + +The AyaNova client application expects report urls format as follows: `[PATH_TO_AYANOVA_APP_URL]/viewreport?oid=[objectid]&rid=[reportid]` + +If the user is not already logged in, they will be prompted to login first before the report is rendered. \ No newline at end of file diff --git a/docs/8.0/ayanova/docs/ay-review.md b/docs/8.0/ayanova/docs/ay-review.md index 5e61c856..7088bc53 100644 --- a/docs/8.0/ayanova/docs/ay-review.md +++ b/docs/8.0/ayanova/docs/ay-review.md @@ -1,3 +1,3 @@ # MISC-REVIEW (was followup) Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/cust-contacts.md b/docs/8.0/ayanova/docs/cust-contacts.md index 2af76725..d61a8ee4 100644 --- a/docs/8.0/ayanova/docs/cust-contacts.md +++ b/docs/8.0/ayanova/docs/cust-contacts.md @@ -1,5 +1,5 @@ # CUSTOMER-CONTACT Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] This form is used to manage Customer type Users known as "Contacts" in AyaNova. diff --git a/docs/8.0/ayanova/docs/customer-csr.md b/docs/8.0/ayanova/docs/customer-csr.md index f1ca948a..9576c9c8 100644 --- a/docs/8.0/ayanova/docs/customer-csr.md +++ b/docs/8.0/ayanova/docs/customer-csr.md @@ -1,3 +1,3 @@ # CUSTOMER-CSR Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/customer-notes.md b/docs/8.0/ayanova/docs/customer-notes.md index 91642c4c..9ea4872c 100644 --- a/docs/8.0/ayanova/docs/customer-notes.md +++ b/docs/8.0/ayanova/docs/customer-notes.md @@ -1,3 +1,3 @@ # CUST-CUSTOMER-NOTES Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/customer-workorders.md b/docs/8.0/ayanova/docs/customer-workorders.md index 116f19b2..45011046 100644 --- a/docs/8.0/ayanova/docs/customer-workorders.md +++ b/docs/8.0/ayanova/docs/customer-workorders.md @@ -1,3 +1,3 @@ # CUSTOMER-WORKORDERS Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/customers.md b/docs/8.0/ayanova/docs/customers.md index 2076d3bd..14121fee 100644 --- a/docs/8.0/ayanova/docs/customers.md +++ b/docs/8.0/ayanova/docs/customers.md @@ -1,6 +1,6 @@ # CUST-CUSTOMERS Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] todo: a standard link to general how to use the data-table at the top of every list help doc todo: a standard link to how to use controls at the top of every form doc diff --git a/docs/8.0/ayanova/docs/head-offices.md b/docs/8.0/ayanova/docs/head-offices.md index c630e4e4..ee7fd1b0 100644 --- a/docs/8.0/ayanova/docs/head-offices.md +++ b/docs/8.0/ayanova/docs/head-offices.md @@ -1,3 +1,3 @@ # CUST-HEADOFFICES Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/home-dashboard.md b/docs/8.0/ayanova/docs/home-dashboard.md index 937f3812..0778a8b3 100644 --- a/docs/8.0/ayanova/docs/home-dashboard.md +++ b/docs/8.0/ayanova/docs/home-dashboard.md @@ -1,3 +1,3 @@ # HOME-DASHBOARD Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/home-memos.md b/docs/8.0/ayanova/docs/home-memos.md index fe474491..0b239874 100644 --- a/docs/8.0/ayanova/docs/home-memos.md +++ b/docs/8.0/ayanova/docs/home-memos.md @@ -1,3 +1,3 @@ # HOME-MEMOS Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/home-reminders.md b/docs/8.0/ayanova/docs/home-reminders.md index 89f532ab..b416ef89 100644 --- a/docs/8.0/ayanova/docs/home-reminders.md +++ b/docs/8.0/ayanova/docs/home-reminders.md @@ -1,3 +1,3 @@ # HOME-REMINDERS Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/home-reviews.md b/docs/8.0/ayanova/docs/home-reviews.md index 67516283..04511926 100644 --- a/docs/8.0/ayanova/docs/home-reviews.md +++ b/docs/8.0/ayanova/docs/home-reviews.md @@ -1,6 +1,6 @@ # HOME-REVIEWS Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] notes: All users can see reviews assigned to them in their home menu diff --git a/docs/8.0/ayanova/docs/home-translation.md b/docs/8.0/ayanova/docs/home-translation.md index 61fd75a2..61546965 100644 --- a/docs/8.0/ayanova/docs/home-translation.md +++ b/docs/8.0/ayanova/docs/home-translation.md @@ -1,3 +1,3 @@ # HOME-TRANSLATION Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/inv-part-assemblies.md b/docs/8.0/ayanova/docs/inv-part-assemblies.md index e1d0c35d..281a1714 100644 --- a/docs/8.0/ayanova/docs/inv-part-assemblies.md +++ b/docs/8.0/ayanova/docs/inv-part-assemblies.md @@ -1,3 +1,3 @@ # INV-PART-ASSEMBLIES Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/inv-part-inventory-transactions.md b/docs/8.0/ayanova/docs/inv-part-inventory-transactions.md index 94d8b5db..6863bb66 100644 --- a/docs/8.0/ayanova/docs/inv-part-inventory-transactions.md +++ b/docs/8.0/ayanova/docs/inv-part-inventory-transactions.md @@ -1,3 +1,3 @@ # INV-TRANSACTIONS Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/inv-part-inventory.md b/docs/8.0/ayanova/docs/inv-part-inventory.md index 969dab87..f0043ce9 100644 --- a/docs/8.0/ayanova/docs/inv-part-inventory.md +++ b/docs/8.0/ayanova/docs/inv-part-inventory.md @@ -1,3 +1,3 @@ # INV-PART-INVENTORY Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/inv-part-requests.md b/docs/8.0/ayanova/docs/inv-part-requests.md index 23203715..c02dc4b6 100644 --- a/docs/8.0/ayanova/docs/inv-part-requests.md +++ b/docs/8.0/ayanova/docs/inv-part-requests.md @@ -1,3 +1,3 @@ # INV-PART-REQUESTS Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/inv-part-serials.md b/docs/8.0/ayanova/docs/inv-part-serials.md index 0d6c9eb6..0aaee17b 100644 --- a/docs/8.0/ayanova/docs/inv-part-serials.md +++ b/docs/8.0/ayanova/docs/inv-part-serials.md @@ -1,3 +1,3 @@ # INV-PART-SERIALS Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/inv-part-stock-levels.md b/docs/8.0/ayanova/docs/inv-part-stock-levels.md index f8a3ac9f..4c7a96df 100644 --- a/docs/8.0/ayanova/docs/inv-part-stock-levels.md +++ b/docs/8.0/ayanova/docs/inv-part-stock-levels.md @@ -1,3 +1,3 @@ # INV-PART-STOCK-LEVELS Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/inv-part-warehouses.md b/docs/8.0/ayanova/docs/inv-part-warehouses.md index f6df9b4f..85ca4e2d 100644 --- a/docs/8.0/ayanova/docs/inv-part-warehouses.md +++ b/docs/8.0/ayanova/docs/inv-part-warehouses.md @@ -1,3 +1,3 @@ # INV-PART-WAREHOUSES Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/inv-parts.md b/docs/8.0/ayanova/docs/inv-parts.md index 4a20711f..6e186c59 100644 --- a/docs/8.0/ayanova/docs/inv-parts.md +++ b/docs/8.0/ayanova/docs/inv-parts.md @@ -1,3 +1,3 @@ # INV-PARTS Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/inv-purchase-order-receipts.md b/docs/8.0/ayanova/docs/inv-purchase-order-receipts.md index ddaab9f8..2576eb10 100644 --- a/docs/8.0/ayanova/docs/inv-purchase-order-receipts.md +++ b/docs/8.0/ayanova/docs/inv-purchase-order-receipts.md @@ -1,3 +1,3 @@ # INV-PO-RECEIPTS Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/inv-purchase-orders.md b/docs/8.0/ayanova/docs/inv-purchase-orders.md index 8dfd4108..56d88949 100644 --- a/docs/8.0/ayanova/docs/inv-purchase-orders.md +++ b/docs/8.0/ayanova/docs/inv-purchase-orders.md @@ -1,6 +1,6 @@ # INV-POS Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] ## OVERVIEW diff --git a/docs/8.0/ayanova/docs/ops-form-backup.md b/docs/8.0/ayanova/docs/ops-form-backup.md index 4b9e7a03..86ad6120 100644 --- a/docs/8.0/ayanova/docs/ops-form-backup.md +++ b/docs/8.0/ayanova/docs/ops-form-backup.md @@ -1,6 +1,6 @@ # OPERATIONS BACKUP FORM -[Incomplete - under construction] +[this document under construction / pre-release] AyaNova can automatically back up to the local file system once per day at a selected time. diff --git a/docs/8.0/ayanova/docs/ops-jobs.md b/docs/8.0/ayanova/docs/ops-jobs.md index ba3d24f0..38007860 100644 --- a/docs/8.0/ayanova/docs/ops-jobs.md +++ b/docs/8.0/ayanova/docs/ops-jobs.md @@ -1,3 +1,3 @@ # OPS-JOBS Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/ops-log.md b/docs/8.0/ayanova/docs/ops-log.md index a77cc3b4..17cf2529 100644 --- a/docs/8.0/ayanova/docs/ops-log.md +++ b/docs/8.0/ayanova/docs/ops-log.md @@ -1,3 +1,3 @@ # OPS-LOG Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/ops-notify-queue.md b/docs/8.0/ayanova/docs/ops-notify-queue.md index 3c78a953..459de851 100644 --- a/docs/8.0/ayanova/docs/ops-notify-queue.md +++ b/docs/8.0/ayanova/docs/ops-notify-queue.md @@ -1,3 +1,3 @@ # OPS-NOTIFY-QUEUE Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/ops-server-state.md b/docs/8.0/ayanova/docs/ops-server-state.md index 42967fd2..21eff9af 100644 --- a/docs/8.0/ayanova/docs/ops-server-state.md +++ b/docs/8.0/ayanova/docs/ops-server-state.md @@ -1,3 +1,3 @@ # OPS SERVER STATE -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/svc-csr.md b/docs/8.0/ayanova/docs/svc-csr.md index c0be3be7..a8e00d40 100644 --- a/docs/8.0/ayanova/docs/svc-csr.md +++ b/docs/8.0/ayanova/docs/svc-csr.md @@ -1,3 +1,3 @@ # SVC-CSR Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/svc-loaners.md b/docs/8.0/ayanova/docs/svc-loaners.md index ddceb50d..dae9db57 100644 --- a/docs/8.0/ayanova/docs/svc-loaners.md +++ b/docs/8.0/ayanova/docs/svc-loaners.md @@ -1,6 +1,6 @@ # SVC-LOANERS Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] ## Shadow units diff --git a/docs/8.0/ayanova/docs/svc-meter-readings.md b/docs/8.0/ayanova/docs/svc-meter-readings.md index 3281205f..0803ce33 100644 --- a/docs/8.0/ayanova/docs/svc-meter-readings.md +++ b/docs/8.0/ayanova/docs/svc-meter-readings.md @@ -1,3 +1,3 @@ # SVC-METER-READINGS Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/svc-pms.md b/docs/8.0/ayanova/docs/svc-pms.md index 218fb863..b071b0b3 100644 --- a/docs/8.0/ayanova/docs/svc-pms.md +++ b/docs/8.0/ayanova/docs/svc-pms.md @@ -1,6 +1,6 @@ # SVC-PMs Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] ### Automatic date calculations diff --git a/docs/8.0/ayanova/docs/svc-projects.md b/docs/8.0/ayanova/docs/svc-projects.md index f158efe4..4d9abe49 100644 --- a/docs/8.0/ayanova/docs/svc-projects.md +++ b/docs/8.0/ayanova/docs/svc-projects.md @@ -1,3 +1,3 @@ # SVC-PROJECTS Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/svc-quotes.md b/docs/8.0/ayanova/docs/svc-quotes.md index 08005e46..e52efa4b 100644 --- a/docs/8.0/ayanova/docs/svc-quotes.md +++ b/docs/8.0/ayanova/docs/svc-quotes.md @@ -1,5 +1,5 @@ # SVC-QUOTES Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] Notes for docs: diff --git a/docs/8.0/ayanova/docs/svc-task-groups.md b/docs/8.0/ayanova/docs/svc-task-groups.md index 0f7fb726..eb5680d9 100644 --- a/docs/8.0/ayanova/docs/svc-task-groups.md +++ b/docs/8.0/ayanova/docs/svc-task-groups.md @@ -1,3 +1,3 @@ # SVC-TASK-GROUPS Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/svc-unit-models.md b/docs/8.0/ayanova/docs/svc-unit-models.md index d0ace78c..f6b14e65 100644 --- a/docs/8.0/ayanova/docs/svc-unit-models.md +++ b/docs/8.0/ayanova/docs/svc-unit-models.md @@ -1,3 +1,3 @@ # SVC-UNIT-MODELS Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/svc-units.md b/docs/8.0/ayanova/docs/svc-units.md index 29c590ad..c30234ea 100644 --- a/docs/8.0/ayanova/docs/svc-units.md +++ b/docs/8.0/ayanova/docs/svc-units.md @@ -1,3 +1,3 @@ # SVC-UNITS Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/svc-work-order-item-priority.md b/docs/8.0/ayanova/docs/svc-work-order-item-priority.md index 16989a53..0a072762 100644 --- a/docs/8.0/ayanova/docs/svc-work-order-item-priority.md +++ b/docs/8.0/ayanova/docs/svc-work-order-item-priority.md @@ -1,4 +1,4 @@ # svc-work-order-item-priority Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/svc-work-order-item-status.md b/docs/8.0/ayanova/docs/svc-work-order-item-status.md index 6f238031..837a0235 100644 --- a/docs/8.0/ayanova/docs/svc-work-order-item-status.md +++ b/docs/8.0/ayanova/docs/svc-work-order-item-status.md @@ -1,4 +1,4 @@ # svc-work-order-item-status Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/docs/8.0/ayanova/docs/svc-work-order-status.md b/docs/8.0/ayanova/docs/svc-work-order-status.md index 59ffb196..02e9036f 100644 --- a/docs/8.0/ayanova/docs/svc-work-order-status.md +++ b/docs/8.0/ayanova/docs/svc-work-order-status.md @@ -1,6 +1,6 @@ # svc-work-order-status Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] todo: locking - locks workorder from edit (other than status for roles that are in status can remove) todo: completed - used for notification processing diff --git a/docs/8.0/ayanova/docs/svc-workorders.md b/docs/8.0/ayanova/docs/svc-workorders.md index 2b28ebac..6a1e6db3 100644 --- a/docs/8.0/ayanova/docs/svc-workorders.md +++ b/docs/8.0/ayanova/docs/svc-workorders.md @@ -1,6 +1,6 @@ # SVC-WORKORDERS Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] docs / sections required diff --git a/docs/8.0/ayanova/docs/vendors.md b/docs/8.0/ayanova/docs/vendors.md index d7031fa1..11b727ea 100644 --- a/docs/8.0/ayanova/docs/vendors.md +++ b/docs/8.0/ayanova/docs/vendors.md @@ -1,3 +1,3 @@ # VENDORS Placeholder -[Incomplete - under construction] +[this document under construction / pre-release] diff --git a/server/AyaNova/resource/rpt/ay-report.js b/server/AyaNova/resource/rpt/ay-report.js index f6a673c9..c510a0a8 100644 --- a/server/AyaNova/resource/rpt/ay-report.js +++ b/server/AyaNova/resource/rpt/ay-report.js @@ -3,15 +3,17 @@ let PreParedReportDataObject = null; ////////////////////////////////// // Pre render function // -async function ayPreRender(ayAllData) { +async function ayPreRender(ayData) { if (typeof ayPrepareData === "function") { - PreParedReportDataObject = await ayPrepareData(ayAllData); + PreParedReportDataObject = await ayPrepareData(ayData); } else { - PreParedReportDataObject = ayAllData; + PreParedReportDataObject = ayData; } return true; } +//##################################### HANDLEBARS HELPERS ################################################### + /////////////////////////////////////// // Set our stock handlebars helpers // @@ -129,6 +131,9 @@ function ayRegisterHelpers() { }); } //eof + +//##################################### LOCALIZATION & TRANSLATION ################################################### + /////////////////////////////////////////// // Turn a utc date into a displayable // short date and time @@ -264,6 +269,9 @@ async function ayGetTranslations(keys) { } } + +//##################################### API UTILITIES ################################################### + /////////////////////////////////// // GET DATA FROM API SERVER // @@ -318,12 +326,6 @@ async function ayPostToAPI(route, data, token) { } } -//Utils -function ayPad(n, width, z) { - z = z || "0"; - n = n + ""; - return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n; -} ///////////////////////////// // attachment download URL @@ -345,3 +347,41 @@ function attachmentDownloadUrl(fileId, ctype) { return AYMETA.ayServerMetaData.ayApiUrl + url; } + +//##################################### CODE UTILITIES ################################################### + +///////////////////////////////////////////////////////// +// Group by function +// reshapes input array into a new array grouped with +// a key named "group" with that group's key value +// and a key named "items" to contain all items +// for that group and also a "count" of items added +// +// +function ayGroupByKey(reportDataArray, groupByKeyName) { + //array to hold grouped data + const ret = []; + //iterate through the raw reprot data + for (let i = 0; i < reportDataArray.length; i++) { + //search the ret array for a group with this name and if found return a reference to that group object + let groupObject = ret.find(z => z.group == reportDataArray[i][groupByKeyName]); + if (groupObject != undefined) { + //there is already a matching group in the return array so just push this raw report data record into it + groupObject.items.push(reportDataArray[i]); + //update the count for this group's items + groupObject.count++; + } else { + //No group yet, so start a new one in the ret array and push this raw report data record + ret.push({ group: reportDataArray[i][groupByKeyName], items: [reportDataArray[i]], count: 1 }); + } + } + return ret; +} + +//Utils +function ayPad(n, width, z) { + z = z || "0"; + n = n + ""; + return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n; +} +