Fix: Add social contributions in budget

This commit is contained in:
Laurent Destailleur 2008-07-31 16:07:40 +00:00
parent 82a3bd3913
commit 5d95afa149
11 changed files with 751 additions and 682 deletions

View File

@ -28,6 +28,7 @@ For users:
- Can attach several files to email when sending an invoice, order or - Can attach several files to email when sending an invoice, order or
proposal by email. proposal by email.
- More informations reported in system information pages. - More informations reported in system information pages.
- Add a budget report.
- New translation: Added spanish language. - New translation: Added spanish language.
- Added a security audit report. - Added a security audit report.
- Other minor changes (features, look, fixes) - Other minor changes (features, look, fixes)

View File

@ -15,15 +15,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/ */
/** /**
\file htdocs/chargesociales.class.php \file htdocs/chargesociales.class.php
\ingroup facture \ingroup facture
\brief Fichier de la classe des charges sociales \brief Fichier de la classe des charges sociales
\version $Revision$ \version $Id$
*/ */
@ -304,11 +302,37 @@ class ChargeSociales
$lien = '<a href="'.DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$this->id.'">';
$lienfin='</a>'; $lienfin='</a>';
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowBill"),'bill').$lienfin.' '); if ($withpicto) $result.=($lien.img_object($langs->trans("ShowSocialContribution"),'bill').$lienfin.' ');
$result.=$lien.($maxlen?dolibarr_trunc($this->lib,$maxlen):$this->lib).$lienfin; $result.=$lien.($maxlen?dolibarr_trunc($this->lib,$maxlen):$this->lib).$lienfin;
return $result; return $result;
} }
/**
* \brief Return amount aof payments already done
* \return int Amount of payment already done, <0 if KO
*/
function getSommePaiement()
{
$table='paiementcharge';
$field='amount';
$sql = 'SELECT sum(amount) as amount';
$sql.= ' FROM '.MAIN_DB_PREFIX.$table;
$sql.= ' WHERE '.$field.' = '.$this->id;
dolibarr_syslog("ChargeSociales::getSommePaiement sql=".$sql, LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
$obj = $this->db->fetch_object($resql);
$this->db->free($resql);
return $obj->amount;
}
else
{
return -1;
}
}
} }

File diff suppressed because it is too large Load Diff

View File

@ -94,7 +94,7 @@ foreach ($accounts as $key=>$type)
$acc->fetch($key); $acc->fetch($key);
$var = !$var; $var = !$var;
$solde = $acc->solde(); $solde = $acc->solde(1);
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td width="30%">'.$acc->getNomUrl(1).'</td>'; print '<td width="30%">'.$acc->getNomUrl(1).'</td>';
@ -148,7 +148,7 @@ foreach ($accounts as $key=>$type)
$acc->fetch($key); $acc->fetch($key);
$var = !$var; $var = !$var;
$solde = $acc->solde(); $solde = $acc->solde(1);
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td width="30%">'.$acc->getNomUrl(1).'</td>'; print '<td width="30%">'.$acc->getNomUrl(1).'</td>';
@ -200,7 +200,7 @@ foreach ($accounts as $key=>$type)
$acc->fetch($key); $acc->fetch($key);
$var = !$var; $var = !$var;
$solde = $acc->solde(); $solde = $acc->solde(1);
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td width="30%">'.$acc->getNomUrl(1).'</td>'; print '<td width="30%">'.$acc->getNomUrl(1).'</td>';

View File

@ -19,25 +19,25 @@
*/ */
/** /**
\file htdocs/compta/bank/treso.php \file htdocs/compta/bank/treso.php
\ingroup banque \ingroup banque
\brief Page de détail du budget de trésorerie \brief Page de détail du budget de trésorerie
\version $Id$ \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/bank.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/bank.lib.php");
require_once(DOL_DOCUMENT_ROOT."/societe.class.php");
require_once(DOL_DOCUMENT_ROOT.'/facture.class.php'); require_once(DOL_DOCUMENT_ROOT.'/facture.class.php');
require_once(DOL_DOCUMENT_ROOT.'/fourn/fournisseur.facture.class.php'); require_once(DOL_DOCUMENT_ROOT.'/fourn/fournisseur.facture.class.php');
require_once(DOL_DOCUMENT_ROOT."/societe.class.php"); require_once(DOL_DOCUMENT_ROOT.'/chargesociales.class.php');
$langs->load("banks"); $langs->load("banks");
$langs->load("bills"); $langs->load("bills");
if (!$user->admin && !$user->rights->banque) if (!$user->admin && !$user->rights->banque)
accessforbidden(); accessforbidden();
$account=isset($_GET["account"])?$_GET["account"]:$_POST["account"];
$vline=isset($_GET["vline"])?$_GET["vline"]:$_POST["vline"]; $vline=isset($_GET["vline"])?$_GET["vline"]:$_POST["vline"];
$page=isset($_GET["page"])?$_GET["page"]:0; $page=isset($_GET["page"])?$_GET["page"]:0;
@ -46,14 +46,15 @@ $mesg='';
/* /*
* Affichage page * View
*/ */
llxHeader(); llxHeader();
$societestatic = new Societe($db); $societestatic = new Societe($db);
$facturestatic=new Facture($db); $facturestatic=new Facture($db);
$facturefournstatic=new FactureFournisseur($db); $facturefournstatic=new FactureFournisseur($db);
$socialcontribstatic=new ChargeSociales($db);
$html = new Form($db); $html = new Form($db);
@ -69,11 +70,11 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
} }
$acct = new Account($db); $acct = new Account($db);
if ($_GET["account"]) if ($_GET["account"])
{ {
$result=$acct->fetch($_GET["account"]); $result=$acct->fetch($_GET["account"]);
} }
if ($_GET["ref"]) if ($_GET["ref"])
{ {
$result=$acct->fetch(0,$_GET["ref"]); $result=$acct->fetch(0,$_GET["ref"]);
$_GET["account"]=$acct->id; $_GET["account"]=$acct->id;
@ -81,13 +82,13 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
/* /*
* *
* *
*/ */
// Onglets // Onglets
$head=bank_prepare_head($acct); $head=bank_prepare_head($acct);
dolibarr_fiche_head($head,'cash',$langs->trans("FinancialAccount"),0); dolibarr_fiche_head($head,'cash',$langs->trans("FinancialAccount"),0);
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Ref // Ref
@ -103,173 +104,210 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
print '</table>'; print '</table>';
print '<br>'; print '<br>';
if ($mesg) print '<div class="error">'.$mesg.'</div>'; if ($mesg) print '<div class="error">'.$mesg.'</div>';
/* $solde = $acct->solde(0);
* Calcul du solde du compte bancaire
*/
$sql = "SELECT sum( amount ) AS solde";
$sql.= " FROM ".MAIN_DB_PREFIX."bank";
$sql.= " WHERE fk_account =".$account;
$result = $db->query($sql);
if ($result)
{
$obj = $db->fetch_object($result);
if ($obj) $solde = $obj->solde;
}
/* /*
* Affiche tableau des echeances à venir * Affiche tableau des echeances à venir
* */
*/
print '<table class="notopnoleftnoright" width="100% border="1">'; print '<table class="notopnoleftnoright" width="100% border="1">';
// Ligne de titre tableau des ecritures // Ligne de titre tableau des ecritures
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Invoices").'</td>'; print '<td>'.$langs->trans("Invoices").'</td>';
print '<td>'.$langs->trans("ThirdParty").'</td>'; print '<td>'.$langs->trans("ThirdParty").'</td>';
print '<td>'.$langs->trans("DateEcheance").'</td>'; print '<td align="center">'.$langs->trans("DateEcheance").'</td>';
print '<td align="right">'.$langs->trans("Debit").'</td>'; print '<td align="right">'.$langs->trans("Debit").'</td>';
print '<td align="right">'.$langs->trans("Credit").'</td>'; print '<td align="right">'.$langs->trans("Credit").'</td>';
print '<td align="right" width="80">'.$langs->trans("BankBalance").'</td>'; print '<td align="right" width="80">'.$langs->trans("BankBalance").'</td>';
print '</tr>'; print '</tr>';
// Solde initial $var=true;
print '<tr class="liste_total"><td align="left" colspan="5">'.$langs->trans("CurrentBalance").'</td>';
// Solde actuel
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td align="left" colspan="5">'.$langs->trans("CurrentBalance").'</td>';
print '<td align="right" nowrap>&nbsp;</td>';
print '</tr>';
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td align="left" colspan="5">&nbsp;</td>';
print '<td align="right" nowrap>'.price($solde).'</td>'; print '<td align="right" nowrap>'.price($solde).'</td>';
print '</tr>'; print '</tr>';
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td align="left" colspan="5">'.$langs->trans("RemainderToPay").'</td>';
print '<td align="right" nowrap>&nbsp;</td>';
print '</tr>';
// Recuperation des factures clients et fournisseurs impayes // Remainder to pay in future
$sql = "SELECT f.rowid as facid, f.facnumber, f.total_ttc, f.type, ".$db->pdate("f.date_lim_reglement")." as dlr,";
// Customer invoices
$sql = "SELECT 'invoice' as family, f.rowid as objid, f.facnumber as ref, f.total_ttc, f.type, ".$db->pdate("f.date_lim_reglement")." as dlr,";
$sql.= " s.rowid as socid, s.nom, s.fournisseur"; $sql.= " s.rowid as socid, s.nom, s.fournisseur";
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON f.fk_soc = s.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON f.fk_soc = s.rowid";
$sql.= " WHERE f.paye = 0 AND fk_statut = 1"; $sql.= " WHERE f.paye = 0 AND fk_statut = 1"; // Not payed
$sql.= " ORDER BY dlr ASC"; $sql.= " ORDER BY dlr ASC";
//$sql.= " UNION DISTINCT";
$sql2= " SELECT ff.rowid as facid, ff.facnumber, (-1*ff.total_ttc) as total_ttc, ff.type, ".$db->pdate("ff.date_lim_reglement")." as dlr,"; // Supplier invoices
$sql2= " SELECT 'supplier_invoice' as family, ff.rowid as objid, ff.facnumber as ref, (-1*ff.total_ttc) as total_ttc, ff.type, ".$db->pdate("ff.date_lim_reglement")." as dlr,";
$sql2.= " s.rowid as socid, s.nom, s.fournisseur"; $sql2.= " s.rowid as socid, s.nom, s.fournisseur";
$sql2.= " FROM ".MAIN_DB_PREFIX."facture_fourn as ff"; $sql2.= " FROM ".MAIN_DB_PREFIX."facture_fourn as ff";
$sql2.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON ff.fk_soc = s.rowid"; $sql2.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON ff.fk_soc = s.rowid";
$sql2.= " WHERE ff.paye = 0 AND fk_statut = 1"; $sql2.= " WHERE ff.paye = 0 AND fk_statut = 1"; // Not payed
$sql2.= " ORDER BY dlr ASC"; $sql2.= " ORDER BY dlr ASC";
// Social contributions
$sql3= " SELECT 'social_contribution' as family, cs.rowid as objid, cs.libelle as ref, (-1*cs.amount) as total_ttc, ccs.libelle as type, ".$db->pdate("cs.date_ech")." as dlr";
$sql3.= " FROM ".MAIN_DB_PREFIX."chargesociales as cs";
$sql3.= " LEFT JOIN ".MAIN_DB_PREFIX."c_chargesociales as ccs ON cs.fk_type = ccs.id";
$sql3.= " WHERE cs.paye = 0"; // Not payed
$sql3.= " ORDER BY dlr ASC";
$error=0;
$tab_sqlobj=array();
// List customer invoices
$result = $db->query($sql); $result = $db->query($sql);
$result2=false; if ($result)
if ($result)
{ {
$result2=$db->query($sql2);
}
if ($result2)
{
$tab_sqlobj=array();
$num = $db->num_rows($result); $num = $db->num_rows($result);
for ($i = 0;$i < $num;$i++) for ($i = 0;$i < $num;$i++)
{ {
$sqlobj = $db->fetch_object($result); $sqlobj = $db->fetch_object($result);
$tab_sqlobj[] = $sqlobj; $tab_sqlobj[] = $sqlobj;
$tab_sqlobjOrder[]= $sqlobj->dlr; $tab_sqlobjOrder[]= $sqlobj->dlr;
} }
$db->free($result); $db->free($result);
}
else $error++;
// List supplier invoices
$result2=$db->query($sql2);
if ($result2)
{
$num = $db->num_rows($result2); $num = $db->num_rows($result2);
for ($i = 0;$i < $num;$i++) for ($i = 0;$i < $num;$i++)
{ {
$sqlobj = $db->fetch_object($result2); $sqlobj = $db->fetch_object($result2);
$tab_sqlobj[] = $sqlobj; $tab_sqlobj[] = $sqlobj;
$tab_sqlobjOrder[]= $sqlobj->dlr; $tab_sqlobjOrder[]= $sqlobj->dlr;
} }
$db->free($result2); $db->free($result2);
}
array_multisort ($tab_sqlobjOrder,$tab_sqlobj); else $error++;
//Apply distinct filter
foreach ($tab_sqlobj as $key=>$value) {
$tab_sqlobj[$key] = "'" . serialize($value) . "'";
}
$tab_sqlobj = array_unique($tab_sqlobj);
foreach ($tab_sqlobj as $key=>$value) {
$tab_sqlobj[$key] = unserialize(trim($value, "'"));
}
$num = sizeOf($tab_sqlobj);
// List social contributions
$result3=$db->query($sql3);
if ($result3)
{
$num = $db->num_rows($result3);
for ($i = 0;$i < $num;$i++)
{
$sqlobj = $db->fetch_object($result3);
$tab_sqlobj[] = $sqlobj;
$tab_sqlobjOrder[]= $sqlobj->dlr;
}
$db->free($result3);
}
else $error++;
// Sort array
if (! $error)
{
array_multisort ($tab_sqlobjOrder,$tab_sqlobj);
//Apply distinct filter
foreach ($tab_sqlobj as $key=>$value) {
$tab_sqlobj[$key] = "'" . serialize($value) . "'";
}
$tab_sqlobj = array_unique($tab_sqlobj);
foreach ($tab_sqlobj as $key=>$value) {
$tab_sqlobj[$key] = unserialize(trim($value, "'"));
}
$num = sizeOf($tab_sqlobj);
$var=False; $var=False;
//$num = $db->num_rows($result); //$num = $db->num_rows($result);
$i = 0; $i = 0;
while ($i < $num) while ($i < $num)
{ {
$paiement = ''; $paiement = '';
$ref = '';
$refcomp = '';
$var=!$var; $var=!$var;
//$obj = $db->fetch_object($result); //$obj = $db->fetch_object($result);
$obj = array_shift($tab_sqlobj); $obj = array_shift($tab_sqlobj);
$societestatic->id = $obj->socid;
$societestatic->nom = $obj->nom;
// Todo: Ajouter gestion des avoirs fournisseurs, champ ff.type = 2
if ($obj->fournisseur == 1 && ($obj->total_ttc < 0 && $obj->type != 2) || ($obj->total_ttc > 0 && $obj->type == 2))
{
$facturefournstatic->ref=$obj->facnumber;
$facturefournstatic->id=$obj->facid;
$facturefournstatic->type=$obj->type;
$facture = $facturefournstatic->getNomUrl(1,'');
// On recherche les paiements deja effectue pour les deduires if ($obj->family == 'supplier_invoice')
$sqlp = "SELECT sum(-1*amount) as paiement"; {
$sqlp.= " FROM ".MAIN_DB_PREFIX.'paiementfourn_facturefourn'; // \TODO This code is to avoid to count suppliers credit note (ff.type = 2)
$sqlp.= " WHERE fk_facturefourn = ".$obj->facid; // Ajouter gestion des avoirs fournisseurs, champ
$resql = $db->query($sqlp); if (($obj->total_ttc < 0 && $obj->type != 2)
if ($resql) || ($obj->total_ttc > 0 && $obj->type == 2))
{ {
$objp = $db->fetch_object($resql); $facturefournstatic->ref=$obj->ref;
if ($objp) $paiement = $objp->paiement; $facturefournstatic->id=$obj->objid;
$facturefournstatic->type=$obj->type;
$ref = $facturefournstatic->getNomUrl(1,'');
$societestatic->id = $obj->socid;
$societestatic->nom = $obj->nom;
$refcomp=$societestatic->getNomUrl(0,'',24);
$paiement = -1*$facturefournstatic->getSommePaiement(); // Payment already done
} }
} }
else if ($obj->family == 'invoice')
{ {
$facturestatic->ref=$obj->facnumber; $facturestatic->ref=$obj->ref;
$facturestatic->id=$obj->facid; $facturestatic->id=$obj->objid;
$facturestatic->type=$obj->type; $facturestatic->type=$obj->type;
$facture = $facturestatic->getNomUrl(1,''); $ref = $facturestatic->getNomUrl(1,'');
// On recherche les paiements deja effectue pour les deduires
$sqlp = "SELECT sum(amount) as paiement";
$sqlp.= " FROM ".MAIN_DB_PREFIX.'paiement_facture';
$sqlp.= " WHERE fk_facture = ".$obj->facid;
$resql = $db->query($sqlp);
if ($resql)
{
$objp = $db->fetch_object($resql);
if ($objp) $paiement = $objp->paiement;
}
}
$societestatic->id = $obj->socid;
$societestatic->nom = $obj->nom;
$refcomp=$societestatic->getNomUrl(0,'',24);
$paiement = $facturestatic->getSommePaiement(); // Payment already done
}
if ($obj->family == 'social_contribution')
{
$socialcontribstatic->ref=$obj->ref;
$socialcontribstatic->id=$obj->objid;
$socialcontribstatic->lib=$obj->type;
$ref = $socialcontribstatic->getNomUrl(1,24);
$paiement = $socialcontribstatic->getSommePaiement(); // Payment already done
}
$total_ttc = $obj->total_ttc; $total_ttc = $obj->total_ttc;
if ($paiement) $total_ttc = $obj->total_ttc - $paiement; if ($paiement) $total_ttc = $obj->total_ttc - $paiement;
$solde += $total_ttc; $solde += $total_ttc;
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print "<td>".$facture."</td>"; print "<td>".$ref."</td>";
print "<td>".$societestatic->getNomUrl(0,'',16)."</td>"; print "<td>".$refcomp."</td>";
print "<td>".dolibarr_print_date($obj->dlr,"day")."</td>"; print '<td align="center">'.dolibarr_print_date($obj->dlr,"day")."</td>";
if ($obj->total_ttc < 0) { print "<td align=\"right\">".price($total_ttc)."</td><td>&nbsp;</td>"; }; if ($obj->total_ttc < 0) { print "<td align=\"right\">".price($total_ttc)."</td><td>&nbsp;</td>"; };
if ($obj->total_ttc >= 0) { print "<td>&nbsp;</td><td align=\"right\">".price($total_ttc)."</td>"; }; if ($obj->total_ttc >= 0) { print "<td>&nbsp;</td><td align=\"right\">".price($total_ttc)."</td>"; };
print "<td align=\"right\">".price($solde)."</td>"; print "<td align=\"right\">".price($solde)."</td>";
print "</tr>"; print "</tr>";
$i++; $i++;
} }
//$db->free($result);
} }
else else
{ {

View File

@ -35,10 +35,9 @@ require_once(DOL_DOCUMENT_ROOT ."/product.class.php");
require_once(DOL_DOCUMENT_ROOT ."/client.class.php"); require_once(DOL_DOCUMENT_ROOT ."/client.class.php");
/** /**
\class Facture * \class Facture
\brief Classe permettant la gestion des factures clients * \brief Classe permettant la gestion des factures clients
*/ */
class Facture extends CommonObject class Facture extends CommonObject
{ {
var $db; var $db;
@ -1639,8 +1638,8 @@ class Facture extends CommonObject
/** /**
* \brief Renvoie la sommes des paiements deja effectués * \brief Return amount aof payments already done
* \return Montant deja versé, <0 si ko * \return int Amount of payment already done, <0 if KO
*/ */
function getSommePaiement() function getSommePaiement()
{ {
@ -1661,6 +1660,7 @@ class Facture extends CommonObject
if ($resql) if ($resql)
{ {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$this->db->free($resql);
return $obj->amount; return $obj->amount;
} }
else else

View File

@ -92,7 +92,7 @@ class box_comptes extends ModeleBoxes {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$account_static->id = $objp->rowid; $account_static->id = $objp->rowid;
$solde=$account_static->solde(); $solde=$account_static->solde(0);
$solde_total += $solde; $solde_total += $solde;

View File

@ -152,6 +152,7 @@ ConfirmCustomerPayment=Do you confirm this paiement input for <b>%s</b> %s ?
ValidateBill=Validate invoice ValidateBill=Validate invoice
NumberOfBills=Nb of invoices NumberOfBills=Nb of invoices
NumberOfBillsByMonth=Nb of invoices by month NumberOfBillsByMonth=Nb of invoices by month
ShowSocialContribution=Show social contribution
ShowBill=Show invoice ShowBill=Show invoice
ShowInvoice=Show invoice ShowInvoice=Show invoice
ShowInvoiceReplace=Show replacing invoice ShowInvoiceReplace=Show replacing invoice

View File

@ -122,6 +122,7 @@ ConfirmClassifyPayedPartiallyAbandon=Ce choix sera celui dans le cas d'un mauvai
ValidateBill=Valider facture ValidateBill=Valider facture
NumberOfBills=Nb de factures NumberOfBills=Nb de factures
NumberOfBillsByMonth=Nb de factures par mois NumberOfBillsByMonth=Nb de factures par mois
ShowSocialContribution=Afficher charge sociale
ShowBill=Afficher facture ShowBill=Afficher facture
ShowInvoice=Afficher la facture ShowInvoice=Afficher la facture
ShowInvoiceReplace=Afficher la facture de remplacement ShowInvoiceReplace=Afficher la facture de remplacement

View File

@ -152,6 +152,7 @@ ConfirmCustomerPayment=Confirmez-vous la saisie de ce r
ValidateBill=Valider facture ValidateBill=Valider facture
NumberOfBills=Nb de factures NumberOfBills=Nb de factures
NumberOfBillsByMonth=Nb de factures par mois NumberOfBillsByMonth=Nb de factures par mois
ShowSocialContribution=Afficher charge sociale
ShowBill=Afficher facture ShowBill=Afficher facture
ShowInvoice=Afficher facture ShowInvoice=Afficher facture
ShowInvoiceReplace=Afficher facture de remplacement ShowInvoiceReplace=Afficher facture de remplacement

View File

@ -404,7 +404,7 @@ class DoliDb
*/ */
function fetch_object($resultset=0) function fetch_object($resultset=0)
{ {
// Si le resultset n'est pas fourni, on prend le dernier utilisé sur cette connexion // Si le resultset n'est pas fourni, on prend le dernier utilisé sur cette connexion
if (! is_resource($resultset)) { $resultset=$this->results; } if (! is_resource($resultset)) { $resultset=$this->results; }
return mysql_fetch_object($resultset); return mysql_fetch_object($resultset);
} }