Fix: uniform code and reindent
This commit is contained in:
parent
1b1bb551d9
commit
ca63f3d8e9
@ -34,11 +34,10 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/member.lib.php");
|
|||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
$langs->load("members");
|
$langs->load("members");
|
||||||
|
|
||||||
if (!$user->admin)
|
if (! $user->admin) accessforbidden();
|
||||||
accessforbidden();
|
|
||||||
|
|
||||||
|
|
||||||
$typeconst=array('yesno','texte','chaine');
|
$type=array('yesno','texte','chaine');
|
||||||
|
|
||||||
$action = GETPOST("action");
|
$action = GETPOST("action");
|
||||||
|
|
||||||
@ -46,32 +45,30 @@ $action = GETPOST("action");
|
|||||||
// Action mise a jour ou ajout d'une constante
|
// Action mise a jour ou ajout d'une constante
|
||||||
if ($action == 'update' || $action == 'add')
|
if ($action == 'update' || $action == 'add')
|
||||||
{
|
{
|
||||||
$const=GETPOST("constname");
|
$constname=GETPOST("constname");
|
||||||
$value=GETPOST("constvalue");
|
$constvalue=GETPOST("constvalue");
|
||||||
|
|
||||||
if (($const=='ADHERENT_CARD_TYPE' || $const=='ADHERENT_ETIQUETTE_TYPE')
|
if (($constname=='ADHERENT_CARD_TYPE' || $constname=='ADHERENT_ETIQUETTE_TYPE') && $constvalue == -1) $constvalue='';
|
||||||
&& $value == -1) $value='';
|
if ($constname=='ADHERENT_LOGIN_NOT_REQUIRED') // Invert choice
|
||||||
if ($const=='ADHERENT_LOGIN_NOT_REQUIRED') // Invert choice
|
|
||||||
{
|
{
|
||||||
if ($value) $value=0;
|
if ($constvalue) $constvalue=0;
|
||||||
else $value=1;
|
else $constvalue=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (in_array($constname,array('ADHERENT_MAIL_VALID','ADHERENT_MAIL_COTIS','ADHERENT_MAIL_RESIL'))) $constvalue=$_POST["constvalue".$constname];
|
||||||
if (in_array($const,array('ADHERENT_MAIL_VALID','ADHERENT_MAIL_COTIS','ADHERENT_MAIL_RESIL'))) $value=$_POST["constvalue".$const];
|
$consttype=$_POST["consttype"];
|
||||||
$type=$_POST["consttype"];
|
|
||||||
$constnote=GETPOST("constnote");
|
$constnote=GETPOST("constnote");
|
||||||
$res=dolibarr_set_const($db,$const,$value,$typeconst[$type],0,$constnote,$conf->entity);
|
$res=dolibarr_set_const($db,$constname,$constvalue,$type[$consttype],0,$constnote,$conf->entity);
|
||||||
|
|
||||||
if (! $res > 0) $error++;
|
if (! $res > 0) $error++;
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
$mesg = '<div class="ok">'.$langs->trans("SetupSaved").'</div>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
$mesg = '<div class="error">'.$langs->trans("Error").'</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,7 +208,8 @@ if ($conf->global->ADHERENT_USE_MAILMAN)
|
|||||||
$lien=img_picto($langs->trans("Active"),'tick').' ';
|
$lien=img_picto($langs->trans("Active"),'tick').' ';
|
||||||
$lien.='<a href="'.$_SERVER["PHP_SELF"].'?action=unset&value=0&name=ADHERENT_USE_MAILMAN">'.$langs->trans("Disable").'</a>';
|
$lien.='<a href="'.$_SERVER["PHP_SELF"].'?action=unset&value=0&name=ADHERENT_USE_MAILMAN">'.$langs->trans("Disable").'</a>';
|
||||||
// Edition des varibales globales
|
// Edition des varibales globales
|
||||||
$constantes=array('ADHERENT_MAILMAN_LISTS',
|
$constantes=array(
|
||||||
|
'ADHERENT_MAILMAN_LISTS',
|
||||||
'ADHERENT_MAILMAN_ADMINPW',
|
'ADHERENT_MAILMAN_ADMINPW',
|
||||||
'ADHERENT_MAILMAN_URL',
|
'ADHERENT_MAILMAN_URL',
|
||||||
'ADHERENT_MAILMAN_UNSUB_URL'
|
'ADHERENT_MAILMAN_UNSUB_URL'
|
||||||
@ -254,12 +252,14 @@ if ($conf->global->ADHERENT_USE_SPIP)
|
|||||||
$lien=img_picto($langs->trans("Active"),'tick').' ';
|
$lien=img_picto($langs->trans("Active"),'tick').' ';
|
||||||
$lien.='<a href="'.$_SERVER["PHP_SELF"].'?action=unset&value=0&name=ADHERENT_USE_SPIP">'.$langs->trans("Disable").'</a>';
|
$lien.='<a href="'.$_SERVER["PHP_SELF"].'?action=unset&value=0&name=ADHERENT_USE_SPIP">'.$langs->trans("Disable").'</a>';
|
||||||
// Edition des varibales globales
|
// Edition des varibales globales
|
||||||
$constantes=array('ADHERENT_USE_SPIP_AUTO',
|
$constantes=array(
|
||||||
|
'ADHERENT_USE_SPIP_AUTO',
|
||||||
'ADHERENT_SPIP_SERVEUR',
|
'ADHERENT_SPIP_SERVEUR',
|
||||||
'ADHERENT_SPIP_DB',
|
'ADHERENT_SPIP_DB',
|
||||||
'ADHERENT_SPIP_USER',
|
'ADHERENT_SPIP_USER',
|
||||||
'ADHERENT_SPIP_PASS'
|
'ADHERENT_SPIP_PASS'
|
||||||
);
|
);
|
||||||
|
|
||||||
print_fiche_titre("SPIP CMS",$lien,'');
|
print_fiche_titre("SPIP CMS",$lien,'');
|
||||||
form_constantes($constantes);
|
form_constantes($constantes);
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@ -323,8 +323,8 @@ $constantes=array(
|
|||||||
'ADHERENT_MAIL_RESIL_SUBJECT',
|
'ADHERENT_MAIL_RESIL_SUBJECT',
|
||||||
'ADHERENT_MAIL_RESIL',
|
'ADHERENT_MAIL_RESIL',
|
||||||
'ADHERENT_MAIL_FROM',
|
'ADHERENT_MAIL_FROM',
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
print_fiche_titre($langs->trans("Other"),'','');
|
print_fiche_titre($langs->trans("Other"),'','');
|
||||||
|
|
||||||
form_constantes($constantes);
|
form_constantes($constantes);
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copytight (C) 2004 Christophe Combelles <ccomb@free.fr>
|
* Copytight (C) 2004 Christophe Combelles <ccomb@free.fr>
|
||||||
* Copytight (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
|
* Copytight (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||||
* Copytight (C) 2010-2011 Juanjo Menent <jmenent@@2byte.es>
|
* Copytight (C) 2010-2011 Juanjo Menent <jmenent@@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -69,7 +69,6 @@ $dateop=-1;
|
|||||||
|
|
||||||
if ($action == 'add' && $account && ! isset($_POST["cancel"]) && $user->rights->banque->modifier)
|
if ($action == 'add' && $account && ! isset($_POST["cancel"]) && $user->rights->banque->modifier)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (price2num($_POST["credit"]) > 0)
|
if (price2num($_POST["credit"]) > 0)
|
||||||
{
|
{
|
||||||
$amount = price2num($_POST["credit"]);
|
$amount = price2num($_POST["credit"]);
|
||||||
@ -96,7 +95,7 @@ if ($action == 'add' && $account && ! isset($_POST["cancel"]) && $user->rights->
|
|||||||
$insertid = $acct->addline($dateop, $operation, $label, $amount, $num_chq, $cat1, $user);
|
$insertid = $acct->addline($dateop, $operation, $label, $amount, $num_chq, $cat1, $user);
|
||||||
if ($insertid > 0)
|
if ($insertid > 0)
|
||||||
{
|
{
|
||||||
Header("Location: account.php?account=" . $account."&action=addline");
|
Header("Location: ".$_SERVER['PHP_SELF']."?account=" . $account."&action=addline");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -167,11 +166,11 @@ if ($account || $_GET["ref"])
|
|||||||
$var=True;
|
$var=True;
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$options = "<option value=\"0\" selected=\"true\"> </option>";
|
$options = '<option value="0" selected="true"> </option>';
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
$options .= "<option value=\"$obj->rowid\">$obj->label</option>\n";
|
$options.= '<option value="'.$obj->rowid.'">'.$obj->label.'</option>'."\n";
|
||||||
$nbcategories++;
|
$nbcategories++;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -184,13 +183,13 @@ if ($account || $_GET["ref"])
|
|||||||
$mode_search = 0;
|
$mode_search = 0;
|
||||||
if ($req_nb)
|
if ($req_nb)
|
||||||
{
|
{
|
||||||
$sql_rech.= " AND b.num_chq like '%".$db->escape($req_nb)."%'";
|
$sql_rech.= " AND b.num_chq LIKE '%".$db->escape($req_nb)."%'";
|
||||||
$param.='&req_nb='.urlencode($req_nb);
|
$param.='&req_nb='.urlencode($req_nb);
|
||||||
$mode_search = 1;
|
$mode_search = 1;
|
||||||
}
|
}
|
||||||
if ($_REQUEST["req_desc"])
|
if ($_REQUEST["req_desc"])
|
||||||
{
|
{
|
||||||
$sql_rech.= " AND b.label like '%".$db->escape($_REQUEST["req_desc"])."%'";
|
$sql_rech.= " AND b.label LIKE '%".$db->escape($_REQUEST["req_desc"])."%'";
|
||||||
$param.='&req_desc='.urlencode($_REQUEST["req_desc"]);
|
$param.='&req_desc='.urlencode($_REQUEST["req_desc"]);
|
||||||
$mode_search = 1;
|
$mode_search = 1;
|
||||||
}
|
}
|
||||||
@ -232,7 +231,7 @@ if ($account || $_GET["ref"])
|
|||||||
$sql.= " AND ba.entity = ".$conf->entity;
|
$sql.= " AND ba.entity = ".$conf->entity;
|
||||||
$sql.= $sql_rech;
|
$sql.= $sql_rech;
|
||||||
|
|
||||||
dol_syslog("account.php count transactions - sql=".$sql);
|
dol_syslog("account.php count transactions - sql=".$sql, LOG_DEBUG);
|
||||||
$result=$db->query($sql);
|
$result=$db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
@ -240,28 +239,20 @@ if ($account || $_GET["ref"])
|
|||||||
$nbline = $obj->nb;
|
$nbline = $obj->nb;
|
||||||
$total_lines = $nbline;
|
$total_lines = $nbline;
|
||||||
|
|
||||||
if ($nbline > $viewline )
|
if ($nbline > $viewline ) $limit = $nbline - $viewline ;
|
||||||
{
|
else $limit = $viewline;
|
||||||
$limit = $nbline - $viewline ;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$limit = $viewline;
|
|
||||||
}
|
|
||||||
|
|
||||||
$db->free($result);
|
$db->free($result);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($page > 0)
|
if ($page > 0)
|
||||||
{
|
{
|
||||||
$limitsql = $nbline - ($page * $viewline);
|
$limitsql = $nbline - ($page * $viewline);
|
||||||
if ($limitsql < $viewline)
|
if ($limitsql < $viewline) $limitsql = $viewline;
|
||||||
{
|
|
||||||
$limitsql = $viewline;
|
|
||||||
}
|
|
||||||
$nbline = $limitsql;
|
$nbline = $limitsql;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -291,24 +282,19 @@ if ($account || $_GET["ref"])
|
|||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
if ($mesg) print '<div class="error">'.$mesg.'</div>';
|
dol_htmloutput_errors($mesg);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Search form
|
* Search form
|
||||||
*/
|
*/
|
||||||
$param.='&account='.$acct->id;
|
$param.='&account='.$acct->id;
|
||||||
|
|
||||||
|
|
||||||
// Define transaction list navigation string
|
// Define transaction list navigation string
|
||||||
$navig='';
|
$navig='';
|
||||||
$navig.='<form action="'.$_SERVER["PHP_SELF"].'" name="newpage" method="GET">';
|
$navig.='<form action="'.$_SERVER["PHP_SELF"].'" name="newpage" method="GET">';
|
||||||
$nbpage=floor($total_lines/$viewline)+($total_lines % $viewline > 0?1:0); // Nombre de page total
|
$nbpage=floor($total_lines/$viewline)+($total_lines % $viewline > 0?1:0); // Nombre de page total
|
||||||
//print 'nbpage='.$nbpage.' viewline='.$viewline.' limitsql='.$limitsql;
|
//print 'nbpage='.$nbpage.' viewline='.$viewline.' limitsql='.$limitsql;
|
||||||
if ($limitsql > $viewline)
|
if ($limitsql > $viewline) $navig.='<a href="account.php?'.$param.'&page='.($page+1).'">'.img_previous().'</a>';
|
||||||
{
|
|
||||||
$navig.='<a href="account.php?'.$param.'&page='.($page+1).'">'.img_previous().'</a>';
|
|
||||||
}
|
|
||||||
$navig.= $langs->trans("Page")." "; // ' Page ';
|
$navig.= $langs->trans("Page")." "; // ' Page ';
|
||||||
$navig.='<input type="text" name="negpage" size="1" class="flat" value="'.($nbpage-$page).'">';
|
$navig.='<input type="text" name="negpage" size="1" class="flat" value="'.($nbpage-$page).'">';
|
||||||
$navig.='<input type="hidden" name="req_nb" value="'.$req_nb.'">';
|
$navig.='<input type="hidden" name="req_nb" value="'.$req_nb.'">';
|
||||||
@ -334,7 +320,6 @@ if ($account || $_GET["ref"])
|
|||||||
if ($ret == 'html') print '<br>';
|
if ($ret == 'html') print '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print '<table class="notopnoleftnoright" width="100%">';
|
print '<table class="notopnoleftnoright" width="100%">';
|
||||||
|
|
||||||
// Show title
|
// Show title
|
||||||
@ -343,7 +328,6 @@ if ($account || $_GET["ref"])
|
|||||||
print '<tr><td colspan="9" align="right">'.$navig.'</td></tr>';
|
print '<tr><td colspan="9" align="right">'.$navig.'</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Form to add a transaction with no invoice
|
// Form to add a transaction with no invoice
|
||||||
if ($user->rights->banque->modifier && $action == 'addline')
|
if ($user->rights->banque->modifier && $action == 'addline')
|
||||||
{
|
{
|
||||||
@ -391,12 +375,11 @@ if ($account || $_GET["ref"])
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print "</form>";
|
print "</form>";
|
||||||
|
|
||||||
print "<tr class=\"noborder\"><td colspan=\"8\"> </td></tr>\n";
|
print '<tr class="noborder"><td colspan="8"> </td></tr>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Affiche tableau des transactions bancaires
|
* Affiche tableau des transactions bancaires
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Ligne de titre tableau des ecritures
|
// Ligne de titre tableau des ecritures
|
||||||
@ -438,7 +421,8 @@ if ($account || $_GET["ref"])
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
|
|
||||||
/* Another solution
|
/*
|
||||||
|
* Another solution
|
||||||
* create temporary table solde type=heap select amount from llx_bank limit 100 ;
|
* create temporary table solde type=heap select amount from llx_bank limit 100 ;
|
||||||
* select sum(amount) from solde ;
|
* select sum(amount) from solde ;
|
||||||
*/
|
*/
|
||||||
@ -449,6 +433,7 @@ if ($account || $_GET["ref"])
|
|||||||
{
|
{
|
||||||
$sql.= ", s.rowid as socid, s.nom as thirdparty";
|
$sql.= ", s.rowid as socid, s.nom as thirdparty";
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
if ($mode_search && $conf->adherent->enabled)
|
if ($mode_search && $conf->adherent->enabled)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -457,6 +442,7 @@ if ($account || $_GET["ref"])
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba";
|
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."bank as b";
|
$sql.= ", ".MAIN_DB_PREFIX."bank as b";
|
||||||
if ($mode_search)
|
if ($mode_search)
|
||||||
@ -482,7 +468,7 @@ if ($account || $_GET["ref"])
|
|||||||
$sql.= $db->order("b.datev, b.datec", "ASC"); // We add date of creation to have correct order when everything is done the same day
|
$sql.= $db->order("b.datev, b.datec", "ASC"); // We add date of creation to have correct order when everything is done the same day
|
||||||
$sql.= $db->plimit($limitsql, 0);
|
$sql.= $db->plimit($limitsql, 0);
|
||||||
|
|
||||||
dol_syslog("account.php get transactions - sql=".$sql);
|
dol_syslog("account.php get transactions - sql=".$sql, LOG_DEBUG);
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
@ -514,12 +500,12 @@ if ($account || $_GET["ref"])
|
|||||||
print '<tr class="liste_total"><td colspan="8">';
|
print '<tr class="liste_total"><td colspan="8">';
|
||||||
print $langs->trans("CurrentBalance");
|
print $langs->trans("CurrentBalance");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print "<td align=\"right\" nowrap><b>".price($total - $objp->amount)."</b></td>";
|
print '<td align="right" nowrap><b>'.price($total - $objp->amount).'</b></td>';
|
||||||
print "<td> </td>";
|
print "<td> </td>";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<tr $bc[$var]>";
|
print '<tr '.$bc[$var].'>';
|
||||||
|
|
||||||
print '<td nowrap="nowrap">'.dol_print_date($db->jdate($objp->do),"day")."</td>\n";
|
print '<td nowrap="nowrap">'.dol_print_date($db->jdate($objp->do),"day")."</td>\n";
|
||||||
|
|
||||||
@ -554,16 +540,20 @@ if ($account || $_GET["ref"])
|
|||||||
$links = $acct->get_url($objp->rowid);
|
$links = $acct->get_url($objp->rowid);
|
||||||
foreach($links as $key=>$val)
|
foreach($links as $key=>$val)
|
||||||
{
|
{
|
||||||
if ($links[$key]['type']=='payment') {
|
if ($links[$key]['type']=='payment')
|
||||||
|
{
|
||||||
$paymentstatic->id=$links[$key]['url_id'];
|
$paymentstatic->id=$links[$key]['url_id'];
|
||||||
print ' '.$paymentstatic->getNomUrl(2);
|
print ' '.$paymentstatic->getNomUrl(2);
|
||||||
}
|
}
|
||||||
else if ($links[$key]['type']=='payment_supplier') {
|
else if ($links[$key]['type']=='payment_supplier')
|
||||||
|
{
|
||||||
$paymentsupplierstatic->id=$links[$key]['url_id'];
|
$paymentsupplierstatic->id=$links[$key]['url_id'];
|
||||||
$paymentsupplierstatic->ref=$links[$key]['url_id'];
|
$paymentsupplierstatic->ref=$links[$key]['url_id'];
|
||||||
print ' '.$paymentsupplierstatic->getNomUrl(2);
|
print ' '.$paymentsupplierstatic->getNomUrl(2);
|
||||||
}
|
}
|
||||||
else if ($links[$key]['type']=='company') {
|
else if ($links[$key]['type']=='company')
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
else if ($links[$key]['type']=='payment_sc')
|
else if ($links[$key]['type']=='payment_sc')
|
||||||
{
|
{
|
||||||
@ -572,7 +562,6 @@ if ($account || $_GET["ref"])
|
|||||||
print ' '.img_object($langs->trans('ShowPayment'),'payment').' ';
|
print ' '.img_object($langs->trans('ShowPayment'),'payment').' ';
|
||||||
//print $langs->trans("SocialContributionPayment");
|
//print $langs->trans("SocialContributionPayment");
|
||||||
print '</a>';
|
print '</a>';
|
||||||
|
|
||||||
}
|
}
|
||||||
else if ($links[$key]['type']=='payment_vat')
|
else if ($links[$key]['type']=='payment_vat')
|
||||||
{
|
{
|
||||||
@ -580,14 +569,21 @@ if ($account || $_GET["ref"])
|
|||||||
$paymentvatstatic->ref=$links[$key]['url_id'];
|
$paymentvatstatic->ref=$links[$key]['url_id'];
|
||||||
print ' '.$paymentvatstatic->getNomUrl(2);
|
print ' '.$paymentvatstatic->getNomUrl(2);
|
||||||
}
|
}
|
||||||
else if ($links[$key]['type']=='banktransfert') {
|
else if ($links[$key]['type']=='banktransfert')
|
||||||
|
{
|
||||||
// Do not show this link (avoid confusion). Can already be accessed from transaction detail
|
// Do not show this link (avoid confusion). Can already be accessed from transaction detail
|
||||||
}
|
}
|
||||||
else if ($links[$key]['type']=='member') {
|
else if ($links[$key]['type']=='member')
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
else if ($links[$key]['type']=='sc') {
|
else if ($links[$key]['type']=='sc')
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
else { // Show link with label $links[$key]['label']
|
else
|
||||||
|
{
|
||||||
|
// Show link with label $links[$key]['label']
|
||||||
if (! empty($objp->label) && ! empty($links[$key]['label'])) print ' - ';
|
if (! empty($objp->label) && ! empty($links[$key]['label'])) print ' - ';
|
||||||
print '<a href="'.$links[$key]['url'].$links[$key]['url_id'].'">';
|
print '<a href="'.$links[$key]['url'].$links[$key]['url_id'].'">';
|
||||||
if (preg_match('/^\((.*)\)$/i',$links[$key]['label'],$reg))
|
if (preg_match('/^\((.*)\)$/i',$links[$key]['label'],$reg))
|
||||||
@ -605,17 +601,19 @@ if ($account || $_GET["ref"])
|
|||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|
||||||
// Add third party column
|
// Add third party column
|
||||||
print '<td>';
|
print '<td>';
|
||||||
foreach($links as $key=>$val)
|
foreach($links as $key=>$val)
|
||||||
{
|
{
|
||||||
if ($links[$key]['type']=='company') {
|
if ($links[$key]['type']=='company')
|
||||||
|
{
|
||||||
$societestatic->id=$links[$key]['url_id'];
|
$societestatic->id=$links[$key]['url_id'];
|
||||||
$societestatic->nom=$links[$key]['label'];
|
$societestatic->nom=$links[$key]['label'];
|
||||||
print $societestatic->getNomUrl(1,'',16);
|
print $societestatic->getNomUrl(1,'',16);
|
||||||
}
|
}
|
||||||
else if ($links[$key]['type']=='sc') { // sc=old value
|
else if ($links[$key]['type']=='sc')
|
||||||
|
{
|
||||||
|
// sc=old value
|
||||||
$chargestatic->id=$links[$key]['url_id'];
|
$chargestatic->id=$links[$key]['url_id'];
|
||||||
if (preg_match('/^\((.*)\)$/i',$links[$key]['label'],$reg))
|
if (preg_match('/^\((.*)\)$/i',$links[$key]['label'],$reg))
|
||||||
{
|
{
|
||||||
@ -629,7 +627,8 @@ if ($account || $_GET["ref"])
|
|||||||
$chargestatic->ref=$chargestatic->lib;
|
$chargestatic->ref=$chargestatic->lib;
|
||||||
print $chargestatic->getNomUrl(1,16);
|
print $chargestatic->getNomUrl(1,16);
|
||||||
}
|
}
|
||||||
else if ($links[$key]['type']=='member') {
|
else if ($links[$key]['type']=='member')
|
||||||
|
{
|
||||||
$memberstatic->id=$links[$key]['url_id'];
|
$memberstatic->id=$links[$key]['url_id'];
|
||||||
$memberstatic->ref=$links[$key]['label'];
|
$memberstatic->ref=$links[$key]['label'];
|
||||||
print $memberstatic->getNomUrl(1,16,'card');
|
print $memberstatic->getNomUrl(1,16,'card');
|
||||||
@ -640,11 +639,11 @@ if ($account || $_GET["ref"])
|
|||||||
// Amount
|
// Amount
|
||||||
if ($objp->amount < 0)
|
if ($objp->amount < 0)
|
||||||
{
|
{
|
||||||
print "<td align=\"right\" nowrap>".price($objp->amount * -1)."</td><td> </td>\n";
|
print '<td align="right" nowrap>'.price($objp->amount * -1).'</td><td> </td>'."\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "<td> </td><td align=\"right\" nowrap> ".price($objp->amount)."</td>\n";
|
print '<td> </td><td align="right" nowrap> '.price($objp->amount).'</td>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Balance
|
// Balance
|
||||||
@ -667,12 +666,12 @@ if ($account || $_GET["ref"])
|
|||||||
// Transaction reconciliated or edit link
|
// Transaction reconciliated or edit link
|
||||||
if ($objp->rappro && $acct->canBeConciliated() > 0) // If line not conciliated and account can be conciliated
|
if ($objp->rappro && $acct->canBeConciliated() > 0) // If line not conciliated and account can be conciliated
|
||||||
{
|
{
|
||||||
print "<td align=\"center\" nowrap>";
|
print '<td align="center" nowrap>';
|
||||||
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&account='.$acct->id.'&page='.$page.'">';
|
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&account='.$acct->id.'&page='.$page.'">';
|
||||||
print img_edit();
|
print img_edit();
|
||||||
print '</a>';
|
print '</a>';
|
||||||
print " ";
|
print " ";
|
||||||
print "<a href=\"releve.php?num=$objp->num_releve&account=$acct->id\">$objp->num_releve</a>";
|
print '<a href="releve.php?num='.$objp->num_releve.'&account='.$acct->id.'">'.$objp->num_releve.'</a>';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -708,7 +707,6 @@ if ($account || $_GET["ref"])
|
|||||||
}
|
}
|
||||||
|
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
@ -732,7 +730,6 @@ if ($account || $_GET["ref"])
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
print "\n</div>\n";
|
print "\n</div>\n";
|
||||||
@ -753,7 +750,7 @@ if ($account || $_GET["ref"])
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "<a class=\"butActionRefused\" title=\"".$langs->trans("NotEnoughPermissions")."\" href=\"#\">".$langs->trans("Conciliate")."</a>";
|
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("Conciliate").'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -765,7 +762,7 @@ if ($account || $_GET["ref"])
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "<a class=\"butActionRefused\" title=\"".$langs->trans("NotEnoughPermissions")."\" href=\"#\">".$langs->trans("AddBankRecord")."</a>";
|
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("AddBankRecord").'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -773,7 +770,6 @@ if ($account || $_GET["ref"])
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user