summaryrefslogtreecommitdiff
path: root/addons/l10n_fr_pos_cert/report
diff options
context:
space:
mode:
Diffstat (limited to 'addons/l10n_fr_pos_cert/report')
-rw-r--r--addons/l10n_fr_pos_cert/report/__init__.py4
-rw-r--r--addons/l10n_fr_pos_cert/report/pos_hash_integrity.py22
-rw-r--r--addons/l10n_fr_pos_cert/report/pos_hash_integrity.xml95
3 files changed, 121 insertions, 0 deletions
diff --git a/addons/l10n_fr_pos_cert/report/__init__.py b/addons/l10n_fr_pos_cert/report/__init__.py
new file mode 100644
index 00000000..af5f8a80
--- /dev/null
+++ b/addons/l10n_fr_pos_cert/report/__init__.py
@@ -0,0 +1,4 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from . import pos_hash_integrity
diff --git a/addons/l10n_fr_pos_cert/report/pos_hash_integrity.py b/addons/l10n_fr_pos_cert/report/pos_hash_integrity.py
new file mode 100644
index 00000000..d7c36038
--- /dev/null
+++ b/addons/l10n_fr_pos_cert/report/pos_hash_integrity.py
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from odoo import api, fields, models
+
+
+class ReportPosHashIntegrity(models.AbstractModel):
+ _name = 'report.l10n_fr_pos_cert.report_pos_hash_integrity'
+ _description = 'Get french pos hash integrity result as PDF.'
+
+ @api.model
+ def _get_report_values(self, docids, data=None):
+ if data:
+ data.update(self.env.company._check_pos_hash_integrity())
+ else:
+ data = self.env.company._check_hash_pos_integrity()
+ return {
+ 'doc_ids' : docids,
+ 'doc_model' : self.env['res.company'],
+ 'data' : data,
+ 'docs' : self.env['res.company'].browse(self.env.company.id),
+ }
diff --git a/addons/l10n_fr_pos_cert/report/pos_hash_integrity.xml b/addons/l10n_fr_pos_cert/report/pos_hash_integrity.xml
new file mode 100644
index 00000000..a64b3d9a
--- /dev/null
+++ b/addons/l10n_fr_pos_cert/report/pos_hash_integrity.xml
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<odoo>
+ <data>
+ <template id="report_pos_hash_integrity">
+ <t t-call="web.html_container">
+ <t t-foreach="docs" t-as="company">
+ <t t-call="web.external_layout">
+ <div class="page">
+ <div class="row" id="hash_header">
+ <div class="col-12">
+ <br/>
+ <h2>Résultat du test d'intégrité - <span t-esc="data['printing_date']"/></h2>
+ <br/>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-12" id="hash_config_review">
+ <h6>
+ Selon l’article 286 du code général des impôts français, toute livraison de bien ou prestation
+ de services ne donnant pas lieu à facturation et étant enregistrée au moyen d’un logiciel ou
+ d’un système de caisse doit satisfaire à des conditions d’inaltérabilité et de sécurisation des
+ données en vue d’un contrôle de l’administration fiscale.
+ <br/>
+ <br/>
+ Ces conditions sont respectées via une fonction de hachage des ventes du Point de Vente.
+ <br/>
+ <br/>
+ </h6>
+ </div>
+ </div>
+ <t t-if="data['result'] != 'None'">
+ <div class="row">
+ <div class="col-12" id="hash_data_consistency">
+ <br/>
+ <h3>Contrôle des données du point de vente</h3>
+ <br/>
+ <t t-if="data['result'] != 'None' and data['msg_alert'] == 'None'">
+ <h5>
+ Toutes les ventes effectuées via le Point de Vente
+ sont bien dans la chaîne de hachage.
+ </h5>
+ <br/>
+ </t>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-12" id="hash_data_consistency_table">
+ <table class="table table-bordered" style="table-layout: fixed">
+ <thead style="display: table-row-group">
+ <tr>
+ <th class="text-center" style="width: 25%" scope="col">First Hash</th>
+ <th class="text-center" style="width: 25%" scope="col">First Entry</th>
+ <th class="text-center" style="width: 25%" scope="col">Last Hash</th>
+ <th class="text-center" style="width: 25%" scope="col">Last Entry</th>
+ </tr>
+ </thead>
+ <tbody>
+ <t t-if="data['result'] != 'None'">
+ <t t-if="data['result']['first_order_hash'] != 'None'">
+ <tr>
+ <td><span t-esc="data['result']['first_order_hash']"/></td>
+ <td>
+ <span t-esc="data['result']['first_order_name']"/> <br/>
+ <span t-esc="data['result']['first_order_date']"/>
+ </td>
+ <td><span t-esc="data['result']['last_order_hash']"/></td>
+ <td>
+ <span t-esc="data['result']['last_order_name']"/> <br/>
+ <span t-esc="data['result']['last_order_date']"/>
+ </td>
+ </tr>
+ </t>
+ </t>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <div class="row" id="hash_last_div">
+ <div class="col-12" id="hash_chain_compliant">
+ <br/>
+ <h6>
+ La chaîne de hachage est conforme: il n’est pas possible d’altérer les données
+ sans casser la chaîne de hachage pour les pièces ultérieures.
+ </h6>
+ <br/>
+ </div>
+ </div>
+ </t>
+ </div>
+ </t>
+ </t>
+ </t>
+ </template>
+ </data>
+</odoo>