Fix bug where invoice situation invoices could not be created (#33842)

This commit is contained in:
Yannis Hoareau
2025-04-14 20:01:35 +02:00
committed by GitHub
parent 2c3cb5806d
commit e62f9cce4a

View File

@@ -1450,7 +1450,7 @@ if (empty($reshook)) {
}
// Standard or deposit invoice, not from a Predefined template invoice
if ((GETPOST('type') == Facture::TYPE_STANDARD || GETPOST('type') == Facture::TYPE_DEPOSIT || GETPOST('type') == Facture::TYPE_PROFORMA || (GETPOST('type') == Facture::TYPE_SITUATION && !GETPOST('situations'))) && GETPOST('fac_rec') <= 0) {
if ((GETPOST('type') == Facture::TYPE_STANDARD || GETPOST('type') == Facture::TYPE_DEPOSIT || GETPOST('type') == Facture::TYPE_PROFORMA || (GETPOST('type') == Facture::TYPE_SITUATION && GETPOSTINT('situations') < 0)) && GETPOST('fac_rec') <= 0) {
$typeamount = GETPOST('typedeposit', 'aZ09');
$valuestandardinvoice = price2num(str_replace('%', '', GETPOST('valuestandardinvoice', 'alpha')), 'MU');
$valuedeposit = price2num(str_replace('%', '', GETPOST('valuedeposit', 'alpha')), 'MU');
@@ -1991,7 +1991,7 @@ if (empty($reshook)) {
}
// Situation invoices
if (GETPOST('type') == Facture::TYPE_SITUATION && GETPOST('situations')) {
if (GETPOST('type') == Facture::TYPE_SITUATION && GETPOSTINT('situations') > 0) {
if (empty($dateinvoice)) {
$error++;
$mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date"));