397 Commits
Author SHA1 Message Date
jekkos 8a8736ad0d fix(i18n): migrate powered_by to named placeholders across all locales (#4661, #4727)
Replace hardcoded string concatenation of the app name and version in the
document <title> with named-placeholder interpolation, consistent with the
existing Common.migration_needed pattern.

- header.php passes ['OSPOS', application_version] as the lang() array
  argument instead of concatenating values around the translation
- All 46 Common.php locale files convert powered_by to a named-placeholder
  template, preserving current rendered output while allowing each locale
  to reorder the app name and version as needed
- hy, ml, nb, and ur leave powered_by empty so MY_Language::getLine()
  falls back to English rather than rendering bare placeholder strings
- de-CH powered_by translated to German
- Codify named-placeholder + ICU MessageFormat as the localization standard
  in the agents documentation
2026-10-28 14:10:27 +04:00
richardmillesandobjecttothis b07f5e3ebb chore(i18n): remove unused Sales language keys (#4637)
Drop verified-unused keys from Sales.php across all locales to reduce
translation burden. Retained:
- invoice_type_* keys (referenced by Sale_lib)
- rewards_package key (built dynamically by register.php)

Fixes #4586

Co-authored-by: objecttothis <17935339+objecttothis@users.noreply.github.com>
2026-10-27 15:24:21 +04:00
objecttothisandClaude Sonnet 4.6 74e825ba6f feat(stock-locations): add default location and sort order support (#4643)
Refactor Stock_location model to camelCase naming and introduce
is_default and sort_order fields with full migration, UI, and
item-sync support. Multiple follow-up fixes consolidated.

Database
- Add is_default (TINYINT, backfilled to oldest non-deleted row) and
  sort_order (nullable unsigned TINYINT unique, dense 0..N-1) columns
  via new migration; MySQL 5.7-compatible backfill using user variables
  instead of ROW_NUMBER(); down() drops both columns

Model
- Rename show_locations → showLocations (camelCase convention)
- Add getDefaultLocationId(), setDefaultLocation(), saveSortOrder();
  validate location existence before setting as default
- delete() compacts sort_order via two-pass CASE update to avoid
  collisions after prior reorders
- Atomic sort_order assignment via explicit SQL COUNT query

Controller / Config
- Modularize save logic into sanitizeSubmittedLocations(),
  deleteRemovedLocations(), saveSubmittedLocations(),
  saveLocationOrderAndDefault(); wrap in single transaction
- Support stock_location_new inputs for new-row creation
- Resolve new-* ID placeholders to real IDs post-save
- Abort loop on save failure; default missing POST arrays to []
- Validate that at least one location array is non-empty

Views
- Add Default column with center-aligned radio buttons; disable for
  unsaved rows; use attr() instead of data() for location IDs
- Escape dynamic location IDs against XSS in all affected partials
- form_count_details.php: fall back to default location when current
  is undefined; guard quantity input similarly
- Add aria-label to default radio inputs

Libraries / Items
- Widen Item_lib::get_item_location() and get_stock_destination() to
  nullable return types
- Guard null location_id in Items::getRow() and getGenerateBarcodes()
- Item::get_multiple_info(): accept ?int $location_id; short-circuit
  with where('item_id', -1) instead of always-false where('1','0')

i18n
- Add stock_location_default, stock_location_default_header,
  stock_location_name_header across all locale files

Tests
- Stock_locationTest: getDefaultLocationId, setDefaultLocation,
  saveSortOrder, delete compaction, saveValue; rename to
  testMethod_Scenario convention
- Add ConfigControllerTest / StockLocationsControllerTest with
  AdminAuthTrait covering CRUD, reorder, default assignment, and
  malformed/empty/blank payload validation
- DatabaseBootstrapTrait-based setup for ItemTest and Stock_locationTest

Signed-off-by: objecttothis <17935339+objecttothis@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-10-27 14:36:34 +04:00
khao_lek 1f5c8de4a8 Translated using Weblate (Thai)
Currently translated at 100.0% (238 of 238 strings)

Translation: opensourcepos/sales
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/sales/th/
2026-10-25 21:33:52 +01:00
khao_lek e2203e1580 Translated using Weblate (Thai)
Currently translated at 100.0% (80 of 80 strings)

Translation: opensourcepos/taxes
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/taxes/th/
2026-10-25 21:33:51 +01:00
khao_lek fe97de45a6 Translated using Weblate (Thai)
Currently translated at 100.0% (10 of 10 strings)

Translation: opensourcepos/error
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/error/th/
2026-10-25 21:33:51 +01:00
khao_lek 0a1cf0c3fb Translated using Weblate (Thai)
Currently translated at 100.0% (147 of 147 strings)

Translation: opensourcepos/reports
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/reports/th/
2026-10-25 21:33:51 +01:00
khao_lek d4b96f5928 Translated using Weblate (Thai)
Currently translated at 100.0% (32 of 32 strings)

Translation: opensourcepos/attributes
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/attributes/th/
2026-10-25 14:17:45 +01:00
khao_lek 84be6a3369 Translated using Weblate (Thai)
Currently translated at 100.0% (53 of 53 strings)

Translation: opensourcepos/customers
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/customers/th/
2026-10-25 14:17:45 +01:00
khao_lek 4be632dac6 Translated using Weblate (Thai)
Currently translated at 100.0% (341 of 341 strings)

Translation: opensourcepos/config
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/config/th/
2026-10-25 14:17:44 +01:00
khao_lek 1b988b0346 Translated using Weblate (Thai)
Currently translated at 99.3% (146 of 147 strings)

Translation: opensourcepos/reports
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/reports/th/
2026-10-25 14:17:43 +01:00
khao_lek 91e49cf049 Translated using Weblate (Thai)
Currently translated at 80.0% (8 of 10 strings)

Translation: opensourcepos/error
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/error/th/
2026-10-25 14:17:43 +01:00
khao_lek b063373d23 Translated using Weblate (Thai)
Currently translated at 96.6% (230 of 238 strings)

Translation: opensourcepos/sales
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/sales/th/
2026-10-25 14:17:42 +01:00
khao_lek 28d99c18cd Translated using Weblate (Thai)
Currently translated at 100.0% (121 of 121 strings)

Translation: opensourcepos/items
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/items/th/
2026-10-25 14:17:42 +01:00
khao_lek 8de93daf2e Translated using Weblate (Thai)
Currently translated at 100.0% (27 of 27 strings)

Translation: opensourcepos/login
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/login/th/
2026-10-25 14:17:41 +01:00
JisooMx 82468e6665 Translated using Weblate (Spanish (Mexico))
Currently translated at 77.9% (53 of 68 strings)

Translation: opensourcepos/giftcards
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/giftcards/es_MX/
2026-10-25 02:33:44 +01:00
JisooMx 317d1431e5 Translated using Weblate (Spanish (Mexico))
Currently translated at 99.7% (340 of 341 strings)

Translation: opensourcepos/config
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/config/es_MX/
2026-10-25 02:33:44 +01:00
JisooMx 08ecb15f0f Translated using Weblate (Spanish)
Currently translated at 100.0% (27 of 27 strings)

Translation: opensourcepos/login
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/login/es/
2026-10-25 02:33:44 +01:00
JisooMx b3a95840c3 Translated using Weblate (Spanish (Mexico))
Currently translated at 90.3% (215 of 238 strings)

Translation: opensourcepos/sales
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/sales/es_MX/
2026-10-25 02:33:43 +01:00
JisooMx d71e7df04e Translated using Weblate (Spanish (Mexico))
Currently translated at 99.3% (146 of 147 strings)

Translation: opensourcepos/reports
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/reports/es_MX/
2026-10-25 00:41:50 +02:00
JisooMx ee68bbe315 Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (121 of 121 strings)

Translation: opensourcepos/items
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/items/es_MX/
2026-10-25 00:41:50 +02:00
JisooMx b723130f52 Translated using Weblate (Spanish (Mexico))
Currently translated at 99.7% (340 of 341 strings)

Translation: opensourcepos/config
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/config/es_MX/
2026-10-25 00:41:50 +02:00
JisooMx cdcf6a988b Translated using Weblate (Spanish (Mexico))
Currently translated at 90.3% (215 of 238 strings)

Translation: opensourcepos/sales
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/sales/es_MX/
2026-10-25 00:41:50 +02:00
JisooMx 11678447b8 Translated using Weblate (Spanish (Mexico))
Currently translated at 98.1% (52 of 53 strings)

Translation: opensourcepos/customers
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/customers/es_MX/
2026-10-25 00:41:50 +02:00
JisooMx 8056580e55 Translated using Weblate (Spanish (Mexico))
Currently translated at 77.9% (53 of 68 strings)

Translation: opensourcepos/giftcards
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/giftcards/es_MX/
2026-10-25 00:41:50 +02:00
JisooMx c136832174 Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (21 of 21 strings)

Translation: opensourcepos/suppliers
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/suppliers/es_MX/
2026-10-25 00:41:50 +02:00
JisooMx 9cd4f84689 Translated using Weblate (Spanish (Mexico))
Currently translated at 99.3% (146 of 147 strings)

Translation: opensourcepos/reports
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/reports/es_MX/
2026-10-24 22:08:45 +02:00
JisooMx 55d0534bf8 Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (80 of 80 strings)

Translation: opensourcepos/taxes
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/taxes/es_MX/
2026-10-24 22:08:44 +02:00
JisooMx 2ad1c7033a Translated using Weblate (Spanish (Mexico))
Currently translated at 98.1% (52 of 53 strings)

Translation: opensourcepos/customers
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/customers/es_MX/
2026-10-24 22:08:44 +02:00
JisooMx 7ec6ad5554 Translated using Weblate (Spanish (Mexico))
Currently translated at 77.9% (53 of 68 strings)

Translation: opensourcepos/giftcards
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/giftcards/es_MX/
2026-10-24 22:08:44 +02:00
JisooMx 1f58afae90 Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (46 of 46 strings)

Translation: opensourcepos/cashups
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/cashups/es_MX/
2026-10-24 22:08:44 +02:00
JisooMx 09e36ee77d Translated using Weblate (Spanish (Mexico))
Currently translated at 96.1% (328 of 341 strings)

Translation: opensourcepos/config
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/config/es_MX/
2026-10-24 22:08:43 +02:00
JoseLuisKukMagana f12cb3b498 Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (121 of 121 strings)

Translation: opensourcepos/items
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/items/es_MX/
2026-10-24 22:08:43 +02:00
JisooMx a614d8ad57 Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (121 of 121 strings)

Translation: opensourcepos/items
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/items/es_MX/
2026-10-24 22:08:43 +02:00
Ezequiel Gonzalez L 0b3c781f90 Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (121 of 121 strings)

Translation: opensourcepos/items
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/items/es_MX/
2026-10-24 22:08:42 +02:00
JoseLuisKukMagana 2debbf84f1 Translated using Weblate (Spanish (Mexico))
Currently translated at 65.2% (79 of 121 strings)

Translation: opensourcepos/items
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/items/es_MX/
2026-10-24 21:36:23 +02:00
JisooMx 8e8d07534e Translated using Weblate (Spanish (Mexico))
Currently translated at 65.2% (79 of 121 strings)

Translation: opensourcepos/items
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/items/es_MX/
2026-10-24 21:36:23 +02:00
JisooMx ee31ad534d Translated using Weblate (Spanish (Mexico))
Currently translated at 98.1% (52 of 53 strings)

Translation: opensourcepos/customers
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/customers/es_MX/
2026-10-24 21:35:47 +02:00
JisooMx c20dd53e32 Translated using Weblate (Spanish (Mexico))
Currently translated at 69.1% (47 of 68 strings)

Translation: opensourcepos/giftcards
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/giftcards/es_MX/
2026-10-24 21:35:47 +02:00
JoseLuisKukMagana 50c1f7ce06 Translated using Weblate (Spanish (Mexico))
Currently translated at 64.4% (78 of 121 strings)

Translation: opensourcepos/items
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/items/es_MX/
2026-10-24 21:35:47 +02:00
JisooMx 1f10c1b694 Translated using Weblate (Spanish (Mexico))
Currently translated at 64.4% (78 of 121 strings)

Translation: opensourcepos/items
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/items/es_MX/
2026-10-24 21:35:47 +02:00
JisooMx 2b9fceab94 Translated using Weblate (Spanish (Mexico))
Currently translated at 100.0% (27 of 27 strings)

Translation: opensourcepos/login
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/login/es_MX/
2026-10-24 21:35:46 +02:00
JisooMx 06c77868fc Translated using Weblate (Spanish (Mexico))
Currently translated at 98.7% (79 of 80 strings)

Translation: opensourcepos/taxes
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/taxes/es_MX/
2026-10-24 21:26:36 +02:00
objecttothis f3e5690700 fix(i18n): align AZ, RU, and EN language files with project conventions (#4658)
- Standardized quote style (single quotes) and formatting across AZ and RU files
- Aligned keys/values with EN reference across all modules (attributes, calendar,
  cashups, common, employees, enum, error, expenses, items, reports, suppliers)
- Corrected translation errors and inaccuracies in AZ and RU strings
- Fixed misplaced and duplicate keys (definition_invalid_group, toggle_cost_and_profit)
- Clarified cost/wholesale distinction in Reports.php (EN + AZ)
- Refined phrasing for required-field messages, serialized-item toggles, and
  print_delay_autoreturn in RU
- Added missing shortcuts-related keys to RU Config.php
- Removed trailing period from definition_successful_adding (EN)
2026-10-23 17:22:38 +04:00
objecttothis b7a3fee22a style(lang): add Georgian, normalize quote style across all locales, add parse tests (#4762)
- Normalize all language files to single quotes with aligned => operators;
  no translation text or logic changes
- Add Georgian (ka) scaffolding across ~18 modules with placeholder
  translations, matching project style conventions
- Add LanguageFilesTest to validate every PHP file under app/Language
  parses without syntax errors; new files auto-discovered via glob
2026-10-19 15:21:04 +04:00
BudsieBuds f750dc9484 feat(config): scope config assets and add system info copy notifications (#4753)
- Scope clipboard.js and bootstrap-tagsinput to configs/manage.php instead of global bundles
- Remove obsolete public/js/clipboard.min.js vendor asset and manual view script inclusion
- Add toast notifications ($.notify) and localized strings for copying system info
- Add localization keys to all Config language files
2026-10-14 22:23:47 +02:00
jekkosandobjecttothis 625bb3536a fix(taxes): reject negative tax rates and percentages (#4730)
* fix(taxes): reject negative tax rates and percentages

Reject negative tax values across all tax entry points so they can
never be persisted and produce inverted sales totals:

- Items::postSave / postBulkUpdate: validate tax_percents.* as
  nonNegativeDecimal (was unvalidated, persisted raw).
- Items::save_tax_data (CSV import): fail the row on a negative
  Tax N Percent instead of silently dropping the tax.
- Taxes::postSave: reject negative tax_rate before saving.
- Config::postSaveTax: reject negative default tax rates.

Adds non-negative regression tests for Items, Taxes and Config, plus
boundary tests proving a zero tax rate/percent is still accepted. New
language strings for the rejection messages.

* test: adopt test{Method}_{Purpose} naming convention for new tests

Align the negative-tax test method names with the convention established
in ConfigTest (testPostSave_RejectsNegativeTaxPercent, etc.), per review.

* fix(config): add language entries to all locales, extract TaxFixtureTrait

* fix(i18n): place tax_rate_non_negative in alphabetical order

Move the new tax_rate_non_negative entry to its correct alphabetical
position (after tax_rate_error_adding_updating) in all locale files.

---------

Co-authored-by: objecttothis <17935339+objecttothis@users.noreply.github.com>
2026-10-09 08:58:00 +02:00
enricodelarosa 73708ee4f7 feat(reports): add detailed item sales report (#4538)
Add a new detailed item sales report that shows all items sold per row
in an exportable format, including sale transaction information. The
existing detailed transaction sales report lacked per-item row display
and export support, and the items summary report did not classify by
sale.

- Wire sale and discount filters for the report
- Validate detailed item sales route filters
- Add English fallback translations for other languages
- Use blank quotes for other language translations
- Normalize language key placement
- Use PSR-style names throughout the report
2026-10-09 02:46:04 +04:00
2929945d0b fix(i18n): add missing toggle_cost_and_profit key to 32 locales (#4712)
* fix(i18n): add missing toggle_cost_and_profit key to 32 locales
* fix(i18n): put toggle_cost_and_profit in alphabetical order
---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Rayan Abdul Cader <minutechreview@users.noreply.github.com>
2026-10-05 10:13:55 +04:00
objecttothisandOllama 1b8ee2e3c1 feat(items): optimize search, attribute filtering, and sort for items view (#4652)
feat(items): optimize search, attribute filtering, and sort for items view (#4652)

BREAKING CHANGE: none

## Search & Query Optimization
- Split item search into two-phase query: Phase A resolves qualifying IDs,
  Phase B joins scoped display tables for better performance and readability
- Sanitize `definition_ids` via `array_map` to prevent injection vulnerabilities
- Introduce subquery for SUM aggregation to prevent over-counting across joins
- Add validation requiring both start and end dates before applying date range filter

## Attribute Search (fixes #2919, #2722)
- Add `SHOW_IN_SEARCH` flag (value 8) to Attribute model to separate
  searchability from table visibility
- Add `parse_attribute_search()` to parse syntax like `color:blue AND size:large`
- Add `applyNamedAttributeSearch()` supporting decimal and date types with
  locale-aware parsing
- Support AND/OR logic for multi-attribute queries

## Sorting
- Add `get_attribute_sort_definition_id()` to detect attribute column sorting
- Join attribute tables dynamically when sorting by attribute columns
- Use `MAX()` for consistent results when sorting by attribute values
- Replace static sort column list with dynamic headers via `itemSortColumns()`
- Add `sanitizeSortColumnAttribute()` to validate attribute definition IDs as sort columns

## Tax & Data Row
- Streamline tax computation in `getItemDataRow()`

## Low Inventory Filter
- Require valid `stock_location_id` before applying low inventory filter
- Add conditional logic to sort by sum of quantities across all locations
  when `stock_location_id` is invalid

## Localization
- Add `show_in_search` / `show_in_search_visibility` strings to all language files
- Translated: de-DE, es-ES, fr, it; English placeholder for remaining locales
- Unify single-quote style across all attribute language files

## Refactoring & Style
- Adopt camelCase naming throughout (variables, helpers, methods)
- Replace `sanitizeSortColumnAttribute` with reusable `sanitizeSortColumn`
  from `Secure_Controller`
- Simplify column key extraction using `array_key_first`
- Apply PSR-12 formatting

## Tests
- Add tests for tax computation, quantity aggregation (single- and multi-location),
  named attribute search, free-text parsing, and date/decimal type handling
- Add `ensureStockLocation` helper to auto-create missing stock locations in tests
- Refactor tests to handle config cache issues

Co-authored-by: Ollama <ollama@steganos.dev>
2026-10-02 14:56:20 +04:00