mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-09-14 14:26:59 -04:00
* Validate gift-card payment amounts (GHSA-9847) Close the negative gift-card amount minting vector: when a forged payment_type like 'Gift Card:<number>' reaches the catch-all validation branch, a negative amount_tendered previously passed decimal_locale and was then routed into Giftcard::decrementGiftcardValue, where value - (-N) increased the balance (store credit minted at will). - Add nonNegativeDecimal rule + 'Sales.negative_amount_tendered' message to the catch-all amount_tendered rules in Sales::postAddPayment(); add the language key to all 46 locale files (populated in en, empty elsewhere). - Guard Giftcard::decrementGiftcardValue() against non-positive amounts so the sink itself can no longer add balance from an inverted subtraction. - Regression tests: controller-level rejection of negative amount_tendered and model-level rejection of negative/zero decrements. * Address PR review: align locale keys, drop advisory refs, add decimal_locale message - Align negative_amount_tendered '=> with all other keys (46 locale files) - Remove docblock + inline comment above decrementGiftcardValue() - Remove GHSA ID and attack-detail description from test; scrub redundant comment - Add decimal_locale message override + focused malformed-amount test * Fix formatting and spacing in SalesControllerTest * fix(lang): remove duplicate negative amount tendered key Consolidate 'negative_amount_invalid' and 'negative_amount_tendered' translation keys in Sales.php across all locale files. Both keys held identical messages, causing redundant translation maintenance. - Drop 'negative_amount_invalid' key, keep 'negative_amount_tendered' - Move existing translated text into 'negative_amount_tendered' where it was previously empty - Applied across all app/Language/*/Sales.php locale files Signed-off-by: objecttothis <17935339+objecttothis@users.noreply.github.com> * fix(sales): allow negative amount_tendered in return mode Return transactions legitimately produce negative amount_due and prefilled amount_tendered values, but validation rules previously enforced nonNegativeDecimal unconditionally, blocking valid returns. - Detect return mode via sale_lib->get_mode() in Sales::process - Build amount_tendered rule conditionally: skip nonNegativeDecimal check when in return mode, keep it for sale/giftcard flows - Apply the conditional rule to both giftcard and standard payment branches Signed-off-by: objecttothis <17935339+objecttothis@users.noreply.github.com> * test: update expected error message in negative payment test Sales controller now returns generic numeric-validation message instead of specific negative-amount message for negative tendered amounts. Update test assertion to match new lang key. - tests/Controllers/SalesControllerTest.php: assert Sales.must_enter_numeric instead of Sales.negative_amount_tendered Signed-off-by: objecttothis <17935339+objecttothis@users.noreply.github.com> * test: remove regression tests for GHSA-9847 negative amount fix Drop testDecrementGiftcardValueRejectsNegativeAmount and testDecrementGiftcardValueRejectsZeroAmount from GiftcardTest. - Remove coverage for decrementGiftcardValue() rejecting non-positive amounts (negative/zero) in tests/Models/GiftcardTest.php Signed-off-by: objecttothis <17935339+objecttothis@users.noreply.github.com> --------- Signed-off-by: objecttothis <17935339+objecttothis@users.noreply.github.com> Co-authored-by: objecttothis <17935339+objecttothis@users.noreply.github.com>
240 lines
15 KiB
PHP
240 lines
15 KiB
PHP
<?php
|
|
|
|
return [
|
|
'account_number' => 'Account #',
|
|
'add_payment' => 'Aggiungi Pagamento',
|
|
'amount_due' => 'Importo Dovuto',
|
|
'amount_due_not_covered' => 'I pagamenti non coprono l\'importo dovuto.',
|
|
'amount_tendered' => 'Importo Offerto',
|
|
'authorized_signature' => 'Firma Autorizzata',
|
|
'cancel_sale' => 'Annulla',
|
|
'cash' => 'Contanti',
|
|
'cash_1' => '',
|
|
'cash_2' => '',
|
|
'cash_3' => '',
|
|
'cash_4' => '',
|
|
'cash_adjustment' => 'Adeguamento in contanti',
|
|
'cash_deposit' => 'Deposito Contanti',
|
|
'cash_filter' => 'Contanti',
|
|
'change_due' => 'Resto Dovuto',
|
|
'change_price' => 'Cambio prezzo di vendita',
|
|
'check' => 'Assegno',
|
|
'check_balance' => 'Promemoria Assegno',
|
|
'check_filter' => 'Assegno',
|
|
'close' => '',
|
|
'comment' => 'Commento',
|
|
'comments' => 'Commenti',
|
|
'company_name' => '',
|
|
'complete' => '',
|
|
'complete_sale' => 'Completata',
|
|
'confirm_cancel_sale' => 'Sei sicuro di voler annullare questa vendita? Tutti gli articoli saranno eliminati.',
|
|
'confirm_delete' => 'Sei sicuro di voler eliminare la vendita selezionata?',
|
|
'confirm_restore' => 'Sei sicuro di voler ripristinare la vendita selezionata?',
|
|
'credit' => 'Carta di Credito',
|
|
'credit_deposit' => 'Deposito Credito',
|
|
'credit_filter' => 'Carta di credito',
|
|
'current_table' => '',
|
|
'customer' => 'Nome',
|
|
'customer_address' => 'Indirizzo',
|
|
'customer_discount' => 'Sconto',
|
|
'customer_email' => 'Email',
|
|
'customer_location' => 'Località',
|
|
'customer_mailchimp_status' => 'Stato Mailchimp',
|
|
'customer_optional' => '(Opzionale)',
|
|
'customer_required' => '(Richiesto)',
|
|
'customer_total' => 'Totale',
|
|
'customer_total_spent' => '',
|
|
'customers_available_points' => 'Punti Dispnibili',
|
|
'daily_sales' => '',
|
|
'date' => 'Data di Vendita',
|
|
'date_range' => 'Intervallo Data',
|
|
'date_required' => 'Deve essere inserita una Data corretta.',
|
|
'date_type' => 'Data è un campo obbligatorio.',
|
|
'debit' => 'Carta di Debito',
|
|
'debit_filter' => '',
|
|
'delete' => 'Permetti Eliminazione',
|
|
'delete_confirmation' => 'Sei sicuro di voler eliminare questa vendita? Questa azione non può essere annullata.',
|
|
'delete_entire_sale' => 'Cancella intera vendita',
|
|
'delete_successful' => 'Cancellazione Vendita terminata correttamente.',
|
|
'delete_unsuccessful' => 'Eliminazione Vendita Fallita.',
|
|
'description_abbrv' => 'Desc.',
|
|
'discard' => 'Scartare',
|
|
'discard_quote' => '',
|
|
'discount' => 'Sconto %',
|
|
'discount_exceeds_item_total' => '',
|
|
'discount_included' => '% Sconto',
|
|
'discount_percent_exceeds_100' => '',
|
|
'discount_short' => '%',
|
|
'due' => 'Dovuto',
|
|
'due_filter' => 'Dovuto',
|
|
'edit' => 'Modifica',
|
|
'edit_item' => 'Modifica Articolo',
|
|
'edit_sale' => 'Modifica Vendita',
|
|
'email_receipt' => 'Scontrino Email',
|
|
'employee' => 'Impiegato',
|
|
'entry' => 'Voce',
|
|
'error_editing_item' => 'Errore modificando un articolo',
|
|
'find_or_scan_item' => 'Scansiona o Cerca Articolo',
|
|
'find_or_scan_item_or_receipt' => 'Scansiona o Cerca Articolo o Scontrino',
|
|
'giftcard' => 'Carta Regalo',
|
|
'giftcard_balance' => 'Carta Regalo Bilancio',
|
|
'giftcard_filter' => '',
|
|
'giftcard_number' => 'Numero Carta Regalo',
|
|
'group_by_category' => 'Raggruppa per Categoria',
|
|
'group_by_type' => 'Raggruppa per Tipo',
|
|
'hsn' => 'HSN',
|
|
'id' => 'ID vendita',
|
|
'include_prices' => 'Includi i prezzi?',
|
|
'insufficient_giftcard_balance' => 'Saldo carta regalo insufficiente per questo pagamento.',
|
|
'insufficient_reward_points' => 'Punti premio insufficienti per questo pagamento.',
|
|
'invoice' => 'Fattura',
|
|
'invoice_confirm' => 'Questa fattura sarà inviata a',
|
|
'invoice_enable' => 'Crea Fattura',
|
|
'invoice_filter' => 'Fatture',
|
|
'invoice_no_email' => 'Questo cliente non ha un indirizzo email valido.',
|
|
'invoice_number' => 'Fattura #',
|
|
'invoice_number_duplicate' => 'Numero Fattura deve essere unico.',
|
|
'invoice_sent' => 'Fattura inviata a',
|
|
'invoice_total' => 'Totale Fattura',
|
|
'invoice_type_custom_invoice' => 'Fattura Personalizzata (custom_invoice.php)',
|
|
'invoice_type_custom_tax_invoice' => 'Fattura con Imposta Personalizzata (custom_tax_invoice.php)',
|
|
'invoice_type_invoice' => 'Fattura (invoice.php)',
|
|
'invoice_type_tax_invoice' => "Fattura d'Imposta",
|
|
'invoice_unsent' => 'Fatturazione fallita sarà inviata a',
|
|
'invoice_update' => 'Ricalcola',
|
|
'item_insufficient_of_stock' => "L'articolo non ha un magazzino sufficiente.",
|
|
'item_name' => 'Nome Articolo',
|
|
'item_number' => 'Articolo #',
|
|
'item_out_of_stock' => 'Articolo fuori stock.',
|
|
'key_browser' => 'Scorciatoie utili',
|
|
'key_cancel' => 'Cancels Current Quote/Invoice/Sale',
|
|
'key_customer_search' => 'Customer Search',
|
|
'key_finish_quote' => 'Termina Preventivo/Fattura senza pagamento',
|
|
'key_finish_sale' => 'Add Payment and Complete Invoice/Sale',
|
|
'key_full' => 'Apri in modalità a schermo intero',
|
|
'key_function' => 'Function',
|
|
'key_help' => 'Shortcuts',
|
|
'key_help_modal' => 'Open Shortcuts Window',
|
|
'key_in' => 'Ingrandire',
|
|
'key_item_search' => 'Item Search',
|
|
'key_out' => 'Rimpicciolisci',
|
|
'key_payment' => 'Add Payment',
|
|
'key_print' => 'Stampa pagina corrente',
|
|
'key_restore' => 'Ripristina visualizzazione/zoom originale',
|
|
'key_search' => 'Tabelle dei rapporti di ricerca',
|
|
'key_suspend' => 'Suspend Current Sale',
|
|
'key_suspended' => 'Show Suspended Sales',
|
|
'key_system' => 'Scorciatoie di sistema',
|
|
'key_tendered' => 'Edit Amount Tendered',
|
|
'key_title' => 'Sales Keyboard Shortcuts',
|
|
'mc' => '',
|
|
'mode' => 'Modalità registra',
|
|
'must_enter_numeric' => 'Import Offerto deve essere un numero.',
|
|
'must_enter_numeric_giftcard' => 'Numero Carta Regalo deve essere un numero.',
|
|
'must_enter_reference_code' => 'Il numero di riferimento/recupero deve essere inserito.',
|
|
'negative_amount_tendered' => 'L\'importo offerto non può essere negativo.',
|
|
'negative_discount_invalid' => '',
|
|
'negative_price_invalid' => '',
|
|
'negative_quantity_invalid' => '',
|
|
'negative_total_invalid' => '',
|
|
'new_customer' => 'Nuovo Cliente',
|
|
'new_item' => 'Nuovo Articolo',
|
|
'no_description' => 'Nessun',
|
|
'no_filter' => 'Tutti',
|
|
'no_items_in_cart' => 'Non ci sono Articoli nel carrello.',
|
|
'no_sales_to_display' => 'Nessuna Vendita da mostrare.',
|
|
'none_selected' => 'Non hai selezionato alcuna vendita da cancellare.',
|
|
'nontaxed_ind' => ' vendita non tassata ',
|
|
'not_authorized' => 'Questa azione non può essere autorizzata.',
|
|
'one_or_multiple' => 'Vendita/e',
|
|
'payment' => 'Tipo di pagamento',
|
|
'payment_amount' => 'Importo',
|
|
'payment_not_cover_total' => 'Pagamento Import deve essere maggiore o uguale al Totale.',
|
|
'payment_type' => 'Tipo',
|
|
'payments' => '',
|
|
'payments_total' => 'Totale Pagamenti',
|
|
'price' => 'Prezzo',
|
|
'print_after_sale' => 'Stampa dopo la vendita',
|
|
'quantity' => 'Quantità',
|
|
'quantity_less_than_reorder_level' => 'Attenzione: la Quantità desiderata è sotto al Livello di riordino per questo Articolo.',
|
|
'quantity_less_than_zero' => "Attenzione: la Quantità desiderata non è sufficiente. Puoi ancora procedere alla vendita ma controlla l'inventario.",
|
|
'quantity_of_items' => 'Quantità di {0} Articolo',
|
|
'quote' => 'Preventivo',
|
|
'quote_number' => 'Numero Preventivo',
|
|
'quote_number_duplicate' => 'Numero Preventivo deve essere unico.',
|
|
'quote_sent' => 'Preventivo inviato a',
|
|
'quote_unsent' => "Preventivo fallito d'essere inviato a",
|
|
'receipt' => 'Scontrino di Vendita',
|
|
'receipt_no_email' => "Questo cliente non ha un'email valida.",
|
|
'receipt_number' => 'Vendita #',
|
|
'receipt_sent' => 'Scontrino inviato a',
|
|
'receipt_unsent' => 'Scontrino fallito da inviare a',
|
|
'reference_code' => 'Codice di riferimento pagamento',
|
|
'reference_code_invalid_characters' => 'Il codice di riferimento deve contenere solo lettere e numeri.',
|
|
'reference_code_length_error' => 'La lunghezza del codice di riferimento non è valida.',
|
|
'refund' => 'Tipo di rimborso',
|
|
'register' => 'Registrazione Vendita',
|
|
'remove_customer' => 'Rimuovi Cliente',
|
|
'remove_discount' => '',
|
|
'return' => 'Reso',
|
|
'rewards' => 'Punti Raccolta',
|
|
'rewards_balance' => 'Bilancio Punti Raccolta',
|
|
'rewards_package' => 'Punti Fedeltà',
|
|
'rewards_remaining_balance' => 'Valore Punti Rimanenti è ',
|
|
'sale' => 'Vendita',
|
|
'sale_by_invoice' => 'Fattura',
|
|
'sale_for_customer' => 'Cliente:',
|
|
'sale_time' => 'Tempo',
|
|
'sales_tax' => 'Imposte di Vendita',
|
|
'sales_total' => '',
|
|
'select_customer' => 'Seleziona Cliente (Opzionale)',
|
|
'send_invoice' => 'Invia Fattura',
|
|
'send_quote' => 'Invia Preventivo',
|
|
'send_receipt' => 'Invia Scontrino',
|
|
'send_work_order' => 'Invia Commessa/Ordine di Lavoro',
|
|
'serial' => 'Seriale',
|
|
'service_charge' => '',
|
|
'show_due' => '',
|
|
'show_invoice' => 'Mostra Fattura',
|
|
'show_receipt' => 'Mostra Scontrino',
|
|
'start_typing_customer_name' => 'Digita i dettagli del cliente...',
|
|
'start_typing_item_name' => 'Incomincia a digitare Nome Articolo o spara il Codice a Barre...',
|
|
'stock' => 'Disponibilità',
|
|
'stock_location' => 'Posizione Stock',
|
|
'sub_total' => 'Subtotale',
|
|
'successfully_deleted' => 'Hai correttamente eliminato',
|
|
'successfully_restored' => 'Hai correttamente ripristinato',
|
|
'successfully_suspended_sale' => 'Vendita sospesa correttamente.',
|
|
'successfully_updated' => 'Aggiornamento vendita a buon fine.',
|
|
'suspend_sale' => 'Sospendi',
|
|
'suspended_doc_id' => 'Documento',
|
|
'suspended_sale_id' => 'ID',
|
|
'suspended_sales' => 'Sospeso',
|
|
'table' => 'Tavolo',
|
|
'takings' => 'Vendite del Giorno',
|
|
'tax' => 'Imposte',
|
|
'tax_id' => 'ID Imposta',
|
|
'tax_invoice' => "Fattura d'Imposta",
|
|
'tax_percent' => 'Imposte %',
|
|
'taxed_ind' => 'T',
|
|
'total' => 'Totale',
|
|
'total_tax_exclusive' => 'Imposte escluse',
|
|
'transaction_failed' => 'Transazione di Vendita fallita.',
|
|
'unable_to_add_item' => 'Aggiunta articolo alla vendita non riuscita',
|
|
'unsuccessfully_deleted' => 'Eliminazione Vendita/e fallita.',
|
|
'unsuccessfully_restored' => 'Ripristino Vendita/e fallita.',
|
|
'unsuccessfully_suspended_sale' => 'Vendita sospesa fallita.',
|
|
'unsuccessfully_updated' => 'Aggiornamento Vendita fallito.',
|
|
'unsuspend' => 'Non-sospeso',
|
|
'unsuspend_and_delete' => 'Azione',
|
|
'update' => 'Aggiorna',
|
|
'upi' => 'UPI',
|
|
'visa' => '',
|
|
'wholesale' => '',
|
|
'work_order' => 'Ordine di Lavoro',
|
|
'work_order_number' => 'Numero Ordine di Lavoro',
|
|
'work_order_number_duplicate' => 'Numero Ordine di Lavoro deve essere unico.',
|
|
'work_order_sent' => 'Ordine di lavoro inviato',
|
|
'work_order_unsent' => 'Ordine di Lavoro fallito da inviare a',
|
|
];
|