27 require
'../../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.
'/compta/prelevement/class/rejetprelevement.class.php';
29 require_once DOL_DOCUMENT_ROOT.
'/compta/prelevement/class/ligneprelevement.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/class/paiement.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
34 $langs->loadLangs(array(
'banks',
'categories',
'withdrawals',
'companies'));
37 $socid =
GETPOST(
'socid',
'int');
38 if ($user->socid) $socid = $user->socid;
41 $type =
GETPOST(
'type',
'aZ09');
44 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
45 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
46 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
48 if (empty($page) || $page == -1) { $page = 0; }
49 $offset = $limit * $page;
50 $pageprev = $page - 1;
51 $pagenext = $page + 1;
58 $title = $langs->trans(
"WithdrawsRefused");
59 if ($type ==
'bank-transfer') {
60 $title = $langs->trans(
"CreditTransfersRefused");
65 if ($sortorder ==
"") $sortorder =
"DESC";
66 if ($sortfield ==
"") $sortfield =
"p.datec";
71 $hookmanager->initHooks(array(
'withdrawalsreceiptsrejectedlist'));
78 $sql =
"SELECT pl.rowid, pr.motif, p.ref, pl.statut";
79 $sql .=
" , s.rowid as socid, s.nom";
80 $sql .=
" FROM ".MAIN_DB_PREFIX.
"prelevement_bons as p";
81 $sql .=
" , ".MAIN_DB_PREFIX.
"prelevement_rejet as pr";
82 $sql .=
" , ".MAIN_DB_PREFIX.
"prelevement_lignes as pl";
83 $sql .=
" , ".MAIN_DB_PREFIX.
"societe as s";
84 $sql .=
" WHERE pr.fk_prelevement_lignes = pl.rowid";
85 $sql .=
" AND pl.fk_prelevement_bons = p.rowid";
86 $sql .=
" AND pl.fk_soc = s.rowid";
87 $sql .=
" AND p.entity = ".$conf->entity;
88 if ($type ==
'bank-transfer') {
89 $sql .=
" AND p.type = 'bank-transfer'";
91 $sql .=
" AND p.type = 'debit-order'";
93 if ($socid) $sql .=
" AND s.rowid = ".$socid;
94 $sql .= $db->order($sortfield, $sortorder);
95 $sql .= $db->plimit($limit + 1, $offset);
97 $result = $db->query($sql);
100 $num = $db->num_rows($result);
106 print"\n<!-- debut table -->\n";
107 print '<table class="noborder tagtable liste" width="100%" cellspacing="0" cellpadding="4">';
108 print '<tr class="liste_titre">';
115 while ($i < min($num, $limit))
117 $obj = $db->fetch_object($result);
119 print '<tr class="oddeven">';
122 print $line->LibStatut($obj->statut, 2).
' ';
123 print '<a href="'.DOL_URL_ROOT.
'/compta/prelevement/line.php?id='.$obj->rowid.
'">';
124 print substr(
'000000'.$obj->rowid, -6).
"</a></td>";
126 print '<td><a href="'.DOL_URL_ROOT.
'/comm/card.php?socid='.$obj->socid.
'">'.$obj->nom.
"</a></td>\n";
128 print '<td>'.$rej->motifs[$obj->motif].
'</td>';
135 print '<tr><td class="opacitymedium" colspan="3">'.$langs->trans(
"None").
'</td></tr>';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
print_barre_liste($titre, $page, $file, $options= '', $sortfield= '', $sortorder= '', $morehtmlcenter= '', $num=-1, $totalnboflines= '', $picto= 'generic', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow= '')
Print a title with navigation controls for pagination.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0)
Check permissions of a user to show a page and an object.
print $_SERVER["PHP_SELF"]
Edit parameters.
print
Draft customers invoices.
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 standing orders rejects.
Class to manage withdrawals.