Fix: add error message

This commit is contained in:
Regis Houssin 2009-12-09 13:42:12 +00:00
parent 987127d634
commit 1a71f873e6
4 changed files with 18 additions and 8 deletions

View File

@ -268,7 +268,8 @@ class ProductFournisseur extends Product
} }
else else
{ {
$sql .= " WHERE fk_product_fournisseur = ".$this->product_fourn_id." AND quantity = ".$qty; $sql.= " WHERE fk_product_fournisseur = ".$this->product_fourn_id;
$sql.= " AND quantity = ".$qty;
} }
if ($this->db->query($sql)) if ($this->db->query($sql))

View File

@ -17,6 +17,7 @@ ChangeSupplierPrice=Change supplier price
ErrorQtyTooLowForThisSupplier=Quantity too low for this supplier or no price defined on this product for this supplier ErrorQtyTooLowForThisSupplier=Quantity too low for this supplier or no price defined on this product for this supplier
ErrorSupplierCountryIsNotDefined=Country for this supplier is not defined. Correct this first. ErrorSupplierCountryIsNotDefined=Country for this supplier is not defined. Correct this first.
ProductHasAlreadyReferenceInThisSupplier=This product has already a reference in this supplier ProductHasAlreadyReferenceInThisSupplier=This product has already a reference in this supplier
ReferenceSupplierIsAlreadyAssociatedWithAProduct=This reference provider is already associated with a product
NoRecordedSuppliers=No suppliers recorded NoRecordedSuppliers=No suppliers recorded
SupplierPayment=Supplier payment SupplierPayment=Supplier payment
SuppliersArea=Suppliers area SuppliersArea=Suppliers area

View File

@ -17,6 +17,7 @@ ChangeSupplierPrice=Modifier prix fournisseur
ErrorQtyTooLowForThisSupplier=Quantité insuffisante pour ce fournisseur ou aucun tarif défini sur ce produit pour ce fournisseur ErrorQtyTooLowForThisSupplier=Quantité insuffisante pour ce fournisseur ou aucun tarif défini sur ce produit pour ce fournisseur
ErrorSupplierCountryIsNotDefined=Le pays de ce fournisseur n'est pas défini. Corriger sur sa fiche. ErrorSupplierCountryIsNotDefined=Le pays de ce fournisseur n'est pas défini. Corriger sur sa fiche.
ProductHasAlreadyReferenceInThisSupplier=Ce produit a déjà une référence chez ce fournisseur ProductHasAlreadyReferenceInThisSupplier=Ce produit a déjà une référence chez ce fournisseur
ReferenceSupplierIsAlreadyAssociatedWithAProduct=Cette référence fournisseur est déjà associée à un produit
NoRecordedSuppliers=Pas de fournisseurs enregistrés NoRecordedSuppliers=Pas de fournisseurs enregistrés
SupplierPayment=Paiement fournisseur SupplierPayment=Paiement fournisseur
SuppliersArea=Espace fournisseurs SuppliersArea=Espace fournisseurs

View File

@ -124,10 +124,12 @@ if ($_POST["action"] == 'updateprice' && $_POST["cancel"] <> $langs->trans("Canc
$result=$supplier->fetch($_POST["id_fourn"]); $result=$supplier->fetch($_POST["id_fourn"]);
$ret=$product->update_buyprice($_POST["qty"], $_POST["price"], $user, $_POST["price_base_type"], $supplier); $ret=$product->update_buyprice($_POST["qty"], $_POST["price"], $user, $_POST["price_base_type"], $supplier);
if (!$error)
{
if ($ret < 0) if ($ret < 0)
{ {
$error++; $error++;
$mesg=$ret.'<div class="error">'.$product->error.'</div>'; $mesg='<div class="error">'.$product->error.'</div>';
if ($ret == -2) if ($ret == -2)
{ {
$mesg='<div class="error">'.$langs->trans("ProductHasAlreadyReferenceInThisSupplier").'</div>'; $mesg='<div class="error">'.$langs->trans("ProductHasAlreadyReferenceInThisSupplier").'</div>';
@ -135,6 +137,11 @@ if ($_POST["action"] == 'updateprice' && $_POST["cancel"] <> $langs->trans("Canc
} }
} }
else else
{
$mesg='<div class="error">'.$langs->trans("ReferenceSupplierIsAlreadyAssociatedWithAProduct").'</div>';
}
}
else
{ {
$error++; $error++;
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Price")).'</div>'; $mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Price")).'</div>';