Files
opensourcepos/app/Language/sv/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.8 KiB
PHP

<?php
return [
"add_exception" => "Lägg till undantag",
"cascade" => "Kaskad",
"cascade_sequence" => "Kaskadesekvens",
"city" => "Stad",
"code" => "Kod",
"confirm_delete" => "Är du säker på att du vill ta bort denna skattekod? Den här åtgärden kan inte ångras",
"confirm_restore" => "Är du säker på att du vill återställa valda skattekod (er)?",
"default_tax_category" => "Standardskattskategori",
"default_tax_rate" => "Standard skattesats",
"error_adding_updating" => "Skattekodens tillägg eller uppdatering misslyckades",
"group_seq" => "Grupp Seq",
"jurisdiction_name" => "Jurisdiktionsnamn",
"name" => "Namn",
"new" => "Ny skattsatts",
"no_taxes" => "",
"no_taxes_to_display" => "Ingen skattesats tillgänglig för visning",
"reporting_authority" => "Rapporteringsmyndighet",
"round_half_down" => "Halv ner",
"round_half_even" => "Halv ojämn",
"round_half_odd" => "Halv ojämn",
"round_half_up" => "Halv upp",
"rounding_code" => "Avrundningskod",
"sales_tax" => "Moms",
"sales_tax_by_invoice" => "Moms per faktura",
"sequence" => "Seq.",
"state" => "Län",
"successful_deleted" => "Du har tagit bort",
"tax_categories" => "Skattekategorier",
"tax_categories_configuration" => "Konfiguration av skattekategorier",
"tax_categories_saved_successfully" => "Ändringar av skattekategorier sparade",
"tax_categories_saved_unsuccessfully" => "Ändringar av skattekategorier sparades inte",
"tax_category" => "Skattekategori",
"tax_category_code" => "Skattkategorikod",
"tax_category_duplicate" => "Dubblett skattekategori",
"tax_category_invalid_chars" => "Ogiltiga tecken i skattekategorinamnet",
"tax_category_name" => "Skattekategorinamn",
"tax_category_new" => "Ny skattekategori",
"tax_category_required" => "Skattekategori krävs",
"tax_code" => "Skattesats",
"tax_code_cannot_be_deleted" => "Skattkods radering misslyckades.",
"tax_code_duplicate" => "Kopiera skattekoden",
"tax_code_invalid_chars" => "Ogiltiga tecken i skattekod",
"tax_code_name" => "Skattkodsnamn",
"tax_code_required" => "Skattekoden är ett obligatoriskt fält.",
"tax_code_successful_deleted" => "Du har raderat Skattekoden",
"tax_code_successful_updated" => "Du har uppdaterat",
"tax_code_successful_updating" => "Du har uppdaterat Skattekoden",
"tax_code_successfully_added" => "Du har lagt till",
"tax_code_type" => "Skattkodstyp",
"tax_codes" => "Skattekoder",
"tax_codes_configuration" => "Skattkodskonfiguration",
"tax_codes_saved_successfully" => "Skattkodsändringar sparade",
"tax_codes_saved_unsuccessfully" => "Skattkodsändringar sparades inte",
"tax_excluded" => "Skatt exkluderad",
"tax_group" => "Skattegrupp",
"tax_group_not_unique" => "Skattegrupp{0} är inte unik",
"tax_group_sequence" => "Skattgruppsekvens",
"tax_included" => "Skatt ingår",
"tax_jurisdiction" => "Skattejurisdiktion",
"tax_jurisdiction_duplicate" => "Dubblett skattejurisdiktion",
"tax_jurisdiction_invalid_chars" => "Ogiltiga tecken i jurisdiktionsnamn",
"tax_jurisdiction_required" => "Skattejurisdiktion krävs",
"tax_jurisdictions" => "Skattejurisdiktioner",
"tax_jurisdictions_configuration" => "Konfiguration av skattejurisdiktioner",
"tax_jurisdictions_saved_successfully" => "Ändringar i skattejurisdiktionen sparades",
"tax_jurisdictions_saved_unsuccessfully" => "Ändringar av skattejurisdiktion sparades inte",
"tax_rate" => "Skattenivå",
"tax_rate_configuration" => "Skattesats konfiguration",
"tax_rate_error_adding_updating" => "Tillägg eller uppdatering av skattesats misslyckades",
"tax_rate_non_negative" => "",
"tax_rate_numeric" => "Skattesats måste vara ett nummer.",
"tax_rate_required" => "Skattesats är ett obligatoriskt fält.",
"tax_rate_successful_updated" => "Du har uppdaterat",
"tax_rate_successfully_added" => "Du har lagt till",
"tax_rates" => "Skattesatser",
"tax_rates_configuration" => "Skattesats konfiguration",
"tax_rounding" => "Skattavrundning",
"tax_type" => "Skattyp",
"update" => "Uppdatera försäljningskategoribeskattning",
"vat_tax" => "Momsskatt",
];