diff --git a/dev/resources/dbmodel/dolibarr_schema.mwb b/dev/resources/dbmodel/dolibarr_schema.mwb
index 9103be2bc11..0d758182f1e 100644
Binary files a/dev/resources/dbmodel/dolibarr_schema.mwb and b/dev/resources/dbmodel/dolibarr_schema.mwb differ
diff --git a/htdocs/blockedlog/admin/blockedlog_archives.php b/htdocs/blockedlog/admin/blockedlog_archives.php
index d2edc2f9bc5..dc421989ae0 100644
--- a/htdocs/blockedlog/admin/blockedlog_archives.php
+++ b/htdocs/blockedlog/admin/blockedlog_archives.php
@@ -1187,9 +1187,19 @@ if ($action != 'check' && $action != 'checkconfirmed') {
$htmltext = '';
if (!userIsTaxAuditor()) {
- $htmltext .= $langs->trans("UnalterableLogTool2", $langs->transnoentities("Archives"))."
";
+ $nbrecorddone = $block_static->countRecord();
+ $mindisksize = 50; // Gb
+ $maxtranspermonth = 10000;
+ $nbrecordallowed = $mindisksize * 1024 * 1024 / 40 - $nbrecorddone;
+ $nbmonthallowed = $nbrecordallowed / $maxtranspermonth;
+
+ $htmltext = '';
+ $htmltext .= $langs->trans("UnalterableLogTool2", $langs->transnoentitiesnoconv("Archives"))."
";
+ $htmltext .= ''.$langs->trans("UnalterableLogTool2MaxUsage", $nbrecorddone, $mindisksize, $nbrecordallowed)."
";
+ $htmltext .= ''.$langs->trans("UnalterableLogTool2b", $langs->transnoentitiesnoconv("Archives"))."
";
+
if ($mysoc->country_code == 'FR') {
- $htmltext .= '
'.$langs->trans("UnalterableLogTool1FR").'
';
+ $htmltext .= '
'.$langs->trans("UnalterableLogTool1FR").'
';
}
//$htmltext .= $langs->trans("UnalterableLogTool1");
//$htmltext .= $langs->trans("UnalterableLogTool3")."
";
diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php
index 5b65eaab071..168c8eaf476 100644
--- a/htdocs/blockedlog/admin/blockedlog_list.php
+++ b/htdocs/blockedlog/admin/blockedlog_list.php
@@ -226,11 +226,20 @@ print ''.img_picto('',
print '
';
print "\n";
+$nbrecorddone = $block_static->countRecord();
+$mindisksize = 50; // Gb
+$maxtranspermonth = 10000;
+$nbrecordallowed = $mindisksize * 1024 * 1024 / 40 - $nbrecorddone;
+$nbmonthallowed = $nbrecordallowed / $maxtranspermonth;
+
$htmltext = '';
$htmltext .= $langs->trans("UnalterableLogTool2", $langs->transnoentitiesnoconv("Archives"))."
";
-$htmltext .= $langs->trans("UnalterableLogTool3")."
";
+$htmltext .= ''.$langs->trans("UnalterableLogTool2MaxUsage", $nbrecorddone, $mindisksize, $nbrecordallowed)."
";
+$htmltext .= ''.$langs->trans("UnalterableLogTool2b", $langs->transnoentitiesnoconv("Archives"))."
";
+
+$htmltext .= ''.$langs->trans("UnalterableLogTool3")."
";
if ($mysoc->country_code == 'FR') {
- $htmltext .= '
'.$langs->trans("UnalterableLogTool1FR").'
';
+ $htmltext .= '
'.$langs->trans("UnalterableLogTool1FR").'
';
}
print info_admin($htmltext, 0, 0, 'warning');
diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php
index 1e51e787b20..48be0b08a7a 100644
--- a/htdocs/blockedlog/class/blockedlog.class.php
+++ b/htdocs/blockedlog/class/blockedlog.class.php
@@ -1884,4 +1884,27 @@ class BlockedLog
return $canbedisabled;
}
+
+
+ /**
+ * Return current number of records.
+ *
+ * @return int Number of recor for all instances
+ */
+ public function countRecord()
+ {
+ $nb = 0;
+
+ $sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."blockedlog";
+ $resql = $this->db->query($sql);
+ if ($resql) {
+ $obj = $this->db->fetch_object($resql);
+ $nb = $obj->nb;
+ } else {
+ dol_print_error($this->db);
+ }
+ $this->db->free($resql);
+
+ return $nb;
+ }
}
diff --git a/htdocs/langs/en_US/blockedlog.lang b/htdocs/langs/en_US/blockedlog.lang
index d158e44e628..c3ac6306ca3 100644
--- a/htdocs/langs/en_US/blockedlog.lang
+++ b/htdocs/langs/en_US/blockedlog.lang
@@ -7,7 +7,9 @@ ArchivesAuditorDesc=You can use this tool to load and control immutable logs fro
ControlDesc=You can use this page to know if some backup restoration were done in the past (or if the last line of the immutable log was deleted) on a given instance
UnalterableLogTool1=The law of some countries (like in France when doing B2C), ask that you do it on a regular basis.
UnalterableLogTool1FR=Remind: In France, you MUST generate archives of the immutable logs, at least, once every year. We recommand to do it once per month. Also, you MUST keep these archives for at least 7 years. According to the law, It is the user's responsibility to store their archives on media that guarantee their preservation, including in the event of hardware failure, so we recommand to store them on at least 2 different physical supports.
-UnalterableLogTool2=The journal of Immutable Logs contains the history of data that need immutable recording. It is the responsibility of the user of the application to ensure backups in order to comply with legal obligations. When securing your immutable logs by exporting and storing archives files (from tab %s), it is recommended to store the exported archive files in at least 2 different places (Secured cloud, External USB drive, ...).
+UnalterableLogTool2=The journal of Immutable Logs contains the history of data that need immutable recording.
+UnalterableLogTool2MaxUsage=You have currently %s unalterable transactions, so, if you match the prerequisite (minimal disk space of %s Gb), you can still record %s transactions (invoice/payment creation/modification) before you need to increase your disk size.
+UnalterableLogTool2b=It is the responsibility of the user of the application to ensure backups in order to comply with legal obligations. When securing your immutable logs by exporting and storing archives files (from tab %s), it is recommended to store the exported archive files in at least 2 different places (Secured cloud, External USB drive, ...).
UnalterableLogTool3=Note that, there is no feature to purge this log and every change tried to be done directly into this log (by a hacker for example) will be reported with a non-valid fingerprint.
UnalterableLogToolRegistrationFR=Before using a software compliant with VAT Anti-Fraud laws, you must register your contact information, in order to be informed of any issue or upgrade required by your installation. This may be a legal requirement of you country.
ApplicationHasBeenRegistered=Your application has been registered.
diff --git a/htdocs/langs/fr_FR/blockedlog.lang b/htdocs/langs/fr_FR/blockedlog.lang
index 84d34a38e27..591f5b0b06a 100644
--- a/htdocs/langs/fr_FR/blockedlog.lang
+++ b/htdocs/langs/fr_FR/blockedlog.lang
@@ -6,7 +6,8 @@ ArchivesDesc=Vous pouvez utiliser cet outil pour exporter les journaux inaltéra
ArchivesAuditorDesc=Vous pouvez utiliser cet outil pour charger les journaux immuables de contrôle et dans des fichiers d'archive.
UnalterableLogTool1=La législation de certains pays (comme en France pour les transactions B2C) exige que cela soit fait régulièrement.
UnalterableLogTool1FR=Rappel : En France, vous devez obligatoirement générer des archives des journaux inaltérables au moins une fois par an. Nous recommandons de le faire une fois par mois. De plus, vous devez conserver ces archives pendant au moins 7 ans. Conformément à la loi, il est de la responsabilité de l'utilisateur de stocker ses archives sur des supports garantissant leur préservation, y compris en cas de panne matérielle. Nous recommandons donc de les stocker sur au moins 2 supports physiques différents.
-UnalterableLogTool2=Le journal des traces inaltérables contient l'historique des données nécessitant un enregistrement inaltérable. Il incombe à l'utilisateur de l'application de veiller à la mise en place de sauvegardes afin de se conformer aux obligations légales. Lors de la sécurisation de vos journaux inaltérables par l'exportation de fichiers d'archives et (à partir de l'onglet %s), il est recommandé de stocker les fichiers d'archives exportés dans au moins 2 emplacements différents (cloud sécurisé, disque dur USB externe, ...).
+UnalterableLogTool2=Le journal des traces inaltérables contient l'historique des données nécessitant un enregistrement inaltérable.
+UnalterableLogTool2b=Il incombe à l'utilisateur de l'application de veiller à la mise en place de sauvegardes afin de se conformer aux obligations légales. Lors de la sécurisation de vos journaux inaltérables par l'exportation de fichiers d'archives et (à partir de l'onglet %s), il est recommandé de stocker les fichiers d'archives exportés dans au moins 2 emplacements différents (cloud sécurisé, disque dur USB externe, ...).
UnalterableLogTool3=Notez qu'il n'existe aucune fonctionnalité pour purger ce journal et toute modification tentée directement dans ce journal (par un pirate informatique par exemple) sera signalée avec une empreinte numérique non valide.
UnalterableLogToolRegistrationFR=Avant d'utiliser un logiciel conforme à la législation anti-fraude à la TVA, vous devez enregistrer vos coordonnées dans commande afin d'être informé de tout problème ou mise à jour nécessaire à votre installation. Cela peut être une obligation légale dans votre pays.
ApplicationHasBeenRegistered=Votre demande a été enregistrée.