Commit Graph

13 Commits

Author SHA1 Message Date
denis_ireri 7fb0fa378a Merge pull request 'Close review gaps: gate fixes, cylinder register, roll tracking, costing, Uganda setup' (#1) from feat/review-backlog-fixes into develop
Reviewed-on: #1
2026-10-10 10:02:46 +00:00
denis_ireri 841df8d49f Document Uganda site setup, open defaults and tests; sort imports
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 10:18:05 +03:00
denis_ireri 49b6510098 Add tests for the release, dispatch, Job Card and estimate gates
test_gates.py patches database reads, so each rule is tested on its own
(11 cases: dispatch by batch, reservation mode, waste capture, quotation
cost build-up, specification lookup through the Production Plan, release
blockers). test_print_cylinder.py uses real records for cylinder readiness
and checks that operators can't call the readiness or disposition endpoints.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 10:17:24 +03:00
denis_ireri fc4632ab4d Add a manual, dry-run-first setup script for the Ugandan company
The live company was created as Kenya/KES. setup_uganda.run creates a UGX
company on the Standard chart with a July-June fiscal year, VAT Output/Input
accounts with 18% sales and purchase templates, stage WIP, Quarantine,
Returns Hold and Rejected warehouses, and sets Manufacturing Settings to
backflush on transferred material with enforced time logs (B1, M7, M8).

It only creates, never deletes, and does nothing without confirm=1. It is
deliberately not an after_migrate hook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 10:11:55 +03:00
denis_ireri b2fd83dc51 Add role profiles for the PRD user roles and lock quality decisions to QA
- Ten "Makap - ..." role profiles map the PRD Section 3 roles (sales,
  prepress, planner, procurement, warehouse, operator, supervisor, QC/QA,
  finance, management) onto standard and Makap roles. Created only if
  missing, so desk edits survive migrate (M6).
- New Machine Operator and Prepress roles. Operators can run Job Cards,
  label rolls and raise in-process inspections, but cannot plan or release.
- Quality eligibility, disposition and concession fields move to permlevel 1:
  only Quality Manager / Concession Authority can set them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 10:11:08 +03:00
denis_ireri c515066403 Add Roll Genealogy and Work Order Cost Variance reports
- Roll Genealogy traces a batch backward (what went into it) or forward
  (where it was used) through submitted Manufacture entries, showing roll
  dimensions and the latest inspection disposition at each step (B3).
- Work Order Cost Variance compares BOM-planned material, operating cost and
  scrap with actual consumption and Job Card time, plus recorded waste kg (M5).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 10:10:21 +03:00
denis_ireri 4304b97e5b Add roll, Job Card and quotation-estimate fields; lay Makap fields out in tabs
- Batch gets roll details (stage, width, length, micron, net/gross kg,
  supplier lot, machine, Work Order) so each roll is a traceable batch (B3).
- Job Card gets operator output and waste capture on its first tab, with a
  derived waste % and a required reason whenever waste is entered.
- Quotation Item can cost a line from an estimating BOM: material grossed up
  for expected waste, BOM operating cost, set-up and cylinder charge, with
  the resulting margin shown against the quoted rate (M4).
- About 120 fields used to stack after amended_from with no sections. They
  now sit in a "Makap" tab per form (a section on child rows) with labelled
  sub-sections, and positions are updated on migrate (m1).
- Tooling Readiness is read-only: it is derived from the cylinder register.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 10:08:43 +03:00
denis_ireri 970f4bdfcf Add a Print Cylinder register for cylinder and plate readiness
Tooling was free text on the specification and a manual select on the Work
Order. The register records each cylinder/plate with its specification,
colour station, dimensions, ownership, location, condition and impressions.
Work Order release now reads it: a job needing print tooling is blocked until
every registered cylinder for its specification is Ready.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 10:05:49 +03:00
denis_ireri 52a0639f84 Close gate bypasses found in the pre-implementation review
- Work Order: copy the Packaging Specification from the Sales Order Item
  (walking back through the Production Plan for sub-assembly orders), and
  re-derive release blockers on submit instead of trusting a stored status.
  Tooling readiness is now derived and enforced (B6/M1/M2).
- Whitelisted operations no longer save with ignore_permissions: callers
  need the right role and write permission on the document (B6).
- Dispatch Gate matches final/outgoing inspections by exact batch and needs
  a batch on every controlled line; Reserved mode needs stock reservation (M3).
- Returns check read a field Delivery Note Item doesn't have.
- Drop the credit-note rule that blocked legitimate partial credits; ERPNext
  already caps cumulative returned qty (m5).
- Billing recompute and Supply Close query only this order's documents (m6).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 10:04:50 +03:00
KabundiNjuki ab599899c0 Child table controllers; module3 hook no longer writes standard DocTypes 2026-10-05 22:43:54 +03:00
KabundiNjuki 72046591a3 Portal, logo, workspace shortcut 2026-10-05 16:04:29 +03:00
KabundiNjuki eafa1242db Implement MAKAP Modules 1-7 backend foundations 2026-09-01 22:29:31 +03:00
KabundiNjuki 55b9e6523d feat: Initialize App 2026-09-01 20:14:22 +03:00