Files
opensourcepos/app/Language/id/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

237 lines
15 KiB
PHP

<?php
return [
'account_number' => 'Akun #',
'add_payment' => 'Terima',
'amount_due' => 'Uang Kembalian',
'amount_tendered' => 'Nilai Pembayaran',
'authorized_signature' => 'Tanda tangan',
'cancel_sale' => 'Batal Jual',
'cash' => 'Tunai',
'cash_1' => '',
'cash_2' => '',
'cash_3' => '',
'cash_4' => '',
'cash_adjustment' => 'Penyesuaian Kas',
'cash_deposit' => 'Deposit Tunai',
'cash_filter' => 'Tunai',
'change_due' => 'Kembalian Uang',
'change_price' => 'Ubah Harga Jual',
'check' => 'Cek',
'check_balance' => 'Aktifkan pengingat',
'check_filter' => 'Cek',
'close' => '',
'comment' => 'Catatan',
'comments' => 'Keterangan',
'company_name' => '',
'complete' => '',
'complete_sale' => 'Selesai',
'confirm_cancel_sale' => 'Apakah anda yakin ingin mengosongkan transaksi penjualan ini? Semua item akan dihapus.',
'confirm_delete' => 'Apakah anda yakin akan menghapus penjualan terpilih?',
'confirm_restore' => 'Apakah anda yakin akan mengembalikan penjualan terpilih?',
'credit' => 'Kartu Kredit',
'credit_deposit' => 'Deposit Kredit',
'credit_filter' => 'Kartu Kredit',
'current_table' => '',
'customer' => 'Pelanggan',
'customer_address' => 'Alamat',
'customer_discount' => 'Diskon',
'customer_email' => 'Email',
'customer_location' => 'Lokasi',
'customer_mailchimp_status' => 'Status MailChimp',
'customer_optional' => '(Diperlukan untuk Pembayaran Jatuh Tempo)',
'customer_required' => '(Dibutuhkan)',
'customer_total' => 'Total',
'customer_total_spent' => '',
'customers_available_points' => 'Poin tersedia',
'daily_sales' => '',
'date' => 'Tanggal Penjualan',
'date_range' => 'Rentang Tanggal',
'date_required' => 'Masukkan tanggal yang benar.',
'date_type' => 'Tanggal tidak boleh kosong.',
'debit' => 'Kartu Debit',
'debit_filter' => '',
'delete' => 'Boleh dihapus',
'delete_confirmation' => 'Apakah anda yakin ingin menghapus transaksi penjualan ini, Pilihan ini tidak dapat dibatalkan.',
'delete_entire_sale' => 'Hapus Transaksi Penjualan',
'delete_successful' => 'Transaksi Penjualan berhasil dihapus.',
'delete_unsuccessful' => 'Transaksi Penjualan gagal dihapus.',
'description_abbrv' => 'Deskripsi.',
'discard' => 'Buang',
'discard_quote' => '',
'discount' => 'Diskon',
'discount_exceeds_item_total' => '',
'discount_included' => '% Diskon',
'discount_percent_exceeds_100' => '',
'discount_short' => '%',
'due' => 'Jatuh tempo',
'due_filter' => 'Jatuh tempo',
'edit' => 'Ubah',
'edit_item' => 'Ubah Item',
'edit_sale' => 'Ubah Penjualan',
'email_receipt' => 'email Faktur',
'employee' => 'Karyawan',
'entry' => 'Entri',
'error_editing_item' => 'mengubah item salah',
'find_or_scan_item' => 'Cari/Scan Item',
'find_or_scan_item_or_receipt' => 'Temukan atau pindai Item atau Faktur',
'giftcard' => 'Kartu Hadiah',
'giftcard_balance' => 'Nilai Kupon Bonus',
'giftcard_filter' => '',
'giftcard_number' => 'Nomor Kartu Hadiah',
'group_by_category' => 'Dikelompokkan berdasarkan Kategori',
'group_by_type' => 'Dikelompokkan berdasarkan Jenis',
'hsn' => 'HSN',
'id' => 'ID Penjualan',
'include_prices' => 'Termasuk Harga?',
'invoice' => 'Faktur',
'invoice_confirm' => 'Faktur ini akan dikirim ke',
'invoice_enable' => 'Nomor Faktur',
'invoice_filter' => 'Faktur',
'invoice_no_email' => 'Pelanggan ini tidak memiliki alamat email yang valid.',
'invoice_number' => 'Nomor Nota',
'invoice_number_duplicate' => 'Nomor nota harus unik.',
'invoice_sent' => 'Faktur dikirim kepada',
'invoice_total' => 'Total faktur',
'invoice_type_custom_invoice' => 'Faktur kustom (custom_invoice.php)',
'invoice_type_custom_tax_invoice' => 'Faktur pajak kustom (custom_tax_invoice.php)',
'invoice_type_invoice' => 'Faktur (invoice.php)',
'invoice_type_tax_invoice' => 'Faktur pajak (tax_invoice.php)',
'invoice_unsent' => 'Faktur gagal dikirim kepada',
'invoice_update' => 'Menghitung ulang',
'item_insufficient_of_stock' => 'Stok Item tidak mencukupi.',
'item_name' => 'Nama Barang',
'item_number' => 'Barang #',
'item_out_of_stock' => 'Barang habis.',
'key_browser' => 'Pintasan bermanfaat',
'key_cancel' => 'Membatalkan Penawaran/Faktur/Penjualan saat ini',
'key_customer_search' => 'Pencarian Pelanggan',
'key_finish_quote' => 'Selesaikan Struk/Faktur tanpa pembayaran',
'key_finish_sale' => 'Tambahkan Pembayaran dan Lengkapi Faktur/Penjualan',
'key_full' => 'Buka dalam Mode Layar Penuh',
'key_function' => 'Fungsi',
'key_help' => 'Pintasan',
'key_help_modal' => 'Buka Jendela Pintasan',
'key_in' => 'Perbesar',
'key_item_search' => 'Pencarian Barang',
'key_out' => 'Perkecil',
'key_payment' => 'Tambahkan Pembayaran',
'key_print' => 'Cetak Halaman sekarang',
'key_restore' => 'Reset tampilan zum',
'key_search' => 'Cari Tabel Laporan',
'key_suspend' => 'Tangguhkan Penjualan saat ini',
'key_suspended' => 'Tampilkan Penjualan yang Ditangguhkan',
'key_system' => 'Pemintas Sistem',
'key_tendered' => 'Edit jumlah yang dibayarkan',
'key_title' => 'Pintasan Papan Ketik Penjualan',
'mc' => '',
'mode' => 'Jenis Transaksi',
'must_enter_numeric' => 'Nilai yang dimasukkan harus berupa angka.',
'must_enter_numeric_giftcard' => 'Nomor Gift Card harus berupa angka.',
'must_enter_reference_code' => 'Nomor referensi/pengambilan harus dimasukkan.',
'negative_discount_invalid' => '',
'negative_price_invalid' => '',
'negative_quantity_invalid' => '',
'negative_total_invalid' => '',
'new_customer' => 'Pelanggan Baru',
'new_item' => 'Barang Baru',
'no_description' => 'Tidak ada deskripsi',
'no_filter' => 'Semua',
'no_items_in_cart' => 'Tidak ada Barang dalam Keranjang Belanja.',
'no_sales_to_display' => 'Tidak ada penjualan yang ditampilkan.',
'none_selected' => 'Anda belum memilih Penjualan untuk dihapus.',
'nontaxed_ind' => ' . ',
'not_authorized' => 'Aksi ini tidak resmi.',
'one_or_multiple' => 'Penjualan',
'payment' => 'Jenis Pembayaran',
'payment_amount' => 'Jumlah',
'payment_not_cover_total' => 'Jumlah pembayaran harus lebih besar atau sama dengan Total.',
'payment_type' => 'Jenis',
'payments' => '',
'payments_total' => 'Total Pembayaran',
'price' => 'Harga',
'print_after_sale' => 'Cetak Faktur setelah penjualan',
'quantity' => 'Jumlah',
'quantity_less_than_reorder_level' => 'Peringatan: Stok Inventori barang ini dibawah level order ulang.',
'quantity_less_than_zero' => 'Peringatan: Stok Inventori tidak cukup. Proses penjualan masih dapat dilanjutkan, tapi periksa Inventori.',
'quantity_of_items' => 'Jumlah dari {0} item',
'quote' => 'Penawaran',
'quote_number' => 'No. Penawaran',
'quote_number_duplicate' => 'No. Penawaran tidak boleh sama.',
'quote_sent' => 'Penawaran dikirim ke',
'quote_unsent' => 'Penawaran gagal dikirim ke',
'receipt' => 'Faktur Penjualan',
'receipt_no_email' => 'Pembeli ini tidak memiliki surel yang valid.',
'receipt_number' => 'POS #',
'receipt_sent' => 'Nota dikirim ke',
'receipt_unsent' => 'Noto gagal dikirim kepada',
'reference_code' => 'Kode Referensi Pembayaran',
'reference_code_invalid_characters' => 'Kode referensi hanya boleh mengandung huruf dan angka.',
'reference_code_length_error' => 'Panjang kode referensi tidak valid.',
'refund' => 'Tipe Pengembalian Dana',
'register' => 'Transaksi Penjualan',
'remove_customer' => 'Hapus Pelanggan',
'remove_discount' => '',
'return' => 'Retur',
'rewards' => 'Poin Penghargaan',
'rewards_balance' => 'Jumlah Poin Penghargaan',
'rewards_package' => 'Hadiah',
'rewards_remaining_balance' => 'Poin hadiah yang tersisa adalah ',
'sale' => 'Penjualan',
'sale_by_invoice' => 'Penjualan berdasarkan Faktur',
'sale_for_customer' => 'Pelanggan:',
'sale_time' => 'Waktu',
'sales_tax' => 'Pajak Penjualan',
'sales_total' => '',
'select_customer' => 'Pilih Pelanggan',
'selected_customer' => 'Pelanggan Terpilih',
'send_invoice' => 'Kirim Faktur',
'send_quote' => 'Kirim Penawaran',
'send_receipt' => 'Kirim Nota',
'send_work_order' => 'Kirim Order Kerja',
'serial' => 'Seri',
'service_charge' => '',
'show_due' => '',
'show_invoice' => 'Tampilkan Faktur',
'show_receipt' => 'Tampilkan Nota',
'start_typing_customer_name' => 'Ketik Nama Pelanggan...',
'start_typing_item_name' => 'Ketik Nama Barang atau Scan Barcode...',
'stock' => 'Stok',
'stock_location' => 'Lokasi Stock',
'sub_total' => 'Sub-total',
'successfully_deleted' => 'Transaksi Penjualan berhasil dihapus',
'successfully_restored' => 'Berhasil dikembalikan',
'successfully_suspended_sale' => 'Penjualan berhasil ditangguhkan.',
'successfully_updated' => 'Penjualan berhasil diperbarui.',
'suspend_sale' => 'Tangguhkan',
'suspended_doc_id' => 'Dokumen',
'suspended_sale_id' => 'ID Penjualan ditangguhkan',
'suspended_sales' => 'Penangguhan',
'table' => 'Meja',
'takings' => 'Daftar Penjualan',
'tax' => 'Pajak',
'tax_id' => 'ID Pajak',
'tax_invoice' => 'Faktur Pajak',
'tax_percent' => 'Pajak %',
'taxed_ind' => 'P',
'total' => 'Total',
'total_tax_exclusive' => 'Tidak termasuk pajak',
'transaction_failed' => 'Transaksi Penjualan gagal.',
'unable_to_add_item' => 'Tidak dapat menambahkan item pada penjualan',
'unsuccessfully_deleted' => 'Transaksi Penjualan gagal dihapus.',
'unsuccessfully_restored' => 'Transaksi Penjualan gagal dikembalikan.',
'unsuccessfully_suspended_sale' => 'Transaksi penjualan gagal ditangguhkan.',
'unsuccessfully_updated' => 'Transaksi Penjualan gagal diperbaharui.',
'unsuspend' => 'Tidak Ditangguhkan',
'unsuspend_and_delete' => 'Batalkan dan hapus penangguhan',
'update' => 'Ubah',
'upi' => 'UPI',
'visa' => '',
'wholesale' => '',
'work_order' => 'Perintah Kerja',
'work_order_number' => 'Nomor Perintah Kerja',
'work_order_number_duplicate' => 'Nomor Perintah Kerja tidak boleh sama.',
'work_order_sent' => 'Perintah Kerja dikirim ke',
'work_order_unsent' => 'Perintah Kerja gagal dikirim ke',
];