';
}
else
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 4dbc60569bb..489eee73932 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -1900,8 +1900,8 @@ if ($action == 'create' && $user->rights->commande->creer)
// invoice
$filtercreditnote = "fk_facture_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
} else {
- $filterabsolutediscount = "fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')";
- $filtercreditnote = "fk_facture_source IS NOT NULL AND description <> '(DEPOSIT)'";
+ $filterabsolutediscount = "fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description LIKE '(DEPOSIT)%')";
+ $filtercreditnote = "fk_facture_source IS NOT NULL AND description NOT LIKE '(DEPOSIT)%'";
}
// Relative and absolute discounts
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 79045fe54b9..8604e95b5a2 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -2563,8 +2563,8 @@ else if ($id > 0 || ! empty($ref))
$filterabsolutediscount = "fk_facture_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
$filtercreditnote = "fk_facture_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
} else {
- $filterabsolutediscount = "fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')";
- $filtercreditnote = "fk_facture_source IS NOT NULL AND description <> '(DEPOSIT)'";
+ $filterabsolutediscount = "fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description LIKE '(DEPOSIT)%')";
+ $filtercreditnote = "fk_facture_source IS NOT NULL AND description NOT LIKE '(DEPOSIT)%'";
}
$absolute_discount = $soc->getAvailableDiscounts('', $filterabsolutediscount);
@@ -2982,9 +2982,9 @@ else if ($id > 0 || ! empty($ref))
// Remise dispo de type avoir
if (! $absolute_discount)
print ' ';
- // $form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote,
- // $filtercreditnote, $resteapayer);
- $form->form_remise_dispo($_SERVER["PHP_SELF"] . '?facid=' . $object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filtercreditnote, 0); // We allow credit note even if amount is higher
+ // $form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filtercreditnote, $resteapayer
+ $more=' ('.$addcreditnote.')';
+ $form->form_remise_dispo($_SERVER["PHP_SELF"] . '?facid=' . $object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filtercreditnote, 0, $more); // We allow credit note even if amount is higher
}
}
if (! $absolute_discount && ! $absolute_creditnote) {
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 7232f6ec270..8fb0118cd2e 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -1128,8 +1128,8 @@ class Form
{
$obj = $this->db->fetch_object($resql);
$desc=dol_trunc($obj->description,40);
- if ($desc=='(CREDIT_NOTE)') $desc=$langs->trans("CreditNote");
- if ($desc=='(DEPOSIT)') $desc=$langs->trans("Deposit");
+ if (preg_match('/\(CREDIT_NOTE\)/', $desc)) $desc=preg_replace('/\(CREDIT_NOTE\)/', $langs->trans("CreditNote"), $desc);
+ if (preg_match('/\(DEPOSIT\)/', $desc)) $desc=preg_replace('/\(DEPOSIT\)/', $langs->trans("Deposit"), $desc);
$selectstring='';
if ($selected > 0 && $selected == $obj->rowid) $selectstring=' selected';
@@ -3762,7 +3762,7 @@ class Form
}
else
{
- if (! $filter || $filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency)).': ';
+ if (! $filter || $filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description LIKE '(DEPOSIT)%')") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency)).': ';
else print $langs->trans("CompanyHasCreditNote",price($amount,0,$langs,0,0,-1,$conf->currency)).': ';
}
$newfilter='fk_facture IS NULL AND fk_facture_line IS NULL'; // Remises disponibles
@@ -3773,7 +3773,7 @@ class Form
if ($nbqualifiedlines > 0)
{
print ' ';
}
if ($more) print $more;