mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-31 14:12:29 +01:00
facture/card.php: avoid validating invoices with date anterior to last invoice date
This commit is contained in:
@@ -302,6 +302,15 @@ if (empty($reshook)) {
|
||||
// Validation
|
||||
$object->fetch($id);
|
||||
|
||||
if (!empty($conf->global-> INVOICE_CHECK_POSTERIOR_DATE)) {
|
||||
$last_of_type = $object->willBeLastOfSameType();
|
||||
if (empty($object->date_validation) && !$last_of_type[0]) {
|
||||
setEventMessages($langs->transnoentities("ErrorInvoiceIsNotLastOfSameType", $object->ref , dol_print_date($object->date, 'day'), dol_print_date($last_of_type[1], 'day')), null, 'errors');
|
||||
header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
// On verifie signe facture
|
||||
if ($object->type == Facture::TYPE_CREDIT_NOTE) {
|
||||
// Si avoir, le signe doit etre negatif
|
||||
|
||||
Reference in New Issue
Block a user