Files
opensourcepos/app/Language/ro/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' => 'Cont #',
'add_payment' => 'Adauga Plata',
'amount_due' => 'Suma datorata',
'amount_tendered' => 'Suma Oferita',
'authorized_signature' => 'Semnatura Autorizata',
'cancel_sale' => 'Anuleaza',
'cash' => 'Numerar',
'cash_1' => '',
'cash_2' => '',
'cash_3' => '',
'cash_4' => '',
'cash_adjustment' => '',
'cash_deposit' => 'Depozit Numerar',
'cash_filter' => 'Numerar',
'change_due' => 'Rest datorat',
'change_price' => '',
'check' => 'Bon/cec',
'check_balance' => 'Verificati restul',
'check_filter' => 'Bon/cec',
'close' => '',
'comment' => 'Comentariu',
'comments' => 'Comentarii',
'company_name' => '',
'complete' => '',
'complete_sale' => 'Finalizare',
'confirm_cancel_sale' => 'Sigur vreti sa eliminati aceasta vanzare? Toate articolele vor fi sterse.',
'confirm_delete' => 'Sigur doriti stergerea Vanzarii/Vanzarilor selectate?',
'confirm_restore' => 'Sigur doriti restabilirea Vanzarii/Vanzarilor selectate?',
'credit' => 'Card Credit',
'credit_deposit' => 'Depozit Credit',
'credit_filter' => '',
'current_table' => '',
'customer' => 'Nume',
'customer_address' => 'Adresa',
'customer_discount' => 'Reducere',
'customer_email' => 'Email',
'customer_location' => 'Amplasare',
'customer_mailchimp_status' => 'Situatie Mailchimp',
'customer_optional' => '(Optional)',
'customer_required' => '(Necesar)',
'customer_total' => 'Total',
'customer_total_spent' => '',
'customers_available_points' => 'Puncte disponibile',
'daily_sales' => '',
'date' => 'Data Vanzare',
'date_range' => 'Perioada',
'date_required' => 'Trebuie introdusa o data corecta.',
'date_type' => 'Data este un camp obligatoriu.',
'debit' => 'Card Debit',
'debit_filter' => '',
'delete' => 'Permite Stergerea',
'delete_confirmation' => 'Sigur doriti stergerea acestei vanzari? Nu puteti reveni anterior dupa aceasta actiune.',
'delete_entire_sale' => 'Sterge Toata Vanzarea',
'delete_successful' => 'Stergere vanzare reusita.',
'delete_unsuccessful' => 'Stergere vanzare nereusita.',
'description_abbrv' => 'Desc.',
'discard' => 'Renunta',
'discard_quote' => '',
'discount' => 'Reducere',
'discount_exceeds_item_total' => '',
'discount_included' => '% Reducere',
'discount_percent_exceeds_100' => '',
'discount_short' => '%',
'due' => 'Datorat',
'due_filter' => 'De plata',
'edit' => 'Editare',
'edit_item' => 'Editare Articol',
'edit_sale' => 'Editare Vanzare',
'email_receipt' => 'Transmite Chitanta pe email',
'employee' => 'Salariat',
'entry' => 'Intrare',
'error_editing_item' => 'Eroare editare articol',
'find_or_scan_item' => 'Gaseste sau scaneaza Articol',
'find_or_scan_item_or_receipt' => 'Gaseste sau scaneaza Articol sau Chitanta',
'giftcard' => 'Card Cadou',
'giftcard_balance' => 'Sold Card Cadou',
'giftcard_filter' => '',
'giftcard_number' => 'Numar Card Cadou',
'group_by_category' => 'Grupare dupa Categorie',
'group_by_type' => 'Grupare dupa Tip',
'hsn' => 'HSN',
'id' => 'ID Vanzare',
'include_prices' => 'Include Preturi?',
'invoice' => 'Factura',
'invoice_confirm' => 'Aceasta factura va fi trimisa catre',
'invoice_enable' => 'Creare Factura',
'invoice_filter' => 'Facturi',
'invoice_no_email' => 'Adresa de email a acestui client nu este valida.',
'invoice_number' => 'Factura #',
'invoice_number_duplicate' => 'Numar Factura trebuie sa fie unic.',
'invoice_sent' => 'Factura trimisa catre',
'invoice_total' => 'Total Factura',
'invoice_type_custom_invoice' => 'Factura Personalizata (custom_invoice.php)',
'invoice_type_custom_tax_invoice' => 'Factura Fiscala Personalizata (custom_tax_invoice.php)',
'invoice_type_invoice' => 'Factura (invoice.php)',
'invoice_type_tax_invoice' => 'Factura Fiscala (tax_invoice.php)',
'invoice_unsent' => 'Factura nu a putut fi trimisă catre',
'invoice_update' => 'Renumara',
'item_insufficient_of_stock' => 'Articol cu fara stoc suficient.',
'item_name' => 'Nume Articol',
'item_number' => 'Articol #',
'item_out_of_stock' => 'Articolul nu este in stoc.',
'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' => 'Mod inregistrare',
'must_enter_numeric' => 'Valoare ofertata trebuie sa fie numerica.',
'must_enter_numeric_giftcard' => 'Numar Card Cadou trebuie sa fie numeric.',
'must_enter_reference_code' => 'Numărul de referință/recuperare trebuie introdus.',
'negative_discount_invalid' => '',
'negative_price_invalid' => '',
'negative_quantity_invalid' => '',
'negative_total_invalid' => '',
'new_customer' => 'Client nou',
'new_item' => 'Articol nou',
'no_description' => 'Fara descriere',
'no_filter' => 'Toate',
'no_items_in_cart' => 'Nu sunt articole in cosul de cumparaturi.',
'no_sales_to_display' => 'Nu sunt Vanzari de afisat.',
'none_selected' => 'Nu ati selecta nicio Vanzare de sters.',
'nontaxed_ind' => '',
'not_authorized' => 'Aceasta actiune nu este autorizata.',
'one_or_multiple' => 'Vanzare(i)',
'payment' => 'Tip Plata',
'payment_amount' => 'Valoare',
'payment_not_cover_total' => 'Valoarea de Plata trebuie sa fie mai mare sau egala decat Totalul.',
'payment_type' => 'Tip',
'payments' => '',
'payments_total' => 'Total Plati',
'price' => 'Pret',
'print_after_sale' => 'Tipareste dupa Vanzare',
'quantity' => 'Cantitate',
'quantity_less_than_reorder_level' => 'Avertisment: Cantitatea dorita este sub nivelul de resuplinire a acestui Articol.',
'quantity_less_than_zero' => 'Avertisment: Cantitatea dorita este insuficienta. Vanzarea poate continua, dar verificati-va stocul.',
'quantity_of_items' => 'Cantitatea a {0} Articole',
'quote' => 'Cotatie',
'quote_number' => 'Numar Cotatie',
'quote_number_duplicate' => 'Numar Cotatie trebuie sa fie unic.',
'quote_sent' => 'Cotatie trimisa catre',
'quote_unsent' => 'Timitere cotatie nereusita catre',
'receipt' => 'Chitanta Vanzari',
'receipt_no_email' => 'Acest client nu are adresa de email valida.',
'receipt_number' => 'Vanzare #',
'receipt_sent' => 'Chitanta trimisa catre',
'receipt_unsent' => 'Trimitere chitanta nereusita catre',
'reference_code' => 'Cod de referință plată',
'reference_code_invalid_characters' => 'Codul de referință trebuie să conțină doar litere și cifre.',
'reference_code_length_error' => 'Lungimea codului de referință este invalidă.',
'refund' => '',
'register' => 'Registru Vanzari',
'remove_customer' => 'Eliminati Clientul',
'remove_discount' => '',
'return' => 'Inapoiere',
'rewards' => 'Puncte fidelizare',
'rewards_balance' => 'Sold Puncte fidelizare',
'rewards_package' => 'Recompense',
'rewards_remaining_balance' => 'Valoarea ramasa a punctelor de fidelizare este ',
'sale' => 'Vanzare',
'sale_by_invoice' => 'Vanzare cu Factura',
'sale_for_customer' => 'Client:',
'sale_time' => 'Timp',
'sales_tax' => 'Taxa',
'sales_total' => '',
'select_customer' => 'Selectare Client',
'send_invoice' => 'Trimite Factura',
'send_quote' => 'Trimite Cotatie',
'send_receipt' => 'Trimite Chitanta',
'send_work_order' => 'Trimite Comanda de Lucru',
'serial' => 'Serie',
'service_charge' => '',
'show_due' => '',
'show_invoice' => 'Arata Factura',
'show_receipt' => 'Arata Chitanta',
'start_typing_customer_name' => 'Incepeti sa tastati detaliile clientului ...',
'start_typing_item_name' => 'Incepeti tastarea Nume Articol sau scanati Cod de bare ...',
'stock' => 'Stoc',
'stock_location' => 'Locatie Stoc',
'sub_total' => 'Subtotal',
'successfully_deleted' => 'Ati reusit stergerea',
'successfully_restored' => 'Ati reusit restaurarea',
'successfully_suspended_sale' => 'Suspendare vanzare reusita.',
'successfully_updated' => 'Actualizare vanzare reusita.',
'suspend_sale' => 'Suspendare',
'suspended_doc_id' => 'Document',
'suspended_sale_id' => 'ID',
'suspended_sales' => 'Suspendata',
'table' => 'Masa',
'takings' => 'Vanzari Zilnice',
'tax' => 'Taxa',
'tax_id' => 'Id Taxa',
'tax_invoice' => 'Factura Fiscala',
'tax_percent' => 'Taxa %',
'taxed_ind' => '',
'total' => 'Total',
'total_tax_exclusive' => 'Fara taxe',
'transaction_failed' => 'Tranzactie nereusita.',
'unable_to_add_item' => 'Adaugare articol la Vanzare nereusita',
'unsuccessfully_deleted' => 'Stergere Vanzare(i) nereusita.',
'unsuccessfully_restored' => 'Restaurare Vanzare(i) nereusita.',
'unsuccessfully_suspended_sale' => 'Suspendare Vanzare nereusita.',
'unsuccessfully_updated' => 'Actualizare Vanzare nereusita.',
'unsuspend' => 'Nesuspendata',
'unsuspend_and_delete' => 'Actiune',
'update' => 'Actualizare',
'upi' => '',
'visa' => '',
'wholesale' => '',
'work_order' => '',
'work_order_number' => '',
'work_order_number_duplicate' => '',
'work_order_sent' => '',
'work_order_unsent' => '',
];