Qual: Uniformisation du code. Suppression des ref_url en doublon avec getNomUrl plus souple.
This commit is contained in:
parent
e72404c00f
commit
af57bcfbc8
@ -750,7 +750,7 @@ if ($_GET['propalid'] > 0)
|
|||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td>'.$langs->trans('Ref').'</td><td colspan="5">'.$propal->ref_url.'</td></tr>';
|
print '<tr><td>'.$langs->trans('Ref').'</td><td colspan="5">'.$propal->ref.'</td></tr>';
|
||||||
|
|
||||||
// Ref client
|
// Ref client
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
|
|||||||
@ -87,7 +87,7 @@ if ($_GET["propalid"] > 0)
|
|||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
print '<tr><td width="30%">'.$langs->trans('Ref').'</td><td colspan="5">'.$propal->ref_url.'</td></tr>';
|
print '<tr><td width="30%">'.$langs->trans('Ref').'</td><td colspan="5">'.$propal->ref.'</td></tr>';
|
||||||
|
|
||||||
$rowspan=3;
|
$rowspan=3;
|
||||||
|
|
||||||
|
|||||||
@ -169,7 +169,7 @@ if ($id > 0)
|
|||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
||||||
print $propal->ref_url;
|
print $propal->ref;
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
// Customer
|
// Customer
|
||||||
|
|||||||
@ -145,7 +145,7 @@ if ($propalid > 0)
|
|||||||
print '<table class="border"width="100%">';
|
print '<table class="border"width="100%">';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td width="30%">'.$langs->trans('Ref').'</td><td colspan="3">'.$propal->ref_url.'</td></tr>';
|
print '<tr><td width="30%">'.$langs->trans('Ref').'</td><td colspan="3">'.$propal->ref.'</td></tr>';
|
||||||
|
|
||||||
// Société
|
// Société
|
||||||
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="5">'.$societe->getNomUrl(1).'</td></tr>';
|
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="5">'.$societe->getNomUrl(1).'</td></tr>';
|
||||||
|
|||||||
@ -109,7 +109,7 @@ if ($_GET['propalid'])
|
|||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="3">'.$propal->ref_url.'</td></tr>';
|
print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="3">'.$propal->ref.'</td></tr>';
|
||||||
|
|
||||||
// Société
|
// Société
|
||||||
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="3">'.$societe->getNomUrl(1).'</td></tr>';
|
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="3">'.$societe->getNomUrl(1).'</td></tr>';
|
||||||
|
|||||||
@ -123,8 +123,8 @@ if ($socid > 0)
|
|||||||
dolibarr_fiche_head($head, 'compta', $societe->nom);
|
dolibarr_fiche_head($head, 'compta', $societe->nom);
|
||||||
|
|
||||||
|
|
||||||
print "<table width=\"100%\">\n";
|
print '<table width="100%" class="notopnoleftnoright">';
|
||||||
print '<tr><td valign="top" width="50%">';
|
print '<tr><td valign="top" width="50%" class="notopnoleft">';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
@ -218,7 +218,7 @@ if ($socid > 0)
|
|||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
|
|
||||||
print '<td valign="top" width="50%">';
|
print '<td valign="top" width="50%" class="notopnoleftnoright">';
|
||||||
|
|
||||||
// Nbre max d'éléments des petites listes
|
// Nbre max d'éléments des petites listes
|
||||||
$MAXLIST=5;
|
$MAXLIST=5;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2006 Destailleur Laurent <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2007 Destailleur Laurent <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
* Copyright (C) 2005-2006 Regis Houssin <regis.houssin@cap-networks.com>
|
* Copyright (C) 2005-2006 Regis Houssin <regis.houssin@cap-networks.com>
|
||||||
*
|
*
|
||||||
@ -145,7 +145,7 @@ if ($_GET["propalid"] > 0)
|
|||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td>'.$langs->trans('Ref').'</td><td colspan="5">'.$propal->ref_url.'</td></tr>';
|
print '<tr><td>'.$langs->trans('Ref').'</td><td colspan="5">'.$propal->ref.'</td></tr>';
|
||||||
|
|
||||||
// Ref client
|
// Ref client
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
|
|||||||
@ -168,7 +168,7 @@ if ($id > 0)
|
|||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
||||||
print $fichinter->ref_url;
|
print $fichinter->ref;
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
// Customer
|
// Customer
|
||||||
|
|||||||
@ -363,13 +363,13 @@ elseif ($_GET["id"] > 0)
|
|||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td>'.$langs->trans("Ref").'</td><td>'.$fichinter->ref.'</td></tr>';
|
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td>'.$fichinter->ref.'</td></tr>';
|
||||||
|
|
||||||
// Societe
|
// Societe
|
||||||
print "<tr><td>".$langs->trans("Company")."</td><td>".$fichinter->client->getNomUrl(1)."</td></tr>";
|
print "<tr><td>".$langs->trans("Company")."</td><td>".$fichinter->client->getNomUrl(1)."</td></tr>";
|
||||||
|
|
||||||
// Date
|
// Date
|
||||||
print '<tr><td width="20%">'.$langs->trans("Date").'</td><td>'.dolibarr_print_date($fichinter->date,"daytext").'</td></tr>';
|
print '<tr><td>'.$langs->trans("Date").'</td><td>'.dolibarr_print_date($fichinter->date,"daytext").'</td></tr>';
|
||||||
|
|
||||||
// Durée
|
// Durée
|
||||||
print '<tr><td>'.$langs->trans("Duration").'</td><td>'.$fichinter->duree.'</td></tr>';
|
print '<tr><td>'.$langs->trans("Duration").'</td><td>'.$fichinter->duree.'</td></tr>';
|
||||||
|
|||||||
@ -185,8 +185,6 @@ class Fichinter extends CommonObject
|
|||||||
$this->note_public = $obj->note_public;
|
$this->note_public = $obj->note_public;
|
||||||
$this->note_private = $obj->note_private;
|
$this->note_private = $obj->note_private;
|
||||||
|
|
||||||
$this->ref_url = '<a href="'.DOL_URL_ROOT.'/fichinter/fiche.php?id='.$this->id.'">'.$this->ref.'</a>';
|
|
||||||
|
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -104,7 +104,7 @@ if ($_GET['id'])
|
|||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="3">'.$fichinter->ref_url.'</td></tr>';
|
print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="3">'.$fichinter->ref.'</td></tr>';
|
||||||
|
|
||||||
// Société
|
// Société
|
||||||
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="3">'.$societe->getNomUrl(1).'</td></tr>';
|
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="3">'.$societe->getNomUrl(1).'</td></tr>';
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2004-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|||||||
@ -547,8 +547,8 @@ else
|
|||||||
print '<br />';
|
print '<br />';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<table border="0" width="100%">';
|
print '<table width="100%" class="notopnoleftnoright">';
|
||||||
print '<tr><td width="50%" valign="top">';
|
print '<tr><td width="50%" valign="top" class="notopnoleft">';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Facture
|
* Facture
|
||||||
@ -586,10 +586,10 @@ else
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '</td><td valign="top">';
|
print '</td><td valign="top" class="notopnoleftnoright">';
|
||||||
|
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table width="100%" class="noborder">';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Liste des paiements
|
* Liste des paiements
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 Éric Seigne <erics@rycks.com>
|
* Copyright (C) 2003 Éric Seigne <erics@rycks.com>
|
||||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -88,10 +88,10 @@ if ( $societe->fetch($socid) )
|
|||||||
dolibarr_fiche_head($head, 'supplier', $societe->nom);
|
dolibarr_fiche_head($head, 'supplier', $societe->nom);
|
||||||
|
|
||||||
|
|
||||||
print '<table width="100%">';
|
print '<table width="100%" class="notopnoleftnoright">';
|
||||||
print '<tr><td valign="top" width="50%">';
|
print '<tr><td valign="top" width="50%" class="notopnoleft">';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table width="100%" class="border">';
|
||||||
print '<tr><td width="20%">'.$langs->trans("Name").'</td><td width="80%" colspan="3">'.$societe->nom.'</td></tr>';
|
print '<tr><td width="20%">'.$langs->trans("Name").'</td><td width="80%" colspan="3">'.$societe->nom.'</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$societe->prefix_comm.'</td></tr>';
|
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$societe->prefix_comm.'</td></tr>';
|
||||||
@ -123,7 +123,7 @@ if ( $societe->fetch($socid) )
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
|
||||||
print '</td><td valign="top" width="50%">';
|
print '</td><td valign="top" width="50%" class="notopnoleftnoright">';
|
||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
$MAXLIST=4;
|
$MAXLIST=4;
|
||||||
|
|||||||
@ -1162,16 +1162,24 @@ class Form
|
|||||||
|
|
||||||
$opt = '<option value="'.$objp->rowid.'"';
|
$opt = '<option value="'.$objp->rowid.'"';
|
||||||
if ($selected == $objp->rowid) $opt.= ' selected="true"';
|
if ($selected == $objp->rowid) $opt.= ' selected="true"';
|
||||||
//$opt.= '>'.$objp->ref.' ('.$objp->ref_fourn.') - ';
|
if ($objp->fprice == '') $opt.=' disabled="disabled"';
|
||||||
$opt.= '>'.$objp->ref.' - ';
|
$opt.= '>'.$objp->ref.' - ';
|
||||||
$opt.= dolibarr_trunc($objp->label,24).' - ';
|
$opt.= dolibarr_trunc($objp->label,18).' - ';
|
||||||
$opt.= $objp->fprice.$langs->trans("Currency".$conf->monnaie)."/".$objp->quantity.$langs->trans("Units");
|
if ($objp->fprice != '')
|
||||||
|
{
|
||||||
|
$opt.= $objp->fprice;
|
||||||
|
$opt.= $langs->trans("Currency".$conf->monnaie)."/".$objp->quantity.$langs->trans("Units");
|
||||||
if ($objp->quantity > 1)
|
if ($objp->quantity > 1)
|
||||||
{
|
{
|
||||||
$opt.=" - ";
|
$opt.=" - ";
|
||||||
$opt.= round($objp->fprice/$objp->quantity,4).$langs->trans("Currency".$conf->monnaie)."/".$langs->trans("Unit");
|
$opt.= round($objp->fprice/$objp->quantity,4).$langs->trans("Currency".$conf->monnaie)."/".$langs->trans("Unit");
|
||||||
}
|
}
|
||||||
if ($objp->duration) $opt .= " - ".$objp->duration;
|
if ($objp->duration) $opt .= " - ".$objp->duration;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$opt.= $langs->trans("NoPriceDefinedForThisSupplier");
|
||||||
|
}
|
||||||
$opt .= "</option>\n";
|
$opt .= "</option>\n";
|
||||||
|
|
||||||
print $opt;
|
print $opt;
|
||||||
|
|||||||
@ -191,6 +191,8 @@ DefaultValue=Default value
|
|||||||
DefaultGlobalValue=Global value
|
DefaultGlobalValue=Global value
|
||||||
Price=Price
|
Price=Price
|
||||||
UnitPrice=Unit price
|
UnitPrice=Unit price
|
||||||
|
UnitPriceHT=Unit price HT
|
||||||
|
UnitPriceTTC=Unit price TTC
|
||||||
PriceU=U.P.
|
PriceU=U.P.
|
||||||
PriceUHT=U.P. HT
|
PriceUHT=U.P. HT
|
||||||
PriceUTTC=U.P. TTC
|
PriceUTTC=U.P. TTC
|
||||||
|
|||||||
@ -110,5 +110,7 @@ NoStockForThisProduct=No stock for this product
|
|||||||
Restock=Restock
|
Restock=Restock
|
||||||
ProductSpecial=Special
|
ProductSpecial=Special
|
||||||
QtyMin=Quantity minimum
|
QtyMin=Quantity minimum
|
||||||
PriceHTQty=Price HT for this quantity
|
PriceQty=Price for this quantity
|
||||||
|
PriceQtyHT=Price for this quantity HT
|
||||||
|
PriceQtyTTC=Price for this quantity TTC
|
||||||
|
NoPriceDefinedForThisSupplier=No price/qty defined for this supplier/product
|
||||||
|
|||||||
@ -192,6 +192,8 @@ DefaultValue=Valeur par d
|
|||||||
DefaultGlobalValue=Valeur globale
|
DefaultGlobalValue=Valeur globale
|
||||||
Price=Prix
|
Price=Prix
|
||||||
UnitPrice=Prix unitaire
|
UnitPrice=Prix unitaire
|
||||||
|
UnitPriceHT=Prix unitaire HT
|
||||||
|
UnitPriceTTC=Prix unitaire TTC
|
||||||
PriceU=P.U.
|
PriceU=P.U.
|
||||||
PriceUHT=P.U. HT
|
PriceUHT=P.U. HT
|
||||||
PriceUTTC=P.U. TTC
|
PriceUTTC=P.U. TTC
|
||||||
|
|||||||
@ -110,4 +110,7 @@ NoStockForThisProduct=Pas de stock pour ce produit
|
|||||||
Restock=Réassort
|
Restock=Réassort
|
||||||
ProductSpecial=Special
|
ProductSpecial=Special
|
||||||
QtyMin=Quantité minimum
|
QtyMin=Quantité minimum
|
||||||
PriceHTQty=Prix HT pour la quantité
|
PriceQty=Prix pour la quantité
|
||||||
|
PriceQtyHT=Prix pour la quantité HT
|
||||||
|
PriceQtyTTC=Prix pour la quantité TTC
|
||||||
|
NoPriceDefinedForThisSupplier=Aucun prix/qté défini pour ce fournisseur/produit
|
||||||
|
|||||||
@ -725,8 +725,9 @@ class Product
|
|||||||
* \param qty Quantite pour lequel le prix est valide
|
* \param qty Quantite pour lequel le prix est valide
|
||||||
* \param buyprice Prix d'achat pour la quantité
|
* \param buyprice Prix d'achat pour la quantité
|
||||||
* \param user Objet user de l'utilisateur qui modifie
|
* \param user Objet user de l'utilisateur qui modifie
|
||||||
|
* \param price_base_type HT or TTC
|
||||||
*/
|
*/
|
||||||
function update_buyprice($id_fourn, $qty, $buyprice, $user)
|
function update_buyprice($id_fourn, $qty, $buyprice, $user, $price_base_type='HT')
|
||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
@ -741,7 +742,7 @@ class Product
|
|||||||
if ($this->db->query($sql))
|
if ($this->db->query($sql))
|
||||||
{
|
{
|
||||||
// Ajoute prix courant du fournisseur pour cette quantité
|
// Ajoute prix courant du fournisseur pour cette quantité
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."product_fournisseur_price ";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."product_fournisseur_price";
|
||||||
$sql .= " SET datec = now()";
|
$sql .= " SET datec = now()";
|
||||||
$sql .= " ,fk_product = ".$this->id;
|
$sql .= " ,fk_product = ".$this->id;
|
||||||
$sql .= " ,fk_soc = ".$id_fourn;
|
$sql .= " ,fk_soc = ".$id_fourn;
|
||||||
@ -777,45 +778,50 @@ class Product
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->error()." ($sql)";
|
$this->error=$this->db->error()." sql=".$sql;
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->error()." ($sql)";
|
$this->error=$this->db->error()." sql=".$sql;
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Modifie le prix d'achat pour un fournisseur par la référecne du produit chez le fournisseur
|
\brief Modifie le prix d'achat pour un fournisseur par la référecne du produit chez le fournisseur
|
||||||
\param id_fourn Id du fournisseur
|
\param id_fourn Id du fournisseur
|
||||||
\param product_fourn_ref Reference du produit chez le fournisseur
|
\param product_fourn_ref Ref du produit chez le fournisseur
|
||||||
\param qty Quantite pour lequel le prix est valide
|
\param qty Quantite pour lequel le prix est valide
|
||||||
\param buyprice Prix d'achat pour la quantité
|
\param buyprice Prix d'achat pour la quantité
|
||||||
\param user Objet user de l'utilisateur qui modifie
|
\param user Objet user de l'utilisateur qui modifie
|
||||||
|
\return int <0 si KO, >0 si OK
|
||||||
*/
|
*/
|
||||||
function UpdateBuyPriceByFournRef($id_fourn, $product_fourn_ref, $qty, $buyprice, $user)
|
function UpdateBuyPriceByFournRef($id_fourn, $product_fourn_ref, $qty, $buyprice, $user, $price_base_type='HT')
|
||||||
{
|
{
|
||||||
$errno=0;
|
$result=0;
|
||||||
|
|
||||||
// Supprime prix courant du fournisseur pour cette quantité
|
// Recherche id produit pour cette ref et fournisseur
|
||||||
$sql = "SELECT fk_product FROM ".MAIN_DB_PREFIX."product_fournisseur";
|
$sql = "SELECT fk_product";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur";
|
||||||
$sql.= " WHERE fk_soc ='".$id_fourn."'";
|
$sql.= " WHERE fk_soc ='".$id_fourn."'";
|
||||||
$sql.= " AND ref_fourn='".$product_fourn_ref."';";
|
$sql.= " AND ref_fourn='".$product_fourn_ref."'";
|
||||||
|
|
||||||
if ($this->db->query($sql))
|
if ($this->db->query($sql))
|
||||||
{
|
{
|
||||||
if ($row = $this->db->fetch_row($resql) )
|
if ($obj = $this->db->fetch_object($resql))
|
||||||
{
|
{
|
||||||
$this->id = $row[0];
|
// Met a jour prix pour la qté
|
||||||
$errno = $this->update_buyprice($id_fourn, $qty, $buyprice, $user);
|
$this->id = $obj->fk_product;
|
||||||
|
$result = $this->update_buyprice($id_fourn, $qty, $buyprice, $user, $price_base_type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $errno;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
* Copyright (C) 2005 Regis Houssin <regis.houssin@cap-networks.com>
|
* Copyright (C) 2005 Regis Houssin <regis.houssin@cap-networks.com>
|
||||||
*
|
*
|
||||||
@ -112,7 +112,7 @@ if ($_POST["action"] == 'updateprice' && $_POST["cancel"] <> $langs->trans("Canc
|
|||||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref")).'</div>';
|
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref")).'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST["qty"])
|
if (! $error && $_POST["qty"])
|
||||||
{
|
{
|
||||||
if ($_POST["price"] >= 0)
|
if ($_POST["price"] >= 0)
|
||||||
{
|
{
|
||||||
@ -249,7 +249,7 @@ if ($_GET["id"] || $_GET["ref"])
|
|||||||
print '<td>'.$langs->trans("QtyMin").'</td>';
|
print '<td>'.$langs->trans("QtyMin").'</td>';
|
||||||
$quantity = $_GET["qty"] ? $_GET["qty"] : "1";
|
$quantity = $_GET["qty"] ? $_GET["qty"] : "1";
|
||||||
print '<td><input class="flat" name="qty" size="5" value="'.$quantity.'"></td>';
|
print '<td><input class="flat" name="qty" size="5" value="'.$quantity.'"></td>';
|
||||||
print '<td>'.$langs->trans("PriceHTQty").'</td>';
|
print '<td>'.$langs->trans("PriceQtyHT").'</td>';
|
||||||
print '<td><input class="flat" name="price" size="8" value="'.price($_GET["price"]).'"></td></tr>';
|
print '<td><input class="flat" name="price" size="8" value="'.price($_GET["price"]).'"></td></tr>';
|
||||||
|
|
||||||
print '<tr><td colspan="6" align="center"><input class="button" type="submit" value="'.$langs->trans("Save").'">';
|
print '<tr><td colspan="6" align="center"><input class="button" type="submit" value="'.$langs->trans("Save").'">';
|
||||||
@ -290,13 +290,14 @@ if ($_GET["id"] || $_GET["ref"])
|
|||||||
print $langs->trans("Suppliers").'</td>';
|
print $langs->trans("Suppliers").'</td>';
|
||||||
print '<td>'.$langs->trans("Ref").'</td>';
|
print '<td>'.$langs->trans("Ref").'</td>';
|
||||||
print '<td align="center">'.$langs->trans("QtyMin").'</td>';
|
print '<td align="center">'.$langs->trans("QtyMin").'</td>';
|
||||||
print '<td align="right">'.$langs->trans("PriceHTQty").'</td>';
|
print '<td align="right">'.$langs->trans("PriceQtyHT").'</td>';
|
||||||
print '<td align="right">'.$langs->trans("UnitPrice").'</td>';
|
print '<td align="right">'.$langs->trans("UnitPriceHT").'</td>';
|
||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Liste des fournisseurs
|
// Liste des fournisseurs
|
||||||
$sql = "SELECT s.nom, s.rowid as socid, pf.ref_fourn, pfp.price, pfp.quantity";
|
$sql = "SELECT s.nom, s.rowid as socid,";
|
||||||
|
$sql.= "pf.ref_fourn, pfp.price, pfp.quantity";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."product_fournisseur as pf";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."product_fournisseur as pf";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";
|
||||||
$sql.= " ON pf.fk_soc = pfp.fk_soc AND pf.fk_product = pfp.fk_product";
|
$sql.= " ON pf.fk_soc = pfp.fk_soc AND pf.fk_product = pfp.fk_product";
|
||||||
|
|||||||
@ -851,8 +851,6 @@ class Propal extends CommonObject
|
|||||||
$this->lignes = array();
|
$this->lignes = array();
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
|
|
||||||
$this->ref_url = '<a href="'.DOL_URL_ROOT.'/comm/propal.php?propalid='.$this->id.'">'.$this->ref.'</a>';
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Lignes propales liées à un produit ou non
|
* Lignes propales liées à un produit ou non
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user