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
5.8 KiB
PHP

<?php
return [
'add_minus' => '',
'allow_alt_description' => '',
'amount_entry' => '',
'bulk_edit' => '',
'buy_price_required' => '',
'cannot_be_deleted' => '',
'cannot_find_item' => '',
'categories' => '',
'category' => '',
'category_new' => '',
'category_required' => '',
'change_all_to_allow_alt_desc' => '',
'change_all_to_not_allow_allow_desc' => '',
'change_all_to_serialized' => '',
'change_all_to_unserialized' => '',
'change_image' => '',
'confirm_bulk_edit' => '',
'confirm_bulk_edit_wipe_taxes' => '',
'confirm_delete' => '',
'confirm_restore' => '',
'cost_price' => '',
'cost_price_number' => '',
'cost_price_required' => '',
'count' => '',
'csv_import_failed' => '',
'csv_import_invalid_location' => '',
'csv_import_nodata_wrongformat' => '',
'csv_import_partially_failed' => '',
'csv_import_success' => '',
'current_quantity' => '',
'default_pack_name' => '',
'description' => '',
'details_count' => '',
'do_nothing' => '',
'edit' => '',
'edit_fields_you_want_to_update' => '',
'edit_multiple_items' => '',
'empty_upc_items' => '',
'error_adding_updating' => '',
'error_updating_multiple' => '',
'generate_barcodes' => '',
'hsn_code' => '',
'image' => '',
'import_items_csv' => '',
'info_provided_by' => '',
'inventory' => '',
'inventory_CSV_import_quantity' => '',
'inventory_comments' => '',
'inventory_data_tracking' => '',
'inventory_date' => '',
'inventory_employee' => '',
'inventory_in_out_quantity' => '',
'inventory_remarks' => '',
'is_deleted' => '',
'is_printed' => '',
'is_serialized' => '',
'item' => '',
'item_id' => '',
'item_number' => '',
'item_number_duplicate' => '',
'item_number_invalid' => '',
'kit' => '',
'location' => '',
'low_inventory_items' => '',
'low_sell_item' => '',
'manually_editing_of_quantity' => '',
'markup' => '',
'name' => '',
'name_required' => '',
'new' => '',
'no_description_items' => '',
'no_items_to_display' => '',
'none' => '',
'none_selected' => '',
'nonstock' => '',
'number_information' => '',
'number_required' => '',
'one_or_multiple' => '',
'pack_name' => '',
'qty_per_pack' => '',
'quantity' => '',
'quantity_number' => '',
'quantity_required' => '',
'receiving_quantity' => '',
'remove_image' => '',
'reorder_level' => '',
'reorder_level_number' => '',
'reorder_level_required' => '',
'retrive_item_info' => '',
'sales_tax_1' => '',
'sales_tax_2' => '',
'search_attributes' => '',
'select_image' => '',
'serialized_items' => '',
'standard' => '',
'stock' => '',
'stock_location' => '',
'stock_type' => '',
'successful_adding' => '',
'successful_bulk_edit' => '',
'successful_deleted' => '',
'successful_updating' => '',
'supplier' => '',
'tax_1' => '',
'tax_2' => '',
'tax_3' => '',
'tax_category' => '',
'tax_name_invalid' => 'გადასახადის სახელი შეიცავს დაუშვებელ სიმბოლოებს.',
'tax_percent' => '',
'tax_percent_number' => '',
'tax_percent_non_negative' => '',
'tax_percent_required' => '',
'tax_percents' => '',
'temp' => '',
'type' => '',
'unit_price' => '',
'unit_price_number' => '',
'unit_price_required' => '',
'upc_database' => '',
'update' => '',
'use_inventory_menu' => '',
];