mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-08-02 10:07:19 -04:00
fix: tax rate inputs blank with comma-decimal locales
The to_tax_decimals() function returns locale-formatted values
(e.g. "18,00" for comma-decimal locales like fr_FR, de_DE).
Browsers reject comma-decimal values in <input type="number">
and render the field blank.
Use raw float value instead - PHP serializes floats with period
decimal regardless of locale. The parse_tax() on the save side
already handles locale-aware parsing, so round-tripping works
correctly.
Fixes #4553
Regression from commit 42ba39d29
This commit is contained in:
@@ -58,7 +58,7 @@
|
||||
'name' => 'default_tax_1_rate',
|
||||
'id' => 'default_tax_1_rate',
|
||||
'class' => 'form-control input-sm',
|
||||
'value' => to_tax_decimals($config['default_tax_1_rate'])
|
||||
'value' => $config['default_tax_1_rate'] !== '' ? (float) $config['default_tax_1_rate'] : ''
|
||||
]) ?>
|
||||
<span class="input-group-addon input-sm">%</span>
|
||||
</div>
|
||||
@@ -83,7 +83,7 @@
|
||||
'name' => 'default_tax_2_rate',
|
||||
'id' => 'default_tax_2_rate',
|
||||
'class' => 'form-control input-sm',
|
||||
'value' => to_tax_decimals($config['default_tax_2_rate'])
|
||||
'value' => $config['default_tax_2_rate'] !== '' ? (float) $config['default_tax_2_rate'] : ''
|
||||
]) ?>
|
||||
<span class="input-group-addon input-sm">%</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user