Files
opensourcepos/app/Language/fa/Sales.php
Nozomu Sasaki (Paul) 85c7ce2da4 Fix negative price/quantity/discount validation (GHSA-wv3j-pp8r-7q43) (#4450)
* Fix business logic vulnerability allowing negative sale totals (GHSA-wv3j-pp8r-7q43)

Add server-side validation in postEditItem() to reject negative prices,
quantities, and discounts, as well as percentage discounts exceeding 100%
and fixed discounts exceeding the item total. Also block sale completion
with negative totals in non-return mode to prevent fraud/theft.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Fix: exempt return mode from negative quantity validation

Return mode legitimately stores items with negative quantities.
The quantity validation now skips the non-negative check in return mode,
consistent with the existing return mode exemption in postComplete().
Also use abs() for fixed discount comparison to handle return quantities.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Refactor: use $rules + validate() pattern per review feedback

Address review comments from jekkos on PR #4450:

1. Use CI4 $rules variable with custom non_negative_decimal validation
   rule instead of manual if-checks for price/discount validation.

2. Add validation error strings to all 44 non-English language files
   (English fallback values used until translations are contributed).

3. Use validate() method with $messages array for localized error
   display, maintaining the existing controller pattern.

Additional improvements:
- Add non_negative_decimal rule to OSPOSRules.php (leverages
  parse_decimals() for locale-aware decimal parsing)
- Preserve manual checks for business logic (return mode quantity
  exemption, discount bounds via bccomp)
- Fix PHP 8.1+ compatibility: avoid passing method return to reset()
- Explicit empty discount handling for bc-math safety

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix: rename to nonNegativeDecimal (PSR), clear non-English translation strings

- Rename validation rule method non_negative_decimal → nonNegativeDecimal in
  OSPOSRules.php and all $rules/$messages references in Sales.php (PSR naming
  per @objecttothis review)
- Replace English fallback text with "" in 43 non-English language files so
  CI4 falls back to the base language string; weblate will handle translations
  (per @jekkos and @objecttothis agreement)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Paul <morimori-dev@github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: objecttothis <17935339+objecttothis@users.noreply.github.com>
2026-04-03 14:49:42 +04:00

232 lines
16 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
return [
"customers_available_points" => "امتیازهای موجود",
"rewards_package" => "پاداش",
"rewards_remaining_balance" => "امتیاز باقی مانده مقدار باقی مانده است",
"account_number" => "حساب #",
"add_payment" => "افزودن پرداخت",
"amount_due" => "مبلغ پرداختی",
"amount_tendered" => "مبلغ مناقصه",
"authorized_signature" => "امضای مجاز",
"cancel_sale" => "لغو",
"cash" => "نقدی",
"cash_1" => "",
"cash_2" => "",
"cash_3" => "",
"cash_4" => "",
"cash_adjustment" => "",
"cash_deposit" => "سپرده نقدی",
"cash_filter" => "نقدی",
"change_due" => "تغییر بدهی",
"change_price" => "تغییر قیمت فروش",
"check" => "بررسی",
"check_balance" => "باقی مانده را بررسی کنید",
"check_filter" => "بررسی",
"close" => "",
"comment" => "اظهار نظر",
"comments" => "نظرات",
"company_name" => "",
"complete" => "",
"complete_sale" => "کامل",
"confirm_cancel_sale" => "آیا مطمئن هستید که می خواهید این فروش را پاک کنید؟ همه موارد پاک خواهند شد.",
"confirm_delete" => "آیا مطمئن هستید که می خواهید فروش (های) خریداری شده را حذف کنید؟",
"confirm_restore" => "آیا مطمئن هستید که می خواهید فروش (های) انتخابی را بازیابی کنید؟",
"credit" => "کارت اعتباری",
"credit_deposit" => "سپرده اعتباری",
"credit_filter" => "",
"current_table" => "",
"customer" => "مشتری",
"customer_address" => "نشانی",
"customer_discount" => "تخفیف",
"customer_email" => "پست الکترونیک",
"customer_location" => "محل",
"customer_mailchimp_status" => "وضعیت Mailchimp",
"customer_optional" => "(مورد نیاز برای پرداخت مقررات)",
"customer_required" => "(ضروری)",
"customer_total" => "جمع",
"customer_total_spent" => "",
"daily_sales" => "",
"date" => "تاریخ فروش",
"date_range" => "محدوده زمانی",
"date_required" => "یک تاریخ صحیح باید وارد شود.",
"date_type" => "تاریخ یک زمینه ضروری است.",
"debit" => "کارت اعتباری",
"debit_filter" => "",
"delete" => "مجاز کردن حذف",
"delete_confirmation" => "آیا مطمئن هستید که می خواهید این فروش را حذف کنید؟ این عملکرد قابل بازگشت نیست.",
"delete_entire_sale" => "حذف فروش کل",
"delete_successful" => "حذف موفقیت آمیز است.",
"delete_unsuccessful" => "حذف فروش انجام نشد.",
"description_abbrv" => "سقوط",
"discard" => "دور انداختن",
"discard_quote" => "",
"discount" => "دیسک",
"discount_included" => "٪ تخفیف",
"discount_short" => "٪",
"due" => "ناشی از",
"due_filter" => "ناشی از",
"edit" => "ویرایش",
"edit_item" => "ویرایش آیتم",
"edit_sale" => "ویرایش فروش",
"email_receipt" => "دریافت ایمیل",
"employee" => "کارمند",
"entry" => "ورود",
"error_editing_item" => "خطا در ویرایش مورد",
"negative_price_invalid" => "",
"negative_quantity_invalid" => "",
"negative_discount_invalid" => "",
"discount_percent_exceeds_100" => "",
"discount_exceeds_item_total" => "",
"negative_total_invalid" => "",
"find_or_scan_item" => "یافتن یا اسکن کردن مورد",
"find_or_scan_item_or_receipt" => "یافتن یا اسکن کردن مورد یا رسید",
"giftcard" => "کارت هدیه",
"giftcard_balance" => "مانده کارت هدیه",
"giftcard_filter" => "",
"giftcard_number" => "شماره کارت هدیه",
"group_by_category" => "گروه بر اساس طبقه بندی",
"group_by_type" => "گروه براساس نوع",
"hsn" => "HSN",
"id" => "شناسه فروش",
"include_prices" => "شامل قیمت ها می شوید؟",
"invoice" => "صورتحساب",
"invoice_confirm" => "این فاکتور به ارسال می شود",
"invoice_enable" => "شماره فاکتور",
"invoice_filter" => "صورت حساب",
"invoice_no_email" => "این مشتری آدرس ایمیل معتبری ندارد.",
"invoice_number" => "صورتحساب #",
"invoice_number_duplicate" => "فاکتور شماره{0} باید بی نظیر باشد.",
"invoice_sent" => "فاکتور ارسال شده به",
"invoice_total" => "فاکتور کل",
"invoice_type_custom_invoice" => "فاکتور سفارشی (custom_invoice.php)",
"invoice_type_custom_tax_invoice" => "فاکتور مالیاتی سفارشی (custom_tax_invoice.php)",
"invoice_type_invoice" => "فاکتور (invoice.php)",
"invoice_type_tax_invoice" => "فاکتور مالیاتی (tax_invoice.php)",
"invoice_unsent" => "فاکتور نتوانست به ارسال شود",
"invoice_update" => "بازگو",
"item_insufficient_of_stock" => "این کالا سهام کافی ندارد.",
"item_name" => "نام مورد",
"item_number" => "مورد #",
"item_out_of_stock" => "مورد خارج از بورس.",
"key_browser" => "",
"key_cancel" => "Cancels Current Quote/Invoice/Sale",
"key_customer_search" => "Customer Search",
"key_finish_quote" => "Finish Quote/Invoice witdout payment",
"key_finish_sale" => "Add Payment and Complete Invoice/Sale",
"key_full" => "",
"key_function" => "Function",
"key_help" => "Shortcuts",
"key_help_modal" => "Open Shortcuts Window",
"key_in" => "",
"key_item_search" => "Item Search",
"key_out" => "",
"key_payment" => "Add Payment",
"key_print" => "",
"key_restore" => "",
"key_search" => "",
"key_suspend" => "Suspend Current Sale",
"key_suspended" => "Show Suspended Sales",
"key_system" => "",
"key_tendered" => "Edit Amount Tendered",
"key_title" => "Sales Keyboard Shortcuts",
"mc" => "",
"mode" => "حالت ثبت نام",
"must_enter_numeric" => "مقدار پیشنهادی باید یک عدد باشد.",
"must_enter_numeric_giftcard" => "شماره کارت هدیه باید یک عدد باشد.",
"new_customer" => "مشتری جدید",
"new_item" => "گزینه جدید",
"no_description" => "بدون توضیح",
"no_filter" => "همه",
"no_items_in_cart" => "هیچ کالایی در سبد خرید وجود ندارد. ر.",
"no_sales_to_display" => "بدون فروش برای نمایش.",
"none_selected" => "شما هیچ فروشی (فروش) را برای حذف انتخاب نکرده اید.",
"nontaxed_ind" => "",
"not_authorized" => "این اقدام مجاز نیست.",
"one_or_multiple" => "حراجی)",
"payment" => "نوع پرداخت",
"payment_amount" => "میزان",
"payment_not_cover_total" => "مبلغ پرداخت باید بیشتر یا برابر با Total باشد.",
"payment_type" => "نوع",
"payments" => "",
"payments_total" => "کل پرداختها",
"price" => "قیمت",
"print_after_sale" => "چاپ بعد از فروش",
"quantity" => "تعداد",
"quantity_less_than_reorder_level" => "هشدار: مقدار مورد نظر برای آن مورد کمتر از سطح ترتیب است.",
"quantity_less_than_zero" => "هشدار: مقدار مورد نظر کافی نیست. شما هنوز هم می توانید فروش را پردازش کنید ، اما موجودی خود را حسابرسی کنید.",
"quantity_of_items" => "مقدار{0} مورد",
"quote" => "نقل قول",
"quote_number" => "تعداد نقل قول",
"quote_number_duplicate" => "نقل قول شماره باید بی نظیر باشد.",
"quote_sent" => "نقل قول ارسال شد به",
"quote_unsent" => "نقل قول ارسال نشد به",
"receipt" => "رسید فروش",
"receipt_no_email" => "این مشتری آدرس ایمیل معتبری ندارد.",
"receipt_number" => "فروش #",
"receipt_sent" => "رسید به",
"receipt_unsent" => "رسید ارسال نشد به",
"refund" => "نوع بازپرداخت",
"register" => "ثبت فروش",
"remove_customer" => "حذف مشتری",
"remove_discount" => "",
"return" => "برگشت",
"rewards" => "امتیاز پاداش",
"rewards_balance" => "تعادل امتیاز پاداش",
"sale" => "فروش",
"sale_by_invoice" => "فروش توسط فاکتور",
"sale_for_customer" => "مشتری:",
"sale_time" => "زمان",
"sales_tax" => "مالیات بر فروش",
"sales_total" => "",
"select_customer" => "مشتری را انتخاب کنید",
"send_invoice" => "فاکتور بفرستید",
"send_quote" => "ارسال نقل قول",
"send_receipt" => "ارسال رسید",
"send_work_order" => "ارسال سفارش کار",
"serial" => "سریال",
"service_charge" => "",
"show_due" => "",
"show_invoice" => "نمایش فاکتور",
"show_receipt" => "نمایش رسید",
"start_typing_customer_name" => "شروع به تایپ جزئیات مشتری ...",
"start_typing_item_name" => "شروع به تایپ نام مورد یا اسکن بارکد ...",
"stock" => "موجودی",
"stock_location" => "موقعیت مکانی سهام",
"sub_total" => "فرعی",
"successfully_deleted" => "شما با موفقیت حذف شده اید",
"successfully_restored" => "شما با موفقیت ترمیم کردید",
"successfully_suspended_sale" => "فروش موفق به حالت تعلیق درآمد.",
"successfully_updated" => "به روزرسانی فروش موفقیت آمیز است.",
"suspend_sale" => "تعلیق",
"suspended_doc_id" => "سند",
"suspended_sale_id" => "شناسه",
"suspended_sales" => "معلق",
"table" => "جدول",
"takings" => "فروش روزانه",
"tax" => "مالیات",
"tax_id" => "شناسه مالیاتی",
"tax_invoice" => "فاکتور مالیات",
"tax_percent" => "مالیات ٪",
"taxed_ind" => "T",
"total" => "جمع",
"total_tax_exclusive" => "پرداخت مالیات",
"transaction_failed" => "معاملات معامله نشد.",
"unable_to_add_item" => "افزودن مورد به فروش انجام نشد",
"unsuccessfully_deleted" => "حذف (فروش) انجام نشد.",
"unsuccessfully_restored" => "بازگرداندن فروش (ها) انجام نشد.",
"unsuccessfully_suspended_sale" => "تعلیق فروش انجام نشد.",
"unsuccessfully_updated" => "به روزرسانی فروش انجام نشد.",
"unsuspend" => "لغو",
"unsuspend_and_delete" => "عمل",
"update" => "به روز رسانی",
"upi" => "UPI",
"visa" => "",
"wholesale" => "",
"work_order" => "سفارش کار",
"work_order_number" => "شماره سفارش کار",
"work_order_number_duplicate" => "شماره سفارش کار باید منحصر به فرد باشد.",
"work_order_sent" => "دستور کار ارسال شده به",
"work_order_unsent" => "دستور کار نتوانست به ارسال شود",
];