28require
'../../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/compta/prelevement/class/rejetprelevement.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/compta/prelevement/class/ligneprelevement.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/class/paiement.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
35$langs->loadLangs(array(
'banks',
'categories',
'withdrawals',
'companies'));
40$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
41$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
42$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
43$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
44if (empty($page) || $page == -1) {
47$offset = $limit * $page;
52$socid =
GETPOST(
'socid',
'int');
54 $socid = $user->socid;
56if ($type ==
'bank-transfer') {
57 $result =
restrictedArea($user,
'paymentbybanktransfer',
'',
'',
'');
69$title = $langs->trans(
"WithdrawsRefused");
70if ($type ==
'bank-transfer') {
71 $title = $langs->trans(
"CreditTransfersRefused");
76if ($sortorder ==
"") {
79if ($sortfield ==
"") {
80 $sortfield =
"p.datec";
86$hookmanager->initHooks(array(
'withdrawalsreceiptsrejectedlist'));
91$sql =
"SELECT pl.rowid, pr.motif, p.ref, pl.statut";
92$sql .=
" , s.rowid as socid, s.nom";
93$sql .=
" FROM ".MAIN_DB_PREFIX.
"prelevement_bons as p";
94$sql .=
" , ".MAIN_DB_PREFIX.
"prelevement_rejet as pr";
95$sql .=
" , ".MAIN_DB_PREFIX.
"prelevement_lignes as pl";
96$sql .=
" , ".MAIN_DB_PREFIX.
"societe as s";
97$sql .=
" WHERE pr.fk_prelevement_lignes = pl.rowid";
98$sql .=
" AND pl.fk_prelevement_bons = p.rowid";
99$sql .=
" AND pl.fk_soc = s.rowid";
100$sql .=
" AND p.entity = ".$conf->entity;
101if ($type ==
'bank-transfer') {
102 $sql .=
" AND p.type = 'bank-transfer'";
104 $sql .=
" AND p.type = 'debit-order'";
107 $sql .=
" AND s.rowid = ".((int) $socid);
109$sql .= $db->order($sortfield, $sortorder);
110$sql .= $db->plimit($limit + 1, $offset);
112$result = $db->query($sql);
114 $num = $db->num_rows($result);
119 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num);
120 print
"\n<!-- debut table -->\n";
121 print
'<table class="noborder tagtable liste" width="100%" cellpadding="4">';
122 print
'<tr class="liste_titre">';
129 while ($i < min($num, $limit)) {
130 $obj = $db->fetch_object($result);
132 print
'<tr class="oddeven">';
135 print $line->LibStatut($obj->statut, 2).
' ';
136 print
'<a href="'.DOL_URL_ROOT.
'/compta/prelevement/line.php?id='.$obj->rowid.
'">';
137 print substr(
'000000'.$obj->rowid, -6).
"</a></td>";
139 print
'<td><a href="'.DOL_URL_ROOT.
'/comm/card.php?socid='.$obj->socid.
'">'.$obj->nom.
"</a></td>\n";
141 print
'<td>'.$rej->motifs[$obj->motif].
'</td>';
148 print
'<tr><td colspan="3"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage withdrawals.
Class to manage standing orders rejects.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
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.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.