diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php
index 78364aa706a..29570ec379c 100644
--- a/htdocs/core/tpl/objectline_create.tpl.php
+++ b/htdocs/core/tpl/objectline_create.tpl.php
@@ -356,35 +356,36 @@ if ($nolinesbefore) {
">
- multicurrency->enabled) && $this->multicurrency_code != $conf->currency) {
+ multicurrency->enabled) && $this->multicurrency_code != $conf->currency) {
$coldisplay++;
?>
">
|
-
">
|
-
">
|
global->PRODUCT_USE_UNITS)
- {
+ if (! empty($conf->global->PRODUCT_USE_UNITS)) {
$coldisplay++;
print '';
print $form->selectUnits($line->fk_unit, "units");
print ' | ';
}
$remise_percent = $buyer->remise_percent;
- if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier')
- {
+ if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') {
$remise_percent = $seller->remise_supplier_percent;
}
$coldisplay++;
@@ -397,8 +398,7 @@ if ($nolinesbefore) {
$coldisplay++;
print ' | ';
}
- if (!empty($usemargins))
- {
+ if (!empty($usemargins)) {
if (!empty($user->rights->margins->creer)) {
$coldisplay++;
?>
@@ -486,19 +486,19 @@ if (!empty($usemargins) && $user->rights->margins->creer)
/* Some js test when we click on button "Add" */
jQuery(document).ready(function() {
global->DISPLAY_MARGIN_RATES)) { ?>
- $("input[name='np_marginRate']:first").blur(function(e) {
- return checkFreeLine(e, "np_marginRate");
- });
- global->DISPLAY_MARK_RATES)) { ?>
- $("input[name='np_markRate']:first").blur(function(e) {
- return checkFreeLine(e, "np_markRate");
- });
-
+ if (!empty($conf->global->DISPLAY_MARGIN_RATES)) { ?>
+ $("input[name='np_marginRate']:first").blur(function(e) {
+ return checkFreeLine(e, "np_marginRate");
+ });
+ global->DISPLAY_MARK_RATES)) { ?>
+ $("input[name='np_markRate']:first").blur(function(e) {
+ return checkFreeLine(e, "np_markRate");
+ });
+
});
/* TODO This does not work for number with thousand separator that is , */
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index 1e0ea5ba92a..9872874a1d0 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -482,7 +482,7 @@ if (empty($reshook))
$amount_ht = $amount_tva = $amount_ttc = array();
$multicurrency_amount_ht = $multicurrency_amount_tva = $multicurrency_amount_ttc = array();
-
+
// Loop on each vat rate
$i = 0;
foreach ($object->lines as $line)
@@ -557,7 +557,7 @@ if (empty($reshook))
$total_creditnote_and_deposit += $obj->amount_ttc;
}
} else dol_print_error($db);
-
+
$discount->amount_ht = $discount->amount_ttc = $total_paiements + $total_creditnote_and_deposit - $object->total_ttc;
$discount->amount_tva = 0;
$discount->tva_tx = 0;