Files
opensourcepos/app/Language/fa/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
7.1 KiB
PHP

<?php
return [
"add_exception" => "یک مورد استثنا اضافه کن",
"cascade" => "آبشار",
"cascade_sequence" => "دنباله آبشار",
"city" => "شهر",
"code" => "کد",
"confirm_delete" => "آیا مطمئن هستید که می خواهید این قانون مالیات را حذف کنید؟ این اقدام قابل بازگشت نیست",
"confirm_restore" => "آیا مطمئن هستید که می خواهید کد (های) مالیاتی انتخاب شده را بازیابی کنید؟",
"default_tax_category" => "طبقه بندی پیش فرض مالیات",
"default_tax_rate" => "نرخ پیش فرض مالیات",
"error_adding_updating" => "کد مالیاتی اضافه یا به روز نشد",
"group_seq" => "گروه 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_code" => "کد طبقه بندی مالیاتی",
"tax_category_duplicate" => "دسته بندی مالیات کپی",
"tax_category_invalid_chars" => "نویسه های نامعتبر در نام طبقه مالیاتی",
"tax_category_name" => "نام طبقه مالیاتی",
"tax_category_new" => "طبقه بندی مالیات جدید",
"tax_category_required" => "طبقه بندی مالیات لازم است",
"tax_code" => "کد مالیاتی",
"tax_code_cannot_be_deleted" => "حذف کد مالیاتی انجام نشد",
"tax_code_duplicate" => "کپی مالیات کد",
"tax_code_invalid_chars" => "نویسه های نامعتبر در کد مالیاتی",
"tax_code_name" => "نام کد مالیاتی",
"tax_code_required" => "کد مالیات یک زمینه ضروری است",
"tax_code_successful_deleted" => "شما کد مالیات را با موفقیت حذف کرده اید",
"tax_code_successful_updated" => "شما با موفقیت به روزرسانی کردید",
"tax_code_successful_updating" => "کد مالیات را با موفقیت به روز کرده اید",
"tax_code_successfully_added" => "شما با موفقیت اضافه کردید",
"tax_code_type" => "نوع کد مالیاتی",
"tax_codes" => "کد مالیاتی",
"tax_codes_configuration" => "پیکربندی کد مالیاتی",
"tax_codes_saved_successfully" => "تغییرات کد مالیاتی ذخیره شده است",
"tax_codes_saved_unsuccessfully" => "تغییرات کد مالیاتی ذخیره نشده است",
"tax_excluded" => "پرداخت مالیات",
"tax_group" => "گروه مالیاتی",
"tax_group_not_unique" => "گروه مالیاتی{0} منحصر به فرد نیست",
"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_configuration" => "پیکربندی نرخ مالیات",
"tax_rate_error_adding_updating" => "افزودن یا به روزرسانی نرخ مالیات انجام نشد",
"tax_rate_non_negative" => "",
"tax_rate_numeric" => "نرخ مالیات باید یک عدد باشد",
"tax_rate_required" => "نرخ مالیات یک زمینه ضروری است",
"tax_rate_successful_updated" => "شما با موفقیت به روزرسانی کردید",
"tax_rate_successfully_added" => "شما با موفقیت اضافه کردید",
"tax_rates" => "نرخ مالیات",
"tax_rates_configuration" => "پیکربندی نرخ مالیات",
"tax_rounding" => "گرد کردن مالیات",
"tax_type" => "نوع مالیات",
"update" => "به روز رسانی نرخ مالیات",
"vat_tax" => "مالیات بر ارزش افزوده",
];