Commit Graph

6635 Commits

Author SHA1 Message Date
Ollama
cef103445e refactor: optimize Docker image size
- Combine RUN commands to reduce layers
- Add --no-install-recommends and clean apt cache
- Use COPY --chown to set ownership during copy
- Update .dockerignore to exclude dev files and build configs

Saves ~260MB (21%) in image size
2026-04-01 16:46:03 +00:00
Ollama
68e9a56632 refactor: remove build-database gulp task (#4447)
The build-database task previously concatenated tables.sql and constraints.sql
into database.sql. Since we now use initial_schema.sql directly in migrations,
this task is no longer needed.

- Remove gulp task 'build-database'
- Keep all other build tasks intact
2026-04-01 16:46:03 +00:00
Ollama
ba05536317 refactor: remove tables.sql and constraints.sql (#4447)
These files have been replaced by initial_schema.sql which is now the
authoritative source for the database schema. The initial migration
loads this schema on fresh installs.

- Remove app/Database/tables.sql
- Remove app/Database/constraints.sql
- Schema is frozen in app/Database/Migrations/sqlscripts/initial_schema.sql
2026-04-01 16:46:03 +00:00
Ollama
f74f286a51 feat: migrate CI from Travis to GitHub Actions with enhancements
- Convert Travis CI configuration to GitHub Actions workflows
- Add multi-arch Docker builds (amd64/arm64)
- Implement initial schema migration for fresh database installs
- Add multi-attribute search with AND logic and sort by attribute columns
- Address various PR review feedback and formatting fixes
2026-04-01 16:46:03 +00:00
Ollama
7180ec33e8 Add Calendar.php translations for missing languages
- es-MX: Spanish (Mexico) calendar translations
- nb: Norwegian Bokmål calendar translations
- he: Hebrew calendar translations
- ml: Malayalam calendar translations
- tl: Tagalog calendar translations
- ar-EG: Arabic (Egypt) calendar translations
- ka, lo, ur: Empty placeholders (cannot translate these languages)
2026-04-01 13:01:54 +00:00
Ollama
496c8a8262 Remove English fallbacks from non-English translations
Use empty strings for sale_not_found in Khmer, Malayalam, and Urdu
as these languages cannot be translated by this model.
2026-04-01 13:01:54 +00:00
Ollama
493d9cc9c1 Fix translation issues from code review
- Use 'Bénéfice' in French Reports.php for consistency with 'profit' key
- Fix Italian grammar: 'Il numero di telefono è richiesto'
- Use 'Responsabile' for 'manager' in Italian Common.php
- Add 'sale_not_found' translation key to missing languages (km, ml, ta, ur)
- Tamil (ta) gets proper translation, others get English fallback
2026-04-01 13:01:54 +00:00
Ollama
f761e1464f Translate missing strings in multiple languages
- Add Calendar.php translation file for es-ES, nl-NL, de-DE
- Fill empty string translations in Common.php for de-DE, nl-NL, fr, it, pt-BR
- Translate UBL invoice strings (ubl_invoice, download_ubl, ubl_generation_failed) in Sales.php
- Add toggle_cost_and_profit in Reports.php for all languages
- Translate error_deleting_admin and error_updating_admin in Employees.php
- Translate csv_import_invalid_location error message in Items.php
- Update various missing translations for administrator, clerk, manager, dashboard, etc.

Languages updated: Spanish (es-ES), Dutch (nl-NL), German (de-DE), French (fr), Italian (it), Portuguese (pt-BR)
2026-04-01 13:01:54 +00:00
Ollama
a5bbb2bcc5 fix: Remove redundant clear_mode() calls
clear_all() already calls clear_mode() internally, so the separate
clear_mode() calls were redundant.
2026-04-01 07:24:23 +00:00
Ollama
92ec321d08 fix: Clear sale session after completing sale
The clear_all() calls in postComplete() were placed after return
statements, making them unreachable dead code. This caused the
completed sale to remain in the session and appear in the Register
when navigating back.

The fix moves clear_all() and clear_mode() calls before the return
statements so they are actually executed, properly clearing the sale
cart, customer, and payments from the session after sale completion.

This fixes the regression reported by @odiea where users had to
manually cancel sales after each transaction.
2026-04-01 07:24:23 +00:00
dependabot[bot]
e046e74c79 Bump picomatch from 2.3.1 to 2.3.2 (#4451)
Bumps [picomatch](https://github.com/micromatch/picomatch) from 2.3.1 to 2.3.2.
- [Release notes](https://github.com/micromatch/picomatch/releases)
- [Changelog](https://github.com/micromatch/picomatch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/picomatch/compare/2.3.1...2.3.2)

---
updated-dependencies:
- dependency-name: picomatch
  dependency-version: 2.3.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: objecttothis <17935339+objecttothis@users.noreply.github.com>
2026-03-30 12:38:07 +04:00
khao_lek
e0cd0f6129 Translated using Weblate (Thai)
Currently translated at 100.0% (146 of 146 strings)

Translation: opensourcepos/reports
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/reports/th/
2026-03-29 11:10:04 +02:00
khao_lek
3b102adf3f Translated using Weblate (Thai)
Currently translated at 100.0% (47 of 47 strings)

Translation: opensourcepos/expenses
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/expenses/th/
2026-03-29 11:10:03 +02:00
khao_lek
260358d611 Translated using Weblate (Thai)
Currently translated at 100.0% (146 of 146 strings)

Translation: opensourcepos/reports
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/reports/th/
2026-03-28 06:04:39 +01:00
khao_lek
e615200466 Translated using Weblate (Thai)
Currently translated at 100.0% (68 of 68 strings)

Translation: opensourcepos/giftcards
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/giftcards/th/
2026-03-28 06:04:39 +01:00
khao_lek
56cead478a Translated using Weblate (Thai)
Currently translated at 100.0% (118 of 118 strings)

Translation: opensourcepos/items
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/items/th/
2026-03-28 06:04:39 +01:00
khao_lek
7030f6bac3 Translated using Weblate (Thai)
Currently translated at 100.0% (43 of 43 strings)

Translation: opensourcepos/employees
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/employees/th/
2026-03-28 06:04:38 +01:00
yakub3k
299f62669a Translated using Weblate (Polish)
Currently translated at 13.6% (20 of 146 strings)

Translation: opensourcepos/reports
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/reports/pl/
2026-03-27 14:29:27 +01:00
yakub3k
072865620a Translated using Weblate (Polish)
Currently translated at 100.0% (19 of 19 strings)

Translation: opensourcepos/expenses_categories
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/expenses_categories/pl/
2026-03-27 14:29:27 +01:00
yakub3k
3bbd4c4c95 Translated using Weblate (Polish)
Currently translated at 29.4% (20 of 68 strings)

Translation: opensourcepos/giftcards
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/giftcards/pl/
2026-03-27 14:29:27 +01:00
yakub3k
0253bf85b8 Translated using Weblate (Polish)
Currently translated at 13.5% (16 of 118 strings)

Translation: opensourcepos/items
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/items/pl/
2026-03-27 14:29:26 +01:00
yakub3k
92c1be8bb1 Translated using Weblate (Polish)
Currently translated at 26.0% (12 of 46 strings)

Translation: opensourcepos/cashups
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/cashups/pl/
2026-03-27 14:29:26 +01:00
yakub3k
23829eab35 Translated using Weblate (Polish)
Currently translated at 12.7% (6 of 47 strings)

Translation: opensourcepos/expenses
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/expenses/pl/
2026-03-27 14:29:25 +01:00
yakub3k
c81c6506cb Translated using Weblate (Polish)
Currently translated at 17.1% (38 of 222 strings)

Translation: opensourcepos/sales
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/sales/pl/
2026-03-27 14:29:25 +01:00
yakub3k
840d9ccc81 Translated using Weblate (Polish)
Currently translated at 9.5% (2 of 21 strings)

Translation: opensourcepos/suppliers
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/suppliers/pl/
2026-03-27 14:29:25 +01:00
yakub3k
e763ee2acc Translated using Weblate (Polish)
Currently translated at 14.6% (48 of 327 strings)

Translation: opensourcepos/config
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/config/pl/
2026-03-27 14:29:25 +01:00
yakub3k
8ef109efbc Translated using Weblate (Polish)
Currently translated at 12.3% (18 of 146 strings)

Translation: opensourcepos/reports
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/reports/pl/
2026-03-27 13:05:14 +01:00
yakub3k
9a544096c2 Translated using Weblate (Polish)
Currently translated at 94.7% (18 of 19 strings)

Translation: opensourcepos/expenses_categories
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/expenses_categories/pl/
2026-03-27 13:05:08 +01:00
yakub3k
3e4ac0b24d Translated using Weblate (Polish)
Currently translated at 4.4% (3 of 68 strings)

Translation: opensourcepos/giftcards
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/giftcards/pl/
2026-03-27 13:05:01 +01:00
yakub3k
3c9c592ca3 Translated using Weblate (Polish)
Currently translated at 13.1% (5 of 38 strings)

Translation: opensourcepos/item_kits
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/item_kits/pl/
2026-03-27 13:04:56 +01:00
yakub3k
a4d8bedbf3 Translated using Weblate (Polish)
Currently translated at 7.6% (9 of 118 strings)

Translation: opensourcepos/items
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/items/pl/
2026-03-27 13:04:53 +01:00
yakub3k
c4304fd0a9 Translated using Weblate (Polish)
Currently translated at 16.2% (36 of 222 strings)

Translation: opensourcepos/sales
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/sales/pl/
2026-03-27 13:04:48 +01:00
yakub3k
44fe2c087a Translated using Weblate (Polish)
Currently translated at 7.5% (4 of 53 strings)

Translation: opensourcepos/customers
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/customers/pl/
2026-03-27 13:04:42 +01:00
yakub3k
985c1c55ce Translated using Weblate (Polish)
Currently translated at 21.0% (4 of 19 strings)

Translation: opensourcepos/expenses_categories
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/expenses_categories/pl/
2026-03-27 12:48:01 +01:00
yakub3k
8029e5538f Translated using Weblate (Polish)
Currently translated at 15.7% (3 of 19 strings)

Translation: opensourcepos/expenses_categories
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/expenses_categories/pl/
2026-03-27 12:46:33 +01:00
yakub3k
1a7683a8ac Translated using Weblate (Polish)
Currently translated at 10.6% (5 of 47 strings)

Translation: opensourcepos/expenses
Translate-URL: https://translate.opensourcepos.org/projects/opensourcepos/expenses/pl/
2026-03-27 12:46:33 +01:00
dependabot[bot]
e4b92b58c3 Bump jspdf from 4.2.0 to 4.2.1
Bumps [jspdf](https://github.com/parallax/jsPDF) from 4.2.0 to 4.2.1.
- [Release notes](https://github.com/parallax/jsPDF/releases)
- [Changelog](https://github.com/parallax/jsPDF/blob/master/RELEASE.md)
- [Commits](https://github.com/parallax/jsPDF/compare/v4.2.0...v4.2.1)

---
updated-dependencies:
- dependency-name: jspdf
  dependency-version: 4.2.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-17 19:06:05 +00:00
Ollama
dc1e448bc3 Fix review comments: remove redundant loop and add XSS escaping
- Remove redundant property assignment loop in Expenses.php
- Add esc() to employee name values to prevent XSS vulnerabilities
2026-03-17 15:32:16 +00:00
Ollama
24b2825b31 Fix: Restrict employee selection in expenses and receivings forms
Users without the 'employees' permission can no longer impersonate other
employees when creating or editing expenses and receivings. The employee
field is now restricted to the current user for new records and shows the
stored employee for existing records.

Changes:
- Expenses controller: Add permission check in getView() and postSave()
- Receivings controller: Add permission check in getEdit() and postSave()
- Form views: Conditionally display dropdown or read-only field

Fixes #3616
2026-03-17 15:32:16 +00:00
Ollama
38d672592b Add seed data to tests for proper integration testing
- Add setUp() to seed test data: items, sales, sales_items, sales_items_taxes
- Add tearDown() to clean up seeded data after tests
- Remove skip conditions since we now have guaranteed test data
- Add testTaxDataIsGroupedByTaxNameAndPercent to verify grouping
- Use narrow date range to isolate seeded data
2026-03-16 18:36:31 +00:00
Ollama
6f7e06e986 Rewrite tests to use database integration testing
Tests now:
- Use DatabaseTestTrait for real database integration
- Actually call getData() and getSummaryData() methods
- Verify row totals (subtotal + tax = total) from real queries
- Verify summary data matches sum of rows
- Test getDataColumns() returns expected structure
- Use assertEqualsWithDelta for float comparisons with tolerance

These tests exercise the actual SQL queries and verify the
mathematical consistency of the calculations returned.
2026-03-16 18:36:31 +00:00
Ollama
fda40d9340 Fix rounding consistency and update tests per review feedback
- Ensure total = subtotal + tax by deriving total from rounded components
- Use assertEqualsWithDelta for float comparisons in tests
- Add defensive null coalescing in calculateSummary helper
- Add missing 'count' key to test data rows
- Add testRoundingAtBoundary test case
2026-03-16 18:36:31 +00:00
Ollama
b49186ec7c Add unit tests for Taxes Summary Report calculations
Tests verify:
- Row totals add up (subtotal + tax = total)
- Summary totals match sum of row values
- Tax-included and tax-not-included modes calculate correctly
- Rounding consistency across calculations
- Negative values (returns) are handled correctly
- Zero tax rows are handled correctly
2026-03-16 18:36:31 +00:00
Ollama
8b56f61b8a Fix Taxes Summary Report totals not matching row values
The report had calculation inconsistencies where:
1. Per-line totals (subtotal + tax) didn't equal the total column
2. Column totals didn't match the sum of individual rows

Root cause: subtotal, tax, and total were calculated independently
using different formulas and rounding at different stages, leading to
cumulative rounding errors.

Fix:
- Use item_tax_amount from database as the source of truth for tax
- Derive subtotal from sale_amount (handling both tax_included and
  tax_not_included modes correctly)
- Calculate total = subtotal + tax consistently for each line
- Override getSummaryData() to sum values from getData() rows,
  ensuring summary totals match the sum of displayed rows

Fixes #4112
2026-03-16 18:36:31 +00:00
Ollama
9820beb0e1 Fix: Add Debit Card filter to Daily Sales and Takings
Add 'only_debit' filter to Daily Sales and Takings dropdown. Reuses
existing 'Sales.debit' language string for the filter label. Includes
filter default initialization in getSearch() to prevent PHP warnings.

Fixes #4439
2026-03-16 18:06:00 +00:00
Ollama
e01dad728f Add AGENTS.md with coding guidelines for AI agents 2026-03-16 18:02:50 +00:00
Ollama
234f930079 Fix strftime directives handling and tighten test assertions
- Remove incorrect %C mapping (was mapping century to full year)
- Add special handling for %C (century), %c (datetime), %n (newline), %t (tab), %x (date)
- Add %h mapping (same as %b for abbreviated month)
- Tighten edge-case test assertions to use assertSame/assertMatchesRegularExpression
- Add tests for new directives: %C, %c, %n, %t, %x, %h
2026-03-14 23:08:39 +00:00
Ollama
3001dc0e17 Fix: Pass parameter to generate() and add composite format tests
- Fixed bug where render() was not passing caller-supplied  to
  generate(), causing ad-hoc tokens to be ignored
- Added %F (yyyy-MM-dd) and %D (MM/dd/yy) composite date formats to
  the IntlDateFormatter pattern map
- Added test coverage for composite date format directives (%F, %D, %T, %R)
2026-03-14 23:08:39 +00:00
Ollama
3ba207e8b9 Use CIUnitTestCase for consistency with other tests 2026-03-14 23:08:39 +00:00
Ollama
d684c49ebd Fix Token_lib::render() for PHP 8.4 compatibility
- Replaced deprecated strftime() with IntlDateFormatter
- Added proper handling for edge cases:
  - Strings with '%' not in date format (e.g., 'Discount: 50%')
  - Invalid date formats (e.g., '%-%-%', '%Y-%q-%bad')
  - Very long strings
- Added comprehensive unit tests for Token_lib
- All date format specifiers now mapped to IntlDateFormatter patterns
2026-03-14 23:08:39 +00:00