Files
opensourcepos/app/Language/nl-NL/Sales.php
jekkosandobjecttothis 839821e2eb bugfix(sales): reject non-negative gift-card amount_tendered (#4674)
* 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>
2026-09-07 11:47:02 +04:00

240 lines
15 KiB
PHP

<?php
return [
'account_number' => 'Account #',
'add_payment' => 'Betaling toevoegen',
'amount_due' => 'Te betalen bedrag',
'amount_due_not_covered' => 'De betalingen dekken het verschuldigde bedrag niet.',
'amount_tendered' => 'Betaald bedrag',
'authorized_signature' => 'Geautoriseerde handtekening',
'cancel_sale' => 'Annuleren',
'cash' => 'Contant',
'cash_1' => '',
'cash_2' => '',
'cash_3' => '',
'cash_4' => '',
'cash_adjustment' => 'Contant correctie',
'cash_deposit' => 'Contact storting',
'cash_filter' => 'Contant',
'change_due' => 'Wisselgeld tegoed',
'change_price' => 'Verkoopprijs wijzigen',
'check' => 'Cheque',
'check_balance' => 'Cheque restant',
'check_filter' => 'Cheque',
'close' => '',
'comment' => 'Opmerking',
'comments' => 'Opmerkingen',
'company_name' => '',
'complete' => '',
'complete_sale' => 'Voltooien',
'confirm_cancel_sale' => 'Weet u zeker dat u deze verkoop wilt wissen? Alle artikelen worden gewist.',
'confirm_delete' => 'Weet u zeker dat u de geselecteerde verko(o)p(en) wilt verwijderen?',
'confirm_restore' => 'Weet u zeker dat u de geselecteerde verko(o)p(en) wilt herstellen?',
'credit' => 'Creditcard',
'credit_deposit' => 'Krediet storting',
'credit_filter' => 'Creditcard',
'current_table' => '',
'customer' => 'Klant',
'customer_address' => 'Adres',
'customer_discount' => 'Korting',
'customer_email' => 'E-mail',
'customer_location' => 'Locatie',
'customer_mailchimp_status' => 'MailChimp Status',
'customer_optional' => '(Vereist voor te betalen betalingen)',
'customer_required' => '(Vereist)',
'customer_total' => 'Totaal',
'customer_total_spent' => '',
'customers_available_points' => 'Beschikbare punten',
'daily_sales' => '',
'date' => 'Verkoopdatum',
'date_range' => 'Datumbereik',
'date_required' => 'Een juiste datum moet ingevuld worden.',
'date_type' => 'Datum is een vereist veld.',
'debit' => 'Betaalpas',
'debit_filter' => '',
'delete' => 'Verwijderen toestaan',
'delete_confirmation' => 'Weet u zeker dat u deze verkoop wilt verwijderen? Deze actie kan niet ongedaan worden gemaakt.',
'delete_entire_sale' => 'Volledige verkoop verwijderen',
'delete_successful' => 'Verkoop verwijderd.',
'delete_unsuccessful' => 'Verkoop verwijderen mislukt.',
'description_abbrv' => 'Beschr.',
'discard' => 'Negeren',
'discard_quote' => '',
'discount' => 'Krtng',
'discount_exceeds_item_total' => '',
'discount_included' => '% korting',
'discount_percent_exceeds_100' => '',
'discount_short' => '%',
'due' => 'Te betalen',
'due_filter' => 'Te betalen',
'edit' => 'Bewerken',
'edit_item' => 'Artikel bewerken',
'edit_sale' => 'Verkoop bewerken',
'email_receipt' => 'E-mail kassabon',
'employee' => 'Werknemer',
'entry' => 'Vermelding',
'error_editing_item' => 'Fout bij artikel bewerken',
'find_or_scan_item' => 'Artikel zoeken of scannen',
'find_or_scan_item_or_receipt' => 'Artikel of kassabon vinden of scannen',
'giftcard' => 'Cadeaubon',
'giftcard_balance' => 'Cadeaubon saldo',
'giftcard_filter' => '',
'giftcard_number' => 'Cadeaubonnummer',
'group_by_category' => 'Groeperen op categorie',
'group_by_type' => 'Groeperen op soort',
'hsn' => 'HSN',
'id' => 'Verkoop ID',
'include_prices' => 'Prijzen opnemen?',
'insufficient_giftcard_balance' => 'Onvoldoende cadeaukaart saldo voor deze betaling.',
'insufficient_reward_points' => 'Onvoldoende beloningspunten voor deze betaling.',
'invoice' => 'Factuur',
'invoice_confirm' => 'Deze factuur zal verzonden worden naar',
'invoice_enable' => 'Factuurnummer',
'invoice_filter' => 'Facturen',
'invoice_no_email' => 'Deze klant bevat geen geldig e-mailadres.',
'invoice_number' => 'Factuur #',
'invoice_number_duplicate' => 'Factuurnummer {0} moet uniek zijn.',
'invoice_sent' => 'Factuur verzonden naar',
'invoice_total' => 'Factuurtotaal',
'invoice_type_custom_invoice' => 'Aangepaste factuur (custom_invoice.php)',
'invoice_type_custom_tax_invoice' => 'Aangepaste belastingfactuur (custom_tax_invoice.php)',
'invoice_type_invoice' => 'Factuur (invoice.php)',
'invoice_type_tax_invoice' => 'Belastingfactuur (tax_invoice.php)',
'invoice_unsent' => 'Fout bij verzenden van factuur naar',
'invoice_update' => 'Opnieuw tellen',
'item_insufficient_of_stock' => 'Artikel heeft onvoldoende voorraad.',
'item_name' => 'Artikelnaam',
'item_number' => 'Artikel #',
'item_out_of_stock' => 'Artikel is niet voorradig.',
'key_browser' => 'Handige snelkoppelingen',
'key_cancel' => 'Cancels Current Quote/Invoice/Sale',
'key_customer_search' => 'Customer Search',
'key_finish_quote' => 'Voltooi Offerte/Factuur zonder betaling',
'key_finish_sale' => 'Add Payment and Complete Invoice/Sale',
'key_full' => 'Openen in volledig scherm',
'key_function' => 'Function',
'key_help' => 'Shortcuts',
'key_help_modal' => 'Open Shortcuts Window',
'key_in' => 'Inzoomen',
'key_item_search' => 'Item Search',
'key_out' => 'Uitzoomen',
'key_payment' => 'Add Payment',
'key_print' => 'Huidige pagina afdrukken',
'key_restore' => 'Originele weergave/grootte herstellen',
'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' => 'Registratie modus',
'must_enter_numeric' => 'Betaald bedrag moet een getal zijn.',
'must_enter_numeric_giftcard' => 'Cadeaubonnummer moet een getal zijn.',
'must_enter_reference_code' => 'Referentie-/ophaalnummer moet worden ingevoerd.',
'negative_amount_tendered' => 'Het betaalde bedrag mag niet negatief zijn.',
'negative_discount_invalid' => '',
'negative_price_invalid' => '',
'negative_quantity_invalid' => '',
'negative_total_invalid' => '',
'new_customer' => 'Nieuwe klant',
'new_item' => 'Nieuw artikel',
'no_description' => 'Geen beschrijving',
'no_filter' => 'Alles',
'no_items_in_cart' => 'Geen artikelen in de winkelwagen.',
'no_sales_to_display' => 'Geen verkopen om te weergeven.',
'none_selected' => 'Geen verko(o)p(en) geselecteerd om te verwijderen.',
'nontaxed_ind' => ' ',
'not_authorized' => 'Deze actie is niet geautoriseerd.',
'one_or_multiple' => 'Verko(o)p(en)',
'payment' => 'Betalingssoort',
'payment_amount' => 'Bedrag',
'payment_not_cover_total' => 'Betaalde bedrag moet groter of gelijk zijn aan totaal.',
'payment_type' => 'Soort',
'payments' => '',
'payments_total' => 'Betalingstotaal',
'price' => 'Prijs',
'print_after_sale' => 'Afdrukken na verkoop',
'quantity' => 'Hoeveelheid',
'quantity_less_than_reorder_level' => 'Waarschuwing: gewenste hoeveelheid is lager dan het opnieuw bestellen niveau voor dit artikel.',
'quantity_less_than_zero' => 'Waarschuwing: gewenste hoeveelheid is onvoldoende. De verkoop kan nog steeds verwerkt worden, maar controleer de voorraad.',
'quantity_of_items' => 'Hoeveelheid van {0} artikelen',
'quote' => 'Offerte',
'quote_number' => 'Offertenummer',
'quote_number_duplicate' => 'Offertenummer moet uniek zijn.',
'quote_sent' => 'Offerte verzonden naar',
'quote_unsent' => 'Offerte niet verzonden naar',
'receipt' => 'Kassabon',
'receipt_no_email' => 'Deze klant bevat geen geldig e-mailadres.',
'receipt_number' => 'Verkoop #',
'receipt_sent' => 'Kassabon verzonden naar',
'receipt_unsent' => 'Kassabon niet verzonden naar',
'reference_code' => 'Betalingsreferentiecode',
'reference_code_invalid_characters' => 'De betalingsreferentiecode mag alleen letters en cijfers bevatten.',
'reference_code_length_error' => 'De lengte van de betalingsreferentiecode is ongeldig.',
'refund' => 'Terugbetaling soort',
'register' => 'Verkoopregister',
'remove_customer' => 'Klant verwijderen',
'remove_discount' => '',
'return' => 'Retourneren',
'rewards' => 'Beloningspunten',
'rewards_balance' => 'Beloningspunten balans',
'rewards_package' => 'Beloningen',
'rewards_remaining_balance' => 'Resterende beloningspunten waarde is ',
'sale' => 'Verkoop',
'sale_by_invoice' => 'Verkopen op factuur',
'sale_for_customer' => 'Klant:',
'sale_time' => 'Tijd',
'sales_tax' => 'BTW',
'sales_total' => '',
'select_customer' => 'Klant selecteren',
'send_invoice' => 'Factuur verzenden',
'send_quote' => 'Offerte verzenden',
'send_receipt' => 'Kassabon verzenden',
'send_work_order' => 'Werkorder verzenden',
'serial' => 'Serieel',
'service_charge' => '',
'show_due' => '',
'show_invoice' => 'Factuur weergeven',
'show_receipt' => 'Kassabon weergeven',
'start_typing_customer_name' => 'Begin met typen klantgegevens...',
'start_typing_item_name' => 'Begin met typen artikelnaam of scan streepjescode...',
'stock' => 'Voorraad',
'stock_location' => 'Voorraadlocatie',
'sub_total' => 'Subtotaal',
'successfully_deleted' => 'U heeft verwijderd',
'successfully_restored' => 'U heeft hersteld',
'successfully_suspended_sale' => 'Verkoop gesluimerd.',
'successfully_updated' => 'Verkoop bijgewerkt.',
'suspend_sale' => 'Sluimeren',
'suspended_doc_id' => 'Document',
'suspended_sale_id' => 'ID',
'suspended_sales' => 'Gesluimerd',
'table' => 'Tafel',
'takings' => 'Dagelijkse verkopen',
'tax' => 'Belasting',
'tax_id' => 'Belasting ID',
'tax_invoice' => 'Belastingfactuur',
'tax_percent' => 'Belasting %',
'taxed_ind' => 'B',
'total' => 'Totaal',
'total_tax_exclusive' => 'Belasting uitsluiten',
'transaction_failed' => 'Verkooptransactie mislukt.',
'unable_to_add_item' => 'Artikel toevoegen aan verkoop mislukt',
'unsuccessfully_deleted' => 'Verko(o)p(en) verwijderen mislukt.',
'unsuccessfully_restored' => 'Verko(o)p(en) herstellen mislukt.',
'unsuccessfully_suspended_sale' => 'Verkoop sluimeren mislukt.',
'unsuccessfully_updated' => 'Verkoop bijwerken mislukt.',
'unsuspend' => 'Ontsluimeren',
'unsuspend_and_delete' => 'Actie',
'update' => 'Bijwerken',
'upi' => 'UPI',
'visa' => '',
'wholesale' => '',
'work_order' => 'Werkorder',
'work_order_number' => 'Werkordernummer',
'work_order_number_duplicate' => 'Werkordernummer moet uniek zijn.',
'work_order_sent' => 'Werkorder verzonden naar',
'work_order_unsent' => 'Werkorder niet verzonden naar',
];