Fix: Cration ligne fournisseur pour un fournisseur d'un pays avec taux tva non dfini
This commit is contained in:
parent
30ba7d180d
commit
a2bbf61d05
@ -2258,6 +2258,9 @@ class Form
|
||||
{
|
||||
global $langs,$conf,$mysoc;
|
||||
|
||||
$txtva=array();
|
||||
$libtva=array();
|
||||
|
||||
//print $societe_vendeuse."-".$societe_acheteuse;
|
||||
if (is_object($societe_vendeuse) && ! $societe_vendeuse->pays_code)
|
||||
{
|
||||
@ -2292,16 +2295,23 @@ class Form
|
||||
if ($resql)
|
||||
{
|
||||
$num = $this->db->num_rows($resql);
|
||||
for ($i = 0; $i < $num; $i++)
|
||||
if ($num)
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$txtva[ $i ] = $obj->taux;
|
||||
$libtva[ $i ] = $obj->taux.'%'.($obj->recuperableonly ? ' *':'');
|
||||
for ($i = 0; $i < $num; $i++)
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$txtva[$i] = $obj->taux;
|
||||
$libtva[$i] = $obj->taux.'%'.($obj->recuperableonly ? ' *':'');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<font class="error">'.$langs->trans("ErrorNoVATRateDefinedForSellerCountry",$code_pays).'</font>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<font class="error">'.$langs->trans("ErrorNoVATRateDefinedForSellerCountry").'</div>';
|
||||
print '<font class="error">'.$this->db->error().'</font>';
|
||||
}
|
||||
|
||||
// Définition du taux à présélectionner
|
||||
@ -2312,23 +2322,26 @@ class Form
|
||||
|
||||
$nbdetaux = sizeof($txtva);
|
||||
|
||||
print '<select class="flat" name="'.$name.'">';
|
||||
if ($default) print '<option value="0">'.$langs->trans("Default").'</option>';
|
||||
|
||||
for ($i = 0 ; $i < $nbdetaux ; $i++)
|
||||
if (sizeof($txtva))
|
||||
{
|
||||
print '<option value="'.$txtva[$i].'"';
|
||||
if ($txtva[$i] == $defaulttx)
|
||||
print '<select class="flat" name="'.$name.'">';
|
||||
if ($default) print '<option value="0">'.$langs->trans("Default").'</option>';
|
||||
|
||||
for ($i = 0 ; $i < $nbdetaux ; $i++)
|
||||
{
|
||||
print ' selected="true"';
|
||||
print '<option value="'.$txtva[$i].'"';
|
||||
if ($txtva[$i] == $defaulttx)
|
||||
{
|
||||
print ' selected="true"';
|
||||
}
|
||||
print '>'.vatrate($libtva[$i]).'</option>';
|
||||
|
||||
$this->tva_taux_value[$i] = $txtva[$i];
|
||||
$this->tva_taux_libelle[$i] = $libtva[$i];
|
||||
|
||||
}
|
||||
print '>'.vatrate($libtva[$i]).'</option>';
|
||||
|
||||
$this->tva_taux_value[$i] = $txtva[$i];
|
||||
$this->tva_taux_libelle[$i] = $libtva[$i];
|
||||
|
||||
print '</select>';
|
||||
}
|
||||
print '</select>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -32,6 +32,7 @@ ErrorDuplicateField=Duplicate value in a unique field
|
||||
ErrorSomeErrorWereFoundRollbackIsDone=Some errors were found. We rollback changes.
|
||||
ErrorConfigParameterNotDefined=Parameter <b>%s</b> is not defined inside Dolibarr config file <b>conf.php</b>.
|
||||
ErrorCantLoadUserFromDolibarrDatabase=Failed to find user <b>%s</b> in Dolibarr database.
|
||||
ErrorNoVATRateDefinedForSellerCountry=Error, no vat rates defined for country '%s'.
|
||||
DolibarrInHttpAuthenticationSoPasswordUseless=Dolibarr authentication mode is setup to <b>%s</b> in configuration file <b>conf.php</b>.<br>This means that password database is extern to Dolibarr, so changing this field may have no effects.
|
||||
Undefined=Undefined
|
||||
PasswordForgotten=Password forgotten ?
|
||||
|
||||
@ -32,6 +32,7 @@ ErrorDuplicateField=Doublon dans un champ unique
|
||||
ErrorSomeErrorWereFoundRollbackIsDone=Des erreurs ont été trouvés. On rollback les modifications.
|
||||
ErrorConfigParameterNotDefined=Le parametre <b>%s</b> n'est pas défini dans le fichier de configuration Dolibarr <b>conf.php</b>.
|
||||
ErrorCantLoadUserFromDolibarrDatabase=Impossible de trouver l'utilisateur <b>%s</b> dans la base Dolibarr.
|
||||
ErrorNoVATRateDefinedForSellerCountry=Erreur, aucun taux tva défini pour le pays '%s'.
|
||||
DolibarrInHttpAuthenticationSoPasswordUseless=Dolibarr est configuré en mode authentification <b>%s</b> dans son fichier de configuration <b>conf.php</b>.<br>Cela signifie que la base des mots de passe est externe à Dolibarr, aussi toute modification de ce champ peut s'avérer sans effet.
|
||||
Undefined=Non défini
|
||||
PasswordForgotten=Mot de passe oublié ?
|
||||
|
||||
Loading…
Reference in New Issue
Block a user