diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 497f676ae8c..3f16a20d98b 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -179,12 +179,6 @@ if (empty($reshook)) ); } - if (!$error && $object->update($object->id, $user) < 1) { - $error++; - setEventMessage($object->error, 'errors'); - $action = 'edit_price'; - } - if (!$error) { $db->begin(); @@ -215,6 +209,11 @@ if (empty($reshook)) } } + if (!$error && $object->update($object->id, $user) < 0) { + $error++; + setEventMessage($object->error, 'errors'); + } + if (empty($error)) { $action = ''; setEventMessage($langs->trans("RecordSaved")); @@ -713,7 +712,7 @@ print "\n"; print ''; print '
'; - + dol_fiche_end(); @@ -793,7 +792,7 @@ if ($action == 'edit_vat' && ($user->rights->produit->creer || $user->rights->se print '| ' . $langs->trans("VATRate") . ' | '; + print ' | |||
| ' . $langs->trans("VATRate") . ' | '; print $form->load_tva("tva_tx", $object->tva_tx, $mysoc, '', $object->id, $object->tva_npr); print ' | |||
| '; print $langs->trans('PriceBase'); print ' | '; - print ''; + print ' | '; print $form->selectPriceBaseType($object->price_base_type, "price_base_type"); print ' | '; print '||
| '.$langs->trans("PriceMode").' | '; + print ' | |||
| '.$langs->trans("PriceMode").' | ';
$price_expression = new PriceExpression($db);
$price_expression_list = array(0 => $langs->trans("PriceNumeric")); //Put the numeric mode as first option
foreach ($price_expression->list_price_expression() as $entry) {
@@ -835,17 +834,18 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->
print $form->selectarray('eid', $price_expression_list, $price_expression_preselection);
print ' '.$langs->trans("PriceExpressionEditor").' ';
print ' | |||
| '; $text = $langs->trans('SellingPrice'); print $form->textwithpicto($text, $langs->trans("PrecisionUnitIsLimitedToXDecimals", $conf->global->MAIN_MAX_DECIMALS_UNIT), 1, 1); - print ' | '; + print ' | '; if ($object->price_base_type == 'TTC') { print ''; } else { @@ -874,16 +875,22 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights-> print ' | ||
| '; $text = $langs->trans('MinPrice'); print $form->textwithpicto($text, $langs->trans("PrecisionUnitIsLimitedToXDecimals", $conf->global->MAIN_MAX_DECIMALS_UNIT), 1, 1); - if ($object->price_base_type == 'TTC') { - print ' | '; - } else { - print ' | '; + print ' | global->PRODUCT_MINIMUM_RECOMMENDED_PRICE)) { + print ' colspan="2"'; } + print '>'; + if ($object->price_base_type == 'TTC') { + print ''; + } else { + print ''; + } + print ' | '; if ( !empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE)) { print ''.$langs->trans("MinimumRecommendedPrice", price($maxpricesupplier,0,'',1,-1,-1,'auto')).' '.img_warning().' | '; } - print '