RBT Group Enhancements: Summary and Tasks

· VG Support

Summary

RBT wants every uploaded invoice and delivery receipt (DR) reviewed by a person, tagged to a branch, kept for audit, and exported through a simpler Export page. The meeting's notes fall into eight workstreams. Two wait on inputs from RBT: the GL account list and a Dropbox account.

#WorkstreamWhat it deliversStatus
AReview and Document LifecycleReview and approve DRs and invoices; reject, archive, return for re-upload; no deleting what was processed or exportedReady
BBranchesBranch management, users in one or more branches, branch picked on upload, lists scoped by branchReady
CUpload Pages and PermissionsSeparate Invoice Upload and DR Upload pages with their own permissions and upload historyReady
DNew Supplier DetectionSuppliers found on extracted invoices added to the list, with who, which branch and a noteReady
ERaw File Naming and BIR ExportRaw files saved under a document number and date name, and downloadable for BIR auditsReady
FPage EnhancementsInvoices, Export and Generate, Delivery Receipts, and the Settings section renameReady
GGL AccountsGL account dropdown on suppliersOn hold: waiting for RBT's list
HRBT DropboxDropbox account connected for RBTOn hold

All work happens in rbtgroup/veritrust-rbtgroup, on branches cut from origin/main. Anything that isn't RBT-specific should go to upstream veritrust-einvoice first.

Progress

Steps 1 to 4 (Invoices part) are merged on both repos, and every production deploy succeeded on both instances: Settings and Branches (#3, #19), Upload Pages and the Invoices table (#5, #21), and the nginx fix (#4, #20), plus the certbot PR #2. The nginx config still has to be applied by hand on each server. The Delivery Receipts table is built on feat/dr-table and in review as PR #6 on rbtgroup and PR #22 on Veritrust-Global. Last updated 2026-12-02.

StepStatusWhereNotes
1. Settings RenameDone9818a46 and 743bff1 on feat/rbt-enhancementspnpm verify passed; code review clean. Review follow-ups done in 743bff1 (stop notice test, one doc sentence); 630 frontend tests pass
2. Branches (B)Done7265256 to cdf2ccd on feat/rbt-enhancementsBuilt and security reviewed; review fixes done (only Owners grant Manage Branches, replacing a file keeps its branch). Audit Log and the Dashboard's Recent Activity now open only for people who see every branch. Verify passed: 1019 backend, 660 frontend, 169 worker tests. Later: tag audit entries with a branch. Duplicate messages across branches accepted as a design choice
3. Upload Pages and Permissions (C)Donefeat/upload-pages: #5 and #21Built: Invoice Upload and DR Upload pages with upload history, Upload Invoices permission (given to every role that could upload before), who uploaded each invoice now recorded. Verify passed: 1043 backend, 680 frontend, 169 worker tests. Independent security review: no findings. To confirm: Delivery Receipts no longer opens for upload-only users. Decided 2026-12-03: uploaders see each upload's status, with a notice when one failed, and can retry a failed upload. Viewers who can't upload see statuses, failed ones included, only with a new View Upload Status permission (no retry). Built as uploads.view_status (Owner and Administrator by default): retry for failed uploads, failure reason, a failed-uploads notice, 3 retries per file. Drive files retryable too. Migration 0035_grant-uploads-view-status. Merged as PR #14 (rbtgroup) and PR #30 (Veritrust-Global) and deployed on both instances. Decided 2026-12-03: failed Dropbox DR files should show in DR Upload history. Done: every drive DR file (Dropbox or Google Drive, failed and refused ones included) shows there for people who see every branch, with a drive filter. Merged as PR #12 (rbtgroup) and PR #28 (Veritrust-Global) and deployed on both instances
4. Invoices and Delivery Receipts Tables (F)Donefeat/upload-pages: #5 and #21Invoices table built: rename, Dropbox card removed, All and Rejected tabs, server-side search, filters (branch, source, dates, status, detections), sorting and 25-row paging, shared table pattern. Code and security reviews done; their fixes are in. Rejected lists discarded invoices until step 5. Delivery Receipts table built on feat/dr-table (ce7074e to e9c1cf1): For Review and Reviewed tabs in one table, server-side search, filters, sorting and paging, Reading and action columns moved to a details panel and row menu; verify passed (1115 backend, 717 frontend); security review clean, code review fixes in. Merged as PR #6 (rbtgroup) and PR #22 (Veritrust-Global) and deployed on both instances. nginx fix done (logs paths without search text): PR #4 on rbtgroup (stacked on deploy PR #2) and PR #20 on Veritrust-Global; applied and verified on the old shared instance on 2026-12-03. Not applied on the rbtgroup instance: its config serves einvoice.rbtgroup.link directly, and that domain's registration failed in Route 53, so it waits on the domain
5. Review and Lifecycle (A)Donefeat/review-lifecycle (762517f to 1ad371d), migration 0030Built: Reject (with reason), Return for Re-upload (with reason), Archive and Unarchive for rejected items, Approve for receipts, read-only detail and status history for any invoice or receipt, and no deleting anything processed, approved, exported, used or replaced. Verify passed: 1200 backend, 752 frontend. Independent security review: safe to ship; its four low findings fixed, and merged with the raw file export (migrations 0030 and 0031). Merged as PR #8 (rbtgroup) and PR #24 (Veritrust-Global). Deployed on the rbtgroup instance. Deployed on the old shared instance after PR #25 (Veritrust-Global) fixed the unordered audit queries in the drive tests; the same settings test fix went to rbtgroup as PR #9. Not built yet: un-rejecting a receipt
6. New Supplier Detection (D)DoneBuilt (64ab5c8 to 7550a8a, migration 0032). A supplier is new when no supplier has its TIN (or its name, without a TIN). New Supplier warning on Extraction Review and in the Invoices list, worked out on the server too. New Suppliers tab on Suppliers: name, TIN, document count, first and latest document, who uploaded, branch; Add as Supplier, Link to Existing Supplier, Dismiss. Dashboard tile. Confirmed 2026-12-03: suppliers stay shared across branches, so a link or dismissal applies to every branch. Follow-up done: optional Added from Branch on each supplier, with when and by whom (Added From column on Suppliers), defaulted from the document when added from New Suppliers; migration 0034_supplier_origin. Merged as PR #13 (rbtgroup) and PR #29 (Veritrust-Global) and deployed on both instances. Verify passed. Independent security review: safe to ship; two low findings fixed in 2b00a3b. Merged as PR #10 (rbtgroup) and PR #26 (Veritrust-Global). Deployed on both instances
7. Export and Generate Export (F)DoneBuilt (43ac915 to 143f0a8, migration 0033). Exports page: table of generated files with search, branch, type, status and date filters, Ready or Downloaded status, and a download per row. Generate Export page: type (invoices, DRs or both), branch and date range, lists the To Be Exported records it takes, preview, then Export back to Exports; Raw Files is an option there. Old /export redirects. Verify passed. Independent security review: safe to ship; its low finding fixed in f174739. Rebuilt on top of step 6 (migration 0033 after 0032, checked on a fresh database); Generate Export also marks new suppliers. Merged as PR #11 (rbtgroup) and PR #27 (Veritrust-Global) and deployed on both instances. Merged after step 6 so the migrations run in order
8. Raw File Naming and BIR Export (E)Donefeat/raw-file-names (27bf7ec, 18e4619)Built. Stored keys stay random; downloads are named INV_<TIN>_<invoice no>_<date> and DR_<branch>_<DR no>_<date> once reviewed, INV_UNREAD_… before. Raw Files dialog on the export page: a zip plus index.csv by type, branch and date range, for people who can export and see every branch; capped at 2,000 files or 500 MB, 20 a hour, audited. Independent security review: safe to ship; its two low findings fixed in b079eae. Merged as PR #7 (rbtgroup) and PR #23 (Veritrust-Global) and deployed on both instances
9. GL Accounts and RBT Dropbox (G, H)On HoldGL Accounts built (migrations 0036, 0037; manual add, import, Not in GL List flag), merged as PR #18 (rbtgroup) and PR #34 (Veritrust-Global) and deployed on both instances (2026-12-03); upload RBT's chart of accounts on Settings > GL Accounts: RBT's Peachtree chart of accounts received; GL Accounts page under Settings imports it, and suppliers pick their GL account from the list. RBT Dropbox still waiting on RBT. rbtgroup.link domain skipped for now
10. Custom RolesDonefeat/custom-rolesRequested 2026-12-03: admins create, rename and delete their own roles and pick each one's permissions. Owner stays built-in with every permission; Maker, Checker and Administrator stay built-in. No one can grant more than they hold. Merged as PR #17 (rbtgroup) and PR #33 (Veritrust-Global) and deployed on both instances; migration 0038_roles. Change: Administrators can no longer grant permissions they don't hold themselves; only an Owner can
11. Deactivation WarningsDonefeat/deactivation-warningsRequested 2026-12-03. Nothing can be deleted, only deactivated, and neither check had warnings. Adds warnings (not blocks): deactivating a branch shows its active users, who has no other branch, and unfinished items; deactivating a user names branches where they are the last active member. The server requires a confirm when there are warnings. Merged as PR #16 (rbtgroup) and PR #32 (Veritrust-Global) and deployed on both instances. Follow-up fixed: Owners and anyone with Manage Branches are no longer counted as stranded, and the last-member warning says when only they remain. Merged as PR #22 (rbtgroup) and PR #38 (Veritrust-Global) and deployed on both instances
12. Supplier DuplicatesDonefeat/supplier-duplicatesDecided 2026-12-03: check duplicates by name and by name + TIN. Same name and same 9-digit TIN (branch code ignored) = same supplier. Name match alone = Possible Match hint, with Link to Existing preselected. New Supplier rows for one supplier merged. Warning before adding a near-duplicate; Possible Duplicates filter on Suppliers. Suggestions only, no auto-merge. Merged as PR #20 (rbtgroup) and PR #35 (Veritrust-Global) and deployed on both instances; no migration. Checks stay fast with 2,000 suppliers and 10,000 documents (under 150 ms)
13. Dashboard FocusIn Progressfeat/dashboard-focusRequested 2026-12-03: Dashboard cut down to invoices and DRs. Work Queue tiles per type (For Review, Returned, To Be Exported, failed) linking to filtered lists, plus New Suppliers; Invoices and Delivery Receipts sections side by side; Recent Exports. Extraction section and approval-only tiles removed
14. DR File PreviewDonefeat/dr-file-previewRequested 2026-12-03: opening a delivery receipt shows its file (image or PDF) side by side with the details, instead of opening it in a new tab. Stacked on narrow screens; Open in New Tab kept as a fallback. Done: shared file viewer (also used by Extraction Review) with zoom, fit and rotate for images and inline PDFs; no header or nginx change needed. Merged as PR #23 (rbtgroup) and PR #39 (Veritrust-Global) and deployed on both instances. Note: each opening now records File Viewed in the Audit Log

A. Review, Approval and Document Lifecycle

Every uploaded invoice and DR goes through Review, then Approved, and can be rejected, archived or returned for re-upload, but never deleted once processed or exported. Today invoices have review, returned, approved (shown as To Be Exported), exported and discarded. DRs only have For Review and a reviewed stamp.

B. Branches

Branches become a real record: each user belongs to one or more branches, and each upload is tagged with one of them. Nothing in the app knows about branches today.

C. Upload Pages and Permissions

Uploading moves to two pages of its own, Invoice Upload and DR Upload, each with its own permission and an upload history. Today invoices upload from the Inbox card, and DRs from the Delivery Receipts page with delivery_receipts.upload.

D. New Supplier Detection

When an extracted invoice's supplier isn't on the list, the app adds it as Pending, with a note saying who uploaded it and from which branch. Suppliers already have a pending status and match by TIN digits.

E. Raw File Naming and BIR Export

Raw files keep their random storage key, and the readable name is worked out from the document's number and date, for downloads and the BIR export. Today both invoices and DRs are saved as <random uuid>.<ext>. Building the stored key from extracted text would break the rule against storage paths from document data, and the number is only known after extraction.

F. Page Enhancements

Four pages get simpler, filterable tables, and the admin section is renamed. Filtering, sorting and paging should run on the server, so the lists stay fast as uploads grow.

Shared Table Pattern

Invoices (Today: Invoice Inbox)

Export (Today: To Be Exported)

Delivery Receipts

Suppliers

Settings Section

G. GL Accounts (On Hold)

Waiting for RBT's GL account list file. Suppliers already have a free-text gl_account column, so this replaces it with a pick from a managed list.

H. RBT Dropbox (On Hold)

On hold until RBT confirms the account. Uploads from Invoices no longer show the Dropbox card, but drive pickup keeps working from Integration.

Suggested Order of Work

Branches come first, because uploads, lists, exports and supplier notes all need a branch. Each step is its own pull request.

  1. Settings rename (Administration to Settings, Settings to Integration): small, and clears the way for Branch Management

  2. Branches: tables, Branch Management, users in branches, branch on documents and DRs (B)

  3. Upload pages and permissions, with the branch picker and upload history (C)

  4. Shared table pattern, then Invoices and Delivery Receipts on it (F)

  5. Review and lifecycle: one status set, DR approval, reject, archive, return, no delete after processing (A)

  6. New supplier detection (D)

  7. Export and Generate Export (F)

  8. Raw file naming and the BIR raw file export (E)

  9. GL Accounts and RBT Dropbox, once their inputs arrive (G, H)

Open Questions