28require 
'../../main.inc.php';
 
   29require_once DOL_DOCUMENT_ROOT.
'/core/lib/prelevement.lib.php';
 
   30require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
 
   31require_once DOL_DOCUMENT_ROOT.
'/compta/prelevement/class/bonprelevement.class.php';
 
   32require_once DOL_DOCUMENT_ROOT.
'/compta/prelevement/class/ligneprelevement.class.php';
 
   33require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
 
   44$langs->loadLangs(array(
"banks", 
"categories", 
'withdrawals', 
'bills'));
 
   54$sortfield = 
GETPOST(
'sortfield', 
'aZ09comma');
 
   55$sortorder = 
GETPOST(
'sortorder', 
'aZ09comma');
 
   57if (empty($page) || $page == -1) {
 
   60$offset = $limit * $page;
 
   68include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php'; 
 
   71if ($user->socid > 0) {
 
   76if ($type == 
'bank-transfer') {
 
   77  $result = 
restrictedArea($user, 
'paymentbybanktransfer', 
'', 
'', 
'');
 
   90llxHeader(
'', $langs->trans(
"WithdrawalsReceipts"));
 
   93  if (
$object->fetch($id, $ref) >= 0) {
 
   95    print 
dol_get_fiche_head($head, 
'statistics', $langs->trans(
"WithdrawalsReceipts"), -1, 
'payment');
 
   97    $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>';
 
   99    dol_banner_tab($object, 
'ref', $linkback, 1, 
'ref', 
'ref');
 
  101    print 
'<div class="fichecenter">';
 
  102    print 
'<div class="underbanner clearboth"></div>';
 
  103    print 
'<table class="border centpercent tableforfield">'.
"\n";
 
  106    print 
'<tr><td class="titlefieldcreate">'.$langs->trans(
"Date").
'</td><td>'.
dol_print_date(
$object->datec, 
'day').
'</td></tr>';
 
  107    print 
'<tr><td>'.$langs->trans(
"Amount").
'</td><td><span class="amount">'.
price(
$object->amount).
'</span></td></tr>';
 
  109    if (!empty(
$object->date_trans)) {
 
  110      $muser = 
new User($db);
 
  111      $muser->fetch(
$object->user_trans);
 
  113      print 
'<tr><td>'.$langs->trans(
"TransData").
'</td><td>';
 
  115      print 
'   <span class="opacitymedium">'.$langs->trans(
"By").
'</span> '.$muser->getNomUrl(-1).
'</td></tr>';
 
  116      print 
'<tr><td>'.$langs->trans(
"TransMetod").
'</td><td>';
 
  120    if (!empty(
$object->date_credit)) {
 
  121      print 
'<tr><td>'.$langs->trans(
'CreditDate').
'</td><td>';
 
  130    print 
'<div class="underbanner clearboth"></div>';
 
  131    print 
'<table class="border centpercent tableforfield">';
 
  135    $fk_bank_account = 
$object->fk_bank_account;
 
  136    if (empty($fk_bank_account)) {
 
  139    if ($fk_bank_account > 0) {
 
  140      $result = $acc->fetch($fk_bank_account);
 
  143    $labelofbankfield = 
"BankToReceiveWithdraw";
 
  144    if (
$object->type == 
'bank-transfer') {
 
  145      $labelofbankfield = 
'BankToPayCreditTransfer';
 
  148    print 
'<tr><td class="titlefieldcreate">';
 
  149    print $form->textwithpicto($langs->trans(
"BankAccount"), $langs->trans($labelofbankfield));
 
  153      print $acc->getNomUrl(1);
 
  158    $modulepart = 
'prelevement';
 
  159    if (
$object->type == 
'bank-transfer') {
 
  160      $modulepart = 
'paymentbybanktransfer';
 
  163    print 
'<tr><td class="titlefieldcreate">';
 
  164    $labelfororderfield = 
'WithdrawalFile';
 
  165    if (
$object->type == 
'bank-transfer') {
 
  166      $labelfororderfield = 
'CreditTransferFile';
 
  168    print $langs->trans($labelfororderfield).
'</td><td>';
 
  170    if (isModEnabled(
'multicompany')) {
 
  171      $labelentity = 
$conf->entity;
 
  172      $relativepath = 
'receipts/'.$object->ref.
'-'.$labelentity.
'.xml';
 
  174      if ($type != 
'bank-transfer') {
 
  175        $dir = 
$conf->prelevement->dir_output;
 
  177        $dir = 
$conf->paymentbybanktransfer->dir_output;
 
  180        $relativepath = 
'receipts/'.$object->ref.
'.xml';
 
  183      $relativepath = 
'receipts/'.$object->ref.
'.xml';
 
  186    print 
'<a data-ajax="false" href="'.DOL_URL_ROOT.
'/document.php?type=text/plain&modulepart='.$modulepart.
'&file='.urlencode($relativepath).
'">'.$relativepath;
 
  187    print 
img_picto(
'', 
'download', 
'class="paddingleft"');
 
  189    print 
'</td></tr></table>';
 
  203  $sql = 
"SELECT sum(pl.amount), pl.statut";
 
  204  $sql .= 
" FROM ".MAIN_DB_PREFIX.
"prelevement_lignes as pl";
 
  205  $sql .= 
" WHERE pl.fk_prelevement_bons = ".((int) 
$object->id);
 
  206  $sql .= 
" GROUP BY pl.statut";
 
  208  $resql = $db->query($sql);
 
  210    $num = $db->num_rows($resql);
 
  215    print
"\n<!-- debut table -->\n";
 
  216    print 
'<div class="div-table-responsive-no-min">'; 
 
  217    print 
'<table class="noborder centpercent">';
 
  218    print 
'<tr class="liste_titre">';
 
  219    print 
'<td>'.$langs->trans(
"Status").
'</td><td class="right">'.$langs->trans(
"Amount").
'</td><td class="right">%</td></tr>';
 
  222      $row = $db->fetch_row($resql);
 
  224      print 
'<tr class="oddeven"><td>';
 
  226      print $line->LibStatut($row[1], 1);
 
  230      print 
'<td class="right"><span class="amount">';
 
  231      print 
price($row[0]);
 
  232      print 
'</span></td>';
 
  234      print 
'<td class="right">';
 
  236        print round($row[0] / 
$object->amount * 100, 2).
" %";
 
  251    print $db->error().
' '.$sql;
 
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
 
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
 
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
 
Class to manage bank accounts.
 
Class to manage withdrawal receipts.
 
Class to manage withdrawals.
 
Class to manage Dolibarr users.
 
dol_is_file($pathoffile)
Return if path is a file.
 
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
 
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
 
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
 
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
 
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.
 
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
 
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
 
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
 
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
 
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
 
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.