Skip to content

Commit c78a74e

Browse files
committed
Fix label on discounts
1 parent afbdc63 commit c78a74e

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

htdocs/comm/remx.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@
144144
$newdiscount2->multicurrency_amount_tva = price2num($newdiscount2->multicurrency_amount_ttc - $newdiscount2->multicurrency_amount_ht);
145145

146146
$db->begin();
147+
147148
$discount->fk_facture_source = 0; // This is to delete only the require record (that we will recreate with two records) and not all family with same fk_facture_source
148149
// This is to delete only the require record (that we will recreate with two records) and not all family with same fk_invoice_supplier_source
149150
$discount->fk_invoice_supplier_source = 0;
@@ -288,7 +289,7 @@
288289
dol_print_error($db);
289290
}
290291

291-
print '<tr><td>'.$langs->trans("CustomerAbsoluteDiscountAllUsers").'</td>';
292+
print '<tr><td class="titlefieldmiddle">'.$langs->trans("CustomerAbsoluteDiscountAllUsers").'</td>';
292293
print '<td class="amount">'.price($remise_all, 1, $langs, 1, -1, -1, $conf->currency).' '.$langs->trans("HT");
293294
if (empty($user->fk_soc)) { // No need to show this for external users
294295
print $form->textwithpicto('', $langs->trans("CustomerAbsoluteDiscountMy").': '.price($remise_user, 1, $langs, 1, -1, -1, $conf->currency).' '.$langs->trans("HT"));
@@ -317,7 +318,7 @@
317318
dol_print_error($db);
318319
}
319320

320-
print '<tr><td>'.$langs->trans("SupplierAbsoluteDiscountAllUsers").'</td>';
321+
print '<tr><td class="titlefieldmiddle">'.$langs->trans("SupplierAbsoluteDiscountAllUsers").'</td>';
321322
print '<td class="amount">'.price($remise_all, 1, $langs, 1, -1, -1, $conf->currency).' '.$langs->trans("HT");
322323
if (empty($user->fk_soc)) { // No need to show this for external users
323324
print $form->textwithpicto('', $langs->trans("SupplierAbsoluteDiscountMy").' : '.price($remise_user, 1, $langs, 1, -1, -1, $conf->currency).' '.$langs->trans("HT"));

htdocs/core/tpl/object_discounts.tpl.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
if ($absolute_discount > 0) {
6767
if (!empty($cannotApplyDiscount) || !$isInvoice || $isNewObject || $object->statut > $objclassname::STATUS_DRAFT || $object->type == $objclassname::TYPE_CREDIT_NOTE || $object->type == $objclassname::TYPE_DEPOSIT) {
6868
$translationKey = empty($discount_type) ? 'CompanyHasDownPaymentOrCommercialDiscount' : 'HasDownPaymentOrCommercialDiscountFromSupplier';
69-
$text = $langs->trans($translationKey, price($absolute_discount), $langs->transnoentities("Currency".$conf->currency)).'.';
69+
$text = $langs->trans($translationKey, price($absolute_discount, 1, $outlangs, 1, -1, -1, $conf->currency)).'.';
7070

7171
if ($isInvoice && !$isNewObject && $object->statut > $objclassname::STATUS_DRAFT && $object->type != $objclassname::TYPE_CREDIT_NOTE && $object->type != $objclassname::TYPE_DEPOSIT) {
7272
$text = $form->textwithpicto($text, $langs->trans('AbsoluteDiscountUse'));
@@ -93,15 +93,15 @@
9393
if ($absolute_creditnote > 0) {
9494
// If validated, we show link "add credit note to payment"
9595
if (!empty($cannotApplyDiscount) || !$isInvoice || $isNewObject || $object->statut != $objclassname::STATUS_VALIDATED || $object->type == $objclassname::TYPE_CREDIT_NOTE) {
96-
$translationKey = !empty($discount_type) ? 'HasCreditNoteFromSupplier' : 'CompanyHasCreditNote';
97-
$text = $langs->trans($translationKey, price($absolute_creditnote), $langs->transnoentities("Currency".$conf->currency)).'.';
96+
$translationKey = empty($discount_type) ? 'CompanyHasCreditNote' : 'HasCreditNoteFromSupplier';
97+
$text = $langs->trans($translationKey, price($absolute_creditnote, 1, $langs, 1, -1, -1, $conf->currency)).'.';
9898

9999
if ($isInvoice && !$isNewObject && $object->statut == $objclassname::STATUS_DRAFT && $object->type != $objclassname::TYPE_DEPOSIT) {
100100
$text = $form->textwithpicto($text, $langs->trans('CreditNoteDepositUse'));
101101
}
102102

103103
if ($absolute_discount <= 0 || $isNewObject) {
104-
$text .= ' ('.$addabsolutediscount.')';
104+
$text .= ' '.$addabsolutediscount;
105105
}
106106

107107
if ($isNewObject) {
@@ -121,7 +121,7 @@
121121
print '<br class="hideonsmartphone"><span class="opacitymedium hideonsmartphone">'.$langs->trans($translationKey).'.</span>';
122122

123123
if ($isInvoice && $object->statut == $objclassname::STATUS_DRAFT && $object->type != $objclassname::TYPE_CREDIT_NOTE && $object->type != $objclassname::TYPE_DEPOSIT) {
124-
print ' ('.$addabsolutediscount.')';
124+
print ' '.$addabsolutediscount;
125125
}
126126
}
127127

htdocs/langs/en_US/bills.lang

+1-1
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ ChequeDeposits=Deposit slips
537537
Cheques=Checks
538538
DepositId=Id deposit
539539
NbCheque=Number of checks
540-
CreditNoteConvertedIntoDiscount=This %s has been converted into %s
540+
CreditNoteConvertedIntoDiscount=%s converted into %s
541541
UsBillingContactAsIncoiveRecipientIfExist=Use contact/address with type 'billing contact' instead of third-party address as recipient for invoices
542542
ShowUnpaidAll=Show all unpaid invoices
543543
ShowUnpaidLateOnly=Show late unpaid invoices only

htdocs/langs/en_US/companies.lang

+4-4
Original file line numberDiff line numberDiff line change
@@ -260,12 +260,12 @@ CompanyHasNoRelativeDiscount=This customer has no relative discount by default
260260
HasRelativeDiscountFromSupplier=You have a default discount of <b>%s%%</b> with this vendor
261261
HasNoRelativeDiscountFromSupplier=No default relative discount with this vendor
262262
CompanyHasAbsoluteDiscount=This customer has discounts available (credits notes or down payments) for <b>%s</b> %s
263-
CompanyHasDownPaymentOrCommercialDiscount=This customer has discounts available (commercial, down payments) for <b>%s</b> %s
264-
CompanyHasCreditNote=This customer still has credit notes for <b>%s</b> %s
263+
CompanyHasDownPaymentOrCommercialDiscount=This customer has discounts available (commercial, down payments) for <b>%s</b>
264+
CompanyHasCreditNote=This customer still has credit notes for <b>%s</b>
265265
HasNoAbsoluteDiscountFromSupplier=No discount/credit available from this vendor
266266
HasAbsoluteDiscountFromSupplier=You have discounts available (credits notes or down payments) for <b>%s</b> %s from this vendor
267-
HasDownPaymentOrCommercialDiscountFromSupplier=You have discounts available (commercial, down payments) for <b>%s</b> %s from this vendor
268-
HasCreditNoteFromSupplier=You have credit notes for <b>%s</b> %s from this vendor
267+
HasDownPaymentOrCommercialDiscountFromSupplier=You have discounts available (commercial, down payments) for <b>%s</b> from this vendor
268+
HasCreditNoteFromSupplier=You have credit notes for <b>%s</b> from this vendor
269269
CompanyHasNoAbsoluteDiscount=This customer has no discount credit available
270270
CustomerAbsoluteDiscountAllUsers=Absolute customer discounts (granted by all users)
271271
CustomerAbsoluteDiscountMy=Absolute customer discounts (granted by yourself)

0 commit comments

Comments
 (0)