diff --git a/htdocs/compta/paiement/rapport.php b/htdocs/compta/paiement/rapport.php
index 5a939f37365..877e8121ad7 100644
--- a/htdocs/compta/paiement/rapport.php
+++ b/htdocs/compta/paiement/rapport.php
@@ -25,10 +25,12 @@
require("../../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/core/modules/rapport/pdf_paiement.class.php");
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
+require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php");
// Security check
-if (! $user->rights->facture->lire)
-accessforbidden();
+if (! $user->rights->facture->lire) accessforbidden();
+
+$action=GETPOST('action');
$dir = $conf->facture->dir_output.'/payments';
@@ -48,7 +50,7 @@ if (! $year) { $year=date("Y"); }
* Actions
*/
-if ($_POST["action"] == 'builddoc')
+if ($action == 'builddoc')
{
$rap = new pdf_paiement($db);
@@ -80,6 +82,8 @@ if ($_POST["action"] == 'builddoc')
* View
*/
+$formother=new FormOther($db);
+
llxHeader();
$titre=($year?$langs->trans("PaymentsReportsForYear",$year):$langs->trans("PaymentsReports"));
@@ -92,33 +96,10 @@ print '';
$cmonth = GETPOST("remonth")?GETPOST("remonth"):date("n", time());
$syear = GETPOST("reyear")?GETPOST("reyear"):date("Y", time());
-print '";
-print '\n";
print '';
print '';
print '
';
@@ -183,7 +164,8 @@ if ($year)
print '';
}
}
-$db->close();
llxFooter();
+
+$db->close();
?>