diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index d65da9d7851..e98ce39bfe9 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2012 Juanjo Menent @@ -99,6 +99,11 @@ if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel")) $tva_tx = str_replace('*','', GETPOST('tva_tx','alpha')); $tva_tx = price2num($tva_tx); + if ($tva_tx == '') + { + $error++; + $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("VATRateForSupplierProduct")).'
'; + } if (empty($quantity)) { $error++; @@ -353,6 +358,7 @@ if ($id || $ref) if (! empty($socid)) // When update { $default_vat=get_default_tva($supplier, $mysoc, $product->id); + if (empty($default_vat)) $default_vat=$product->tva_tx; } print ''; print '';