{"id":21331,"date":"2024-03-11T15:06:06","date_gmt":"2024-03-11T14:06:06","guid":{"rendered":"https:\/\/help.openbee.com\/open-bee-scan-capture\/knowledge-base\/how-to-guides\/scripts-in-capture\/case-studies\/index\/consistency-1-jse_consistency_result-comparison-of-total\/"},"modified":"2026-05-13T09:35:25","modified_gmt":"2026-05-13T07:35:25","slug":"consistency-1-jse_consistency_result-comparison-of-total","status":"publish","type":"page","link":"https:\/\/help.openbee.com\/en\/open-bee-scan-capture\/knowledge-base\/how-to-guides\/scripts-in-capture\/case-studies\/index\/consistency-1-jse_consistency_result-comparison-of-total\/","title":{"rendered":"Consistency (1): JSE_Consistency_Result: Comparison of Total"},"content":{"rendered":"\n<p>Checking the Consistency <strong>Index Part<\/strong> COHERENCE_INDEX. <br\/>To see the data recovery part, <a href=\"https:\/\/help.openbee.com\/en\/open-bee-scan-capture\/knowledge-base\/how-to-guides\/scripts-in-capture\/case-studies\/index\/consistency-1-jse_datatable-comparison-of-total\/\">click on this link<\/a><\/p>\n\n<p>In this specific case, the goal is to compare the total of the rows reported by the data of the consistency index (var Total) and the total excluding tax of the invoice (var mtHTText)<\/p>\n\n<pre class=\"wp-block-code\"><code>var indexCoherence = getFirstIndexFromID(pParameters, \"COHERENCE_INDEX\");\r\nvar Total=0;\r\n\r\n\/*************************************************\r\nTotal des donn\u00e9es r\u00e9cup\u00e9r\u00e9es dans le tableau\r\n*************************************************\/\r\n\r\nvar data = getConsistencyColumnDatas(indexCoherence, \"Total\");\r\ndata=data.map(Number);\r\n\r\nfor(i=0;i&lt;data.length;i++){\r\n\tTotal+=data&#91;i];\r\n}\r\n\r\n\/*************************************************\/\r\n\r\n\/\/recuperation de la valeur de l'index Total HT\r\nvar mtHTText = getTextFromIndexInfo(getFirstIndexFromID(pParameters, \"AMOUNT_EX_VAT_INDEX\"));\r\nmtHTText =parseFloat(mtHTText.replace(',', '.'));\r\n\r\nvar coherence = new JSE_Consistency_Result();\r\nif(mtHTText ==Total)\r{\r\n\tcoherence.message= \"OK\";\r\n\tcoherence.state=\"VALID\";\r\n\tcoherence.success=true;\r\n}\r\nelse{\r\n\tcoherence.message=\"la valeur Total du Hors taxe est diff\u00e9rente\"+(mtHTText ==Total);\r\n\tcoherence.state=\"WARNING\";\r\n\tcoherence.success=true; \/\/ Pour ne pas bloquer la validation\r\n}\t\r\n\n\r\nreturn coherence;\r\n\n\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Checking the Consistency Index Part COHERENCE_INDEX. To see the data recovery part, click on this link In this specific case, the goal is to compare the total of the rows reported by the data of the consistency index (var Total) and the total excluding tax of the invoice (var mtHTText)<\/p>\n","protected":false},"author":97,"featured_media":0,"parent":21276,"menu_order":12,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-21331","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages\/21331","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/users\/97"}],"replies":[{"embeddable":true,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/comments?post=21331"}],"version-history":[{"count":2,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages\/21331\/revisions"}],"predecessor-version":[{"id":29206,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages\/21331\/revisions\/29206"}],"up":[{"embeddable":true,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages\/21276"}],"wp:attachment":[{"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/media?parent=21331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}