mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-09-13 22:08:16 -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
14 KiB
PHP
240 lines
14 KiB
PHP
<?php
|
|
|
|
return [
|
|
'account_number' => '',
|
|
'add_payment' => 'Přidat platbu',
|
|
'amount_due' => 'K úhradě',
|
|
'amount_due_not_covered' => 'Platby nepokrývají splatnou částku.',
|
|
'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' => '',
|
|
'insufficient_giftcard_balance' => 'Nedostatečný zůstatek na dárkové kartě pro tuto platbu.',
|
|
'insufficient_reward_points' => 'Nedostatečné body odměny pro tuto platbu.',
|
|
'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_amount_tendered' => 'Uhrazená částka nemůže být záporná.',
|
|
'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' => '',
|
|
];
|