Files
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

126 lines
7.7 KiB
PHP

<?php
return [
'add_minus' => 'Dodavanje/skidanje s inventure',
'allow_alt_description' => 'Dozvoli Alt opis',
'amount_entry' => '',
'bulk_edit' => 'Zajedno uređenje',
'buy_price_required' => 'Prodajna cijena je potrebna',
'cannot_be_deleted' => 'Nemožete obrisati odabranu stavku, jedna ili više odabranih stavki ima prodaju.',
'cannot_find_item' => 'Nema informacije o odabranoj stavci',
'categories' => '',
'category' => 'Kategorija',
'category_new' => '',
'category_required' => 'Kategorija je potrebna',
'change_all_to_allow_alt_desc' => 'Dozvali Alt opis za sve',
'change_all_to_not_allow_allow_desc' => 'Nije dozvoljen Alt opis za sve',
'change_all_to_serialized' => 'Promijeni sve u serijske brojeve',
'change_all_to_unserialized' => 'ukloni sve serijske brojeve',
'change_image' => 'Promjeni sliku',
'confirm_bulk_edit' => 'Jeste li sigurni da želite urediti odabrane stavke?',
'confirm_bulk_edit_wipe_taxes' => 'Sve stavke poreznih informacija bit će zamijenjene',
'confirm_delete' => 'Jeste li sigrni da želite obrisati odabrane stavke?',
'confirm_restore' => '',
'cost_price' => 'Nabavna cijena',
'cost_price_number' => 'Nabavna cijena mora biti broj',
'cost_price_required' => 'Nabavna cijena je potrebna',
'count' => 'Ažuriraj inveturu',
'csv_import_failed' => 'Greška kod uvoza iz CSV-a',
'csv_import_invalid_location' => '',
'csv_import_nodata_wrongformat' => 'Your uploaded file has no data or wrong format',
'csv_import_partially_failed' => 'Most Items imported. But some were not, here is the list',
'csv_import_success' => 'Import of Items successful',
'current_quantity' => 'Trenutna količina',
'default_pack_name' => '',
'description' => 'Opis',
'details_count' => 'Pojedinosati o količinama inventure',
'do_nothing' => 'Ne radi ništa',
'edit' => '',
'edit_fields_you_want_to_update' => 'Uredi polja koja želite urediti za sve odabrane stavke',
'edit_multiple_items' => 'Uredi višestruke stavke',
'empty_upc_items' => 'UPC artikal',
'error_adding_updating' => 'Greška kod dodavanja/ažuriranja stavke',
'error_updating_multiple' => 'Greška kod ažuriranja stavki',
'generate_barcodes' => 'Generiraj barkod',
'hsn_code' => '',
'image' => 'Slika',
'import_items_csv' => 'Uvezi stavke iz CSV-a',
'info_provided_by' => 'Info daje',
'inventory' => 'Inventura',
'inventory_CSV_import_quantity' => '',
'inventory_comments' => 'Komentari',
'inventory_data_tracking' => '',
'inventory_date' => '',
'inventory_employee' => '',
'inventory_in_out_quantity' => '',
'inventory_remarks' => '',
'is_deleted' => 'Obrisano',
'is_printed' => '',
'is_serialized' => 'Artikal ima ser. broj',
'item' => 'Stavka',
'item_id' => '',
'item_number' => 'UPC/EAN/ISBN',
'item_number_duplicate' => 'Broj stavke već postoji u bazi',
'item_number_invalid' => 'Broj stavke sadrži nedopuštene znakove.',
'kit' => '',
'location' => 'Mjesto',
'low_inventory_items' => 'Rasprodaja artikala',
'low_sell_item' => '',
'manually_editing_of_quantity' => 'Ručno uređivanje količine',
'markup' => '',
'name' => 'Naziv artikla',
'name_required' => 'Naziv artikla je potreban',
'new' => 'Novi artikal',
'no_description_items' => 'Artikal nema opisa',
'no_items_to_display' => 'Nema artikla za prikazati',
'none' => 'Egysem',
'none_selected' => 'Niste odabrali nijedan artikal za uređivanje',
'nonstock' => '',
'number_information' => 'Redni broj',
'number_required' => 'UPC/EAN/ISBN je potreban',
'one_or_multiple' => 'Artikal(i)',
'pack_name' => '',
'qty_per_pack' => '',
'quantity' => 'Količina',
'quantity_number' => 'Količina mora biti broj',
'quantity_required' => '',
'receiving_quantity' => 'Zaprimljena količina',
'remove_image' => 'Ukloni sliku',
'reorder_level' => 'Poredaj razine',
'reorder_level_number' => 'Numeracija mora biti numerička',
'reorder_level_required' => 'Numeracija je obavezna',
'retrive_item_info' => 'Info o zaprimljenom artiklu',
'sales_tax_1' => 'Prodajni porez 1',
'sales_tax_2' => 'Prodajni porez 2',
'search_attributes' => 'Polje za pretragu',
'select_image' => 'Odaberi sliku',
'serialized_items' => 'Artikl ima ser. broj',
'standard' => '',
'stock' => '',
'stock_location' => 'Mjesto skladišta',
'stock_type' => '',
'successful_adding' => 'Uspješno ste dodali artikal',
'successful_bulk_edit' => 'Uspješno ste ažurirali odabrane stavke',
'successful_deleted' => 'Uspješno ste obrisali artikl',
'successful_updating' => 'Uspješno ste ažurirali artikl',
'supplier' => 'Dobavljač',
'tax_1' => 'Porez 1',
'tax_2' => 'Porez 2',
'tax_3' => '',
'tax_category' => '',
'tax_name_invalid' => 'Naziv poreza sadrži nedopuštene znakove.',
'tax_percent' => '% poreza',
'tax_percent_number' => '',
'tax_percent_non_negative' => '',
'tax_percent_required' => '% poreza je obavezan',
'tax_percents' => '%-ci poreza',
'temp' => '',
'type' => '',
'unit_price' => 'Maloprodajna cijena',
'unit_price_number' => 'Maloprodajna cijena mora biti broj',
'unit_price_required' => 'Maloprodajna cijena je obavezna',
'upc_database' => 'UPC baza',
'update' => 'Ažuriraj artikl',
'use_inventory_menu' => 'Koristi inv. meni',
];