Fix date of invoice in future.
This commit is contained in:
parent
db220e7af5
commit
b011d6e188
@ -315,8 +315,14 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
elseif ($action == 'setdatef' && $user->rights->fournisseur->facture->creer)
|
elseif ($action == 'setdatef' && $user->rights->fournisseur->facture->creer)
|
||||||
{
|
{
|
||||||
|
$newdate=dol_mktime(0,0,0,$_POST['datefmonth'],$_POST['datefday'],$_POST['datefyear']);
|
||||||
|
if ($newdate > (dol_now() + (empty($conf->global->INVOICE_MAX_OFFSET_IN_FUTURE)?0:$conf->global->INVOICE_MAX_OFFSET_IN_FUTURE)))
|
||||||
|
{
|
||||||
|
if (empty($conf->global->INVOICE_MAX_OFFSET_IN_FUTURE)) setEventMessages($langs->trans("WarningInvoiceDateInFuture"), null, 'warnings');
|
||||||
|
else setEventMessages($langs->trans("WarningInvoiceDateTooFarInFuture"), null, 'warnings');
|
||||||
|
}
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$object->date=dol_mktime(12,0,0,$_POST['datefmonth'],$_POST['datefday'],$_POST['datefyear']);
|
$object->date=$newdate;
|
||||||
if ($object->date_echeance && $object->date_echeance < $object->date) $object->date_echeance=$object->date;
|
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);
|
||||||
|
|||||||
@ -240,6 +240,9 @@ if ($object->id > 0)
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
dol_fiche_end();
|
||||||
|
|
||||||
|
|
||||||
$modulepart = 'facture_fournisseur';
|
$modulepart = 'facture_fournisseur';
|
||||||
$permission = $user->rights->fournisseur->facture->creer;
|
$permission = $user->rights->fournisseur->facture->creer;
|
||||||
$permtoedit = $user->rights->fournisseur->facture->creer;
|
$permtoedit = $user->rights->fournisseur->facture->creer;
|
||||||
|
|||||||
@ -333,6 +333,8 @@ InvoiceAutoValidate=Validate invoices automatically
|
|||||||
GeneratedFromRecurringInvoice=Generated from template recurring invoice %s
|
GeneratedFromRecurringInvoice=Generated from template recurring invoice %s
|
||||||
DateIsNotEnough=Date not reached yet
|
DateIsNotEnough=Date not reached yet
|
||||||
InvoiceGeneratedFromTemplate=Invoice %s generated from recurring template invoice %s
|
InvoiceGeneratedFromTemplate=Invoice %s generated from recurring template invoice %s
|
||||||
|
WarningInvoiceDateInFuture=Warning, the invoice date is higher than current date
|
||||||
|
WarningInvoiceDateTooFarInFuture=Warning, the invoice date is too far from current date
|
||||||
# PaymentConditions
|
# PaymentConditions
|
||||||
Statut=Status
|
Statut=Status
|
||||||
PaymentConditionShortRECEP=Due Upon Receipt
|
PaymentConditionShortRECEP=Due Upon Receipt
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user