fix date echance

This commit is contained in:
florian HENRY
2017-01-06 14:47:57 +01:00
parent 43942e6ea2
commit c4f0433805

View File

@@ -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);
}
@@ -2152,7 +2160,7 @@ else
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code);
} else {
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
if($object->statut == 0) {
if($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code != $conf->currency) {
print '<div class="inline-block"> &nbsp; &nbsp; &nbsp; &nbsp; ';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=actualizemulticurrencyrate">'.$langs->trans("ActualizeCurrency").'</a>';
print '</div>';
@@ -2269,7 +2277,7 @@ else
}
// Amount
print '<tr><td>'.$langs->trans('AmountHT').'</td><td>'.price($object->total_ht,1,$langs,0,-1,-1,$conf->currency).'</td></tr>';
print '<tr><td class="titlefield">'.$langs->trans('AmountHT').'</td><td>'.price($object->total_ht,1,$langs,0,-1,-1,$conf->currency).'</td></tr>';
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td>'.price($object->total_tva,1,$langs,0,-1,-1,$conf->currency).'<div class="inline-block"> &nbsp; &nbsp; &nbsp; &nbsp; ';
if (GETPOST('calculationrule')) $calculationrule=GETPOST('calculationrule','alpha');
else $calculationrule=(empty($conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND)?'totalofround':'roundoftotal');