Fix missing error message on invoice creation

This commit is contained in:
Laurent Destailleur 2017-01-02 11:31:21 +01:00
parent d986247e0f
commit f07c741176

View File

@ -1345,8 +1345,16 @@ if (empty($reshook))
setEventMessages($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), null, 'errors');
$error ++;
}
if (! GETPOST('prod_entry_mode'))
{
if (GETPOST('type') < 0 && ! GETPOST('search_idprod'))
{
setEventMessages($langs->trans('ErrorChooseBetweenFreeAntryOrPredefinedProduct'), null, 'errors');
$error ++;
}
}
if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && GETPOST('type') < 0) {
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors');
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors');
$error ++;
}
if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && (! ($price_ht >= 0) || $price_ht == '') && $price_ht_devise == '') // Unit price can be 0 but not ''