From d0aeab83d150bfb3f344385a6d1881495562299a Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 9 Sep 2020 17:47:22 +0000 Subject: [PATCH] --- docs/8.0/ayanova/docs/form-ay-report-edit.md | 21 ++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/docs/8.0/ayanova/docs/form-ay-report-edit.md b/docs/8.0/ayanova/docs/form-ay-report-edit.md index 769aa9ad..667cac52 100644 --- a/docs/8.0/ayanova/docs/form-ay-report-edit.md +++ b/docs/8.0/ayanova/docs/form-ay-report-edit.md @@ -101,19 +101,25 @@ The data provided to the report consists of the same fields visible in the user #### Localization -Localization is a *Client* responsibility in AyaNova. +Localization, the display of Dates, Times, Numbers and AyaNova translated text is a *Client* responsibility in AyaNova. The server is Locale agnostic and doesn't normally process data into localized format but rather leaves that to the Client AyaNova software running on the web browser. However, because reports are processed *at* the server, the server uses the locale information provided by the Client when requesting the report in the ayClientMetaData property in conjunction with the Helpers provided to localize the data to display according to the Client that requested the report. -Some reports are also generated outside of a Client session, for example when sending a report as an attachment in an email notification, in that case report defaults will be used. +Localizable values should display the same in a report as they do in the AyaNova user interface in the browser. -Date and time values: raw Date and time values are provided in the ayReportData object in UTC / GMT time and [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) universal time format. Helpers are used to display this data in the Client default format. +##### Date and time values -Currency / decimal: currency and decimal number values are provided in simple decimal notation and formatted for display using a Handlebars helper and the Client default format. +Date and time values are always stored at the server and provided in the ayReportData object in UTC / GMT time and [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) universal time format. The values are converted to the user's local time zone and display format in the AyaNova client software and reports. The `ayDateTime`, `ayDate` and `ayTime` Helpers are used to display this data in the Client default format and time zone. -Translations: translated text is displayed in the current logged in Client User's default Translation setting using a Handlebars helper. +##### Currency / decimal + +Currency and decimal number values are provided in simple decimal notation and formatted for display using the `ayCurrency` / `ayDecimal` Handlebars helpers and the Client default language and currency settings. + +##### Translations + +Translated text is displayed in the current logged in User's default Translation setting using the `ayT` Handlebars helper. ### ayClientMetaData @@ -246,7 +252,7 @@ Formats a raw DateTime stamp into a short time only (no date) in the locale form ## API Usage -Note that you can use the full power of the [AyaNova developer's API](api-intro.md) with your reports to bring in any data from anywhere in AyaNova as required. +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. The currently logged in User's API Bearer access token is provided for accessing API routes via the `ayClientMetaData.Authorization` value (see above). @@ -254,6 +260,7 @@ You should not store a static copy of an API Bearer access token or hard code it While it is possible to login via a script using alternate credentials and access the API with alternative access to the current logged in user, this opens a security hole as you would need to hard code credentials into the report script and is **absolutely NOT recommended**. + ### API convenience functions Two functions are provided with the report to assist with API usage from your ayPrepareData custom function: @@ -265,8 +272,6 @@ The ayGetFromAPI function works with GET routes in the API: ```async function ayGetFromAPI(route, token) {...``` - - *POST* The ayPostToAPI function works with POST routes in the API: