facture/card.php: avoid validating invoices with date anterior to last invoice date
This commit is contained in:
parent
eda9622c9c
commit
7c866ce6a2
@ -302,6 +302,15 @@ if (empty($reshook)) {
|
|||||||
// Validation
|
// Validation
|
||||||
$object->fetch($id);
|
$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
|
// On verifie signe facture
|
||||||
if ($object->type == Facture::TYPE_CREDIT_NOTE) {
|
if ($object->type == Facture::TYPE_CREDIT_NOTE) {
|
||||||
// Si avoir, le signe doit etre negatif
|
// Si avoir, le signe doit etre negatif
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user