diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 8b7409f8bc5..40bc4289b4a 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -317,7 +317,15 @@ if (empty($reshook)) { $object->fetch($id); $object->date=dol_mktime(12,0,0,$_POST['datefmonth'],$_POST['datefday'],$_POST['datefyear']); - if ($object->date_echeance && $object->date_echeance < $object->date) $object->date_echeance=$object->date; + $date_echence_calc=$object->calculate_date_lim_reglement(); + if (!empty($object->date_echeance) && $object->date_echeance < $date_echence_calc) + { + $object->date_echeance = $date_echence_calc; + } + if ($object->date_echeance && $object->date_echeance < $object->date) + { + $object->date_echeance=$object->date; + } $result=$object->update($user); if ($result < 0) dol_print_error($db,$object->error); } @@ -995,7 +1003,7 @@ if (empty($reshook)) } $price_base_type = 'HT'; $pu_ht_devise = price2num($price_ht_devise, 'MU'); - + $result=$object->addline($product_desc, $pu_ht, $tva_tx, $localtax1_tx, $localtax2_tx, $qty, 0, $remise_percent, $date_start, $date_end, 0, $tva_npr, $price_base_type, $type, -1, 0, $array_options, $fk_unit, 0, $pu_ht_devise); } @@ -1494,7 +1502,7 @@ if ($action == 'create') if ((empty($origin)) || ((($origin == 'propal') || ($origin == 'commande')) && (! empty($originid)))) { // Deposit - if (empty($conf->global->INVOICE_DISABLE_DEPOSIT)) + if (empty($conf->global->INVOICE_DISABLE_DEPOSIT)) { print '