fix: New PO Project Code Selection #126

Open
shad0w wants to merge 2 commits from claude/issue-124 into master
Owner

Automated fix by Claude Code for #124.

Closes #124

Review, merge, then create a release tag (vX.Y.Z) to deploy.

Automated fix by Claude Code for #124. Closes #124 Review, merge, then create a release tag (vX.Y.Z) to deploy.
shad0w added 1 commit 2026-06-24 08:06:10 +00:00
feat(po): Project Code dropdown on PO forms
All checks were successful
PR checks / checks (pull_request) Successful in 51s
PR checks / integration (pull_request) Successful in 29s
4ed27d668b
Replace the free-text Project Code input with a native <select> carrying a
fixed list of project codes (Petronet LNG Cochin, COMACOE Trombay, Haldia
Reach, Haldia MMT, COMACOE Mandvi) plus an empty "— none —" option, across
all three PO forms (new / edit / manager-edit).

- Add a shared PROJECT_CODES constant in lib/validations/po.ts as the single
  source of truth.
- Add a reusable <ProjectCodeField> (mirrors <DeliveryLocationField>): plain
  HTML select keeping name="projectCode" so the server actions are unchanged.
- The field stays optional; projectCode remains a nullable free-text snapshot
  (no schema/migration, no validation tightening) so legacy/imported values
  are not rejected. On edit, a current value not in the list is preserved as a
  leading "(current)" option so it is never silently dropped.
- Add unit tests for the new field.

Fixes #124

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author
Owner

claude-review: also make report drill down to po via this functionality. drilling down into particular accounting code / cost center will take you to the pr history page with that period and cost center/accounting code applied as filters

claude-review: also make report drill down to po via this functionality. drilling down into particular accounting code / cost center will take you to the pr history page with that period and cost center/accounting code applied as filters
Author
Owner

[Claude review-bot] Addressed the following review comment(s) on claude/issue-124 (1 commit(s) pushed):

  • PR conversation (by shad0w)
[Claude review-bot] Addressed the following review comment(s) on `claude/issue-124` (1 commit(s) pushed): - **PR conversation** (by shad0w) <!-- ppms-review-bot handled: conv:836 -->
shad0w added 1 commit 2026-06-24 10:40:11 +00:00
feat(reports): drill from cost centre / accounting code into PO History (#126)
All checks were successful
PR checks / checks (pull_request) Successful in 49s
PR checks / integration (pull_request) Successful in 32s
fd7b31e64d
Report detail pages now link to the underlying POs, addressing the PR #126
review comment: drilling into a cost centre or accounting code opens PO
History pre-filtered to that dimension and the period in view.

- Cost Centre / Accounting Code detail pages gain a "View POs" link.
- periodRange() maps the on-screen period onto History's approved-date
  window (weekly→month, monthly→FY, yearly→full span); spend is dated by
  approvedAt.
- PO History gains an accountId filter (any tree node, expanded to leaves
  via accountLeafIds()) matching PO-level OR line-item accounts — the same
  basis the reports use.
- History page + CSV/PDF export share one buildPoHistoryWhere() builder so
  they never diverge.
- Tests: unit (periodRange, accountLeafIds) + integration (History account
  filter across PO-level/line-item, with the approved window).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
All checks were successful
PR checks / checks (pull_request) Successful in 49s
PR checks / integration (pull_request) Successful in 32s
This pull request has changes conflicting with the target branch.
  • CHANGELOG.md
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin claude/issue-124:claude/issue-124
git checkout claude/issue-124

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git checkout master
git merge --no-ff claude/issue-124
git checkout claude/issue-124
git rebase master
git checkout master
git merge --ff-only claude/issue-124
git checkout claude/issue-124
git rebase master
git checkout master
git merge --no-ff claude/issue-124
git checkout master
git merge --squash claude/issue-124
git checkout master
git merge --ff-only claude/issue-124
git checkout master
git merge claude/issue-124
git push origin master
Sign in to join this conversation.
No description provided.