Files
opensourcepos/app/Language/cs/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' => 'Přidat platbu',
'amount_due' => 'K úhradě',
'amount_tendered' => 'Uhrazeno',
'authorized_signature' => '',
'cancel_sale' => 'Zrušit',
'cash' => 'Hotovost',
'cash_1' => '',
'cash_2' => '',
'cash_3' => '',
'cash_4' => '',
'cash_adjustment' => '',
'cash_deposit' => '',
'cash_filter' => 'Hotově',
'change_due' => 'Zbývá',
'change_price' => '',
'check' => 'Bankovním převodem',
'check_balance' => '',
'check_filter' => '',
'close' => '',
'comment' => 'Komentář',
'comments' => 'Komentář',
'company_name' => '',
'complete' => '',
'complete_sale' => 'Dokončit',
'confirm_cancel_sale' => 'Opravdu chcete zrušit účtenku? Všechny položky budou smazány.',
'confirm_delete' => 'Opravdu chcete smazat vybranou účtenku?',
'confirm_restore' => 'Opravdu chcete obnovit vybranou účtenku?',
'credit' => 'Kreditní karta',
'credit_deposit' => '',
'credit_filter' => '',
'current_table' => '',
'customer' => 'Jméno',
'customer_address' => 'Adresa',
'customer_discount' => 'Sleva',
'customer_email' => 'Email',
'customer_location' => 'Místo',
'customer_mailchimp_status' => 'Stav mailchimp',
'customer_optional' => '(Volitelné)',
'customer_required' => '(Vyžadováno)',
'customer_total' => 'Celkem',
'customer_total_spent' => '',
'customers_available_points' => 'Dostupné body',
'daily_sales' => '',
'date' => 'Datum prodeje',
'date_range' => 'Rozsah data',
'date_required' => 'Musí být vloženo správné datum.',
'date_type' => 'Datum je nutno zadat.',
'debit' => 'Debetní karta',
'debit_filter' => '',
'delete' => 'Povolit mazání',
'delete_confirmation' => 'Opravdu chcete smazat tuto účtenku? Tato operace není vratná.',
'delete_entire_sale' => 'Zrušit celou účtenku',
'delete_successful' => 'Účtenka byla smazána.',
'delete_unsuccessful' => 'Účtenka nebyla smazána.',
'description_abbrv' => 'Položka.',
'discard' => 'Zrušit',
'discard_quote' => '',
'discount' => 'Sleva %',
'discount_exceeds_item_total' => '',
'discount_included' => '% Sleva',
'discount_percent_exceeds_100' => '',
'discount_short' => '%',
'due' => '',
'due_filter' => 'Neuhrazeno',
'edit' => 'Upravit',
'edit_item' => 'Upravit položku',
'edit_sale' => 'Upravit účtenku',
'email_receipt' => 'Odeslat účtenku',
'employee' => 'Prodávající',
'entry' => 'Záznam',
'error_editing_item' => 'Chyba při úpravě položky',
'find_or_scan_item' => 'Najít nebo skenovat položku',
'find_or_scan_item_or_receipt' => 'Najít nebo skenovat položku či účtenku',
'giftcard' => 'Dárkový poukaz',
'giftcard_balance' => '',
'giftcard_filter' => '',
'giftcard_number' => 'Číslo dárkového poukazu',
'group_by_category' => 'Seskupit podle kategorií',
'group_by_type' => 'Seskupit podle typu',
'hsn' => '',
'id' => 'Číslo dokladu',
'include_prices' => '',
'invoice' => 'Faktura',
'invoice_confirm' => 'Tato faktura bude odeslána',
'invoice_enable' => 'Vytvořit fakturu',
'invoice_filter' => 'Faktury',
'invoice_no_email' => 'Zákazníl nemá platný e-mail.',
'invoice_number' => 'Faktura č',
'invoice_number_duplicate' => 'Číslo faktury musí být jedinečné.',
'invoice_sent' => 'Faktura odeslána',
'invoice_total' => '',
'invoice_type_custom_invoice' => '',
'invoice_type_custom_tax_invoice' => '',
'invoice_type_invoice' => '',
'invoice_type_tax_invoice' => '',
'invoice_unsent' => 'Fakturu se nepodařilo odeslat',
'invoice_update' => 'Přepočítat',
'item_insufficient_of_stock' => 'Není dostatek kusů na skladě.',
'item_name' => 'Název položky',
'item_number' => 'Číslo položky',
'item_out_of_stock' => 'Položka není skladem.',
'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' => 'Typ dokladu',
'must_enter_numeric' => '',
'must_enter_numeric_giftcard' => 'Číslo dárkového poukazu musí být číslo.',
'must_enter_reference_code' => 'Je nutné zadat referenční/vyhledávací číslo.',
'negative_discount_invalid' => '',
'negative_price_invalid' => '',
'negative_quantity_invalid' => '',
'negative_total_invalid' => '',
'new_customer' => 'Nový zákazník',
'new_item' => 'Nová položka',
'no_description' => 'Žádný',
'no_filter' => 'Vše',
'no_items_in_cart' => 'Nejsou zde žádné položky.',
'no_sales_to_display' => 'Žádné účtenky k zobrazení.',
'none_selected' => 'Nebylo nic vybráno ke smazání.',
'nontaxed_ind' => '',
'not_authorized' => 'Tato akce nebyla povolena.',
'one_or_multiple' => '',
'payment' => 'Způsob platby',
'payment_amount' => 'Částka',
'payment_not_cover_total' => 'Zaplacená částka musí být stejná nebo větší než celková částka.',
'payment_type' => 'Typ',
'payments' => '',
'payments_total' => 'Uhrazeno',
'price' => 'Cena',
'print_after_sale' => 'Vytisknout automaticky',
'quantity' => 'ks',
'quantity_less_than_reorder_level' => 'Upozornění: Množství zboží je pod nastavenou úrovní pro doobjednání.',
'quantity_less_than_zero' => 'Pozor: Není dostatek zboží. Můžete pokračovat v prodeji, ale zkontrolujte si stav skladu.',
'quantity_of_items' => 'Množství položek {0}',
'quote' => 'Nabídka',
'quote_number' => 'Číslo nabídky',
'quote_number_duplicate' => 'Číslo nabídky musí být jedinečné.',
'quote_sent' => 'Nabidku odeslat',
'quote_unsent' => 'Nabídku odeslat',
'receipt' => 'Účtenka',
'receipt_no_email' => 'Zákazníl nemá platný e-mail.',
'receipt_number' => 'Číslo dokladu',
'receipt_sent' => 'Účtenku odeslat',
'receipt_unsent' => 'Účtenku nelze odeslat',
'reference_code' => 'Referenční kód platby',
'reference_code_invalid_characters' => 'Referenční kód smí obsahovat pouze písmena a číslice.',
'reference_code_length_error' => 'Délka referenčního kódu je neplatná.',
'refund' => '',
'register' => 'Pokladna',
'remove_customer' => 'Odebrat zákazníka',
'remove_discount' => '',
'return' => 'Vratka',
'rewards' => '',
'rewards_balance' => '',
'rewards_package' => '',
'rewards_remaining_balance' => '',
'sale' => '',
'sale_by_invoice' => '',
'sale_for_customer' => 'Zákazník:',
'sale_time' => 'Čas',
'sales_tax' => 'DPH',
'sales_total' => '',
'select_customer' => 'Vyberte zákazníka',
'send_invoice' => 'Odeslat fakturu',
'send_quote' => 'Odeslat nabídku',
'send_receipt' => 'Odeslat účtenku',
'send_work_order' => '',
'serial' => 'Sériové číslo',
'service_charge' => '',
'show_due' => '',
'show_invoice' => 'Zobrazit fakturu',
'show_receipt' => 'Zobrazit účtenku',
'start_typing_customer_name' => 'Vložte podrobnosti o zákazníkovi...',
'start_typing_item_name' => 'Napište název položky nebo naskenujte čárový kód..',
'stock' => 'Sklad',
'stock_location' => 'Umístění skladu',
'sub_total' => 'Bez DPH',
'successfully_deleted' => 'Bylo uspěšně smazáno',
'successfully_restored' => 'Bylo úspěšně obnoveno',
'successfully_suspended_sale' => 'Prodej byl úspěšně zaparkován.',
'successfully_updated' => 'Účtenka byla upravena.',
'suspend_sale' => 'Zaparkovat',
'suspended_doc_id' => 'Dokument',
'suspended_sale_id' => 'ID',
'suspended_sales' => 'Zaparkovat',
'table' => 'Stůl',
'takings' => 'Transakce',
'tax' => 'DPH',
'tax_id' => '',
'tax_invoice' => '',
'tax_percent' => 'DPH %',
'taxed_ind' => '',
'total' => 'Celkem',
'total_tax_exclusive' => 'Bez DPH',
'transaction_failed' => '',
'unable_to_add_item' => 'Přidání položky se nepovedlo',
'unsuccessfully_deleted' => 'Účtenka nebyla smazána.',
'unsuccessfully_restored' => 'Účtenka nebyla obnovena.',
'unsuccessfully_suspended_sale' => 'Prodej se nepovedlo zaparkovat.',
'unsuccessfully_updated' => 'Účtenka nebyla upravena.',
'unsuspend' => 'Odparkovat',
'unsuspend_and_delete' => 'Akce',
'update' => 'Obnovit',
'upi' => '',
'visa' => '',
'wholesale' => '',
'work_order' => '',
'work_order_number' => '',
'work_order_number_duplicate' => '',
'work_order_sent' => '',
'work_order_unsent' => '',
];