fix date echance
This commit is contained in:
parent
43942e6ea2
commit
c4f0433805
@ -317,7 +317,15 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$object->date=dol_mktime(12,0,0,$_POST['datefmonth'],$_POST['datefday'],$_POST['datefyear']);
|
$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);
|
$result=$object->update($user);
|
||||||
if ($result < 0) dol_print_error($db,$object->error);
|
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);
|
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code);
|
||||||
} else {
|
} else {
|
||||||
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
|
$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"> ';
|
print '<div class="inline-block"> ';
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=actualizemulticurrencyrate">'.$langs->trans("ActualizeCurrency").'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=actualizemulticurrencyrate">'.$langs->trans("ActualizeCurrency").'</a>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
@ -2269,7 +2277,7 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Amount
|
// 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"> ';
|
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td>'.price($object->total_tva,1,$langs,0,-1,-1,$conf->currency).'<div class="inline-block"> ';
|
||||||
if (GETPOST('calculationrule')) $calculationrule=GETPOST('calculationrule','alpha');
|
if (GETPOST('calculationrule')) $calculationrule=GETPOST('calculationrule','alpha');
|
||||||
else $calculationrule=(empty($conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND)?'totalofround':'roundoftotal');
|
else $calculationrule=(empty($conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND)?'totalofround':'roundoftotal');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user