Fix #1544: Can remove date from invoice

This commit is contained in:
Cedric 2014-08-14 08:41:24 +02:00
parent 91900f54c2
commit 8670a89ecb
2 changed files with 10 additions and 1 deletions

View File

@ -19,6 +19,7 @@ Fix: Link product, In list view and label product
Fix: visible task into area "time" for "My task" must limit task to tasks i am assigned to.
Fix: When disabled, all fields to add time into task line must be disabled.
Fix: Missing include files.lib.php in some pages ti use dol_delete_recursive
Fix: [ bug #1544 ] Can remove date from invoice
***** ChangeLog for 3.5.4 compared to 3.5.3 *****
Fix: Hide title of event when agenda module disabled.

View File

@ -282,7 +282,15 @@ else if ($action == 'setinvoicedate' && $user->rights->facture->creer)
{
$object->fetch($id);
$old_date_lim_reglement=$object->date_lim_reglement;
$object->date=dol_mktime(12,0,0,$_POST['invoicedatemonth'],$_POST['invoicedateday'],$_POST['invoicedateyear']);
$date=dol_mktime(12,0,0,$_POST['invoicedatemonth'],$_POST['invoicedateday'],$_POST['invoicedateyear']);
if (empty($date))
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors');
header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id.'&action=editinvoicedate');
exit;
}
$object->date=$date;
$new_date_lim_reglement=$object->calculate_date_lim_reglement();
if ($new_date_lim_reglement > $old_date_lim_reglement) $object->date_lim_reglement=$new_date_lim_reglement;
if ($object->date_lim_reglement < $object->date) $object->date_lim_reglement=$object->date;