26 require
'../../main.inc.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/lib/prelevement.lib.php';
28 require_once DOL_DOCUMENT_ROOT.
'/compta/prelevement/class/bonprelevement.class.php';
29 require_once DOL_DOCUMENT_ROOT.
'/compta/prelevement/class/ligneprelevement.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
33 $langs->loadLangs(array(
"banks",
"categories",
'withdrawals',
'bills'));
39 $prev_id =
GETPOST(
'id',
'int');
42 $type =
GETPOST(
'type',
'aZ09');
45 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
46 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
47 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
49 if (empty($page) || $page == -1) { $page = 0; }
50 $offset = $limit * $page;
51 $pageprev = $page - 1;
52 $pagenext = $page + 1;
58 include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
60 if (!$user->rights->prelevement->bons->lire && $object->type !=
'bank-transfer') {
63 if (!$user->rights->paymentbybanktransfer->read && $object->type ==
'bank-transfer') {
73 llxHeader(
'', $langs->trans(
"WithdrawalsReceipts"));
75 if ($prev_id > 0 || $ref)
77 if ($object->fetch($prev_id, $ref) >= 0)
82 $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>';
86 print '<div class="fichecenter">';
87 print '<div class="underbanner clearboth"></div>';
88 print '<table class="border centpercent tableforfield">'.
"\n";
91 print '<tr><td class="titlefield">'.$langs->trans(
"Date").
'</td><td>'.
dol_print_date($object->datec,
'day').
'</td></tr>';
92 print '<tr><td>'.$langs->trans(
"Amount").
'</td><td>'.
price($object->amount).
'</td></tr>';
94 if ($object->date_trans <> 0)
96 $muser =
new User($db);
97 $muser->fetch($object->user_trans);
99 print '<tr><td>'.$langs->trans(
"TransData").
'</td><td>';
101 print ' <span class="opacitymedium">'.$langs->trans(
"By").
'</span> '.$muser->getFullName($langs).
'</td></tr>';
102 print '<tr><td>'.$langs->trans(
"TransMetod").
'</td><td>';
103 print $object->methodes_trans[$object->method_trans];
106 if ($object->date_credit <> 0)
108 print '<tr><td>'.$langs->trans(
'CreditDate').
'</td><td>';
117 print '<div class="underbanner clearboth"></div>';
118 print '<table class="border centpercent tableforfield">';
121 $result = $acc->fetch($conf->global->PRELEVEMENT_ID_BANKACCOUNT);
123 print '<tr><td class="titlefield">';
124 $labelofbankfield =
"BankToReceiveWithdraw";
125 if ($object->type ==
'bank-transfer') $labelofbankfield =
'BankToPayCreditTransfer';
126 print $langs->trans($labelofbankfield);
130 print $acc->getNomUrl(1);
134 print '<tr><td class="titlefield">';
135 $labelfororderfield =
'WithdrawalFile';
136 if ($object->type ==
'bank-transfer') $labelfororderfield =
'CreditTransferFile';
137 print $langs->trans($labelfororderfield).
'</td><td>';
138 $relativepath =
'receipts/'.$object->ref.
'.xml';
139 $modulepart =
'prelevement';
140 if ($object->type ==
'bank-transfer') $modulepart =
'paymentbybanktransfer';
141 print '<a data-ajax="false" href="'.DOL_URL_ROOT.
'/document.php?type=text/plain&modulepart='.$modulepart.
'&file='.urlencode($relativepath).
'">'.$relativepath.
'</a>';
142 print '</td></tr></table>';
156 $sql =
"SELECT sum(pl.amount), pl.statut";
157 $sql .=
" FROM ".MAIN_DB_PREFIX.
"prelevement_lignes as pl";
158 $sql .=
" WHERE pl.fk_prelevement_bons = ".$object->id;
159 $sql .=
" GROUP BY pl.statut";
161 $resql = $db->query($sql);
164 $num = $db->num_rows(
$resql);
169 print"\n<!-- debut table -->\n";
170 print
'<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
171 print
'<tr class="liste_titre">';
172 print
'<td>'.$langs->trans(
"Status").
'</td><td class="right">'.$langs->trans(
"Amount").
'</td><td class="right">%</td></tr>';
176 $row = $db->fetch_row(
$resql);
178 print
'<tr class="oddeven"><td>';
180 print $line->LibStatut($row[1], 1);
182 print
'</td><td class="right">';
183 print
price($row[0]);
185 print
'</td><td class="right">';
186 if ($object->amount) print round($row[0] / $object->amount * 100, 2).
" %";
198 print $db->error().
' '.$sql;
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Class to manage Dolibarr users.
Class to manage bank accounts.
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...
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
Class to manage withdrawal receipts.
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 ...
prelevement_prepare_head(BonPrelevement $object)
Prepare array with list of tabs.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
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.
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.
Class to manage withdrawals.