Skip to content

[IP-370]: invoice line numbering#683

Draft
nielsdrost7 wants to merge 9 commits into
InvoicePlane:developfrom
underdogg-forks:codex/invoice-line-numbering-370
Draft

[IP-370]: invoice line numbering#683
nielsdrost7 wants to merge 9 commits into
InvoicePlane:developfrom
underdogg-forks:codex/invoice-line-numbering-370

Conversation

@nielsdrost7

Copy link
Copy Markdown
Collaborator

No description provided.

Ran vendor/bin/pint on develop: import ordering, binary-operator
spacing, and empty-body brace style. Purely cosmetic, no behavior
change.
@InvoicePlane InvoicePlane deleted a comment from coderabbitai Bot Jul 19, 2026
…ed_at

Expense, Payment, Project, and Task all set $timestamps = false and have
no created_at column, but the RecentExpensesWidget/RecentPaymentsWidget/
RecentProjectsWidget/RecentTasksWidget dashboard widgets called ->latest()
with no argument, which defaults to ordering by created_at regardless of
$timestamps. MySQL (CI) raises a hard 1054 Unknown column error; SQLite
silently reinterprets the double-quoted "created_at" identifier as a
string literal when it can't resolve it, so the bug never surfaced in
local sqlite-backed test runs.
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f5568af1-795d-41ef-867d-a438535813bd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Local tests silently diverging from CI's MariaDB (via a documented SQLite
.env.testing fallback) has repeatedly masked real bugs this session —
->latest() defaulting to a nonexistent created_at column, and identifier
quoting differences, both passed locally on SQLite and only failed on CI.

- docker-compose.yml: cli service now injects DB_CONNECTION=mysql/DB_HOST=db
  etc. itself and depends_on db, so `docker compose run --rm cli php artisan
  test` works against real MariaDB with zero per-developer .env.testing edits
- Add docker-resources/mariadb/init/01-create-test-db.sql to provision a
  dedicated invoiceplane_test database alongside the dev one on first boot
- Fix db service: the named `database` volume was declared but never
  mounted, so all local dev/test data was lost on every container recreate
- docker-resources/php-cli/Dockerfile: rebuild on Debian (php:8.4-cli) with
  the minimal proven extension set, matching the ip2-test-php:8.4 image this
  session used successfully throughout — see InvoicePlane#689 for a still-open false-
  failure issue found with a fresh cli image build, flagged in the docs
- Update AGENTS.md/CLAUDE.md/README.md/.github/DOCKER.md/Makefile to point
  at the compose db/cli path instead of the SQLite instructions
- Note throughout: use `php artisan test`, not raw vendor/bin/phpunit — the
  two were observed to behave differently for this app's Livewire form tests
…nvoicePlane#370)

- Add getSetting/getSettingBool/setSetting methods to Company model for per-company settings
- Create CompanySettings page with toggle for show_line_item_position_numbers
- Register CompanySettings in CompanyPanelProvider with navigation item
- Add position number placeholder to InvoiceForm repeater when setting enabled
- Update invoice PDF template to conditionally show position column
- Add translation keys for position numbering feature
- Add PHPUnit tests for CompanySettings page functionality

The position numbers are display-only (no new DB column) and toggle per company.
Complies with German/EU legal requirements for line item reference numbers.
The page's blade view and class were written against an API shape that
doesn't exist in the installed filament/* 5.6.7: <x-filament-forms::form>
and <x-filament-forms::actions> aren't registered components in this
version (the working pattern elsewhere in this codebase is a plain
<form> tag plus <x-filament::actions>), Filament\Support\Enums\MaxWidth
was renamed to Width, and <x-filament-panels::page.simple> requires the
page to extend SimplePage (for hasLogo()) rather than the generic Page
class this page actually extends — switched to the plain
<x-filament-panels::page> wrapper instead. Also added the public $data
property required for getFormStatePath('data') to actually bind state,
without which the settings toggle silently failed to persist.
@nielsdrost7
nielsdrost7 force-pushed the codex/invoice-line-numbering-370 branch from f9dc338 to c570de3 Compare July 24, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant