Fix: Bad management error
This commit is contained in:
parent
68b54f5cac
commit
a5e8063cfd
@ -324,7 +324,8 @@ else if ($action == 'set_ref_client' && $user->rights->facture->creer) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Classify to validated
|
// Classify to validated
|
||||||
else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->facture->valider) {
|
else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->facture->valider)
|
||||||
|
{
|
||||||
$idwarehouse = GETPOST('idwarehouse');
|
$idwarehouse = GETPOST('idwarehouse');
|
||||||
|
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
@ -333,8 +334,8 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->factu
|
|||||||
// Check parameters
|
// Check parameters
|
||||||
|
|
||||||
// Check for mandatory prof id
|
// Check for mandatory prof id
|
||||||
for($i = 1; $i < 5; $i ++) {
|
for($i = 1; $i < 6; $i ++)
|
||||||
|
{
|
||||||
$idprof_mandatory = 'SOCIETE_IDPROF' . ($i) . '_INVOICE_MANDATORY';
|
$idprof_mandatory = 'SOCIETE_IDPROF' . ($i) . '_INVOICE_MANDATORY';
|
||||||
$idprof = 'idprof' . $i;
|
$idprof = 'idprof' . $i;
|
||||||
if (! $object->thirdparty->$idprof && ! empty($conf->global->$idprof_mandatory)) {
|
if (! $object->thirdparty->$idprof && ! empty($conf->global->$idprof_mandatory)) {
|
||||||
@ -362,9 +363,11 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->factu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error) {
|
if (! $error)
|
||||||
|
{
|
||||||
$result = $object->validate($user, '', $idwarehouse);
|
$result = $object->validate($user, '', $idwarehouse);
|
||||||
if ($result >= 0) {
|
if ($result >= 0)
|
||||||
|
{
|
||||||
// Define output language
|
// Define output language
|
||||||
$outputlangs = $langs;
|
$outputlangs = $langs;
|
||||||
$newlang = '';
|
$newlang = '';
|
||||||
@ -381,7 +384,8 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->factu
|
|||||||
facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setEventMessage($object->error, 'errors');
|
if (count($object->errors)) setEventMessage($object->errors, 'errors');
|
||||||
|
else setEventMessage($object->error, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user