Files
opensourcepos/app/Language/lo/Taxes.php
T
jekkosandobjecttothis 625bb3536a fix(taxes): reject negative tax rates and percentages (#4730)
* fix(taxes): reject negative tax rates and percentages

Reject negative tax values across all tax entry points so they can
never be persisted and produce inverted sales totals:

- Items::postSave / postBulkUpdate: validate tax_percents.* as
  nonNegativeDecimal (was unvalidated, persisted raw).
- Items::save_tax_data (CSV import): fail the row on a negative
  Tax N Percent instead of silently dropping the tax.
- Taxes::postSave: reject negative tax_rate before saving.
- Config::postSaveTax: reject negative default tax rates.

Adds non-negative regression tests for Items, Taxes and Config, plus
boundary tests proving a zero tax rate/percent is still accepted. New
language strings for the rejection messages.

* test: adopt test{Method}_{Purpose} naming convention for new tests

Align the negative-tax test method names with the convention established
in ConfigTest (testPostSave_RejectsNegativeTaxPercent, etc.), per review.

* fix(config): add language entries to all locales, extract TaxFixtureTrait

* fix(i18n): place tax_rate_non_negative in alphabetical order

Move the new tax_rate_non_negative entry to its correct alphabetical
position (after tax_rate_error_adding_updating) in all locale files.

---------

Co-authored-by: objecttothis <17935339+objecttothis@users.noreply.github.com>
2026-10-09 08:58:00 +02:00

85 lines
5.3 KiB
PHP

<?php
return [
"add_exception" => "ເພີ່ມຂໍ້ຜິດພາດ",
"cascade" => "Cascade",
"cascade_sequence" => "",
"city" => "ເມືອງ",
"code" => "ລະຫັດ",
"confirm_delete" => "ແນ່ໃຈບໍວ່າຕ້ອງການລຶບອອກ? ການກຳທຳນີ້ຈະບໍສາມາດເຮັດຄືນໄດ້",
"confirm_restore" => "",
"default_tax_category" => "ຄ່າພຶ້ນຖານໝວດພາສີ",
"default_tax_rate" => "ພຶ້ນຖານອັດຕາພາສີ",
"error_adding_updating" => "ເພີ່ມຫຼືແກ້ໄຂລະຫັດພາສີບໍສຳເລັດ",
"group_seq" => "ກຸ່ມ",
"jurisdiction_name" => "ຊື່ເຂດອຳນາດສານ",
"name" => "ຊື່",
"new" => "ພາສີໃໝ່",
"no_taxes" => "",
"no_taxes_to_display" => "ບໍມີລະຫັດພາສີທີ່ຈະສະແດງ",
"reporting_authority" => "ລາຍງານສິດທິ",
"round_half_down" => "ເຄິ່ງໜຶ່ງ",
"round_half_even" => "ເຄິ່ງຄູ່",
"round_half_odd" => "ເຄິ່ງຄີກ",
"round_half_up" => "ເຄິ່ງຂຶ້ນ",
"rounding_code" => "ລະຫັດປັດເສດ",
"sales_tax" => "ພາສີການຂາຍ",
"sales_tax_by_invoice" => "ພາສີການຂາຍຕາມໃບແຈ້ງໜີ້",
"sequence" => "ລຳດັບ.",
"state" => "ສະຖານະ",
"successful_deleted" => "ລືບສຳເລັດ",
"tax_categories" => "ໝວດພາສີ",
"tax_categories_configuration" => "",
"tax_categories_saved_successfully" => "",
"tax_categories_saved_unsuccessfully" => "",
"tax_category" => "Tax Category",
"tax_category_code" => "",
"tax_category_duplicate" => "",
"tax_category_invalid_chars" => "",
"tax_category_name" => "",
"tax_category_new" => "",
"tax_category_required" => "",
"tax_code" => "Tax Code",
"tax_code_cannot_be_deleted" => "Tax Code delete failed.",
"tax_code_duplicate" => "",
"tax_code_invalid_chars" => "",
"tax_code_name" => "Tax Code Name",
"tax_code_required" => "Tax Code is a required field.",
"tax_code_successful_deleted" => "You have successfully deleted Tax Code",
"tax_code_successful_updated" => "You have successfully updated",
"tax_code_successful_updating" => "You have successfully updated Tax Code",
"tax_code_successfully_added" => "You have successfully added",
"tax_code_type" => "Tax Code Type",
"tax_codes" => "",
"tax_codes_configuration" => "",
"tax_codes_saved_successfully" => "",
"tax_codes_saved_unsuccessfully" => "",
"tax_excluded" => "",
"tax_group" => "",
"tax_group_not_unique" => "",
"tax_group_sequence" => "",
"tax_included" => "",
"tax_jurisdiction" => "",
"tax_jurisdiction_duplicate" => "",
"tax_jurisdiction_invalid_chars" => "",
"tax_jurisdiction_required" => "",
"tax_jurisdictions" => "",
"tax_jurisdictions_configuration" => "",
"tax_jurisdictions_saved_successfully" => "",
"tax_jurisdictions_saved_unsuccessfully" => "",
"tax_rate" => "Tax Rate",
"tax_rate_configuration" => "",
"tax_rate_error_adding_updating" => "",
"tax_rate_non_negative" => "",
"tax_rate_numeric" => "Tax Rate must be a number.",
"tax_rate_required" => "Tax Rate is a required field.",
"tax_rate_successful_updated" => "",
"tax_rate_successfully_added" => "",
"tax_rates" => "",
"tax_rates_configuration" => "",
"tax_rounding" => "",
"tax_type" => "",
"update" => "Update Sales Category Tax",
"vat_tax" => "VAT Tax",
];