mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-09-13 05:47:23 -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
16 KiB
PHP
240 lines
16 KiB
PHP
<?php
|
|
|
|
return [
|
|
'account_number' => 'Tài khoản #',
|
|
'add_payment' => 'Thêm thanh toán',
|
|
'amount_due' => 'Số còn lại phải thanh toán',
|
|
'amount_due_not_covered' => 'Các khoản thanh toán không đủ để trang trải số tiền phải trả.',
|
|
'amount_tendered' => 'Số tiền thanh toán',
|
|
'authorized_signature' => 'Chữ ký ủy quyền',
|
|
'cancel_sale' => 'Thôi',
|
|
'cash' => 'Tiền mặt',
|
|
'cash_1' => '',
|
|
'cash_2' => '',
|
|
'cash_3' => '',
|
|
'cash_4' => '',
|
|
'cash_adjustment' => 'Điều chỉnh tiền mặt',
|
|
'cash_deposit' => 'Số dư tiền mặt',
|
|
'cash_filter' => 'Tiền mặt',
|
|
'change_due' => 'Tiền thối lại',
|
|
'change_price' => 'Thay đổi giá bán',
|
|
'check' => 'Séc',
|
|
'check_balance' => 'Phần còn lại séc',
|
|
'check_filter' => 'Séc',
|
|
'close' => '',
|
|
'comment' => 'Ghi chú',
|
|
'comments' => 'Ghi chú',
|
|
'company_name' => '',
|
|
'complete' => '',
|
|
'complete_sale' => 'Hoàn thành',
|
|
'confirm_cancel_sale' => 'Bạn có chắc muốn xóa trắng lần bán hàng này? Mọi hàng hóa sẽ bị xóa sạch.',
|
|
'confirm_delete' => 'Bạn chắc chắn muốn xóa các lần bán hàng được chọn không?',
|
|
'confirm_restore' => 'Bạn chắc chắn muốn hoàn lại các lần bán hàng được chọn không?',
|
|
'credit' => 'Thẻ tín dụng',
|
|
'credit_deposit' => 'Số dư tiền gửi',
|
|
'credit_filter' => 'Thẻ tín dụng',
|
|
'current_table' => '',
|
|
'customer' => 'Khách hàng',
|
|
'customer_address' => 'Địa chỉ',
|
|
'customer_discount' => 'Giảm giá',
|
|
'customer_email' => 'Thư điện tử',
|
|
'customer_location' => 'Vị trí',
|
|
'customer_mailchimp_status' => 'Trạng thái tài khoản Mailchimp',
|
|
'customer_optional' => '(Tùy chọn)',
|
|
'customer_required' => '(Bắt buộc)',
|
|
'customer_total' => 'Tổng cộng',
|
|
'customer_total_spent' => '',
|
|
'customers_available_points' => 'Các điểm sẵn có',
|
|
'daily_sales' => '',
|
|
'date' => 'Ngày bán',
|
|
'date_range' => 'Phạm vi Ngày',
|
|
'date_required' => 'Ngày phải được nhập theo định dạng.',
|
|
'date_type' => 'Trường Ngày tháng là bắt buộc.',
|
|
'debit' => 'Thẻ ghi nợ',
|
|
'debit_filter' => '',
|
|
'delete' => 'Cho phép xóa',
|
|
'delete_confirmation' => 'Bạn có chắc muốn xóa lần nhập bán hàng? Thao tác này không thể hoàn lại.',
|
|
'delete_entire_sale' => 'Xóa toàn bộ đơn bán hàng',
|
|
'delete_successful' => 'Đã xóa thành công lần bán hàng.',
|
|
'delete_unsuccessful' => 'Gặp lỗi khi xóa đơn bán hàng.',
|
|
'description_abbrv' => 'Ggiá.',
|
|
'discard' => 'Hủy',
|
|
'discard_quote' => '',
|
|
'discount' => 'Ggiá %',
|
|
'discount_exceeds_item_total' => '',
|
|
'discount_included' => '% Giảm giá',
|
|
'discount_percent_exceeds_100' => '',
|
|
'discount_short' => '%',
|
|
'due' => 'Trả chậm',
|
|
'due_filter' => 'Trả chậm',
|
|
'edit' => 'Sửa',
|
|
'edit_item' => 'Sửa hàng hóa',
|
|
'edit_sale' => 'Sửa bán hàng',
|
|
'email_receipt' => 'Biên lai thư',
|
|
'employee' => 'Nhân viên',
|
|
'entry' => 'Mục nhập',
|
|
'error_editing_item' => 'Lỗi sửa hàng hóa',
|
|
'find_or_scan_item' => 'Tìm hay quét Hàng hóa',
|
|
'find_or_scan_item_or_receipt' => 'Tìm hay quét Hàng hóa hay Biên lai',
|
|
'giftcard' => 'Thẻ quà tặng',
|
|
'giftcard_balance' => 'Số thẻ quà tặng còn lại',
|
|
'giftcard_filter' => '',
|
|
'giftcard_number' => 'Số Thẻ quà tặng',
|
|
'group_by_category' => 'Gộp theo Danh mục',
|
|
'group_by_type' => 'Gộp theo kiểu',
|
|
'hsn' => 'HSN',
|
|
'id' => 'Mã bán hàng',
|
|
'include_prices' => 'Bao gồm Giá?',
|
|
'insufficient_giftcard_balance' => 'Số dư thẻ quà tặng không đủ cho khoản thanh toán này.',
|
|
'insufficient_reward_points' => 'Điểm thưởng không đủ cho khoản thanh toán này.',
|
|
'invoice' => 'Hóa đơn',
|
|
'invoice_confirm' => 'Hóa đơn sẽ được gửi đến',
|
|
'invoice_enable' => 'Tạo hóa dơn',
|
|
'invoice_filter' => 'Hóa đơn',
|
|
'invoice_no_email' => 'Khách hàng này không có địa chỉ thư điện tử hợp lệ.',
|
|
'invoice_number' => 'Hóa đơn #',
|
|
'invoice_number_duplicate' => 'Số Hóa đơn phải duy nhất.',
|
|
'invoice_sent' => 'Gửi Hóa đơn đến',
|
|
'invoice_total' => 'Tổng hóa đơn',
|
|
'invoice_type_custom_invoice' => 'Hóa đơn tùy chọn (custom_invoice.php)',
|
|
'invoice_type_custom_tax_invoice' => 'Hóa đơn thuế tự chọn (custom_tax_invoice.php)',
|
|
'invoice_type_invoice' => 'Hóa đơn (invoice.php)',
|
|
'invoice_type_tax_invoice' => 'Hóa đơn thuế (tax_invoice.php)',
|
|
'invoice_unsent' => 'Gặp lỗi khi gửi Hóa đơn cho',
|
|
'invoice_update' => 'Kiểm lại',
|
|
'item_insufficient_of_stock' => 'Không đủ hàng tồn cho mặt hàng này.',
|
|
'item_name' => 'Tên Hàng hóa',
|
|
'item_number' => 'Hàng hóa #',
|
|
'item_out_of_stock' => 'Hết hàng trong kho.',
|
|
'key_browser' => 'Phím tắt hữu ích',
|
|
'key_cancel' => 'Hủy báo giá/hóa đơn/bán hàng hiện tại',
|
|
'key_customer_search' => 'Tìm khách hàng',
|
|
'key_finish_quote' => 'Kết thúc báo giá/hóa đơn mà không cần thanh toán',
|
|
'key_finish_sale' => 'Thanh toán và hoàn thành hóa đơn/bán hàng',
|
|
'key_full' => 'Toàn màn hình',
|
|
'key_function' => 'Function',
|
|
'key_help' => 'Phím tắt',
|
|
'key_help_modal' => 'Mở cửa sổ phím tắt',
|
|
'key_in' => 'Phòng to',
|
|
'key_item_search' => 'Tìm hàng hóa',
|
|
'key_out' => 'Thu nhỏ',
|
|
'key_payment' => 'Thêm thanh toán',
|
|
'key_print' => 'In trang hiện tại',
|
|
'key_restore' => 'Khôi phục mức thu/phóng mặc định',
|
|
'key_search' => 'Tìm báo cáo',
|
|
'key_suspend' => 'Tạm hoãn đơn hàng',
|
|
'key_suspended' => 'Xem đơn hàng tạm hoãn',
|
|
'key_system' => 'Phím tắt hệ thống',
|
|
'key_tendered' => 'Edit Amount Tendered',
|
|
'key_title' => 'Phím tắt bán hàng',
|
|
'mc' => '',
|
|
'mode' => 'Chế độ đăng ký',
|
|
'must_enter_numeric' => 'Số tiền thanh toán phải là dạng số.',
|
|
'must_enter_numeric_giftcard' => 'Số Thẻ quà tặng phải là dạng số.',
|
|
'must_enter_reference_code' => 'Số tham chiếu/truy xuất phải được nhập.',
|
|
'negative_amount_tendered' => 'Số tiền thanh toán không được là số âm.',
|
|
'negative_discount_invalid' => '',
|
|
'negative_price_invalid' => '',
|
|
'negative_quantity_invalid' => '',
|
|
'negative_total_invalid' => '',
|
|
'new_customer' => 'Khách hàng mới',
|
|
'new_item' => 'Hàng hóa mới',
|
|
'no_description' => 'Không',
|
|
'no_filter' => 'Tất cả',
|
|
'no_items_in_cart' => 'Không có Hàng hóa trong rổ hàng.',
|
|
'no_sales_to_display' => 'Không có lần bán hàng để hiển thị.',
|
|
'none_selected' => 'Bạn chưa chọn bất kỳ một lần bán hàng nào để mà xóa.',
|
|
'nontaxed_ind' => '',
|
|
'not_authorized' => 'Thao tác này không được phép.',
|
|
'one_or_multiple' => 'Bán hàng',
|
|
'payment' => 'Phương thức thanh toán',
|
|
'payment_amount' => 'Tổng số',
|
|
'payment_not_cover_total' => 'Chưa thanh toán đủ đơn hàng.',
|
|
'payment_type' => 'Kiểu',
|
|
'payments' => '',
|
|
'payments_total' => 'Đã thanh toán',
|
|
'price' => 'Giá',
|
|
'print_after_sale' => 'In sau khi Bán hàng',
|
|
'quantity' => 'Số lượng',
|
|
'quantity_less_than_reorder_level' => 'Cảnh báo: Số lượng mong muốn dưới Mức đặt mua bổ xung cho hàng hóa đó.',
|
|
'quantity_less_than_zero' => 'Cảnh báo: Số lượng mong muốn không đủ. Bạn vẫn có thể xử lý đơn hàng, nhưng hãy kiểm toán tồn kho của bạn.',
|
|
'quantity_of_items' => 'Số lượng của Hàng hóa {0}',
|
|
'quote' => 'Báo giá',
|
|
'quote_number' => 'Số Báo giá',
|
|
'quote_number_duplicate' => 'Số Báo giá phải là duy nhất.',
|
|
'quote_sent' => 'Báo giá gửi đến',
|
|
'quote_unsent' => 'Gặp lỗi khi gửi báo giá đến',
|
|
'receipt' => 'Biên lai các lần bán hàng',
|
|
'receipt_no_email' => 'Khách hàng này có địa chỉ thư điện tử không hợp lệ.',
|
|
'receipt_number' => 'Bán hàng #',
|
|
'receipt_sent' => 'Biên lai gửi đến',
|
|
'receipt_unsent' => 'Gặp lỗi khi gửi biên lai đến',
|
|
'reference_code' => 'Mã tham chiếu thanh toán',
|
|
'reference_code_invalid_characters' => 'Mã tham chiếu chỉ được chứa chữ cái và chữ số.',
|
|
'reference_code_length_error' => 'Độ dài mã tham chiếu không hợp lệ.',
|
|
'refund' => 'Phương thức hoàn tiền',
|
|
'register' => 'Nhập đơn bán hàng',
|
|
'remove_customer' => 'Xóa bỏ khách hàng',
|
|
'remove_discount' => '',
|
|
'return' => 'Trả hàng',
|
|
'rewards' => 'Điểm thưởng',
|
|
'rewards_balance' => 'Số Điểm thưởng còn lại',
|
|
'rewards_package' => 'Điểm thưởng',
|
|
'rewards_remaining_balance' => 'Giá trị còn lại của điểm thưởng là ',
|
|
'sale' => 'Bán hàng',
|
|
'sale_by_invoice' => 'Bán bằng Hóa đơn',
|
|
'sale_for_customer' => 'Khách hàng:',
|
|
'sale_time' => 'Thời gian',
|
|
'sales_tax' => 'Thuế các lần bán hàng',
|
|
'sales_total' => '',
|
|
'select_customer' => 'Chọn Khách hàng',
|
|
'send_invoice' => 'Gửi hóa đơn',
|
|
'send_quote' => 'Gửi báo giá',
|
|
'send_receipt' => 'Gửi biên lai',
|
|
'send_work_order' => 'Gửi Giấy giao việc',
|
|
'serial' => 'Số sê-ri',
|
|
'service_charge' => '',
|
|
'show_due' => '',
|
|
'show_invoice' => 'Hiển thị hóa đơn',
|
|
'show_receipt' => 'Hiển thị biên lai',
|
|
'start_typing_customer_name' => 'Bắt đầu gõ chi tiết khách hàng...',
|
|
'start_typing_item_name' => 'Bắt đầu gõ tên hàng hóa hoặc quét mã vạch...',
|
|
'stock' => 'Kho',
|
|
'stock_location' => 'Vị trí kho',
|
|
'sub_total' => 'Tổng trước thuế',
|
|
'successfully_deleted' => 'Bạn đã xóa thành công',
|
|
'successfully_restored' => 'Bạn đã khôi phục lại đơn hàng',
|
|
'successfully_suspended_sale' => 'Đã tạm hoãn thành công lần bán hàng.',
|
|
'successfully_updated' => 'Đã cập nhật thành công lần bán hàng.',
|
|
'suspend_sale' => 'Tạm hoãn',
|
|
'suspended_doc_id' => 'Tài liệu',
|
|
'suspended_sale_id' => 'MÃ SỐ',
|
|
'suspended_sales' => 'Đơn hàng tạm hoãn',
|
|
'table' => 'Bàn',
|
|
'takings' => 'Đơn hàng trong ngày',
|
|
'tax' => 'Thuế',
|
|
'tax_id' => 'Mã số thuế',
|
|
'tax_invoice' => 'Hóa đơn thuế',
|
|
'tax_percent' => 'Thuế %',
|
|
'taxed_ind' => 'T',
|
|
'total' => 'Tổng',
|
|
'total_tax_exclusive' => 'Gồm thuế',
|
|
'transaction_failed' => 'Gặp lỗi khi giao dịch bán hàng.',
|
|
'unable_to_add_item' => 'Gặp lỗi khi thêm hàng hóa vào đơn hàng',
|
|
'unsuccessfully_deleted' => 'Gặp lỗi khi xóa các lần bán hàng.',
|
|
'unsuccessfully_restored' => 'Gặp lỗi khi hoàn lại các lần bán hàng.',
|
|
'unsuccessfully_suspended_sale' => 'Gặp lỗi khi tạm ngừng lần bán hàng.',
|
|
'unsuccessfully_updated' => 'Gặp lỗi khi cập nhật lần bán hàng.',
|
|
'unsuspend' => 'Hủy tạm hoãn',
|
|
'unsuspend_and_delete' => 'Thao tác',
|
|
'update' => 'Cập nhật',
|
|
'upi' => 'UPI',
|
|
'visa' => '',
|
|
'wholesale' => '',
|
|
'work_order' => 'Giấy giao việc',
|
|
'work_order_number' => 'Số giấy giao việc',
|
|
'work_order_number_duplicate' => 'Số giấy giao việc phải là duy nhất.',
|
|
'work_order_sent' => 'Gửi Giấy giao việc cho',
|
|
'work_order_unsent' => 'Gặp lỗi khi gửi Giấy giao việc cho',
|
|
];
|