This commit is contained in:
2021-11-23 00:06:39 +00:00
parent ee21fff64e
commit 64ea86e036
15 changed files with 20 additions and 20 deletions

View File

@@ -116,10 +116,10 @@ namespace AyaNova.Biz
var partNames = await PickListFetcher.GetResponseAsync(PickList, null, null, true, partIdList, null, ct, null,string.Empty);
foreach (PartAssemblyItem pai in ret.Items)
{
pai.PartViz = partNames.Where(z => z.Id == pai.PartId).First().Name;
pai.PartNameViz = partNames.Where(z => z.Id == pai.PartId).First().Name;
}
//sort in place by partviz
ret.Items.Sort((lhs, rhs) => lhs.PartViz.CompareTo(rhs.PartViz));
//sort in place by partnameviz
ret.Items.Sort((lhs, rhs) => lhs.PartNameViz.CompareTo(rhs.PartNameViz));
}
return ret;
@@ -354,7 +354,7 @@ namespace AyaNova.Biz
private async Task PopulateVizFields(PartAssembly pa)
{
foreach (PartAssemblyItem o in pa.Items)
o.PartViz = await ct.Part.AsNoTracking().Where(x => x.Id == o.PartId).Select(x => x.Name).FirstOrDefaultAsync();
o.PartNameViz = await ct.Part.AsNoTracking().Where(x => x.Id == o.PartId).Select(x => x.Name).FirstOrDefaultAsync();
}

View File

@@ -293,8 +293,8 @@ namespace AyaNova.Biz
//populate viz fields from provided object
private async Task PopulateVizFields(PartInventory o, List<NameIdItem> ayaTypesEnumList, System.Data.Common.DbCommand cmd)
{
var partInfo = await ct.Part.AsNoTracking().Where(x => x.Id == o.PartId).Select(x => new { partViz = x.Description, partNameViz = x.Name, partUPCViz = x.UPC }).FirstOrDefaultAsync();
o.PartDescriptionViz = partInfo.partViz;
var partInfo = await ct.Part.AsNoTracking().Where(x => x.Id == o.PartId).Select(x => new { PartDescriptionViz = x.Description, partNameViz = x.Name, partUPCViz = x.UPC }).FirstOrDefaultAsync();
o.PartDescriptionViz = partInfo.PartDescriptionViz;
o.PartNameViz = partInfo.partNameViz;
o.PartUpcViz = partInfo.partUPCViz;

View File

@@ -180,8 +180,8 @@ namespace AyaNova.Biz
{
var partInfo = await ct.Part.AsNoTracking().Where(x => x.Id == item.PartId).Select(x => new { partViz = x.Description, partNameViz = x.Name, partUPCViz=x.UPC, partunitofmeasureviz = x.UnitOfMeasure, partmanufacturernumber = x.ManufacturerNumber }).FirstOrDefaultAsync();
item.PartDescriptionViz = partInfo.partViz;
var partInfo = await ct.Part.AsNoTracking().Where(x => x.Id == item.PartId).Select(x => new { PartDescriptionViz = x.Description, partNameViz = x.Name, partUPCViz=x.UPC, partunitofmeasureviz = x.UnitOfMeasure, partmanufacturernumber = x.ManufacturerNumber }).FirstOrDefaultAsync();
item.PartDescriptionViz = partInfo.PartDescriptionViz;
item.PartNameViz = partInfo.partNameViz;
item.UpcViz=partInfo.partUPCViz;
item.PartUnitOfMeasureViz = partInfo.partunitofmeasureviz;

View File

@@ -16,7 +16,7 @@ namespace AyaNova.Models
[Required]
public long PartId { get; set; }
[NotMapped]
public string PartViz { get; set; }
public string PartNameViz { get; set; }
[Required]
public decimal Quantity { get; set; }

View File

@@ -1 +1 @@
{"Name":"💡109x EXAMPLE PO Basic table layout ","Active":true,"Notes":"example of displaying a Parent value when the #each references a Child, use a ../ in front of the Property name in the mustaches\nexample PDF Options Header & Footer; ","Roles":124927,"AType":26,"IncludeWoItemDescendants":false,"Template":"<html>\n<body>\t\n\t<table>\t\t\n\t<thead><!-- this indicates start of your table header section -->\n\t\t<tr><!-- this indicates start of one row in your thead -->\n\t\t\t<th>column header 1</th> <!-- The text in <th> elements are bold and centered by default, can also override by setting specifics in your CSS -->\n\t\t\t<th>column header 2</th>\n\t\t\t<th>column header 3</th>\n\t\t\t<th>column header 4</th>\n\t\t</tr><!-- this indicates end of that one row in your thead -->\n\t</thead><!-- this indicates end of your table header section -->\n\t{{#each ayReportData}}<!-- this #each encompasses the area that repeats for each object (i.e. each PO) in your Sample Data -->\n\t<!-- if want the header repeated for every PO, the #each to encompass the thead area too, otherwise encompass the tbody -->\t\n\t<tbody>\t<!-- this indicates start of your table body section -->\t\n\t\t{{#each Items}} <!-- this #each encompasses the area that repeats for each Child object (i.e. each PO Item) in your Sample Data -->\n\t\t\t<tr><!-- this indicates start of one row in your tbody -->\n\t\t\t\t<td>TBODY PO# {{../Serial}}</td> <!-- to display a Parent value when the #each references a Child, use a ../ in front of the Property name in the mustaches -->\n\t\t\t\t<td class=\"fontgreen\">TBODY Part #: {{PartViz}} </td> <!-- to display a value when the #each references a Child, encompass the Property name in mustaches -->\n\t\t\t\t<td>TBODY Qty Ordered: {{QuantityOrdered}}</td><!-- The text in <td> elements are regular and left-aligned by default, can also set specifics in your CSS -->\n\t\t\t\t<td>TBODY Serials: {{Serials}}</td><!-- in this instance, Serials with an S refers to the serials received for that PO Item -->\n\t\t\t</tr>\n\t\t{{/each}}<!-- this closes the emcompassed area that repeats for each Child object (i.e. each PO Item) in your Sample Data -->\t\t\n\t</tbody><!-- this indicates end of your table body section -->\n\t{{/each}}<!-- this closes the emcompassed area that repeats for each object (i.e. each PO) in your Sample Data -->\n\t<tfoot class=\"footertext\"><!-- this applies specific CSS class attributes to all of tfoot and its td's -->\n\t\t<tr>\n\t\t\t<td>footer stuff 1</td>\n\t\t\t<td colspan=\"2\">expands across two columns with or without having to have text</td><!-- this inline colspan spans multiple columns -->\n\t\t\t<td>footer stuff 3</td>\n\t\t</tr>\n\t</tfoot><!-- this indicates end of your table footer section -->\t\t\n\t</table>\t\t\n</body>\n</html>","Style":"table { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 18pt;\n width: 100%;\n }\n\ntbody tr {\n width: 100%;\n}\n\ntbody tr:nth-child(even) {\n font-size: 10pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n} \ntbody tr:nth-child(odd) {\n font-size: 10pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\n} \n.footertext {\n font-size: 20pt;\n font-style: italic;\n background-color: pink;\n}\n\n.fontgreen {\n color: green;\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 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":"<span style=\"font-size:6pt;width: 94%; text-align:left; \">&nbsp;&nbsp;&nbsp;&nbsp;Todays date:&nbsp; <span class=\"date\"></span>&nbsp; set in PDF Options</span>","FooterTemplate":"<span style=\"font-size:6pt;width: 94%; text-align: right; \">&nbsp; set in PDF Options&nbsp;&nbsp;Page&nbsp;<span class=\"pageNumber\"></span>&nbsp;of&nbsp;<span class=\"totalPages\"></span>&nbsp;&nbsp;&nbsp;&nbsp;</span>","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"15mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000}
{"Name":"💡109x EXAMPLE PO Basic table layout ","Active":true,"Notes":"example of displaying a Parent value when the #each references a Child, use a ../ in front of the Property name in the mustaches\nexample PDF Options Header & Footer; ","Roles":124927,"AType":26,"IncludeWoItemDescendants":false,"Template":"<html>\n<body>\t\n\t<table>\t\t\n\t<thead><!-- this indicates start of your table header section -->\n\t\t<tr><!-- this indicates start of one row in your thead -->\n\t\t\t<th>column header 1</th> <!-- The text in <th> elements are bold and centered by default, can also override by setting specifics in your CSS -->\n\t\t\t<th>column header 2</th>\n\t\t\t<th>column header 3</th>\n\t\t\t<th>column header 4</th>\n\t\t</tr><!-- this indicates end of that one row in your thead -->\n\t</thead><!-- this indicates end of your table header section -->\n\t{{#each ayReportData}}<!-- this #each encompasses the area that repeats for each object (i.e. each PO) in your Sample Data -->\n\t<!-- if want the header repeated for every PO, the #each to encompass the thead area too, otherwise encompass the tbody -->\t\n\t<tbody>\t<!-- this indicates start of your table body section -->\t\n\t\t{{#each Items}} <!-- this #each encompasses the area that repeats for each Child object (i.e. each PO Item) in your Sample Data -->\n\t\t\t<tr><!-- this indicates start of one row in your tbody -->\n\t\t\t\t<td>TBODY PO# {{../Serial}}</td> <!-- to display a Parent value when the #each references a Child, use a ../ in front of the Property name in the mustaches -->\n\t\t\t\t<td class=\"fontgreen\">TBODY Part #: {{PartNameViz}} </td> <!-- to display a value when the #each references a Child, encompass the Property name in mustaches -->\n\t\t\t\t<td>TBODY Qty Ordered: {{QuantityOrdered}}</td><!-- The text in <td> elements are regular and left-aligned by default, can also set specifics in your CSS -->\n\t\t\t\t<td>TBODY Serials: {{Serials}}</td><!-- in this instance, Serials with an S refers to the serials received for that PO Item -->\n\t\t\t</tr>\n\t\t{{/each}}<!-- this closes the emcompassed area that repeats for each Child object (i.e. each PO Item) in your Sample Data -->\t\t\n\t</tbody><!-- this indicates end of your table body section -->\n\t{{/each}}<!-- this closes the emcompassed area that repeats for each object (i.e. each PO) in your Sample Data -->\n\t<tfoot class=\"footertext\"><!-- this applies specific CSS class attributes to all of tfoot and its td's -->\n\t\t<tr>\n\t\t\t<td>footer stuff 1</td>\n\t\t\t<td colspan=\"2\">expands across two columns with or without having to have text</td><!-- this inline colspan spans multiple columns -->\n\t\t\t<td>footer stuff 3</td>\n\t\t</tr>\n\t</tfoot><!-- this indicates end of your table footer section -->\t\t\n\t</table>\t\t\n</body>\n</html>","Style":"table { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 18pt;\n width: 100%;\n }\n\ntbody tr {\n width: 100%;\n}\n\ntbody tr:nth-child(even) {\n font-size: 10pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n} \ntbody tr:nth-child(odd) {\n font-size: 10pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\n} \n.footertext {\n font-size: 20pt;\n font-style: italic;\n background-color: pink;\n}\n\n.fontgreen {\n color: green;\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 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":"<span style=\"font-size:6pt;width: 94%; text-align:left; \">&nbsp;&nbsp;&nbsp;&nbsp;Todays date:&nbsp; <span class=\"date\"></span>&nbsp; set in PDF Options</span>","FooterTemplate":"<span style=\"font-size:6pt;width: 94%; text-align: right; \">&nbsp; set in PDF Options&nbsp;&nbsp;Page&nbsp;<span class=\"pageNumber\"></span>&nbsp;of&nbsp;<span class=\"totalPages\"></span>&nbsp;&nbsp;&nbsp;&nbsp;</span>","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"15mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000}

View File

@@ -1 +1 @@
{"Name":"💡109x EXAMPLE PO comparing qty ordered to qty received for each poitem","Active":true,"Notes":"example custom Helper if_eq to compare ordered to received, if same show in green. if NOT same, show in red.\nexample use of HTML if else /if - if serials present then show, else show preset text","Roles":124927,"AType":26,"IncludeWoItemDescendants":false,"Template":"<html>\n<body>\n\t\n\t<table>\n \n <thead>\n <tr>\n <td>PO#:</td>\n <td>Part#:</td>\n <td>QTY Ordered:</td>\n <td>QTY Received:</td>\n <td>Serials Received:</td>\n </tr>\n </thead>\n {{#each ayReportData}}\n <tbody> \n {{#each Items}} \n <tr> <!--note the additional Helper created #if_eq with which to do a direct comparison -->\n <td>{{../Serial}}</td> <!-- reference the 'parent' scope by placing ../ in front of the property name -->\n <td>{{PartViz}} </td> <!-- whereas this is within 'Items' so no prefix of ../ -->\n <td>{{QuantityOrdered}}</td>\n\n <!-- if_eq else statements below basically does: if received equals ordered display in green, if not equal, displays in red -->\n {{#if_eq QuantityOrdered QuantityReceived}}<td class=\"fontgreen\">same as ordered {{QuantityReceived}}</td> {{else}}<td class=\"fontred\">different than ordered {{QuantityReceived}}</td>{{/if_eq}}\n\t\t\t\t\t<!-- if else statements below basically does: if poitem has any serial numbers display, else if no serial display that preset text in red -->\n {{#if Serials}}<td>{{Serials}}</td>{{else}}<td class=\"fontblue\">no serials documented</td>{{/if}}\n </tr>\n {{/each}}\n </tbody>\n {{/each}}\n </table>\n\t\n</body>\n</html>","Style":".example {\n color: blue;\n}\n\ntable { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 16pt;\n width: 100%;\n }\n\ntbody td {\n width: 20%; /* spans each column even width */\n}\n\ntbody tr:nth-child(even) {\n font-size: 10pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n} \ntbody tr:nth-child(odd) {\n font-size: 10pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\n} \n\n.fontgreen {\n color: green;\n}\n.fontblue {\n color: blue;\n}\n.fontred {\n color:red;\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 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})\n\n//custom helper so can do a direct comparison - i.e. if value equals xxxx, then show, else show yyyyy\n//note that this HAS to be added here in Helpers, is NOT built in\nHandlebars.registerHelper('if_eq', function(a, b, opts) {\n if(a == b) // Or === depending on your needs\n return opts.fn(this);\n else\n return opts.inverse(this);\n});\n","RenderType":0,"HeaderTemplate":null,"FooterTemplate":null,"DisplayHeaderFooter":false,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"15mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000}
{"Name":"💡109x EXAMPLE PO comparing qty ordered to qty received for each poitem","Active":true,"Notes":"example custom Helper if_eq to compare ordered to received, if same show in green. if NOT same, show in red.\nexample use of HTML if else /if - if serials present then show, else show preset text","Roles":124927,"AType":26,"IncludeWoItemDescendants":false,"Template":"<html>\n<body>\n\t\n\t<table>\n \n <thead>\n <tr>\n <td>PO#:</td>\n <td>Part#:</td>\n <td>QTY Ordered:</td>\n <td>QTY Received:</td>\n <td>Serials Received:</td>\n </tr>\n </thead>\n {{#each ayReportData}}\n <tbody> \n {{#each Items}} \n <tr> <!--note the additional Helper created #if_eq with which to do a direct comparison -->\n <td>{{../Serial}}</td> <!-- reference the 'parent' scope by placing ../ in front of the property name -->\n <td>{{PartNameViz}} </td> <!-- whereas this is within 'Items' so no prefix of ../ -->\n <td>{{QuantityOrdered}}</td>\n\n <!-- if_eq else statements below basically does: if received equals ordered display in green, if not equal, displays in red -->\n {{#if_eq QuantityOrdered QuantityReceived}}<td class=\"fontgreen\">same as ordered {{QuantityReceived}}</td> {{else}}<td class=\"fontred\">different than ordered {{QuantityReceived}}</td>{{/if_eq}}\n\t\t\t\t\t<!-- if else statements below basically does: if poitem has any serial numbers display, else if no serial display that preset text in red -->\n {{#if Serials}}<td>{{Serials}}</td>{{else}}<td class=\"fontblue\">no serials documented</td>{{/if}}\n </tr>\n {{/each}}\n </tbody>\n {{/each}}\n </table>\n\t\n</body>\n</html>","Style":".example {\n color: blue;\n}\n\ntable { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 16pt;\n width: 100%;\n }\n\ntbody td {\n width: 20%; /* spans each column even width */\n}\n\ntbody tr:nth-child(even) {\n font-size: 10pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n} \ntbody tr:nth-child(odd) {\n font-size: 10pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\n} \n\n.fontgreen {\n color: green;\n}\n.fontblue {\n color: blue;\n}\n.fontred {\n color:red;\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 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})\n\n//custom helper so can do a direct comparison - i.e. if value equals xxxx, then show, else show yyyyy\n//note that this HAS to be added here in Helpers, is NOT built in\nHandlebars.registerHelper('if_eq', function(a, b, opts) {\n if(a == b) // Or === depending on your needs\n return opts.fn(this);\n else\n return opts.inverse(this);\n});\n","RenderType":0,"HeaderTemplate":null,"FooterTemplate":null,"DisplayHeaderFooter":false,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"15mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000}

View File

@@ -1 +1 @@
{"Name":"💡109x EXAMPLE PO show parent value AND child value on SAME row","Active":true,"Notes":"example HTML mustache for displaying parent property (i.e. the PO number) when \"in\" Child iteration (PO items)","Roles":124927,"AType":26,"IncludeWoItemDescendants":false,"Template":"<html>\n<body>\n\t\n\t<table>\n {{#each ayReportData}}\n <thead>\n <tr>\n <td>MAIN HEADER PO#: {{Serial}}</td> <!-- note NO ../ in front of the variable name here as this #each references the object directly -->\n <td>MAIN HEADER empty1</td>\n <td>MAIN HEADER empty2</td>\n </tr>\n </thead>\n <tbody> \n {{#each Items}} \n \n <tr>\n \n <td>TBODY PO# {{../Serial}}</td> <!-- note the ../ in front of the variable name when calling a variable from 'above' the Items array of the object -->\n <td>TBODY Part #: {{PartViz}} </td>\n <td>TBODY Qty Ordered: {{QuantityOrdered}}</td> <!-- whereas these are from the #each Items array of the object -->\n \n </tr>\n {{/each}}\n </tbody>\n {{/each}}\n </table>\n\t\n</body>\n</html>","Style":".example {\n color: blue;\n}\n\ntable { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 16pt;\n width: 100%;\n }\n\ntbody tr {\n width: 100%;\n}\n\ntbody tr:nth-child(even) {\n font-size: 10pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n} \ntbody tr:nth-child(odd) {\n font-size: 10pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\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 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":"<span style=\"font-size:6pt;width: 94%; text-align:left; \">&nbsp;&nbsp;&nbsp;&nbsp;(from PDF Options) Printed date:&nbsp;<span class=\"date\"></span></span>","FooterTemplate":"<span style=\"font-size:6pt;width: 94%; text-align: right; \">&nbsp; set in PDF Options&nbsp;&nbsp;Page&nbsp;<span class=\"pageNumber\"></span>&nbsp;of&nbsp;<span class=\"totalPages\"></span>&nbsp;&nbsp;&nbsp;&nbsp;</span>","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"10mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000}
{"Name":"💡109x EXAMPLE PO show parent value AND child value on SAME row","Active":true,"Notes":"example HTML mustache for displaying parent property (i.e. the PO number) when \"in\" Child iteration (PO items)","Roles":124927,"AType":26,"IncludeWoItemDescendants":false,"Template":"<html>\n<body>\n\t\n\t<table>\n {{#each ayReportData}}\n <thead>\n <tr>\n <td>MAIN HEADER PO#: {{Serial}}</td> <!-- note NO ../ in front of the variable name here as this #each references the object directly -->\n <td>MAIN HEADER empty1</td>\n <td>MAIN HEADER empty2</td>\n </tr>\n </thead>\n <tbody> \n {{#each Items}} \n \n <tr>\n \n <td>TBODY PO# {{../Serial}}</td> <!-- note the ../ in front of the variable name when calling a variable from 'above' the Items array of the object -->\n <td>TBODY Part #: {{PartNameViz}} </td>\n <td>TBODY Qty Ordered: {{QuantityOrdered}}</td> <!-- whereas these are from the #each Items array of the object -->\n \n </tr>\n {{/each}}\n </tbody>\n {{/each}}\n </table>\n\t\n</body>\n</html>","Style":".example {\n color: blue;\n}\n\ntable { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 16pt;\n width: 100%;\n }\n\ntbody tr {\n width: 100%;\n}\n\ntbody tr:nth-child(even) {\n font-size: 10pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n} \ntbody tr:nth-child(odd) {\n font-size: 10pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\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 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":"<span style=\"font-size:6pt;width: 94%; text-align:left; \">&nbsp;&nbsp;&nbsp;&nbsp;(from PDF Options) Printed date:&nbsp;<span class=\"date\"></span></span>","FooterTemplate":"<span style=\"font-size:6pt;width: 94%; text-align: right; \">&nbsp; set in PDF Options&nbsp;&nbsp;Page&nbsp;<span class=\"pageNumber\"></span>&nbsp;of&nbsp;<span class=\"totalPages\"></span>&nbsp;&nbsp;&nbsp;&nbsp;</span>","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"10mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000}

View File

@@ -1 +1 @@
{"Name":"💡109x EXAMPLE PO show tags dependent on custom Helpers","Active":true,"Notes":"example custom Helpers functions if has tag X then show Y, else return something else like preset text\nexample in custom Helper if want to use CSS styling, how to correctly wrap in a safestring","Roles":124927,"AType":26,"IncludeWoItemDescendants":false,"Template":"<html>\n\n<body>\n\t<h2>Example: Helpers to show if has a specific Tag / Custom fields usage </h2>\n\t<p>See the specific Helpers in this report template, and the help documentation for additional details</p>\n\n\t<table>\n\t\t{{#each ayReportData}}\n\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th>&nbsp;</th>\n\t\t\t\t<th>&nbsp;</th>\n\t\t\t</tr>\n\t\t</thead> \n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<th>For PO#:</th> <!--th styles this as a heading column -->\n\t\t\t\t<th>{{ Serial }}</th><!--th styles this as a heading column -->\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>Display 1st Tag only:</td><!--td styles this as a data column -->\n\t\t\t\t<td>{{ Tags.[0]}} </td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>Called ayReportData's to display all tags for this PO:</td>\n\t\t\t\t<td class=\"blueMe\">{{ Tags}}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>Called custom Helper to display if has tag 'gold':</td>\n\t\t\t\t<td class=\"blueMe\">{{ isInTag Tags}}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>Called custom Helper to display if has tag 'brown':</td>\n\t\t\t\t<td class=\"blueMe\">{{ isInTag2 Tags}}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>Called custom Helper to display if has tag 'yellow':</td>\n\t\t\t\t<td class=\"blueMe\">{{ isInTag3 Tags}}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>If CustomFields.c1 has value, will display greenfont else will display redfont</td>\n\t\t\t\t{{#if CustomFields.c1}} <td class='greenMe' >{{CustomFields.c1}}</td> {{else}} <td class='redMe' >nope nothing here</td> {{/if}}\n\t\t\t</tr>\n\t\t\t{{#each Items}}\n\t\t\t<tr>\n\t\t\t\t<td>For each POitem will display in redfont if QuantyReceived is false, undefined, null, \"\", 0, or []</td>\n\t\t\t\t{{#if QuantityReceived}} <td class='greenMe' >For {{PartViz}} have received: {{QuantityReceived}}</td> {{else}} <td class='redMe' >Nothing received yet for {{PartViz}}</td> {{/if}}\n\t\t\t</tr>\n\t\t\t{{/each}}\n\t\t</tbody>\n\t\t{{/each}}\n\t</table>\n \n</body>\n\n</html>","Style":".redMe {\n color: red;\n}\n\n.greenMe {\n color: green;\n}\n\n\n.blueMe {\n color: blue;\n}\n\ntable { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 18pt;\n width: 100%;\n }\n\n\n\ntbody tr:nth-child(even) {\n font-size: 10pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n} \ntbody tr:nth-child(odd) {\n font-size: 10pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\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 return reportData;\n}","JsHelpers":"Handlebars.registerHelper('isInTag', function (Tags) \n{\n for (var i=0; i<Tags.length; i++) \n\t{\n if (Tags[i].match('gold'))\n\t\t{ \n return 'gold'; \n\t\t}\n }\n return 'no gold tag';\n});\n\nHandlebars.registerHelper('isInTag2', function (Tags) \n{\n for (var i=0; i<Tags.length; i++) \n\t{\n if (Tags[i].match('brown'))\n\t\t{ \n\t\t\treturn 'THE WORD or part of brown IS IN HERE';\n\t\t}\n }\n return 'NOPE part of full word with \\'brown\\' is NOT HERE';\n});\n\nHandlebars.registerHelper('isInTag3', function (Tags) \n{\n for (var i=0; i<Tags.length; i++) \n\t{\n if (Tags[i].match('yellow'))\n\t\t{ \n\t\t\treturn new Handlebars.SafeString(\"<p class='greenMe' >\" + \"yellow is in here!! see how this shows in greenfont!\" +\"</p>\"); //if want to use CSS styling, be sure to wrap in a safestring\n\t\t}\n }\n return 'Nope yellow isn\\'t in tags for this poitem'; //if don't want to return any element at all, comment this else aspect out fully\n});\n","RenderType":0,"HeaderTemplate":null,"FooterTemplate":null,"DisplayHeaderFooter":false,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"15mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000}
{"Name":"💡109x EXAMPLE PO show tags dependent on custom Helpers","Active":true,"Notes":"example custom Helpers functions if has tag X then show Y, else return something else like preset text\nexample in custom Helper if want to use CSS styling, how to correctly wrap in a safestring","Roles":124927,"AType":26,"IncludeWoItemDescendants":false,"Template":"<html>\n\n<body>\n\t<h2>Example: Helpers to show if has a specific Tag / Custom fields usage </h2>\n\t<p>See the specific Helpers in this report template, and the help documentation for additional details</p>\n\n\t<table>\n\t\t{{#each ayReportData}}\n\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th>&nbsp;</th>\n\t\t\t\t<th>&nbsp;</th>\n\t\t\t</tr>\n\t\t</thead> \n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<th>For PO#:</th> <!--th styles this as a heading column -->\n\t\t\t\t<th>{{ Serial }}</th><!--th styles this as a heading column -->\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>Display 1st Tag only:</td><!--td styles this as a data column -->\n\t\t\t\t<td>{{ Tags.[0]}} </td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>Called ayReportData's to display all tags for this PO:</td>\n\t\t\t\t<td class=\"blueMe\">{{ Tags}}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>Called custom Helper to display if has tag 'gold':</td>\n\t\t\t\t<td class=\"blueMe\">{{ isInTag Tags}}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>Called custom Helper to display if has tag 'brown':</td>\n\t\t\t\t<td class=\"blueMe\">{{ isInTag2 Tags}}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>Called custom Helper to display if has tag 'yellow':</td>\n\t\t\t\t<td class=\"blueMe\">{{ isInTag3 Tags}}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>If CustomFields.c1 has value, will display greenfont else will display redfont</td>\n\t\t\t\t{{#if CustomFields.c1}} <td class='greenMe' >{{CustomFields.c1}}</td> {{else}} <td class='redMe' >nope nothing here</td> {{/if}}\n\t\t\t</tr>\n\t\t\t{{#each Items}}\n\t\t\t<tr>\n\t\t\t\t<td>For each POitem will display in redfont if QuantyReceived is false, undefined, null, \"\", 0, or []</td>\n\t\t\t\t{{#if QuantityReceived}} <td class='greenMe' >For {{PartNameViz}} have received: {{QuantityReceived}}</td> {{else}} <td class='redMe' >Nothing received yet for {{PartNameViz}}</td> {{/if}}\n\t\t\t</tr>\n\t\t\t{{/each}}\n\t\t</tbody>\n\t\t{{/each}}\n\t</table>\n \n</body>\n\n</html>","Style":".redMe {\n color: red;\n}\n\n.greenMe {\n color: green;\n}\n\n\n.blueMe {\n color: blue;\n}\n\ntable { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 18pt;\n width: 100%;\n }\n\n\n\ntbody tr:nth-child(even) {\n font-size: 10pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n} \ntbody tr:nth-child(odd) {\n font-size: 10pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\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 return reportData;\n}","JsHelpers":"Handlebars.registerHelper('isInTag', function (Tags) \n{\n for (var i=0; i<Tags.length; i++) \n\t{\n if (Tags[i].match('gold'))\n\t\t{ \n return 'gold'; \n\t\t}\n }\n return 'no gold tag';\n});\n\nHandlebars.registerHelper('isInTag2', function (Tags) \n{\n for (var i=0; i<Tags.length; i++) \n\t{\n if (Tags[i].match('brown'))\n\t\t{ \n\t\t\treturn 'THE WORD or part of brown IS IN HERE';\n\t\t}\n }\n return 'NOPE part of full word with \\'brown\\' is NOT HERE';\n});\n\nHandlebars.registerHelper('isInTag3', function (Tags) \n{\n for (var i=0; i<Tags.length; i++) \n\t{\n if (Tags[i].match('yellow'))\n\t\t{ \n\t\t\treturn new Handlebars.SafeString(\"<p class='greenMe' >\" + \"yellow is in here!! see how this shows in greenfont!\" +\"</p>\"); //if want to use CSS styling, be sure to wrap in a safestring\n\t\t}\n }\n return 'Nope yellow isn\\'t in tags for this poitem'; //if don't want to return any element at all, comment this else aspect out fully\n});\n","RenderType":0,"HeaderTemplate":null,"FooterTemplate":null,"DisplayHeaderFooter":false,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"15mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000}

File diff suppressed because one or more lines are too long