diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php
index c3cabdffad1..3b4503c6865 100644
--- a/htdocs/comm/fiche.php
+++ b/htdocs/comm/fiche.php
@@ -58,6 +58,15 @@ if ($_GET["action"] == 'attribute_prefix')
$societe = new Societe($db, $_GET["socid"]);
$societe->attribute_prefix($db, $_GET["socid"]);
}
+// conditions de règlement
+if ($_POST["action"] == 'setconditions')
+{
+
+ $societe = new Societe($db, $_GET["socid"]);
+ $societe->cond_reglement=$_POST['mode_reglement_id'];
+ $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET cond_reglement='".$_POST['mode_reglement_id']."' WHERE idp='".$socid."'";
+ $result = $db->query($sql);
+}
// mode de règlement
if ($_POST["action"] == 'setmode')
{
@@ -329,10 +338,22 @@ if ($_socid > 0)
print '
'.$objsoc->price_level." | ";
print '';
}
- // mode de règlement
if($conf->facture->enabled)
{
+ // conditions de règlement
$langs->load('bills');
+ $html = new Form($db);
+ print '';
+ print '| ';
+ print $langs->trans('PaymentConditions');
+ print ' | | ';
+ print ' ';
+ print ' | ';
+ print ' | ';
+ $html->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$objsoc->id,$objsoc->cond_reglement,'mode_reglement_id');
+ print " | ";
+ print '
';
+ // mode de règlement
print '';
print '| ';
print $langs->trans('PaymentMode');
@@ -340,7 +361,6 @@ if ($_socid > 0)
print ' ';
print ' | ';
print ' | ';
- $html = new Form($db);
$html->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$objsoc->id,$objsoc->mode_reglement,'mode_reglement_id');
print " | ";
print '
';
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index aa2192a4a14..02d2a74e859 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -665,9 +665,8 @@ if ($_GET['action'] == 'create')
print '';
// Conditions de réglement
- $cond_reglement_id_defaut=1;
print '| '.$langs->trans('PaymentConditions').' | ';
- $html->select_conditions_paiements($cond_reglement_id_defaut,'cond_reglement_id');
+ $html->select_conditions_paiements($soc->cond_reglement,'cond_reglement_id');
print ' |
';
// Mode de réglement