forked from Wavyzz/dolibarr
Fix: Bad management error
This commit is contained in:
@@ -324,7 +324,8 @@ else if ($action == 'set_ref_client' && $user->rights->facture->creer) {
|
||||
}
|
||||
|
||||
// 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');
|
||||
|
||||
$object->fetch($id);
|
||||
@@ -333,8 +334,8 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->factu
|
||||
// Check parameters
|
||||
|
||||
// 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 = 'idprof' . $i;
|
||||
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);
|
||||
if ($result >= 0) {
|
||||
if ($result >= 0)
|
||||
{
|
||||
// Define output language
|
||||
$outputlangs = $langs;
|
||||
$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);
|
||||
}
|
||||
} else {
|
||||
setEventMessage($object->error, 'errors');
|
||||
if (count($object->errors)) setEventMessage($object->errors, 'errors');
|
||||
else setEventMessage($object->error, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user