Files
opensourcepos/app/Language/zh-Hant/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
14 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' => 'Email 銷售單',
'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' => '重覆的發票號碼.',
'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' => '取消目前詢價/收據/銷售',
'key_customer_search' => '搜尋顧客',
'key_finish_quote' => '完成詢價/收據 尚未付款',
'key_finish_sale' => '增加付款及完成收據/販售',
'key_full' => '',
'key_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' => '選擇客戶 (Optional)',
'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' => '工作指示發送失敗',
];