Fix: Fix bad link toward suplier invoice in referer stat page of products
This commit is contained in:
parent
d6648b65f2
commit
6e47327ee7
@ -40,7 +40,7 @@ class Fournisseur extends Societe
|
||||
|
||||
/**
|
||||
* \brief Constructeur de la classe
|
||||
* \param DB handler accès base de données
|
||||
* \param DB handler acc<EFBFBD>s base de donn<EFBFBD>es
|
||||
* \param id id societe (0 par defaut)
|
||||
*/
|
||||
|
||||
@ -84,12 +84,12 @@ class Fournisseur extends Societe
|
||||
|
||||
function NbProduct()
|
||||
{
|
||||
$sql = "SELECT count(*)";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."product_fournisseur";
|
||||
$sql .= " WHERE fk_soc = ".$this->id;
|
||||
$sql = "SELECT count(pf.rowid)";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur as pf,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."product_fournisseur_price as ppf";
|
||||
$sql .= " WHERE fk_soc = ".$this->id." AND ppf.fk_product_fournisseur = pf.rowid";
|
||||
|
||||
$resql = $this->db->query($sql) ;
|
||||
|
||||
if ( $resql )
|
||||
{
|
||||
$row = $this->db->fetch_row($resql);
|
||||
@ -99,13 +99,12 @@ class Fournisseur extends Societe
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Créé la commande au statut brouillon
|
||||
* \param user Utilisateur qui crée
|
||||
* \return int <0 si ko, id de la commande créée si ok
|
||||
* \brief Cr<EFBFBD><EFBFBD> la commande au statut brouillon
|
||||
* \param user Utilisateur qui cr<EFBFBD>e
|
||||
* \return int <0 si ko, id de la commande cr<EFBFBD><EFBFBD>e si ok
|
||||
*/
|
||||
function updateFromCommandeClient($user, $idc, $comclientid)
|
||||
{
|
||||
@ -116,9 +115,9 @@ class Fournisseur extends Societe
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Créé la commande au statut brouillon
|
||||
* \param user Utilisateur qui crée
|
||||
* \return int <0 si ko, id de la commande créée si ok
|
||||
* \brief Cr<EFBFBD><EFBFBD> la commande au statut brouillon
|
||||
* \param user Utilisateur qui cr<EFBFBD>e
|
||||
* \return int <0 si ko, id de la commande cr<EFBFBD><EFBFBD>e si ok
|
||||
*/
|
||||
function create_commande($user)
|
||||
{
|
||||
@ -215,8 +214,8 @@ class Fournisseur extends Societe
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Créé une categorie fournisseur
|
||||
* \param user Utilisateur qui crée
|
||||
* \brief Cr<EFBFBD><EFBFBD> une categorie fournisseur
|
||||
* \param user Utilisateur qui cr<EFBFBD>e
|
||||
* \param name Nom categorie
|
||||
* \return int <0 si ko, 0 si ok
|
||||
*/
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2006 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -56,9 +56,11 @@ if ($user->societe_id > 0)
|
||||
|
||||
|
||||
/*
|
||||
* Affiche fiche
|
||||
*
|
||||
* View
|
||||
*/
|
||||
|
||||
$invoicestatic=new Facture($db);
|
||||
|
||||
$html = new Form($db);
|
||||
|
||||
|
||||
@ -96,8 +98,8 @@ if ($_GET["id"] || $_GET["ref"])
|
||||
// Libelle
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$product->libelle.'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Prix
|
||||
|
||||
// Price
|
||||
print '<tr><td>'.$langs->trans("SellingPrice").'</td><td colspan="3">';
|
||||
if ($product->price_base_type == 'TTC')
|
||||
{
|
||||
@ -164,16 +166,17 @@ if ($_GET["id"] || $_GET["ref"])
|
||||
$var=!$var;
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$objp->facid.'">'.img_object($langs->trans("ShowBill"),"bill").' ';
|
||||
print $objp->facnumber;
|
||||
print "</a></td>\n";
|
||||
print '<td>';
|
||||
$invoicestatic->id=$objp->facid;
|
||||
$invoicestatic->ref=$objp->facnumber;
|
||||
print $invoicestatic->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,44).'</a></td>';
|
||||
print "<td>".$objp->code_client."</td>\n";
|
||||
print "<td align=\"center\">";
|
||||
print dolibarr_print_date($objp->date)."</td>";
|
||||
print "<td align=\"right\">".price($objp->total_ht)."</td>\n";
|
||||
$fac=new Facture($db);
|
||||
print '<td align="right">'.$fac->LibStatut($objp->paye,$objp->statut,5).'</td>';
|
||||
print '<td align="right">'.$invoicestatic->LibStatut($objp->paye,$objp->statut,5).'</td>';
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -28,7 +28,7 @@
|
||||
|
||||
require("./pre.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/facture.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/fourn/fournisseur.facture.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/product.class.php");
|
||||
|
||||
$langs->load("companies");
|
||||
@ -57,9 +57,11 @@ if ($user->societe_id > 0)
|
||||
|
||||
|
||||
/*
|
||||
* Affiche fiche
|
||||
*
|
||||
* View
|
||||
*/
|
||||
|
||||
$supplierinvoicestatic=new FactureFournisseur($db);
|
||||
|
||||
$html = new Form($db);
|
||||
|
||||
if ($_GET["id"] || $_GET["ref"])
|
||||
@ -164,9 +166,11 @@ if ($_GET["id"] || $_GET["ref"])
|
||||
$var=!$var;
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$objp->facid.'">'.img_object($langs->trans("ShowBill"),"bill").' ';
|
||||
print $objp->facnumber;
|
||||
print "</a></td>\n";
|
||||
print '<td>';
|
||||
$supplierinvoicestatic->id=$objp->facid;
|
||||
$supplierinvoicestatic->ref=$objp->facnumber;
|
||||
print $supplierinvoicestatic->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,44).'</a></td>';
|
||||
print "<td>".$objp->code_client."</td>\n";
|
||||
print "<td align=\"center\">";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user