Fix label on discounts

This commit is contained in:
Laurent Destailleur 2024-06-22 13:53:11 +02:00
parent afbdc63b65
commit c78a74edde
4 changed files with 13 additions and 12 deletions

View file

@ -144,6 +144,7 @@ if ($action == 'confirm_split' && GETPOST("confirm", "alpha") == 'yes' && $permi
$newdiscount2->multicurrency_amount_tva = price2num($newdiscount2->multicurrency_amount_ttc - $newdiscount2->multicurrency_amount_ht);
$db->begin();
$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
// 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
$discount->fk_invoice_supplier_source = 0;
@ -288,7 +289,7 @@ if ($socid > 0) {
dol_print_error($db);
}
print '<tr><td>'.$langs->trans("CustomerAbsoluteDiscountAllUsers").'</td>';
print '<tr><td class="titlefieldmiddle">'.$langs->trans("CustomerAbsoluteDiscountAllUsers").'</td>';
print '<td class="amount">'.price($remise_all, 1, $langs, 1, -1, -1, $conf->currency).' '.$langs->trans("HT");
if (empty($user->fk_soc)) { // No need to show this for external users
print $form->textwithpicto('', $langs->trans("CustomerAbsoluteDiscountMy").': '.price($remise_user, 1, $langs, 1, -1, -1, $conf->currency).' '.$langs->trans("HT"));
@ -317,7 +318,7 @@ if ($socid > 0) {
dol_print_error($db);
}
print '<tr><td>'.$langs->trans("SupplierAbsoluteDiscountAllUsers").'</td>';
print '<tr><td class="titlefieldmiddle">'.$langs->trans("SupplierAbsoluteDiscountAllUsers").'</td>';
print '<td class="amount">'.price($remise_all, 1, $langs, 1, -1, -1, $conf->currency).' '.$langs->trans("HT");
if (empty($user->fk_soc)) { // No need to show this for external users
print $form->textwithpicto('', $langs->trans("SupplierAbsoluteDiscountMy").' : '.price($remise_user, 1, $langs, 1, -1, -1, $conf->currency).' '.$langs->trans("HT"));

View file

@ -66,7 +66,7 @@ if ($isNewObject) {
if ($absolute_discount > 0) {
if (!empty($cannotApplyDiscount) || !$isInvoice || $isNewObject || $object->statut > $objclassname::STATUS_DRAFT || $object->type == $objclassname::TYPE_CREDIT_NOTE || $object->type == $objclassname::TYPE_DEPOSIT) {
$translationKey = empty($discount_type) ? 'CompanyHasDownPaymentOrCommercialDiscount' : 'HasDownPaymentOrCommercialDiscountFromSupplier';
$text = $langs->trans($translationKey, price($absolute_discount), $langs->transnoentities("Currency".$conf->currency)).'.';
$text = $langs->trans($translationKey, price($absolute_discount, 1, $outlangs, 1, -1, -1, $conf->currency)).'.';
if ($isInvoice && !$isNewObject && $object->statut > $objclassname::STATUS_DRAFT && $object->type != $objclassname::TYPE_CREDIT_NOTE && $object->type != $objclassname::TYPE_DEPOSIT) {
$text = $form->textwithpicto($text, $langs->trans('AbsoluteDiscountUse'));
@ -93,15 +93,15 @@ if ($absolute_discount > 0) {
if ($absolute_creditnote > 0) {
// If validated, we show link "add credit note to payment"
if (!empty($cannotApplyDiscount) || !$isInvoice || $isNewObject || $object->statut != $objclassname::STATUS_VALIDATED || $object->type == $objclassname::TYPE_CREDIT_NOTE) {
$translationKey = !empty($discount_type) ? 'HasCreditNoteFromSupplier' : 'CompanyHasCreditNote';
$text = $langs->trans($translationKey, price($absolute_creditnote), $langs->transnoentities("Currency".$conf->currency)).'.';
$translationKey = empty($discount_type) ? 'CompanyHasCreditNote' : 'HasCreditNoteFromSupplier';
$text = $langs->trans($translationKey, price($absolute_creditnote, 1, $langs, 1, -1, -1, $conf->currency)).'.';
if ($isInvoice && !$isNewObject && $object->statut == $objclassname::STATUS_DRAFT && $object->type != $objclassname::TYPE_DEPOSIT) {
$text = $form->textwithpicto($text, $langs->trans('CreditNoteDepositUse'));
}
if ($absolute_discount <= 0 || $isNewObject) {
$text .= ' ('.$addabsolutediscount.')';
$text .= ' '.$addabsolutediscount;
}
if ($isNewObject) {
@ -121,7 +121,7 @@ if ($absolute_discount <= 0 && $absolute_creditnote <= 0) {
print '<br class="hideonsmartphone"><span class="opacitymedium hideonsmartphone">'.$langs->trans($translationKey).'.</span>';
if ($isInvoice && $object->statut == $objclassname::STATUS_DRAFT && $object->type != $objclassname::TYPE_CREDIT_NOTE && $object->type != $objclassname::TYPE_DEPOSIT) {
print ' ('.$addabsolutediscount.')';
print ' '.$addabsolutediscount;
}
}

View file

@ -537,7 +537,7 @@ ChequeDeposits=Deposit slips
Cheques=Checks
DepositId=Id deposit
NbCheque=Number of checks
CreditNoteConvertedIntoDiscount=This %s has been converted into %s
CreditNoteConvertedIntoDiscount=%s converted into %s
UsBillingContactAsIncoiveRecipientIfExist=Use contact/address with type 'billing contact' instead of third-party address as recipient for invoices
ShowUnpaidAll=Show all unpaid invoices
ShowUnpaidLateOnly=Show late unpaid invoices only

View file

@ -260,12 +260,12 @@ CompanyHasNoRelativeDiscount=This customer has no relative discount by default
HasRelativeDiscountFromSupplier=You have a default discount of <b>%s%%</b> with this vendor
HasNoRelativeDiscountFromSupplier=No default relative discount with this vendor
CompanyHasAbsoluteDiscount=This customer has discounts available (credits notes or down payments) for <b>%s</b> %s
CompanyHasDownPaymentOrCommercialDiscount=This customer has discounts available (commercial, down payments) for <b>%s</b> %s
CompanyHasCreditNote=This customer still has credit notes for <b>%s</b> %s
CompanyHasDownPaymentOrCommercialDiscount=This customer has discounts available (commercial, down payments) for <b>%s</b>
CompanyHasCreditNote=This customer still has credit notes for <b>%s</b>
HasNoAbsoluteDiscountFromSupplier=No discount/credit available from this vendor
HasAbsoluteDiscountFromSupplier=You have discounts available (credits notes or down payments) for <b>%s</b> %s from this vendor
HasDownPaymentOrCommercialDiscountFromSupplier=You have discounts available (commercial, down payments) for <b>%s</b> %s from this vendor
HasCreditNoteFromSupplier=You have credit notes for <b>%s</b> %s from this vendor
HasDownPaymentOrCommercialDiscountFromSupplier=You have discounts available (commercial, down payments) for <b>%s</b> from this vendor
HasCreditNoteFromSupplier=You have credit notes for <b>%s</b> from this vendor
CompanyHasNoAbsoluteDiscount=This customer has no discount credit available
CustomerAbsoluteDiscountAllUsers=Absolute customer discounts (granted by all users)
CustomerAbsoluteDiscountMy=Absolute customer discounts (granted by yourself)