Fix debug direct debit module
This commit is contained in:
parent
63876a1b91
commit
ebe625aa16
Binary file not shown.
@ -45,16 +45,25 @@ if ($user->societe_id > 0) accessforbidden();
|
||||
// Get supervariables
|
||||
$action = GETPOST('action','alpha');
|
||||
$id = GETPOST('id','int');
|
||||
|
||||
$socid = GETPOST('socid','int');
|
||||
$page = GETPOST('page','int');
|
||||
$sortorder = ((GETPOST('sortorder','alpha')=="")) ? "DESC" : GETPOST('sortorder','alpha');
|
||||
$sortfield = ((GETPOST('sortfield','alpha')=="")) ? "pl.fk_soc" : GETPOST('sortfield','alpha');
|
||||
|
||||
|
||||
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortfield) $sortfield='pl.fk_soc';
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ( $action == 'confirm_delete' )
|
||||
{
|
||||
$bon = new BonPrelevement($db,"");
|
||||
@ -73,10 +82,12 @@ if ( $action == 'confirm_credite' && GETPOST('confirm','alpha') == 'yes')
|
||||
$bon = new BonPrelevement($db,"");
|
||||
$bon->fetch($id);
|
||||
|
||||
$bon->set_credite();
|
||||
|
||||
header("Location: card.php?id=".$id);
|
||||
exit;
|
||||
$res=$bon->set_credite();
|
||||
if ($res >= 0)
|
||||
{
|
||||
header("Location: card.php?id=".$id);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'infotrans' && $user->rights->prelevement->bons->send)
|
||||
@ -162,12 +173,12 @@ if ($id > 0)
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
|
||||
|
||||
// Status
|
||||
print '<tr><td width="20%">'.$langs->trans('Status').'</td>';
|
||||
print '<tr><td>'.$langs->trans('Status').'</td>';
|
||||
print '<td>'.$bon->getLibStatut(1).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -176,16 +187,16 @@ if ($id > 0)
|
||||
$muser = new User($db);
|
||||
$muser->fetch($bon->user_trans);
|
||||
|
||||
print '<tr><td width="20%">'.$langs->trans("TransData").'</td><td>';
|
||||
print '<tr><td>'.$langs->trans("TransData").'</td><td>';
|
||||
print dol_print_date($bon->date_trans,'day');
|
||||
print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("TransMetod").'</td><td>';
|
||||
print '<tr><td>'.$langs->trans("TransMetod").'</td><td>';
|
||||
print $bon->methodes_trans[$bon->method_trans];
|
||||
print '</td></tr>';
|
||||
}
|
||||
if($bon->date_credit <> 0)
|
||||
{
|
||||
print '<tr><td width="20%">'.$langs->trans('CreditDate').'</td><td>';
|
||||
print '<tr><td>'.$langs->trans('CreditDate').'</td><td>';
|
||||
print dol_print_date($bon->date_credit,'day');
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -194,7 +205,7 @@ if ($id > 0)
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<table class="border" width="100%"><tr><td width="20%">';
|
||||
print '<table class="border" width="100%"><tr><td class="titlefield">';
|
||||
print $langs->trans("WithdrawalFile").'</td><td>';
|
||||
$relativepath = 'receipts/'.$bon->ref.'.xml';
|
||||
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&modulepart=prelevement&file='.urlencode($relativepath).'">'.$relativepath.'</a>';
|
||||
@ -204,7 +215,6 @@ if ($id > 0)
|
||||
|
||||
|
||||
|
||||
|
||||
if (empty($bon->date_trans) && $user->rights->prelevement->bons->send && $action=='settransmitted')
|
||||
{
|
||||
print '<form method="post" name="userfile" action="card.php?id='.$bon->id.'" enctype="multipart/form-data">';
|
||||
@ -236,7 +246,7 @@ if ($id > 0)
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">'.$langs->trans("NotifyCredit").'</td></tr>';
|
||||
print '<tr '.$bc[false].'><td width="20%">'.$langs->trans('CreditDate').'</td><td>';
|
||||
print '<tr '.$bc[false].'><td>'.$langs->trans('CreditDate').'</td><td>';
|
||||
print $form->select_date('','','','','',"infocredit",1,1);
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
@ -269,17 +279,11 @@ if ($id > 0)
|
||||
|
||||
$ligne=new LignePrelevement($db,$user);
|
||||
|
||||
if ($page == -1) { $page = 0 ; }
|
||||
|
||||
$offset = $conf->liste_limit * $page ;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
/*
|
||||
* Lines into withdraw request
|
||||
*/
|
||||
$sql = "SELECT pl.rowid, pl.statut, pl.amount";
|
||||
$sql.= ", s.rowid as socid, s.nom as name";
|
||||
$sql = "SELECT pl.rowid, pl.statut, pl.amount,";
|
||||
$sql.= " s.rowid as socid, s.nom as name";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."prelevement_bons as pb";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
@ -306,7 +310,7 @@ if ($id > 0)
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Lines"),$_SERVER["PHP_SELF"],"pl.rowid",'',$urladd);
|
||||
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom",'',$urladd);
|
||||
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"pl.amount","",$urladd,'align="center"');
|
||||
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"pl.amount","",$urladd,'align="right"');
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
@ -320,13 +324,12 @@ if ($id > 0)
|
||||
|
||||
print "<tr ".$bc[$var].">";
|
||||
|
||||
// Status of line
|
||||
print "<td>";
|
||||
|
||||
print $ligne->LibStatut($obj->statut,2);
|
||||
print " ";
|
||||
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/ligne.php?id='.$obj->rowid.'">';
|
||||
print substr('000000'.$obj->rowid, -6);
|
||||
print sprintf("%06s",$obj->rowid);
|
||||
print '</a></td>';
|
||||
|
||||
$thirdparty=new Societe($db);
|
||||
@ -335,7 +338,7 @@ if ($id > 0)
|
||||
print $thirdparty->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
|
||||
print '<td align="center">'.price($obj->amount)."</td>\n";
|
||||
print '<td align="right">'.price($obj->amount)."</td>\n";
|
||||
|
||||
print '<td>';
|
||||
|
||||
@ -350,23 +353,18 @@ if ($id > 0)
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
$total += $obj->total_ttc;
|
||||
$total += $obj->amount;
|
||||
$var=!$var;
|
||||
$i++;
|
||||
}
|
||||
|
||||
if($socid)
|
||||
if ($num > 0)
|
||||
{
|
||||
print "<tr ".$bc[$var].">";
|
||||
|
||||
print '<tr class="liste_total">';
|
||||
print '<td>'.$langs->trans("Total").'</td>';
|
||||
|
||||
print '<td align="center">'.price($total)."</td>\n";
|
||||
|
||||
print '<td> </td>';
|
||||
|
||||
print '<td align="right">'.price($total)."</td>\n";
|
||||
print '<td> </td>';
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
|
||||
@ -323,7 +323,7 @@ class BonPrelevement extends CommonObject
|
||||
/**
|
||||
* Set credite and set status of linked invoices
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
function set_credite()
|
||||
{
|
||||
|
||||
@ -136,24 +136,22 @@ class LignePrelevement
|
||||
{
|
||||
return $langs->trans($this->statuts[$statut]);
|
||||
}
|
||||
|
||||
if ($mode == 1)
|
||||
{
|
||||
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut==2) return img_picto($langs->trans($this->statuts[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut==3) return img_picto($langs->trans($this->statuts[$statut]),'statut8').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]); // Waiting
|
||||
if ($statut==2) return img_picto($langs->trans($this->statuts[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]); // Credited
|
||||
if ($statut==3) return img_picto($langs->trans($this->statuts[$statut]),'statut8').' '.$langs->trans($this->statuts[$statut]); // Refused
|
||||
}
|
||||
if ($mode == 2)
|
||||
{
|
||||
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]),'statut1');
|
||||
if ($statut==2) return img_picto($langs->trans($this->statuts[$statut]),'statut4');
|
||||
if ($statut==2) return img_picto($langs->trans($this->statuts[$statut]),'statut6');
|
||||
if ($statut==3) return img_picto($langs->trans($this->statuts[$statut]),'statut8');
|
||||
}
|
||||
|
||||
if ($mode == 3)
|
||||
{
|
||||
if ($statut==0) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut1');
|
||||
if ($statut==2) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut4');
|
||||
if ($statut==2) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut6');
|
||||
if ($statut==3) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut8');
|
||||
}
|
||||
}
|
||||
|
||||
@ -239,6 +239,7 @@ else
|
||||
/*
|
||||
* List of latest withdraws
|
||||
*/
|
||||
/*
|
||||
$limit=5;
|
||||
|
||||
print load_fiche_titre($langs->trans("LastWithdrawalReceipts",$limit),'','');
|
||||
@ -291,6 +292,7 @@ else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
*/
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@ -110,10 +110,10 @@ if ($resql)
|
||||
print '<table class="liste" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Bill"));
|
||||
print_liste_field_titre($langs->trans("Company"));
|
||||
print_liste_field_titre($langs->trans("Amount"));
|
||||
print_liste_field_titre($langs->trans("DateRequest"));
|
||||
print_liste_field_titre($langs->trans("Bill"), $_SERVER["PHP_SELF"]);
|
||||
print_liste_field_titre($langs->trans("Company"), $_SERVER["PHP_SELF"]);
|
||||
print_liste_field_titre($langs->trans("Amount"), $_SERVER["PHP_SELF"], "", "", $param, 'align="right"');
|
||||
print_liste_field_titre($langs->trans("DateRequest"), $_SERVER["PHP_SELF"], "", "", $param, 'align="center"');
|
||||
print_liste_field_titre('');
|
||||
print '</tr>';
|
||||
|
||||
@ -154,7 +154,7 @@ if ($resql)
|
||||
|
||||
print '<td align="right">'.price($obj->total_ttc).'</td>';
|
||||
|
||||
print '<td align="right">'.dol_print_date($db->jdate($obj->date_demande),'day').'</td>';
|
||||
print '<td align="center">'.dol_print_date($db->jdate($obj->date_demande),'day').'</td>';
|
||||
|
||||
print '<td align="right"></td>';
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
@ -43,9 +43,25 @@ if ($user->societe_id > 0) accessforbidden();
|
||||
// Get supervariables
|
||||
$prev_id = GETPOST('id','int');
|
||||
$socid = GETPOST('socid','int');
|
||||
$page = GETPOST('page','int');
|
||||
$sortorder = ((GETPOST('sortorder','alpha')=="")) ? "DESC" : GETPOST('sortorder','alpha');
|
||||
$sortfield = ((GETPOST('sortfield','alpha')=="")) ? "p.ref" : GETPOST('sortfield','alpha');
|
||||
|
||||
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortfield) $sortfield='p.ref';
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$invoicetmp = new Facture($db);
|
||||
$thirdpartytmp = new Societe($db);
|
||||
|
||||
llxHeader('',$langs->trans("WithdrawalsReceipts"));
|
||||
|
||||
@ -60,30 +76,27 @@ if ($prev_id)
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
|
||||
// Status
|
||||
print '<tr><td width="20%">'.$langs->trans('Status').'</td>';
|
||||
print '<td>'.$bon->getLibStatut(1).'</td>';
|
||||
print '</tr>';
|
||||
print '<tr><td>'.$langs->trans('Status').'</td><td>'.$bon->getLibStatut(1).'</td></tr>';
|
||||
|
||||
if($bon->date_trans <> 0)
|
||||
{
|
||||
$muser = new User($db);
|
||||
$muser->fetch($bon->user_trans);
|
||||
|
||||
print '<tr><td width="20%">'.$langs->trans("TransData").'</td><td>';
|
||||
print '<tr><td>'.$langs->trans("TransData").'</td><td>';
|
||||
print dol_print_date($bon->date_trans,'day');
|
||||
print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("TransMetod").'</td><td>';
|
||||
print '<tr><td>'.$langs->trans("TransMetod").'</td><td>';
|
||||
print $bon->methodes_trans[$bon->method_trans];
|
||||
print '</td></tr>';
|
||||
}
|
||||
if($bon->date_credit <> 0)
|
||||
{
|
||||
print '<tr><td width="20%">'.$langs->trans('CreditDate').'</td><td>';
|
||||
print '<tr><td>'.$langs->trans('CreditDate').'</td><td>';
|
||||
print dol_print_date($bon->date_credit,'day');
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -92,7 +105,7 @@ if ($prev_id)
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<table class="border" width="100%"><tr><td width="20%">';
|
||||
print '<table class="border" width="100%"><tr><td class="titlefield">';
|
||||
print $langs->trans("WithdrawalFile").'</td><td>';
|
||||
$relativepath = 'receipts/'.$bon->ref.'.xml';
|
||||
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&modulepart=prelevement&file='.urlencode($relativepath).'">'.$relativepath.'</a>';
|
||||
@ -107,11 +120,8 @@ if ($prev_id)
|
||||
}
|
||||
}
|
||||
|
||||
$offset = $conf->liste_limit * $page ;
|
||||
|
||||
/*
|
||||
* Liste des factures
|
||||
*/
|
||||
// List of invoices
|
||||
$sql = "SELECT pf.rowid";
|
||||
$sql.= ",f.rowid as facid, f.facnumber as ref, f.total_ttc";
|
||||
$sql.= ", s.rowid as socid, s.nom as name, pl.statut";
|
||||
@ -127,27 +137,49 @@ $sql.= " AND pf.fk_facture = f.rowid";
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
if ($prev_id) $sql.= " AND p.rowid=".$prev_id;
|
||||
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
||||
$sql.= " ORDER BY $sortfield $sortorder ";
|
||||
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}
|
||||
|
||||
$sql.= $db->plimit($limit + 1,$offset);
|
||||
|
||||
$result = $db->query($sql);
|
||||
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
|
||||
$urladd = "&id=".$prev_id;
|
||||
$param = "&id=".$prev_id;
|
||||
|
||||
print_barre_liste("", $page, "factures.php", $urladd, $sortfield, $sortorder, '', $num);
|
||||
// Lines of title fields
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
||||
|
||||
$massactionbutton='';
|
||||
|
||||
print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, '', '', $limit);
|
||||
|
||||
print"\n<!-- debut table -->\n";
|
||||
print '<table class="liste" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Bill"),$_SERVER["PHP_SELF"],"p.ref",'',$urladd,'class="liste_titre"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom",'',$urladd,'class="liste_titre"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"f.total_ttc","",$urladd,'class="liste_titre" align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('');
|
||||
print_liste_field_titre($langs->trans("Bill"),$_SERVER["PHP_SELF"],"p.ref",'',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom",'',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("StatusDebitCredit"),$_SERVER["PHP_SELF"],"","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
@ -155,24 +187,31 @@ if ($result)
|
||||
|
||||
$total = 0;
|
||||
|
||||
while ($i < min($num,$conf->liste_limit))
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
print "<tr ".$bc[$var]."><td>";
|
||||
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">';
|
||||
print img_object($langs->trans("ShowBill"),"bill");
|
||||
print '</a> ';
|
||||
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">'.$obj->ref."</a></td>\n";
|
||||
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">';
|
||||
print img_object($langs->trans("ShowCompany"),"company"). ' '.$obj->name."</a></td>\n";
|
||||
|
||||
print '<td align="center">'.price($obj->total_ttc)."</td>\n";
|
||||
$invoicetmp->id = $obj->facid;
|
||||
$invoicetmp->ref = $obj->ref;
|
||||
|
||||
$thirdpartytmp->id = $obj->socid;
|
||||
$thirdpartytmp->name = $obj->name;
|
||||
|
||||
print "<tr ".$bc[$var].">";
|
||||
|
||||
print "<td>";
|
||||
print $invoicetmp->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
|
||||
print '<td>';
|
||||
print $thirdpartytmp->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
|
||||
// Amount
|
||||
print '<td align="right">'.price($obj->total_ttc)."</td>\n";
|
||||
|
||||
// Status of requests
|
||||
print '<td align="center">';
|
||||
|
||||
if ($obj->statut == 0)
|
||||
{
|
||||
@ -187,23 +226,25 @@ if ($result)
|
||||
print '<b>'.$langs->trans("StatusRefused").'</b>';
|
||||
}
|
||||
|
||||
print "</td></tr>\n";
|
||||
print "</td>";
|
||||
|
||||
print "<td></td>";
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
$total += $obj->total_ttc;
|
||||
$var=!$var;
|
||||
$i++;
|
||||
}
|
||||
|
||||
if($socid)
|
||||
if ($num > 0)
|
||||
{
|
||||
print "<tr ".$bc[$var]."><td>";
|
||||
|
||||
print '<tr class="liste_total">';
|
||||
print '<td>'.$langs->trans("Total").'</td>';
|
||||
|
||||
print '<td align="center">'.price($total)."</td>\n";
|
||||
|
||||
print '<td> </td>';
|
||||
|
||||
print '<td align="right">'.price($total)."</td>\n";
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
|
||||
@ -59,12 +59,12 @@ if ($prev_id)
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
|
||||
|
||||
// Status
|
||||
print '<tr><td width="20%">'.$langs->trans('Status').'</td>';
|
||||
print '<tr><td>'.$langs->trans('Status').'</td>';
|
||||
print '<td>'.$bon->getLibStatut(1).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -73,16 +73,16 @@ if ($prev_id)
|
||||
$muser = new User($db);
|
||||
$muser->fetch($bon->user_trans);
|
||||
|
||||
print '<tr><td width="20%">'.$langs->trans("TransData").'</td><td>';
|
||||
print '<tr><td>'.$langs->trans("TransData").'</td><td>';
|
||||
print dol_print_date($bon->date_trans,'day');
|
||||
print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("TransMetod").'</td><td>';
|
||||
print '<tr><td>'.$langs->trans("TransMetod").'</td><td>';
|
||||
print $bon->methodes_trans[$bon->method_trans];
|
||||
print '</td></tr>';
|
||||
}
|
||||
if($bon->date_credit <> 0)
|
||||
{
|
||||
print '<tr><td width="20%">'.$langs->trans('CreditDate').'</td><td>';
|
||||
print '<tr><td>'.$langs->trans('CreditDate').'</td><td>';
|
||||
print dol_print_date($bon->date_credit,'day');
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -91,7 +91,7 @@ if ($prev_id)
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<table class="border" width="100%"><tr><td width="20%">';
|
||||
print '<table class="border" width="100%"><tr><td class="titlefield">';
|
||||
print $langs->trans("WithdrawalFile").'</td><td>';
|
||||
$relativepath = 'receipts/'.$bon->ref.'.xml';
|
||||
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&modulepart=prelevement&file='.urlencode($relativepath).'">'.$relativepath.'</a>';
|
||||
@ -130,8 +130,7 @@ $sql.= " ORDER BY pl.amount DESC";
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
print"\n<!-- debut table -->\n";
|
||||
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
||||
@ -142,35 +141,47 @@ if ($resql)
|
||||
$var=True;
|
||||
$total = 0;
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
print "<tr ".$bc[$var]."><td>";
|
||||
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/ligne.php?id='.$obj->rowid.'">';
|
||||
print img_picto('', 'statut'.$obj->statut).' ';
|
||||
print substr('000000'.$obj->rowid, -6);
|
||||
print '</a></td>';
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.$obj->name."</a></td>\n";
|
||||
|
||||
print '<td align="right">'.price($obj->amount)."</td>\n";
|
||||
print '<td>'.$rej->motifs[$obj->motif].'</td>';
|
||||
|
||||
print '<td align="center">'.yn($obj->afacturer).'</td>';
|
||||
print '<td align="center">'.$obj->fk_facture.'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$total += $obj->amount;
|
||||
$var=!$var;
|
||||
$i++;
|
||||
if ($num > 0)
|
||||
{
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
print "<tr ".$bc[$var]."><td>";
|
||||
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/ligne.php?id='.$obj->rowid.'">';
|
||||
print img_picto('', 'statut'.$obj->statut).' ';
|
||||
print substr('000000'.$obj->rowid, -6);
|
||||
print '</a></td>';
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.$obj->name."</a></td>\n";
|
||||
|
||||
print '<td align="right">'.price($obj->amount)."</td>\n";
|
||||
print '<td>'.$rej->motifs[$obj->motif].'</td>';
|
||||
|
||||
print '<td align="center">'.yn($obj->afacturer).'</td>';
|
||||
print '<td align="center">'.$obj->fk_facture.'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$total += $obj->amount;
|
||||
$var=!$var;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
print '<tr class="liste_total"><td> </td>';
|
||||
print '<td class="liste_total">'.$langs->trans("Total").'</td>';
|
||||
print '<td align="right">'.price($total)."</td>\n";
|
||||
print '<td colspan="3"> </td>';
|
||||
print "</tr>\n</table>\n";
|
||||
else
|
||||
{
|
||||
print '<tr><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
|
||||
if ($num > 0)
|
||||
{
|
||||
print '<tr class="liste_total"><td> </td>';
|
||||
print '<td class="liste_total">'.$langs->trans("Total").'</td>';
|
||||
print '<td align="right">'.price($total)."</td>\n";
|
||||
print '<td colspan="3"> </td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
print "</table>\n";
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
|
||||
@ -57,12 +57,12 @@ if ($prev_id)
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
|
||||
|
||||
// Status
|
||||
print '<tr><td width="20%">'.$langs->trans('Status').'</td>';
|
||||
print '<tr><td>'.$langs->trans('Status').'</td>';
|
||||
print '<td>'.$bon->getLibStatut(1).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -71,16 +71,16 @@ if ($prev_id)
|
||||
$muser = new User($db);
|
||||
$muser->fetch($bon->user_trans);
|
||||
|
||||
print '<tr><td width="20%">'.$langs->trans("TransData").'</td><td>';
|
||||
print '<tr><td>'.$langs->trans("TransData").'</td><td>';
|
||||
print dol_print_date($bon->date_trans,'day');
|
||||
print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("TransMetod").'</td><td>';
|
||||
print '<tr><td>'.$langs->trans("TransMetod").'</td><td>';
|
||||
print $bon->methodes_trans[$bon->method_trans];
|
||||
print '</td></tr>';
|
||||
}
|
||||
if($bon->date_credit <> 0)
|
||||
{
|
||||
print '<tr><td width="20%">'.$langs->trans('CreditDate').'</td><td>';
|
||||
print '<tr><td>'.$langs->trans('CreditDate').'</td><td>';
|
||||
print dol_print_date($bon->date_credit,'day');
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -89,7 +89,7 @@ if ($prev_id)
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<table class="border" width="100%"><tr><td width="20%">';
|
||||
print '<table class="border" width="100%"><tr><td class="titlefield">';
|
||||
print $langs->trans("WithdrawalFile").'</td><td>';
|
||||
$relativepath = 'receipts/'.$bon->ref.'.xml';
|
||||
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&modulepart=prelevement&file='.urlencode($relativepath).'">'.$relativepath.'</a>';
|
||||
|
||||
@ -40,6 +40,7 @@ RefusedReason=Reason for rejection
|
||||
RefusedInvoicing=Billing the rejection
|
||||
NoInvoiceRefused=Do not charge the rejection
|
||||
InvoiceRefused=Invoice refused (Charge the rejection to customer)
|
||||
StatusDebitCredit=Status debit/credit
|
||||
StatusWaiting=Waiting
|
||||
StatusTrans=Sent
|
||||
StatusCredited=Credited
|
||||
|
||||
Loading…
Reference in New Issue
Block a user