28 require
'../../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/prelevement.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/compta/prelevement/class/bonprelevement.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/compta/prelevement/class/rejetprelevement.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/class/paiement.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
36 $langs->loadLangs(array(
"banks",
"categories",
'withdrawals',
'bills'));
39 if ($user->socid > 0) {
47 $type =
GETPOST(
'type',
'aZ09');
50 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
51 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
52 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
54 if (empty($page) || $page == -1) {
57 $offset = $limit * $page;
58 $pageprev = $page - 1;
59 $pagenext = $page + 1;
64 include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
67 if ($user->socid > 0) {
71 $type = $object->type;
72 if ($type ==
'bank-transfer') {
73 $result =
restrictedArea($user,
'paymentbybanktransfer',
'',
'',
'');
84 llxHeader(
'', $langs->trans(
"WithdrawalsReceipts"));
86 if ($id > 0 || $ref) {
87 if ($object->fetch($id, $ref) >= 0) {
89 print
dol_get_fiche_head($head,
'rejects', $langs->trans(
"WithdrawalsReceipts"), -1,
'payment');
91 $linkback =
'<a href="'.DOL_URL_ROOT.
'/compta/prelevement/orders_list.php?restore_lastsearch_values=1'.($object->type !=
'bank-transfer' ?
'' :
'&type=bank-transfer').
'">'.$langs->trans(
"BackToList").
'</a>';
95 print
'<div class="fichecenter">';
96 print
'<div class="underbanner clearboth"></div>';
97 print
'<table class="border centpercent tableforfield">'.
"\n";
100 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"Date").
'</td><td>'.
dol_print_date($object->datec,
'day').
'</td></tr>';
101 print
'<tr><td>'.$langs->trans(
"Amount").
'</td><td><span class="amount">'.
price($object->amount).
'</span></td></tr>';
103 if ($object->date_trans <> 0) {
104 $muser =
new User($db);
105 $muser->fetch($object->user_trans);
107 print
'<tr><td>'.$langs->trans(
"TransData").
'</td><td>';
109 print
' <span class="opacitymedium">'.$langs->trans(
"By").
'</span> '.$muser->getNomUrl(-1).
'</td></tr>';
110 print
'<tr><td>'.$langs->trans(
"TransMetod").
'</td><td>';
111 print $object->methodes_trans[$object->method_trans];
114 if ($object->date_credit <> 0) {
115 print
'<tr><td>'.$langs->trans(
'CreditDate').
'</td><td>';
124 print
'<div class="underbanner clearboth"></div>';
125 print
'<table class="border centpercent tableforfield">';
128 $result = $acc->fetch($conf->global->PRELEVEMENT_ID_BANKACCOUNT);
130 print
'<tr><td class="titlefieldcreate">';
131 $labelofbankfield =
"BankToReceiveWithdraw";
132 if ($object->type ==
'bank-transfer') {
133 $labelofbankfield =
'BankToPayCreditTransfer';
135 print $langs->trans($labelofbankfield);
139 print $acc->getNomUrl(1);
144 print
'<tr><td class="titlefieldcreate">';
145 $labelfororderfield =
'WithdrawalFile';
146 if ($object->type ==
'bank-transfer') {
147 $labelfororderfield =
'CreditTransferFile';
149 print $langs->trans($labelfororderfield).
'</td><td>';
150 $relativepath =
'receipts/'.$object->ref.
'.xml';
151 $modulepart =
'prelevement';
152 if ($object->type ==
'bank-transfer') {
153 $modulepart =
'paymentbybanktransfer';
155 print
'<a data-ajax="false" href="'.DOL_URL_ROOT.
'/document.php?type=text/plain&modulepart='.$modulepart.
'&file='.urlencode($relativepath).
'">'.$relativepath;
156 print
img_picto(
'',
'download',
'class="paddingleft"');
158 print
'</td></tr></table>';
174 $sql =
"SELECT pl.rowid, pl.amount, pl.statut";
175 $sql .=
" , s.rowid as socid, s.nom as name";
176 $sql .=
" , pr.motif, pr.afacturer, pr.fk_facture";
177 $sql .=
" FROM ".MAIN_DB_PREFIX.
"prelevement_bons as p";
178 $sql .=
" , ".MAIN_DB_PREFIX.
"prelevement_lignes as pl";
179 $sql .=
" , ".MAIN_DB_PREFIX.
"societe as s";
180 $sql .=
" , ".MAIN_DB_PREFIX.
"prelevement_rejet as pr";
181 $sql .=
" WHERE p.rowid=".((int) $object->id);
182 $sql .=
" AND pl.fk_prelevement_bons = p.rowid";
183 $sql .=
" AND p.entity = ".$conf->entity;
184 $sql .=
" AND pl.fk_soc = s.rowid";
185 $sql .=
" AND pl.statut = 3 ";
186 $sql .=
" AND pr.fk_prelevement_lignes = pl.rowid";
190 $sql .=
" ORDER BY pl.amount DESC";
194 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
195 $result = $db->query($sql);
203 $sql .= $db->plimit($limit + 1, $offset);
205 $resql = $db->query($sql);
207 $num = $db->num_rows(
$resql);
211 print
"\n<!-- debut table -->\n";
212 print
'<div class="div-table-responsive-no-min">';
213 print
'<table class="noborder centpercent">';
214 print
'<tr class="liste_titre">';
215 print
'<td>'.$langs->trans(
"Line").
'</td><td>'.$langs->trans(
"ThirdParty").
'</td><td class="right">'.$langs->trans(
"Amount").
'</td>';
216 print
'<td>'.$langs->trans(
"Reason").
'</td><td align="center">'.$langs->trans(
"ToBill").
'</td><td class="center">'.$langs->trans(
"Invoice").
'</td></tr>';
223 $obj = $db->fetch_object(
$resql);
225 print
'<tr class="oddeven"><td>';
227 print
'<a href="'.DOL_URL_ROOT.
'/compta/prelevement/line.php?id='.$obj->rowid.
'">';
228 print
img_picto(
'',
'statut'.$obj->statut).
' ';
229 print substr(
'000000'.$obj->rowid, -6);
231 print
'<td><a href="'.DOL_URL_ROOT.
'/comm/card.php?socid='.$obj->socid.
'">'.$obj->name.
"</a></td>\n";
233 print
'<td class="right"><span class="amount">'.price($obj->amount).
"</span></td>\n";
234 print
'<td>'.$rej->motifs[$obj->motif].
'</td>';
236 print
'<td class="center">'.yn($obj->afacturer).
'</td>';
237 print
'<td class="center">'.$obj->fk_facture.
'</td>';
240 $total += $obj->amount;
245 print
'<tr><td colspan="6" class="opacitymedium">'.$langs->trans(
"None").
'</td></tr>';
249 print
'<tr class="liste_total"><td> </td>';
250 print
'<td class="liste_total">'.$langs->trans(
"Total").
'</td>';
251 print
'<td class="right"><span class="amount">'.price($total).
"</span></td>\n";
252 print
'<td colspan="3"> </td>';
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage bank accounts.
Class to manage withdrawal receipts.
Class to manage standing orders rejects.
Class to manage Dolibarr users.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_get_fiche_end($notab=0)
Return tab footer of a card.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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 from a POST of a form.
prelevement_prepare_head(BonPrelevement $object)
Prepare array with list of tabs.
$nbtotalofrecords
Count total nb of records.
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.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.