From 64fd226b4a061d505476b6186037fcc8f69fb7e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 9 Mar 2023 10:56:13 +0100 Subject: [PATCH 1/2] fix reports to be exportable by module --- htdocs/compta/journal/purchasesjournal.php | 4 ++-- htdocs/compta/journal/sellsjournal.php | 3 ++- htdocs/compta/localtax/clients.php | 4 ++-- htdocs/compta/resultat/clientfourn.php | 4 ++-- htdocs/compta/resultat/result.php | 2 +- htdocs/compta/stats/cabyuser.php | 2 +- htdocs/compta/tva/quadri_detail.php | 2 +- htdocs/core/lib/report.lib.php | 12 ++++-------- 8 files changed, 15 insertions(+), 18 deletions(-) diff --git a/htdocs/compta/journal/purchasesjournal.php b/htdocs/compta/journal/purchasesjournal.php index dee5d8d628e..432b991c5d3 100644 --- a/htdocs/compta/journal/purchasesjournal.php +++ b/htdocs/compta/journal/purchasesjournal.php @@ -55,7 +55,7 @@ if (isModEnabled('comptabilite')) { if (isModEnabled('accounting')) { $result = restrictedArea($user, 'accounting', '', '', 'comptarapport'); } - +$hookmanager->initHooks(['purchasejournallist']); /* * Actions @@ -192,7 +192,7 @@ if ($result) { /* * Show result array */ -print ""; +print '
'; print ""; ///print ""; print ""; diff --git a/htdocs/compta/journal/sellsjournal.php b/htdocs/compta/journal/sellsjournal.php index c3846280ee3..90a8b36c1ce 100644 --- a/htdocs/compta/journal/sellsjournal.php +++ b/htdocs/compta/journal/sellsjournal.php @@ -57,6 +57,7 @@ if (isModEnabled('comptabilite')) { if (isModEnabled('accounting')) { $result = restrictedArea($user, 'accounting', '', '', 'comptarapport'); } +$hookmanager->initHooks(['selljournallist']); /* * Actions @@ -237,7 +238,7 @@ if ($result) { */ -print '
".$langs->trans("JournalNum")."".$langs->trans("Date")."
'; +print '
'; print ''; //print ""; print ''; diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php index d5aef47c285..d7b0ccbda73 100644 --- a/htdocs/compta/localtax/clients.php +++ b/htdocs/compta/localtax/clients.php @@ -110,7 +110,7 @@ if (empty($local)) { accessforbidden('Parameter localTaxType is missing'); exit; } - +$hookmanager->initHooks(['customerlocaltaxlist']); $calc = 0; /* @@ -185,7 +185,7 @@ $vatcust = $langs->transcountry($local == 1 ? "LT1" : "LT2", $mysoc->country_cod $vatsup = $langs->transcountry($local == 1 ? "LT1" : "LT2", $mysoc->country_code); print '
'; -print '
".$langs->trans("JournalNum")."'.$langs->trans('Date').''.$langs->trans('Piece').' ('.$langs->trans('InvoiceRef').')
'; +print '
'; // IRPF that the customer has retained me if ($calc == 0 || $calc == 2) { diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 54f242edb7c..6d4a04102f0 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -155,7 +155,7 @@ if (isModEnabled('comptabilite')) { if (isModEnabled('accounting')) { $result = restrictedArea($user, 'accounting', '', '', 'comptarapport'); } - +$hookmanager->initHooks(['customersupplierreportlist']); /* * View @@ -254,7 +254,7 @@ if ($date_endyear) { $param .= '&date_endyear='.$date_endyear; } -print '
'; +print '
'; print ''; if ($modecompta == 'BOOKKEEPING') { diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 0996b893a5f..a44772107aa 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -158,7 +158,7 @@ if (isModEnabled('comptabilite')) { if (isModEnabled('accounting')) { $result = restrictedArea($user, 'accounting', '', '', 'comptarapport'); } - +$hookmanager->initHooks(['resultreportlist']); /* * View diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 130d41d1d66..22ed2fcd154 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -46,7 +46,7 @@ if (isModEnabled('comptabilite')) { if (isModEnabled('accounting')) { $result = restrictedArea($user, 'accounting', '', '', 'comptarapport'); } - +$hookmanager->initHooks(['cabyuserreportlist']); // Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES') $modecompta = $conf->global->ACCOUNTING_MODE; if (GETPOST("modecompta")) { diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 997c90e083c..1cedd5ce410 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -203,7 +203,7 @@ $vatexpensereport = $langs->trans("VATPaid"); // VAT Received and paid print '
'; -print '
'; +print '
'; $y = $year_current; $i = 0; diff --git a/htdocs/core/lib/report.lib.php b/htdocs/core/lib/report.lib.php index a4279d27a95..c9f44fb4e08 100644 --- a/htdocs/core/lib/report.lib.php +++ b/htdocs/core/lib/report.lib.php @@ -48,17 +48,13 @@ function report_header($reportname, $notused, $period, $periodlink, $description $varlink = '?'.$varlink; } - $head = array(); + $title = $langs->trans("Report"); - $h = 0; - $head[$h][0] = $_SERVER["PHP_SELF"].$varlink; - $head[$h][1] = $langs->trans("Report"); - $head[$h][2] = 'report'; - - print ''."\n"; + print_barre_liste($title, '', ''); + print ''."\n"; print ''."\n"; - print dol_get_fiche_head($head, 'report'); + print dol_get_fiche_head(); foreach ($moreparam as $key => $value) { print ''."\n"; From 13ad7f5bad34cc83cb191971b732a49eeca0dbeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 9 Mar 2023 11:11:09 +0100 Subject: [PATCH 2/2] remove debug --- htdocs/compta/paiement/cheque/card.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index e3293718784..a5a519adfeb 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -145,7 +145,6 @@ if ($action == 'create' && GETPOST("accountid", "int") > 0 && $user->rights->ban if (GETPOSTISARRAY('toRemise')) { $object->type = $type; $arrayofid = GETPOST('toRemise', 'array:int'); - var_dump($arrayofid); $result = $object->create($user, GETPOST("accountid", "int"), 0, GETPOST('toRemise', 'array:int')); if ($result > 0) {