Files
objecttothisandTravis Garrison 9c542efaf6 Feature: Payment reference code (#4587)
* Add `reference_code` to sale payment queries and group by statements

Signed-off-by: Travis Garrison <travis@chiraqbookstore.com>

* Refactor `Sales` controller to improve payment handling readability and replace snake_case with camelCase variables

Signed-off-by: Travis Garrison <travis@chiraqbookstore.com>

* Add missing translations for `Sales` language file and include new keys like `must_enter_rrn` and `reference_code`

Signed-off-by: Travis Garrison <travis@chiraqbookstore.com>

* Refactor `Sales` payment handling to use camelCase and extend `addPayment` with `referenceCode` support

Signed-off-by: Travis Garrison <travis@chiraqbookstore.com>

* Refactor `Sales` models, controllers, and libraries to adopt camelCase naming conventions and improve readability

Signed-off-by: Travis Garrison <travis@chiraqbookstore.com>

* Add translations and updates for `must_enter_reference_code` and `reference_code` across language files and update `Sales` controller to replace `must_enter_rrn` with the new key

Signed-off-by: Travis Garrison <travis@chiraqbookstore.com>

* feat(sales): add reference code input and payment type helper

- Add `get_reference_code_payment_types()` to locale_helper as single
  source of truth for card-requiring payment types
- Add reference code row to register view, shown/hidden via JS based
  on selected payment type
- Fix payment type dropdown width to 100% for consistent layout
- Add min-width to payment buttons and right-padding to button group

Signed-off-by: Travis Garrison <travis@chiraqbookstore.com>

* feat(config): add payment reference code length configuration

- Add payment_reference_code_min and payment_reference_code_max fields
  to Config controller save logic
- Add translation keys for reference code length limits across all
  language files (min/max label + section header)
- Align array key formatting in Config controller for readability

Signed-off-by: Travis Garrison <travis@chiraqbookstore.com>

* style(lang): normalize string delimiters to single quotes across all language files

Convert double-quoted array keys and values to single quotes in all
app/Language/*/Config.php and app/Language/*/Sales.php variants.
No translation content changed — formatting only.

Also add Localization section to AGENTS.md documenting language file
conventions for new keys and fallback behavior.

Signed-off-by: Travis Garrison <travis@chiraqbookstore.com>

* feat(lang): add payment reference code length translations

Add localized strings for payment_reference_code_length_limits,
payment_reference_code_length_max_label, and
payment_reference_code_length_min_label across all supported locales.

Signed-off-by: Travis Garrison <travis@chiraqbookstore.com>

* test(config,sales): add payment reference code min/max validation tests

- Add baseLocalePayload() helper in ConfigTest for postSaveLocale tests
- Add testSaveLocale_AcceptsValidReferenceCodeMinMax and related boundary tests
- Add Sale_libPaymentTest for payment reference code validation in Sale_lib

Signed-off-by: Travis Garrison <travis@chiraqbookstore.com>

* fix(sales): add type-specific validation for amount_tendered

Gift card payments use amount_tendered as giftcard number (integer);
cash/other payments require decimal_locale format. Apply correct
validation rule per payment type instead of generic required.

Signed-off-by: Travis Garrison <travis@chiraqbookstore.com>

* fix(lang): replace self-closing </br> with <br> in all locales

Signed-off-by: Travis Garrison <travis@chiraqbookstore.com>

* fix(sales): use configurable precision in discount comparison

Replace hardcoded precision 2 with totals_decimals() when comparing
discount against item total via bccomp/bcmul, so discount validation
respects the configured decimal precision setting.

Signed-off-by: Travis Garrison <travis@chiraqbookstore.com>

* fix(lang): correct Azerbaijani translations in Config.php

Replace placeholder/mismatched strings with accurate translations:
- email_mailpath, email_smtp_pass, invoice_email_message
- number_locale_invalid/required, receipt_template
- reward_configuration, right, tax_decimals, theme

Signed-off-by: Travis Garrison <travis@chiraqbookstore.com>

* feat(sales): add reference code support to payment edit flow

- Add reference_code field to new payment row in sale edit form
- Persist reference_code on insert in Sale model
- Validate reference_code_new in Sales controller using configurable min/max length rules

Signed-off-by: Travis Garrison <travis@chiraqbookstore.com>

* feat(lang): add Georgian (ka) language stubs for Config and Sales

Signed-off-by: Travis Garrison <travis@chiraqbookstore.com>

* Match the fallback maximum reference_code length to the maximum of the field in the db

Signed-off-by: Travis Garrison <travis@chiraqbookstore.com>

* Bug fixes

- Add validation of UI settings to prevent overridden values from being passed.
- Correct maximum value in JS for payment_reference_code maximum length to 40.
- Fix bug causing copy_entire_sale() to incorrectly copy the reference code and cash_adjustment

Signed-off-by: Travis Garrison <travis@chiraqbookstore.com>

---------

Signed-off-by: Travis Garrison <travis@chiraqbookstore.com>
Co-authored-by: Travis Garrison <travis@chiraqbookstore.com>
2026-07-10 13:49:05 +04:00

236 lines
16 KiB
PHP

<?php
return [
'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' => '',
'customers_available_points' => 'امتیازهای موجود',
'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_exceeds_item_total' => '',
'discount_included' => '٪ تخفیف',
'discount_percent_exceeds_100' => '',
'discount_short' => '٪',
'due' => 'ناشی از',
'due_filter' => 'ناشی از',
'edit' => 'ویرایش',
'edit_item' => 'ویرایش آیتم',
'edit_sale' => 'ویرایش فروش',
'email_receipt' => 'دریافت ایمیل',
'employee' => 'کارمند',
'entry' => 'ورود',
'error_editing_item' => 'خطا در ویرایش مورد',
'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' => 'شماره کارت هدیه باید یک عدد باشد.',
'must_enter_reference_code' => 'شماره مرجع/بازیابی باید وارد شود.',
'negative_discount_invalid' => '',
'negative_price_invalid' => '',
'negative_quantity_invalid' => '',
'negative_total_invalid' => '',
'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' => 'رسید ارسال نشد به',
'reference_code' => 'کد مرجع پرداخت',
'reference_code_invalid_characters' => 'کد مرجع باید فقط شامل حروف و اعداد باشد.',
'reference_code_length_error' => 'طول کد مرجع نامعتبر است.',
'refund' => 'نوع بازپرداخت',
'register' => 'ثبت فروش',
'remove_customer' => 'حذف مشتری',
'remove_discount' => '',
'return' => 'برگشت',
'rewards' => 'امتیاز پاداش',
'rewards_balance' => 'تعادل امتیاز پاداش',
'rewards_package' => 'پاداش',
'rewards_remaining_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' => 'دستور کار نتوانست به ارسال شود',
];