Files
opensourcepos/app/Language/hy/Sales.php
objecttothis 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
11 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' => '',
'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' => '',
'id' => '',
'include_prices' => '',
'invoice' => '',
'invoice_confirm' => '',
'invoice_enable' => '',
'invoice_filter' => '',
'invoice_no_email' => '',
'invoice_number' => '',
'invoice_number_duplicate' => '',
'invoice_sent' => '',
'invoice_total' => '',
'invoice_type_custom_invoice' => '',
'invoice_type_custom_tax_invoice' => '',
'invoice_type_invoice' => '',
'invoice_type_tax_invoice' => '',
'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' => '',
'payment_type' => '',
'payments' => '',
'payments_total' => '',
'price' => '',
'print_after_sale' => '',
'quantity' => '',
'quantity_less_than_reorder_level' => '',
'quantity_less_than_zero' => '',
'quantity_of_items' => '',
'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' => '',
'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' => '',
'visa' => '',
'wholesale' => '',
'work_order' => '',
'work_order_number' => '',
'work_order_number_duplicate' => '',
'work_order_sent' => '',
'work_order_unsent' => '',
];