case 4137

This commit is contained in:
2022-03-10 19:58:45 +00:00
parent 304173317d
commit a4136f25a9
2 changed files with 30 additions and 1 deletions

View File

@@ -197,7 +197,7 @@ The report data provided comes directly from the Server and is not translated or
#### Custom fields in report data
In AyaNova an object can have up to 16 customizable fields of extra data. In the *SAMPLE DATA* area of the report editor interface you can see the custom field data, for example:
In AyaNova an object can have up to 16 customizable fields of extra data. In the _SAMPLE DATA_ area of the report editor interface you can see the custom field data, for example:
```json
"CustomFields": {
@@ -341,6 +341,26 @@ Format value as all capitals:
`{{ ayCaps ReportFieldName }}`
### ayConcat
Concatenates the given arguments into a string.
Arguments to the helper are either field names or static strings separated by a single space between each one.
The result of the helper is each argument's value appended to the end of the previous one. This means there are no spaces between them unless you add spacing arguments as in the first example below.
Used as the only helper on it's own:
`{{ ayConcat field1 ',' field2 '->' 'blue' someotherfield ' ' 'morestring' }}`
Would result in "contentsoffield1,contentsoffield2->bluecontentsofsomeotherfield morestring"
As an argument to _another_ helper:
`{{ ayBC (ayConcat 'workorder:' Serial ',' 'customer:' customerViz) '{ "bcid": "qrcode","includetext":true, "scale":3}' }}`
This example from a work order report would create a QR Code that contains text from multiple fields, e.g. "workorder:483,customer:XYZ accounting".
### ayCurrency
Formats a raw currency decimal value into a currency value formatted for the locale of the Client or server / report default

View File

@@ -133,6 +133,15 @@ function ayRegisterHelpers() {
} //eof
///////////////////////////////////////////
// Concat helper using
// https://stackoverflow.com/a/52571635/8939
//
Handlebars.registerHelper('ayConcat', function() {
arguments = [...arguments].slice(0, -1);
return arguments.join('');
});
//##################################### LOCALIZATION & TRANSLATION ###################################################
///////////////////////////////////////////