Merge branch '3.9' of https://github.com/Dolibarr/dolibarr into 3.9
This commit is contained in:
commit
af5a75c39b
@ -392,20 +392,21 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
|
|
||||||
// Check for mandatory prof id
|
// Check for mandatory prof id (but only if country is than than ours)
|
||||||
for($i = 1; $i < 6; $i ++)
|
if ($mysoc->country_id > 0 && $object->thirdparty->country_id == $mysoc->country_id)
|
||||||
|
{
|
||||||
|
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))
|
||||||
{
|
{
|
||||||
if (! $error)
|
if (! $error) $langs->load("errors");
|
||||||
$langs->load("errors");
|
$error++;
|
||||||
$error ++;
|
|
||||||
|
|
||||||
setEventMessages($langs->trans('ErrorProdIdIsMandatory', $langs->transcountry('ProfId' . $i, $object->thirdparty->country_code)), null, 'errors');
|
setEventMessages($langs->trans('ErrorProdIdIsMandatory', $langs->transcountry('ProfId' . $i, $object->thirdparty->country_code)), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$qualified_for_stock_change = 0;
|
$qualified_for_stock_change = 0;
|
||||||
if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
|
if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
|
||||||
|
|||||||
@ -396,7 +396,7 @@ if (empty($reshook))
|
|||||||
// Only for companies
|
// Only for companies
|
||||||
if (!($object->particulier || $private))
|
if (!($object->particulier || $private))
|
||||||
{
|
{
|
||||||
for ($i = 1; $i < 5; $i++)
|
for ($i = 1; $i <= 6; $i++)
|
||||||
{
|
{
|
||||||
$slabel="idprof".$i;
|
$slabel="idprof".$i;
|
||||||
$_POST[$slabel]=trim($_POST[$slabel]);
|
$_POST[$slabel]=trim($_POST[$slabel]);
|
||||||
@ -411,8 +411,10 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check for mandatory prof id (but only if country is than than ours)
|
||||||
|
if ($mysoc->country_id > 0 && $object->country_id == $mysoc->country_id)
|
||||||
|
{
|
||||||
$idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY';
|
$idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY';
|
||||||
|
|
||||||
if (! $vallabel && ! empty($conf->global->$idprof_mandatory))
|
if (! $vallabel && ! empty($conf->global->$idprof_mandatory))
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
@ -423,6 +425,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user