Ext.data.JsonP.p359C8ED4_DE57_4598_A819_30B6DC4526C4({"guide":"<h1 id='p359C8ED4_DE57_4598_A819_30B6DC4526C4-section-contract-number-and-name-generator'>Contract number and name generator</h1>\n<div class='toc'>\n<p><strong>Contents</strong></p>\n<ul>\n<li>1. <a href='#!/guide/p359C8ED4_DE57_4598_A819_30B6DC4526C4-section-contract-number-generator'>Contract number generator</a>\n </li>\n<li>2. <a href='#!/guide/p359C8ED4_DE57_4598_A819_30B6DC4526C4-section-contract-name'>Contract name</a>\n </li>\n</ul></div>\n\n\n<p>Contract numbers and names are created by generators. Each generator is based on a template that generates the contract number, for example, with the help of contract data. Additional information on numbers and names can be found in <a\nhref=\"#!/guide/pEB586201_2285_4D03_9D72_4F799451178E\">Contract (contract file)</a>.</p>\n\n\n<p><span class=\"tag_important\">The contract numbers and name generator used to create a new file have to be specified in the <a\nhref=\"#!/guide/p7B9917EA_3551_445E_A621_AF59E23AE8DF\">contract type</a> configuration.</span></p>\n\n\n<p><p><img src=\"guides/p359C8ED4_DE57_4598_A819_30B6DC4526C4/img1.png\" alt=\"\" width=\"939\" height=\"356\"></p></p>\n\n\n<p>Information, including on the available template helpers (Handlebars.js) and templating options, is provided by the <code><a href=\"#!/api/sol.common.Template\" rel=\"sol.common.Template\" class=\"docClass\">sol.common.Template</a></code> class. A few examples are explained in the following.</p>\n\n\n<p>The template syntax <code>{{ }}</code> enables access to contract information via the <code>sord</code> object. The <code><a href=\"#!/api/sol.common.ObjectFormatter\" rel=\"sol.common.ObjectFormatter\" class=\"docClass\">sol.common.ObjectFormatter</a></code> class transforms the ELO Indexserver sord object, forming the basis for this.</p>\n\n\n<h2 id='p359C8ED4_DE57_4598_A819_30B6DC4526C4-section-contract-number-generator'>Contract number generator</h2>\n\n\n<p>Generators for the contract number have to be filed to <code>\\Administration\\Business Solutions Custom\\contract\\Configuration\\Generators\\Contract no.\\</code> as text files.</p>\n\n\n<p>Contract numbers can be generated with the <code>count</code> template helper. The helper expects a number range (here: <code>sol.contract.ContractNo</code>) and optionally the possibility to generate a number with a predefined amount of digits (here <span\nstyle='font-weight:bold;font-style:italic'>000000</span>). </p>\n\n\n<pre><code>C{{count &quot;sol.contract.ContractNo&quot; &quot;000000&quot;}}\n\n// Results:\n// C000001\n// C000002\n</code></pre>\n\n\n<p>If the contract type (index field: <code>CONTRACT_TYPE</code>) is to be added to the number range, the contract number generator can be extended as follows:</p>\n\n\n<pre><code>C-{{sord.objKeys.CONTRACT_TYPE}}-{{count &quot;sol.contract.ContractNo.{{sord.objKeys.CONTRACT_TYPE}}&quot; &quot;000000&quot;}}\n\n// Results:\n// C-Subscription-000001\n// C-Subscription-000002\n// C-Maintenance_Contract-000001\n</code></pre>\n\n\n<p><span class=\"tag_important\">When creating your own number generators, make sure to include all number range information in the contract number. Otherwise, duplicate numbers may be generated.</span></p>\n\n\n<h2 id='p359C8ED4_DE57_4598_A819_30B6DC4526C4-section-contract-name'>Contract name</h2>\n\n\n<p>Generators for the contract name (short name) have to be filed to <code>\\Administration\\Business Solutions Custom\\contract\\Configuration\\Generators\\Contract short description\\</code> as text files.</p>\n\n\n<p>All contract information can be accessed in the process. The example below shows the standard solution where the contract number and contract name are added.</p>\n\n\n<pre><code>{{sord.objKeys.CONTRACT_NO}} {{sord.objKeys.CONTRACT_NAME}}\n</code></pre>\n\n","title":"Contract number and name generator"});