Go to the documentation of this file.
27 require
'../../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/modules/rapport/pdf_paiement.class.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
33 $action =
GETPOST(
'action',
'aZ09');
36 if ($user->socid > 0) {
38 $socid = $user->socid;
41 $dir = $conf->facture->dir_output.
'/payments';
42 if (empty($user->rights->societe->client->voir) || $socid) {
43 $dir .=
'/private/'.$user->id;
52 if (empty($user->rights->facture->lire)) {
61 if ($action ==
'builddoc') {
64 $outputlangs = $langs;
65 if (
GETPOST(
'lang_id',
'aZ09')) {
67 $outputlangs->setDefaultLang(
GETPOST(
'lang_id',
'aZ09'));
72 $sav_charset_output = $outputlangs->charset_output;
73 if ($rap->write_file($dir,
GETPOST(
"remonth",
"int"),
GETPOST(
"reyear",
"int"), $outputlangs) > 0) {
74 $outputlangs->charset_output = $sav_charset_output;
76 $outputlangs->charset_output = $sav_charset_output;
80 $year =
GETPOST(
"reyear",
"int");
93 $titre = ($year ? $langs->trans(
"PaymentsReportsForYear", $year) : $langs->trans(
"PaymentsReports"));
97 print
'<form method="post" action="rapport.php?year='.$year.
'">';
98 print
'<input type="hidden" name="token" value="'.newToken().
'">';
99 print
'<input type="hidden" name="action" value="builddoc">';
100 $cmonth =
GETPOST(
"remonth") ?
GETPOST(
"remonth") : date(
"n", time());
101 $syear =
GETPOST(
"reyear") ?
GETPOST(
"reyear") : date(
"Y", time());
103 print $formother->select_month($cmonth,
'remonth');
105 print $formother->selectyear($syear,
'reyear');
107 print
'<input type="submit" class="button" value="'.$langs->trans(
"Create").
'">';
114 $year_dirs =
dol_dir_list($dir,
'directories', 0,
'^[0-9]{4}$',
'',
'DESC');
115 foreach ($year_dirs as $d) {
116 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?year='.$d[
'name'].
'">'.$d[
'name'].
'</a> ';
120 if (is_dir($dir.
'/'.$year)) {
121 if (!empty($year_dirs)) print
'<br>';
123 print
'<table width="100%" class="noborder">';
124 print
'<tr class="liste_titre">';
125 print
'<td>'.$langs->trans(
"Reporting").
'</td>';
126 print
'<td class="right">'.$langs->trans(
"Size").
'</td>';
127 print
'<td class="right">'.$langs->trans(
"Date").
'</td>';
130 $files = (
dol_dir_list($dir.
'/'.$year,
'files', 0,
'^payments-[0-9]{4}-[0-9]{2}\.pdf$',
'',
'name',
'DESC', 1));
131 foreach ($files as $f) {
132 $relativepath = $f[
'level1name'].
'/'.$f[
'name'];
133 print
'<tr class="oddeven">';
134 print
'<td><a data-ajax="false" href="'.DOL_URL_ROOT.
'/document.php?modulepart=facture_paiement&file='.urlencode($relativepath).
'">'.
img_pdf().
' '.$f[
'name'].
'</a>'.$formfile->showPreview($f[
'name'],
'facture_paiement', $relativepath, 0).
'</td>';
135 print
'<td class="right">'.dol_print_size($f[
'size']).
'</td>';
136 print
'<td class="right">'.dol_print_date($f[
'date'],
"dayhour").
'</td>';
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
Class to manage translations.
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0)
Scan a directory and return a list of files/directories.
img_pdf($titlealt='default', $size=3)
Show pdf logo.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Classe permettant de generer les rapports de paiement.