mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-14 08:54:21 +01:00
Fix show alays date fields for contract module.
Fix select of product were lost.
This commit is contained in:
@@ -207,13 +207,13 @@ if (empty($reshook))
|
||||
if ($datecommande == '') {
|
||||
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentities('Date')), 'errors');
|
||||
$action = 'create';
|
||||
$error ++;
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($socid < 1) {
|
||||
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), 'errors');
|
||||
$action = 'create';
|
||||
$error ++;
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (! $error) {
|
||||
@@ -334,7 +334,7 @@ if (empty($reshook))
|
||||
$result = $object->addline($desc, $lines [$i]->subprice, $lines [$i]->qty, $lines [$i]->tva_tx, $lines [$i]->localtax1_tx, $lines [$i]->localtax2_tx, $lines [$i]->fk_product, $lines [$i]->remise_percent, $lines [$i]->info_bits, $lines [$i]->fk_remise_except, 'HT', 0, $date_start, $date_end, $product_type, $lines [$i]->rang, $lines [$i]->special_code, $fk_parent_line, $lines [$i]->fk_fournprice, $lines [$i]->pa_ht, $label, $array_option);
|
||||
|
||||
if ($result < 0) {
|
||||
$error ++;
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -349,14 +349,14 @@ if (empty($reshook))
|
||||
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been
|
||||
// modified by hook
|
||||
if ($reshook < 0)
|
||||
$error ++;
|
||||
$error++;
|
||||
} else {
|
||||
setEventMessage($srcobject->error, 'errors');
|
||||
$error ++;
|
||||
$error++;
|
||||
}
|
||||
} else {
|
||||
setEventMessage($object->error, 'errors');
|
||||
$error ++;
|
||||
$error++;
|
||||
}
|
||||
} else {
|
||||
// Required extrafield left blank, error message already defined by setOptionalsFromPost()
|
||||
@@ -390,7 +390,7 @@ if (empty($reshook))
|
||||
$result = $object->add_contact(GETPOST('contactid'), 'CUSTOMER', 'external');
|
||||
if ($result < 0) {
|
||||
setEventMessage($langs->trans("ErrorFailedToAddContact"), 'errors');
|
||||
$error ++;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -554,24 +554,24 @@ if (empty($reshook))
|
||||
|
||||
if (empty($idprod) && ($price_ht < 0) && ($qty < 0)) {
|
||||
setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), 'errors');
|
||||
$error ++;
|
||||
$error++;
|
||||
}
|
||||
if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && GETPOST('type') < 0) {
|
||||
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors');
|
||||
$error ++;
|
||||
$error++;
|
||||
}
|
||||
if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && (! ($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not ''
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), 'errors');
|
||||
$error ++;
|
||||
$error++;
|
||||
}
|
||||
if ($qty == '') {
|
||||
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), 'errors');
|
||||
$error ++;
|
||||
$error++;
|
||||
}
|
||||
if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && empty($product_desc)) {
|
||||
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), 'errors');
|
||||
$error ++;
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (! $error && ($qty >= 0) && (! empty($product_desc) || ! empty($idprod))) {
|
||||
@@ -826,7 +826,7 @@ if (empty($reshook))
|
||||
|
||||
if ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min))) {
|
||||
setEventMessage($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), 'errors');
|
||||
$error ++;
|
||||
$error++;
|
||||
}
|
||||
} else {
|
||||
$type = GETPOST('type');
|
||||
@@ -835,7 +835,7 @@ if (empty($reshook))
|
||||
// Check parameters
|
||||
if (GETPOST('type') < 0) {
|
||||
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), 'errors');
|
||||
$error ++;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1137,10 +1137,10 @@ if (empty($reshook))
|
||||
if (empty($reshook)) {
|
||||
$result = $object->insertExtraFields();
|
||||
if ($result < 0) {
|
||||
$error ++;
|
||||
$error++;
|
||||
}
|
||||
} else if ($reshook < 0)
|
||||
$error ++;
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($error)
|
||||
|
||||
Reference in New Issue
Block a user