Files
opensourcepos/app/Language/zh-Hans/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
13 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 Address',
'customer_discount' => '折扣',
'customer_email' => 'Customer Email',
'customer_location' => 'Customer Location',
'customer_mailchimp_status' => '',
'customer_optional' => '',
'customer_required' => '',
'customer_total' => 'Total',
'customer_total_spent' => '',
'customers_available_points' => '可用积分',
'daily_sales' => '',
'date' => '日期',
'date_range' => '日期範圍',
'date_required' => 'A correct date needs to be filled in',
'date_type' => 'Date field is required',
'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',
'discount_percent_exceeds_100' => '',
'discount_short' => '%',
'due' => '',
'due_filter' => '',
'edit' => '編輯',
'edit_item' => '編輯產品',
'edit_sale' => '編輯銷售資料',
'email_receipt' => 'Email 銷售單',
'employee' => '員工',
'entry' => '',
'error_editing_item' => '編輯產品錯誤',
'find_or_scan_item' => '查找/掃描商品',
'find_or_scan_item_or_receipt' => '查找/掃描產品或收貨單',
'giftcard' => '禮金券',
'giftcard_balance' => 'Giftcard Balance',
'giftcard_filter' => '',
'giftcard_number' => '禮金券編號',
'group_by_category' => '',
'group_by_type' => '',
'hsn' => '',
'id' => '銷售編號',
'include_prices' => '',
'invoice' => 'Invoice',
'invoice_confirm' => 'This invoice will be sent to',
'invoice_enable' => 'Create Invoice',
'invoice_filter' => 'Invoices',
'invoice_no_email' => 'This customer does not have a valid email address',
'invoice_number' => 'Invoice #',
'invoice_number_duplicate' => 'Please enter an unique invoice number',
'invoice_sent' => 'Invoice sent to',
'invoice_total' => '',
'invoice_type_custom_invoice' => '',
'invoice_type_custom_tax_invoice' => '',
'invoice_type_invoice' => '',
'invoice_type_tax_invoice' => '',
'invoice_unsent' => 'Invoice failed to be sent to',
'invoice_update' => 'Recount',
'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' => 'None',
'no_filter' => 'All',
'no_items_in_cart' => '購物車中沒有任何產品',
'no_sales_to_display' => 'No sales to display',
'none_selected' => '您還沒有選擇任何產品進行編輯',
'nontaxed_ind' => '',
'not_authorized' => '',
'one_or_multiple' => '',
'payment' => '付款方式',
'payment_amount' => 'Amount',
'payment_not_cover_total' => '付款金額不足',
'payment_type' => 'Type',
'payments' => '',
'payments_total' => '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' => 'POS #',
'receipt_sent' => 'Receipt sent to',
'receipt_unsent' => 'Receipt failed to be sent to',
'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' => 'Time',
'sales_tax' => '',
'sales_total' => '',
'select_customer' => '選擇客戶 (Optional)',
'send_invoice' => 'Send Invoice',
'send_quote' => '',
'send_receipt' => 'Send Receipt',
'send_work_order' => '',
'serial' => '序號',
'service_charge' => '',
'show_due' => '',
'show_invoice' => 'Show Invoice',
'show_receipt' => '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' => 'Takings',
'tax' => '稅額',
'tax_id' => '',
'tax_invoice' => '',
'tax_percent' => '稅率 %',
'taxed_ind' => '',
'total' => '總計',
'total_tax_exclusive' => 'Tax excluded',
'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' => '',
];