Qual: Uniformize code
This commit is contained in:
parent
7c543d0c2a
commit
2c05d99742
@ -543,41 +543,37 @@ if ($id > 0 || ! empty($ref))
|
||||
if ($links[$key]['type']=='payment')
|
||||
{
|
||||
$paymentstatic->id=$links[$key]['url_id'];
|
||||
$paymentstatic->ref=$links[$key]['url_id'];
|
||||
print ' '.$paymentstatic->getNomUrl(2);
|
||||
}
|
||||
else if ($links[$key]['type']=='payment_supplier')
|
||||
elseif ($links[$key]['type']=='payment_supplier')
|
||||
{
|
||||
$paymentsupplierstatic->id=$links[$key]['url_id'];
|
||||
$paymentsupplierstatic->ref=$links[$key]['url_id'];
|
||||
print ' '.$paymentsupplierstatic->getNomUrl(2);
|
||||
}
|
||||
else if ($links[$key]['type']=='company')
|
||||
elseif ($links[$key]['type']=='payment_sc')
|
||||
{
|
||||
|
||||
}
|
||||
else if ($links[$key]['type']=='payment_sc')
|
||||
{
|
||||
//print ' - ';
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/fiche.php?id='.$links[$key]['url_id'].'">';
|
||||
print ' '.img_object($langs->trans('ShowPayment'),'payment').' ';
|
||||
//print $langs->trans("SocialContributionPayment");
|
||||
print '</a>';
|
||||
}
|
||||
else if ($links[$key]['type']=='payment_vat')
|
||||
elseif ($links[$key]['type']=='payment_vat')
|
||||
{
|
||||
$paymentvatstatic->id=$links[$key]['url_id'];
|
||||
$paymentvatstatic->ref=$links[$key]['url_id'];
|
||||
print ' '.$paymentvatstatic->getNomUrl(2);
|
||||
}
|
||||
else if ($links[$key]['type']=='banktransfert')
|
||||
elseif ($links[$key]['type']=='banktransfert')
|
||||
{
|
||||
// Do not show link to transfer ince there is no transfer card (avoid confusion). Can already be accessed from transaction detail.
|
||||
// Do not show link to transfer since there is no transfer card (avoid confusion). Can already be accessed from transaction detail.
|
||||
if ($objp->amount > 0)
|
||||
{
|
||||
$banklinestatic->fetch($links[$key]['url_id']);
|
||||
$bankstatic->id=$banklinestatic->fk_account;
|
||||
$bankstatic->label=$banklinestatic->bank_account_label;
|
||||
print ' ('.$langs->trans("From ");
|
||||
print ' ('.$langs->trans("from").' ';
|
||||
print $bankstatic->getNomUrl(1,'transactions');
|
||||
print ' '.$langs->trans("toward").' ';
|
||||
$bankstatic->id=$objp->bankid;
|
||||
@ -589,7 +585,7 @@ if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$bankstatic->id=$objp->bankid;
|
||||
$bankstatic->label=$objp->bankref;
|
||||
print ' ('.$langs->trans("From ");
|
||||
print ' ('.$langs->trans("from").' ';
|
||||
print $bankstatic->getNomUrl(1,'');
|
||||
print ' '.$langs->trans("toward").' ';
|
||||
$banklinestatic->fetch($links[$key]['url_id']);
|
||||
@ -600,11 +596,15 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
//var_dump($links);
|
||||
}
|
||||
else if ($links[$key]['type']=='member')
|
||||
elseif ($links[$key]['type']=='company')
|
||||
{
|
||||
|
||||
}
|
||||
else if ($links[$key]['type']=='sc')
|
||||
elseif ($links[$key]['type']=='member')
|
||||
{
|
||||
|
||||
}
|
||||
elseif ($links[$key]['type']=='sc')
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -20,11 +20,17 @@
|
||||
/**
|
||||
* \file htdocs/compta/bank/releve.php
|
||||
* \ingroup banque
|
||||
* \brief Page d'affichage d'un releve
|
||||
* \brief Page to show a bank receipt report
|
||||
*/
|
||||
|
||||
require('../../main.inc.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
@ -76,6 +82,14 @@ $pagenext = $page + 1;
|
||||
llxHeader();
|
||||
|
||||
$form = new Form($db);
|
||||
$societestatic=new Societe($db);
|
||||
$chargestatic=new ChargeSociales($db);
|
||||
$memberstatic=new Adherent($db);
|
||||
$paymentstatic=new Paiement($db);
|
||||
$paymentsupplierstatic=new PaiementFourn($db);
|
||||
$paymentvatstatic=new TVA($db);
|
||||
$bankstatic=new Account($db);
|
||||
$banklinestatic=new AccountLine($db);
|
||||
|
||||
|
||||
// Load account
|
||||
@ -131,7 +145,7 @@ if (empty($num))
|
||||
print_barre_liste('', $page, $_SERVER["PHP_SELF"], "&account=".$acct->id, $sortfield, $sortorder,'',$numrows);
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("AccountStatement").'</td></tr>';
|
||||
|
||||
//while ($i < min($numrows,$conf->liste_limit)) // retrait de la limite tant qu'il n'y a pas de pagination
|
||||
@ -145,7 +159,7 @@ if (empty($num))
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<tr $bc[$var]><td><a href=\"releve.php?num=$objp->numr&account=".$acct->id."\">$objp->numr</a></td></tr>\n";
|
||||
print '<tr '.$bc[$var].'><td><a href="releve.php?num='.$objp->numr.'&account='.$acct->id.'">'.$objp->numr.'</a></td></tr>'."\n";
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
@ -252,13 +266,16 @@ else
|
||||
}
|
||||
|
||||
// Recherche les ecritures pour le releve
|
||||
$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv";
|
||||
$sql.= ", b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
|
||||
$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv,";
|
||||
$sql.= " b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type,";
|
||||
$sql.= " ba.rowid as bankid, ba.ref as bankref, ba.label as banklabel";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."bank as b";
|
||||
$sql.= " WHERE b.num_releve='".$db->escape($num)."'";
|
||||
if (!isset($num)) $sql.= " OR b.num_releve is null";
|
||||
$sql.= " AND b.fk_account = ".$acct->id;
|
||||
$sql.= " ORDER BY b.datev ASC";
|
||||
$sql.= " AND b.fk_account = ba.rowid";
|
||||
$sql.= $db->order("b.datev, b.datec", "ASC"); // We add date of creation to have correct order when everything is done the same day
|
||||
|
||||
$result = $db->query($sql);
|
||||
|
||||
@ -314,19 +331,61 @@ else
|
||||
else print '<br>';
|
||||
if ($links[$key]['type']=='payment')
|
||||
{
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$links[$key]['url_id'].'">';
|
||||
print img_object($langs->trans('ShowPayment'),'payment').' ';
|
||||
print $langs->trans("Payment");
|
||||
print '</a>';
|
||||
$paymentstatic->id=$links[$key]['url_id'];
|
||||
$paymentstatic->ref=$langs->trans("Payment");
|
||||
print ' '.$paymentstatic->getNomUrl(1);
|
||||
$newline=0;
|
||||
}
|
||||
elseif ($links[$key]['type']=='payment_supplier') {
|
||||
print '<a href="'.DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$links[$key]['url_id'].'">';
|
||||
print img_object($langs->trans('ShowPayment'),'payment').' ';
|
||||
print $langs->trans("Payment");
|
||||
print '</a>';
|
||||
elseif ($links[$key]['type']=='payment_supplier')
|
||||
{
|
||||
$paymentsupplierstatic->id=$links[$key]['url_id'];
|
||||
$paymentsupplierstatic->ref=$langs->trans("Payment");;
|
||||
print ' '.$paymentsupplierstatic->getNomUrl(1);
|
||||
$newline=0;
|
||||
}
|
||||
elseif ($links[$key]['type']=='payment_sc')
|
||||
{
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/fiche.php?id='.$links[$key]['url_id'].'">';
|
||||
print ' '.img_object($langs->trans('ShowPayment'),'payment').' ';
|
||||
print $langs->trans("SocialContributionPayment");
|
||||
print '</a>';
|
||||
$newline=0;
|
||||
}
|
||||
elseif ($links[$key]['type']=='payment_vat')
|
||||
{
|
||||
$paymentvatstatic->id=$links[$key]['url_id'];
|
||||
$paymentvatstatic->ref=$langs->trans("Payment");
|
||||
print ' '.$paymentvatstatic->getNomUrl(2);
|
||||
}
|
||||
elseif ($links[$key]['type']=='banktransfert') {
|
||||
// Do not show link to transfer since there is no transfer card (avoid confusion). Can already be accessed from transaction detail.
|
||||
if ($objp->amount > 0)
|
||||
{
|
||||
$banklinestatic->fetch($links[$key]['url_id']);
|
||||
$bankstatic->id=$banklinestatic->fk_account;
|
||||
$bankstatic->label=$banklinestatic->bank_account_label;
|
||||
print ' ('.$langs->trans("from").' ';
|
||||
print $bankstatic->getNomUrl(1,'transactions');
|
||||
print ' '.$langs->trans("toward").' ';
|
||||
$bankstatic->id=$objp->bankid;
|
||||
$bankstatic->label=$objp->bankref;
|
||||
print $bankstatic->getNomUrl(1,'');
|
||||
print ')';
|
||||
}
|
||||
else
|
||||
{
|
||||
$bankstatic->id=$objp->bankid;
|
||||
$bankstatic->label=$objp->bankref;
|
||||
print ' ('.$langs->trans("from").' ';
|
||||
print $bankstatic->getNomUrl(1,'');
|
||||
print ' '.$langs->trans("toward").' ';
|
||||
$banklinestatic->fetch($links[$key]['url_id']);
|
||||
$bankstatic->id=$banklinestatic->fk_account;
|
||||
$bankstatic->label=$banklinestatic->bank_account_label;
|
||||
print $bankstatic->getNomUrl(1,'transactions');
|
||||
print ')';
|
||||
}
|
||||
}
|
||||
elseif ($links[$key]['type']=='company') {
|
||||
print '<a href="'.DOL_URL_ROOT.'/societe/soc.php?socid='.$links[$key]['url_id'].'">';
|
||||
print img_object($langs->trans('ShowCustomer'),'company').' ';
|
||||
@ -334,34 +393,19 @@ else
|
||||
print '</a>';
|
||||
$newline=0;
|
||||
}
|
||||
else if ($links[$key]['type']=='sc') {
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$links[$key]['url_id'].'">';
|
||||
print img_object($langs->trans('ShowBill'),'bill').' ';
|
||||
print $langs->trans("SocialContribution");
|
||||
print '</a>';
|
||||
$newline=0;
|
||||
}
|
||||
else if ($links[$key]['type']=='payment_sc') {
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/sociales/xxx.php?id='.$links[$key]['url_id'].'">';
|
||||
print img_object($langs->trans('ShowPayment'),'payment').' ';
|
||||
print $langs->trans("SocialContributionPayment");
|
||||
print '</a>';
|
||||
$newline=0;
|
||||
}
|
||||
else if ($links[$key]['type']=='member') {
|
||||
elseif ($links[$key]['type']=='member') {
|
||||
print '<a href="'.DOL_URL_ROOT.'/adherents/fiche.php?rowid='.$links[$key]['url_id'].'">';
|
||||
print img_object($langs->trans('ShowMember'),'user').' ';
|
||||
print $links[$key]['label'];
|
||||
print '</a>';
|
||||
$newline=0;
|
||||
}
|
||||
else if ($links[$key]['type']=='banktransfert') {
|
||||
/* print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$links[$key]['url_id'].'">';
|
||||
print img_object($langs->trans('ShowTransaction'),'payment').' ';
|
||||
print $langs->trans("TransactionOnTheOtherAccount");
|
||||
print '</a>';
|
||||
$newline=0;
|
||||
*/
|
||||
elseif ($links[$key]['type']=='sc') {
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$links[$key]['url_id'].'">';
|
||||
print img_object($langs->trans('ShowBill'),'bill').' ';
|
||||
print $langs->trans("SocialContribution");
|
||||
print '</a>';
|
||||
$newline=0;
|
||||
}
|
||||
else {
|
||||
print '<a href="'.$links[$key]['url'].$links[$key]['url_id'].'">';
|
||||
|
||||
@ -140,6 +140,7 @@ ConfirmClone=Choose data you want to clone :
|
||||
NoCloneOptionsSpecified=No data to clone defined.
|
||||
Of=of
|
||||
Go=Go
|
||||
Run=Run
|
||||
CopyOf=Copy of
|
||||
Show=Show
|
||||
ShowCardHere=Show card
|
||||
@ -648,6 +649,8 @@ Element=Element
|
||||
NoPhotoYet=No pictures available yet
|
||||
HomeDashboard=Home summary
|
||||
Deductible=Deductible
|
||||
from=from
|
||||
toward=toward
|
||||
|
||||
# Week day
|
||||
Monday=Monday
|
||||
|
||||
@ -141,6 +141,7 @@ ConfirmClone=Veuillez choisir votre option de clonage :
|
||||
NoCloneOptionsSpecified=Aucun option de clonage n'a été spécifiée.
|
||||
Of=du
|
||||
Go=Aller
|
||||
Run=Lancer
|
||||
CopyOf=Copie de
|
||||
Show=Voir
|
||||
ShowCardHere=Voir la fiche ici
|
||||
@ -652,6 +653,8 @@ Element=Élément
|
||||
NoPhotoYet=Pas de photo disponible pour l'instant
|
||||
HomeDashboard=Synthèse accueil
|
||||
Deductible=Déductible
|
||||
from=de
|
||||
toward=vers
|
||||
|
||||
# Week day
|
||||
Monday=Lundi
|
||||
|
||||
Loading…
Reference in New Issue
Block a user