Repository navigation
Description
Summary
Audit of app/Language/en/Sales.php found ~45 keys with zero references anywhere in the codebase (controllers, views, models, libraries, JS files). These should be removed to reduce translation burden across all locale files.
Verified Unused Keys
Searched via lang('Sales.<key>') pattern across all PHP, JS, and view files.
Definitely unused (no hits anywhere)
| Key | Current value |
|---|---|
cash_1 |
(empty) |
cash_2 |
(empty) |
cash_3 |
(empty) |
cash_4 |
(empty) |
close |
(empty) |
complete |
(empty) |
current_table |
(empty) |
customer_total_spent |
(empty) |
customers_available_points |
"Points Available" |
daily_sales |
(empty) |
date_type |
"Date is a required field." |
delete_entire_sale |
"Delete Entire Sale" |
discard_quote |
(empty) |
discount_short |
"%" |
edit_sale |
"Edit Sale" |
giftcard_filter |
(empty) |
invoice_type_custom_invoice |
"Custom Invoice (custom_invoice.php)" |
invoice_type_custom_tax_invoice |
"Custom Tax Invoice (custom_tax_invoice.php)" |
invoice_type_invoice |
"Invoice (invoice.php)" |
invoice_type_tax_invoice |
"Tax Invoice (tax_invoice.php)" |
invoice_update |
"Recount" |
mc |
(empty) |
no_filter |
"All" |
no_sales_to_display |
"No Sales to display." |
remove_discount |
(empty) |
rewards_balance |
"Reward Points Balance" |
rewards_package |
"Rewards" |
sale_by_invoice |
"Sale by Invoice" |
sale_for_customer |
"Customer:" |
sales_total |
(empty) |
service_charge |
(empty) |
show_due |
(empty) |
visa |
(empty) |
wholesale |
(empty) |
Possibly dynamic — verify before removing
These keys follow a pattern that could be constructed dynamically (e.g. lang('Sales.' . $result ? 'x_sent' : 'x_unsent')). A search for the literal lang('Sales.key_name') form returns no hits, but check for string concatenation or variable key lookups before deleting.
| Key | Current value | Pattern concern |
|---|---|---|
delete_successful |
"Sale delete successful." | success/fail pair |
delete_unsuccessful |
"Sale delete failed." | success/fail pair |
invoice_sent |
"Invoice sent to" | sent/unsent pair |
invoice_unsent |
"Invoice failed to be sent to" | sent/unsent pair |
quote_sent |
"Quote sent to" | sent/unsent pair |
quote_unsent |
"Quote failed to be sent to" | sent/unsent pair |
work_order_sent |
"Work Order sent to" | sent/unsent pair |
work_order_unsent |
"Work Order failed to be sent to" | sent/unsent pair |
payment_not_cover_total |
"Payment Amount must be greater than or equal to Total." | may be in JS |
Note:
receipt_sent/receipt_unsentARE used —Sales.php:1007uses a ternarylang($result ? 'Sales.receipt_sent' : 'Sales.receipt_unsent'). The invoice/quote/work_order equivalents show no such pattern currently but may have existed or be planned.
Scope
Each removed key must also be removed from all locale files under app/Language/*/Sales.php (30+ locales). Recommend a script or find-replace pass rather than manual edits.
Verification Method
# Check for any usage of a key before removing:
grep -r "Sales\.key_name" app/ public/False Positives (confirmed used — do NOT remove)
These appeared unused in initial scan but are referenced:
taxed_ind/nontaxed_ind→app/Libraries/Tax_lib.php:158-160quantity_less_than_reorder_level/quantity_less_than_zero→app/Libraries/Sale_lib.php:1204-1206item_out_of_stock/item_insufficient_of_stock→app/Libraries/Sale_lib.phpgroup_by_type/group_by_category→app/Libraries/Sale_lib.php:74-75show_invoice/show_receipt→app/Helpers/tabular_helper.php:122,129account_number/wallet/upi→app/Helpers/locale_helper.php,app/Controllers/Sales.phpinvoice_total→app/Views/sales/quote.php,app/Views/sales/invoice.phpreceipt_sent/receipt_unsent→app/Controllers/Sales.php:1007
Activity
objecttothis commentedon Jun 29, 2026
Similar audits of the other language files should be done and these should be removed from other languages as well.
objecttothis commentedon Jul 2, 2026
TODO: Sync
selected_customerkey across locale Sales.php filesFollow-up from a CodeRabbit review comment on
#4587(requested by@objecttothis), flagged as out of scope for that PR.Context
The
selected_customertranslation key exists inapp/Language/en/Sales.php(and possibly a couple of other locales) but is missing from mostapp/Language/*/Sales.phpfiles. Locales without this key will silently fall back to the default English string instead of showing a translated label.Required change
selected_customerkey to allapp/Language/*/Sales.phpfiles that are currently missing it, using locale-appropriate wording consistent with neighboring customer-related keys (e.g.,selected_customer,select_customer).Links
Acceptance criteria
selected_customerkey present with a translated (or intentionally empty, per project convention) value in everyapp/Language/*/Sales.phpfile.objecttothis commentedon Oct 22, 2026
Claude Issue Checker Agent (cc @objecttothis)
Investigated against current
master.Status: Still present (cleanup not merged).
app/Language/en/Sales.phpstill contains essentially all of the keys flagged as unused in this issue, e.g.cash_1/cash_2/cash_3/cash_4,close,complete,current_table,customer_total_spent,customers_available_points,daily_sales,date_type,delete_entire_sale,discard_quote,discount_short,edit_sale,giftcard_filter,invoice_type_custom_invoice,invoice_type_custom_tax_invoice,invoice_type_invoice,invoice_type_tax_invoice,invoice_update,mc,no_filter,no_sales_to_display,remove_discount,rewards_balance,rewards_package,sale_by_invoice,sale_for_customer,sales_total,service_charge,show_due,visa,wholesale— all still defined verbatim in the file.This lines up with the issue's linked PR #4637 "chore: remove unused Sales language keys" still being open/unmerged as of this check.
Merge branch 'master' into fix-4586-unused-sales-lang-keys
chore(i18n): remove unused Sales language keys (opensourcepos#4637)