Fix: Question about warehouse must not be done when module stock is
disabled. Fix: Option STOCK_SUPPORTS_SERVICES was not correctly implemented (missing test at some places).
This commit is contained in:
parent
d22bfa8847
commit
b4add020a9
@ -3,6 +3,9 @@ English Dolibarr ChangeLog
|
|||||||
--------------------------------------------------------------
|
--------------------------------------------------------------
|
||||||
|
|
||||||
***** ChangeLog for 3.5.4 compared to 3.5.3 *****
|
***** ChangeLog for 3.5.4 compared to 3.5.3 *****
|
||||||
|
Fix: Question about warehouse must not be done when module stock is disabled.
|
||||||
|
Fix: Option STOCK_SUPPORTS_SERVICES was not correctly implemented
|
||||||
|
(missing test at some places).
|
||||||
Fix: Renaming a project with uplaoded files failed.
|
Fix: Renaming a project with uplaoded files failed.
|
||||||
Fix: [ bug #1476 ] Invoice creation form loses invoice date when there is a validation error.
|
Fix: [ bug #1476 ] Invoice creation form loses invoice date when there is a validation error.
|
||||||
Fix: [ bug #1431 ] Reception and Send supplier order box has a weird top margin.
|
Fix: [ bug #1431 ] Reception and Send supplier order box has a weird top margin.
|
||||||
|
|||||||
@ -1011,8 +1011,18 @@ else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->co
|
|||||||
{
|
{
|
||||||
$idwarehouse=GETPOST('idwarehouse');
|
$idwarehouse=GETPOST('idwarehouse');
|
||||||
|
|
||||||
|
$qualified_for_stock_change=0;
|
||||||
|
if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(1);
|
||||||
|
}
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $object->hasProductsOrServices(1))
|
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change)
|
||||||
{
|
{
|
||||||
if (! $idwarehouse || $idwarehouse == -1)
|
if (! $idwarehouse || $idwarehouse == -1)
|
||||||
{
|
{
|
||||||
@ -1047,8 +1057,18 @@ else if ($action == 'confirm_modif' && $user->rights->commande->creer)
|
|||||||
{
|
{
|
||||||
$idwarehouse=GETPOST('idwarehouse');
|
$idwarehouse=GETPOST('idwarehouse');
|
||||||
|
|
||||||
|
$qualified_for_stock_change=0;
|
||||||
|
if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(1);
|
||||||
|
}
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $object->hasProductsOrServices(1))
|
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change)
|
||||||
{
|
{
|
||||||
if (! $idwarehouse || $idwarehouse == -1)
|
if (! $idwarehouse || $idwarehouse == -1)
|
||||||
{
|
{
|
||||||
@ -1094,8 +1114,18 @@ else if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->comm
|
|||||||
{
|
{
|
||||||
$idwarehouse=GETPOST('idwarehouse');
|
$idwarehouse=GETPOST('idwarehouse');
|
||||||
|
|
||||||
|
$qualified_for_stock_change=0;
|
||||||
|
if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(1);
|
||||||
|
}
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $object->hasProductsOrServices(1))
|
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change)
|
||||||
{
|
{
|
||||||
if (! $idwarehouse || $idwarehouse == -1)
|
if (! $idwarehouse || $idwarehouse == -1)
|
||||||
{
|
{
|
||||||
@ -1887,8 +1917,19 @@ else
|
|||||||
$text.='<br>';
|
$text.='<br>';
|
||||||
$text.=$notify->confirmMessage('ORDER_VALIDATE',$object->socid);
|
$text.=$notify->confirmMessage('ORDER_VALIDATE',$object->socid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$qualified_for_stock_change=0;
|
||||||
|
if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(1);
|
||||||
|
}
|
||||||
|
|
||||||
$formquestion=array();
|
$formquestion=array();
|
||||||
if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $object->hasProductsOrServices(1))
|
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change)
|
||||||
{
|
{
|
||||||
$langs->load("stocks");
|
$langs->load("stocks");
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||||
@ -1906,9 +1947,19 @@ else
|
|||||||
// Confirm back to draft status
|
// Confirm back to draft status
|
||||||
if ($action == 'modif')
|
if ($action == 'modif')
|
||||||
{
|
{
|
||||||
|
$qualified_for_stock_change=0;
|
||||||
|
if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(1);
|
||||||
|
}
|
||||||
|
|
||||||
$text=$langs->trans('ConfirmUnvalidateOrder',$object->ref);
|
$text=$langs->trans('ConfirmUnvalidateOrder',$object->ref);
|
||||||
$formquestion=array();
|
$formquestion=array();
|
||||||
if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $object->hasProductsOrServices(1))
|
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change)
|
||||||
{
|
{
|
||||||
$langs->load("stocks");
|
$langs->load("stocks");
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||||
@ -1934,12 +1985,22 @@ else
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Confirmation de l'annulation
|
* Confirmation de l'annulation
|
||||||
*/
|
*/
|
||||||
if ($action == 'cancel')
|
if ($action == 'cancel')
|
||||||
{
|
{
|
||||||
|
$qualified_for_stock_change=0;
|
||||||
|
if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(1);
|
||||||
|
}
|
||||||
|
|
||||||
$text=$langs->trans('ConfirmCancelOrder',$object->ref);
|
$text=$langs->trans('ConfirmCancelOrder',$object->ref);
|
||||||
$formquestion=array();
|
$formquestion=array();
|
||||||
if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $object->hasProductsOrServices(1))
|
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $qualified_for_stock_change)
|
||||||
{
|
{
|
||||||
$langs->load("stocks");
|
$langs->load("stocks");
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||||
@ -1956,7 +2017,7 @@ else
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Confirmation de la suppression d'une ligne produit
|
* Confirmation de la suppression d'une ligne produit
|
||||||
*/
|
*/
|
||||||
if ($action == 'ask_deleteline')
|
if ($action == 'ask_deleteline')
|
||||||
{
|
{
|
||||||
$formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
|
$formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
|
||||||
|
|||||||
@ -488,7 +488,7 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fourn
|
|||||||
setEventMessage($object->error, 'errors');
|
setEventMessage($object->error, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we have permission, and if we don't need to provide th idwarehouse, we go directly on approved step
|
// If we have permission, and if we don't need to provide the idwarehouse, we go directly on approved step
|
||||||
if ($user->rights->fournisseur->commande->approuver && ! (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $object->hasProductsOrServices(1)))
|
if ($user->rights->fournisseur->commande->approuver && ! (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $object->hasProductsOrServices(1)))
|
||||||
{
|
{
|
||||||
$action='confirm_approve';
|
$action='confirm_approve';
|
||||||
@ -499,8 +499,18 @@ else if ($action == 'confirm_approve' && $confirm == 'yes' && $user->rights->fou
|
|||||||
{
|
{
|
||||||
$idwarehouse=GETPOST('idwarehouse', 'int');
|
$idwarehouse=GETPOST('idwarehouse', 'int');
|
||||||
|
|
||||||
|
$qualified_for_stock_change=0;
|
||||||
|
if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(1);
|
||||||
|
}
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $object->hasProductsOrServices(1))
|
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $qualified_for_stock_change)
|
||||||
{
|
{
|
||||||
if (! $idwarehouse || $idwarehouse == -1)
|
if (! $idwarehouse || $idwarehouse == -1)
|
||||||
{
|
{
|
||||||
@ -1193,8 +1203,18 @@ elseif (! empty($object->id))
|
|||||||
*/
|
*/
|
||||||
if ($action == 'approve')
|
if ($action == 'approve')
|
||||||
{
|
{
|
||||||
|
$qualified_for_stock_change=0;
|
||||||
|
if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(1);
|
||||||
|
}
|
||||||
|
|
||||||
$formquestion=array();
|
$formquestion=array();
|
||||||
if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $object->hasProductsOrServices(1))
|
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) && $qualified_for_stock_change)
|
||||||
{
|
{
|
||||||
$langs->load("stocks");
|
$langs->load("stocks");
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||||
|
|||||||
@ -129,7 +129,7 @@ elseif ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fourni
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change)
|
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change)
|
||||||
{
|
{
|
||||||
$langs->load("stocks");
|
$langs->load("stocks");
|
||||||
if (! $idwarehouse || $idwarehouse == -1)
|
if (! $idwarehouse || $idwarehouse == -1)
|
||||||
@ -1475,7 +1475,17 @@ else
|
|||||||
}*/
|
}*/
|
||||||
$formquestion=array();
|
$formquestion=array();
|
||||||
|
|
||||||
if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $object->hasProductsOrServices(1))
|
$qualified_for_stock_change=0;
|
||||||
|
if (empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$qualified_for_stock_change=$object->hasProductsOrServices(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change)
|
||||||
{
|
{
|
||||||
$langs->load("stocks");
|
$langs->load("stocks");
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user