27 require
'../../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/lib/prelevement.lib.php';
29 require_once DOL_DOCUMENT_ROOT.
'/compta/prelevement/class/bonprelevement.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/compta/prelevement/class/ligneprelevement.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
34 $langs->loadLangs(array(
"banks",
"categories",
'withdrawals',
'bills'));
40 $type =
GETPOST(
'type',
'aZ09');
43 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
44 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
45 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
47 if (empty($page) || $page == -1) {
50 $offset = $limit * $page;
51 $pageprev = $page - 1;
52 $pagenext = $page + 1;
58 include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
61 if ($user->socid > 0) {
65 $type = $object->type;
66 if ($type ==
'bank-transfer') {
67 $result =
restrictedArea($user,
'paymentbybanktransfer',
'',
'',
'');
78 llxHeader(
'', $langs->trans(
"WithdrawalsReceipts"));
80 if ($id > 0 || $ref) {
81 if ($object->fetch($id, $ref) >= 0) {
83 print
dol_get_fiche_head($head,
'statistics', $langs->trans(
"WithdrawalsReceipts"), -1,
'payment');
85 $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>';
89 print
'<div class="fichecenter">';
90 print
'<div class="underbanner clearboth"></div>';
91 print
'<table class="border centpercent tableforfield">'.
"\n";
94 print
'<tr><td class="titlefieldcreate">'.$langs->trans(
"Date").
'</td><td>'.
dol_print_date($object->datec,
'day').
'</td></tr>';
95 print
'<tr><td>'.$langs->trans(
"Amount").
'</td><td><span class="amount">'.
price($object->amount).
'</span></td></tr>';
97 if ($object->date_trans <> 0) {
98 $muser =
new User($db);
99 $muser->fetch($object->user_trans);
101 print
'<tr><td>'.$langs->trans(
"TransData").
'</td><td>';
103 print
' <span class="opacitymedium">'.$langs->trans(
"By").
'</span> '.$muser->getNomUrl(-1).
'</td></tr>';
104 print
'<tr><td>'.$langs->trans(
"TransMetod").
'</td><td>';
105 print $object->methodes_trans[$object->method_trans];
108 if ($object->date_credit <> 0) {
109 print
'<tr><td>'.$langs->trans(
'CreditDate').
'</td><td>';
118 print
'<div class="underbanner clearboth"></div>';
119 print
'<table class="border centpercent tableforfield">';
122 $result = $acc->fetch($conf->global->PRELEVEMENT_ID_BANKACCOUNT);
124 print
'<tr><td class="titlefieldcreate">';
125 $labelofbankfield =
"BankToReceiveWithdraw";
126 if ($object->type ==
'bank-transfer') {
127 $labelofbankfield =
'BankToPayCreditTransfer';
129 print $langs->trans($labelofbankfield);
133 print $acc->getNomUrl(1);
138 print
'<tr><td class="titlefieldcreate">';
139 $labelfororderfield =
'WithdrawalFile';
140 if ($object->type ==
'bank-transfer') {
141 $labelfororderfield =
'CreditTransferFile';
143 print $langs->trans($labelfororderfield).
'</td><td>';
144 $relativepath =
'receipts/'.$object->ref.
'.xml';
145 $modulepart =
'prelevement';
146 if ($object->type ==
'bank-transfer') {
147 $modulepart =
'paymentbybanktransfer';
149 print
'<a data-ajax="false" href="'.DOL_URL_ROOT.
'/document.php?type=text/plain&modulepart='.$modulepart.
'&file='.urlencode($relativepath).
'">'.$relativepath;
150 print
img_picto(
'',
'download',
'class="paddingleft"');
152 print
'</td></tr></table>';
166 $sql =
"SELECT sum(pl.amount), pl.statut";
167 $sql .=
" FROM ".MAIN_DB_PREFIX.
"prelevement_lignes as pl";
168 $sql .=
" WHERE pl.fk_prelevement_bons = ".((int) $object->id);
169 $sql .=
" GROUP BY pl.statut";
171 $resql = $db->query($sql);
173 $num = $db->num_rows(
$resql);
178 print
"\n<!-- debut table -->\n";
179 print
'<div class="div-table-responsive-no-min">';
180 print
'<table class="noborder centpercent">';
181 print
'<tr class="liste_titre">';
182 print
'<td>'.$langs->trans(
"Status").
'</td><td class="right">'.$langs->trans(
"Amount").
'</td><td class="right">%</td></tr>';
185 $row = $db->fetch_row(
$resql);
187 print
'<tr class="oddeven"><td>';
189 print $line->LibStatut($row[1], 1);
193 print
'<td class="right"><span class="amount">';
194 print
price($row[0]);
195 print
'</span></td>';
197 print
'<td class="right">';
198 if ($object->amount) {
199 print round($row[0] / $object->amount * 100, 2).
" %";
214 print $db->error().
' '.$sql;
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 withdrawals.
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.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
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.
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.
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.