From d52dc51ddfd37a91820e8e18b0d32919c35d163f Mon Sep 17 00:00:00 2001 From: Mathieu Lutfy Date: Wed, 21 Jul 2021 08:42:04 -0400 Subject: [PATCH] Fix 'includes tax' translation for PriceSet Checkbox fields --- CRM/Price/BAO/PriceField.php | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/CRM/Price/BAO/PriceField.php b/CRM/Price/BAO/PriceField.php index f5435efda1..8c2fcbadcf 100644 --- a/CRM/Price/BAO/PriceField.php +++ b/CRM/Price/BAO/PriceField.php @@ -387,17 +387,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { $postHelpText = '' . $opt['help_post'] . ''; } if (isset($taxAmount) && $invoicing) { - if ($displayOpt == 'Do_not_show') { - $opt['label'] = '' . $opt['label'] . '' . '' . CRM_Utils_Money::format($opt[$valueFieldName] + $taxAmount) . ''; - } - elseif ($displayOpt == 'Inclusive') { - $opt['label'] = '' . $opt['label'] . '' . '' . CRM_Utils_Money::format($opt[$valueFieldName] + $taxAmount) . ''; - $opt['label'] .= ' (includes ' . $taxTerm . ' of ' . CRM_Utils_Money::format($opt['tax_amount']) . ')'; - } - else { - $opt['label'] = '' . $opt['label'] . '' . '' . CRM_Utils_Money::format($opt[$valueFieldName]) . ''; - $opt['label'] .= ' + ' . CRM_Utils_Money::format($opt['tax_amount']) . ' ' . $taxTerm . ''; - } + $opt['label'] = '' . $opt['label'] . '' . self::getTaxLabel($opt, $valueFieldName, $displayOpt, $taxTerm); } else { $opt['label'] = '' . $opt['label'] . '' . '' . CRM_Utils_Money::format($opt[$valueFieldName]) . ''; @@ -848,7 +838,7 @@ WHERE id IN (" . implode(',', array_keys($priceFields)) . ')'; } elseif ($displayOpt == 'Inclusive') { $label = CRM_Utils_Money::format($opt[$valueFieldName] + $opt['tax_amount']); - $label .= ' (includes ' . $taxTerm . ' of ' . CRM_Utils_Money::format($opt['tax_amount']) . ')'; + $label .= ' ' . ts('(includes %1 of %2)', [1 => $taxTerm, 2 => CRM_Utils_Money::format($opt['tax_amount'])]) . ''; } else { $label = CRM_Utils_Money::format($opt[$valueFieldName]); -- 2.25.1