You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tax rate inputs blank with comma-decimal locales (az_AZ, fr_FR, etc.) after type=number added #4553
Tax 1 Rate and Tax 2 Rate fields in the Tax configuration tab do not populate when the system locale uses a comma as the decimal separator (e.g., az_AZ, fr_FR, de_DE). The fields render blank even though the value is correctly stored in the database. With en_US (period decimal separator) the fields populate correctly.
Steps to Reproduce
Set locale to any comma-decimal locale (e.g., Azerbaijani az_AZ) in Config → Locale
Set Tax 1 Rate to any value (e.g., 18) and save
Navigate away and return to Config → Tax tab
Expected: Tax 1 Rate field shows 18
Actual: Tax 1 Rate field is blank
Root Cause
Commit 42ba39d29 added type='number' to the tax rate inputs in app/Views/configs/tax_config.php for input validation. However, to_tax_decimals() formats the value using PHP's NumberFormatter with the configured locale — producing "18,00" for comma-decimal locales. Browsers reject a comma-decimal value in <input type="number"> and render the field blank.
// tax_config.php — value rendered as "18,00" with az_AZ locale'value' => to_tax_decimals($config['default_tax_1_rate'])
This was not an issue prior to 42ba39d29 (before v3.4.1) because the inputs were plain type='text'.
Proposed Fix
type='number' inputs require a machine-readable, period-decimal value — not a locale-formatted display string. The fix is to pass the raw numeric value (cast to float, which PHP serialises with . regardless of locale) instead of the locale-formatted string for these two inputs.
// tax_config.php — always produces "18" or "18.5", compatible with type="number"'value' => $config['default_tax_1_rate'] !== '' ? (float) $config['default_tax_1_rate'] : ''
Apply the same pattern to default_tax_2_rate on line 86.
This preserves the type='number' browser validation while correctly supporting all locales. The existing parse_tax() on the save side already handles locale-aware parsing of the submitted value, so round-tripping is unaffected.
Affected File
app/Views/configs/tax_config.php — lines 61 and 86
Environment
Reproduced on current master. Not present at release 5f395d (v3.4.1) — that release predates the type='number' addition.
@jekkos this regression came from 42ba39d. I think we don't have a test that verifies changes work properly on both locales that use , as a decimal separator and those which use .. We might not want to do the minor release until this is mitigated.
Added type='number' to discount fields (pre-existing, not from this commit)
❌ No (raw $config values)
app/Views/configs/receipt_config.php
Added type='number' to receipt settings
❌ No (raw $config values)
app/Views/configs/invoice_config.php
Added type='number' to invoice number fields
❌ No (integer values)
app/Views/login.php
Moved use statement, no input changes
❌ No
Confirmed Regression: tax_config.php Only
Lines 61 and 86 use locale-formatted values in number-type inputs:
// Line 61'value' => to_tax_decimals($config['default_tax_1_rate'])
// Line 86 'value' => to_tax_decimals($config['default_tax_2_rate'])
Other Inputs Are Safe
All other type='number' inputs added in this commit use raw $config values from the database, which are stored as machine-readable numbers (period decimals), so they work correctly regardless of locale.
Fix
Branch pushed: fix-tax-input-locale
The fix replaces locale-formatted values with raw numeric values for tax rate inputs:
PHP serializes floats with a period decimal regardless of locale. The parse_tax() function on the save side already handles locale-aware parsing, so round-tripping works correctly.
Activity
objecttothis commentedon May 21, 2026
@jekkos this regression came from 42ba39d. I think we don't have a test that verifies changes work properly on both locales that use
,as a decimal separator and those which use.. We might not want to do the minor release until this is mitigated.jekkos commentedon May 21, 2026
Regression Analysis
I've analyzed commit
42ba39d29to identify all potential regressions from addingtype='number'to input fields.Files Changed by Commit 42ba39d
app/Views/configs/tax_config.phptype='number'to tax rate inputsto_tax_decimals()for valuesapp/Views/configs/email_config.phptype='number'to smtp_port, smtp_timeout$configvalues)app/Views/configs/barcode_config.phptype='number'to barcode settings$configvalues)app/Views/configs/info_config.phptype='tel'to phone/faxapp/Views/configs/general_config.phptype='number'to discount fields (pre-existing, not from this commit)$configvalues)app/Views/configs/receipt_config.phptype='number'to receipt settings$configvalues)app/Views/configs/invoice_config.phptype='number'to invoice number fieldsapp/Views/login.phpusestatement, no input changesConfirmed Regression:
tax_config.phpOnlyLines 61 and 86 use locale-formatted values in number-type inputs:
Other Inputs Are Safe
All other
type='number'inputs added in this commit use raw$configvalues from the database, which are stored as machine-readable numbers (period decimals), so they work correctly regardless of locale.Fix
Branch pushed:
fix-tax-input-localeThe fix replaces locale-formatted values with raw numeric values for tax rate inputs:
PHP serializes floats with a period decimal regardless of locale. The
parse_tax()function on the save side already handles locale-aware parsing, so round-tripping works correctly.fix: tax rate input locale handling - save path
revert: remove type=number from tax rate inputs
jekkos commentedon Jun 3, 2026
Resolution
PR #4555 has been updated with the correct fix.
Root Cause
Commit 42ba39d added
type="number"to the tax rate input fields. This causes issues with locale-specific decimal separators because:type="number"inputs as dot-decimal (e.g., "5.5") regardless of the user's localeSolution
Revert the
type="number"addition and keep using text inputs with the existing locale-aware functions:to_tax_decimals()for display (formats according to locale)parse_tax()for parsing (interprets according to locale)This is the same pattern used successfully in other tax rate inputs throughout the application (
items/form.php,tax_rates_form.php).Changes
tax_config.php: Removedtype="number",step,min,maxattributes from tax rate inputsConfig.php: Restoredparse_tax()for locale-aware parsingThe PR is ready for review: #4555
fix: tax rate inputs blank with comma-decimal locales (#4555)