diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index 2068a7c1570..3795916e943 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -107,7 +107,10 @@ class Commande } $this->soc_id = $propal->soc_id; - + $this->cond_reglement_id = $propal->cond_reglement_id; + $this->mode_reglement_id = $propal->mode_reglement_id; + + /* Définit la société comme un client */ $soc = new Societe($this->db); $soc->id = $this->soc_id; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 25feada995e..f82d77afa38 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -301,17 +301,6 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer) $soc = new Societe($db); $soc->fetch($obj->idp); - if ($propalid) - { - $cond_reglement_id = $obj->fk_cond_reglement; - $mode_reglement_id = $obj->fk_mode_reglement; - } - else - { - $cond_reglement_id = $soc->cond_reglement; - $mode_reglement_id = $soc->mode_reglement; - } - $nbrow=4; if ($conf->projet->enabled) $nbrow++; @@ -343,12 +332,12 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer) // Conditions de réglement print ''.$langs->trans('PaymentConditions').''; - $html->select_conditions_paiements($cond_reglement_id,'cond_reglement_id'); + $html->select_conditions_paiements($soc->cond_reglement,'cond_reglement_id'); print ''; // Mode de réglement print ''.$langs->trans('PaymentMode').''; - $html->select_types_paiements($mode_reglement_id,'mode_reglement_id'); + $html->select_types_paiements($soc->mode_reglement,'mode_reglement_id'); print ''; if ($conf->projet->enabled)