Lint went from 84 problems to 0. Build passes.
Dead code:
- TeamInvoices: drop the orphaned Subcontractor PO block (updateSubcontractorPO
plus send/ready-to-pay/paid/reopen/cancel/delete/download/CPA-export handlers
and ~25 derived vars). That feature moved to the routed
TeamCreateSubcontractorPO / TeamSubcontractorPODetail pages in the Layout2
redesign; these were leftovers. 2100 -> 1880 lines.
- Tasks: drop unrendered project sort/tab/completion logic in TasksPageShell.
- Remove 59 unused vars, imports, and handlers across 12 other files.
Removed wasted queries:
- TeamInvoices ran a nested subcontractor_payments join (profiles, projects,
companies, PO items, tasks) on every page load into state nothing read.
- TeamInvoices and ExternalMyInvoices each fetched a task-type map on invoice
open and discarded it; the ExternalMyInvoices one blocked the detail popup.
- RequestForm queried sign_families on mount into unread state.
Dependencies:
- Drop heic2any (zero imports). heic-to is the one in use and already lazy-loads.
Effects and exports:
- RequestForm: remove 4 effects. Sign-row sizing and company-change resets move
into their change handlers; single-company selection is derived during render
rather than written back into form state.
- FilterDropdown: measure position on click instead of in an effect, which also
removes a one-frame stale-position flicker.
- BrandBook: latest-ref pattern so the 900ms address debounce is not reset by
handler identity.
- ClientMyInvoices: hoist MONTHS to module scope.
- Split non-component exports: POPUP_FIELD_LABEL moves to lib/popupStyles.js;
resolveProfileAvatar and useLiveClock are internal-only; getGreeting deleted
as nothing referenced it.
Companies.jsx keeps one scoped eslint-disable with a reason: load() only
setStates after awaiting its queries, so set-state-in-effect is a false positive
there, and load() is shared with the create/delete handlers.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Invoice numbers now come from DB function next_invoice_number()
(max+1 per year under advisory lock) with a unique index; the old
row-count method reused numbers after deletes and raced concurrent
creates, which broke public pay links
- Remove dead standalone TeamCreateInvoice page; the TeamInvoices
modal is the single create path (page had already drifted)
- Invoice delete now asks for confirmation and only un-bills tasks/
submissions not billed on another invoice
- Created invoice shows correct "sent" status in list without reload
- Invoice/due dates computed at save time, not module load
- Reopening a paid invoice clears stale stripe_fee
- Stripe webhook markPaid is idempotent (no double receipts)
- subcontractor_invoice_items.version_number column stores billing
version explicitly; description parsing kept as legacy fallback
- Drop unused buildInvoiceStatusByKey/deriveVersionStatus
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Fourge's own error revisions should never be charged to the client.
getRevisionChargeQuantity now returns 0 for revision_type=fourge_error
regardless of version number. Applied at all 4 invoice picker call sites.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Review-shadow submissions are type=initial with blank service_type; the
picker grabbed the first initial found, hitting a shadow -> null service ->
$0 price. New pickInitialServiceType() skips shadows and prefers a real
service_type. Fixes Harlingen sites showing $0 on invoice.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Each revision (R00, R01, R02) is now an independent trackable unit:
invoiceVersionRules: add deriveVersionStatus, buildInvoiceStatusByKey,
parseVersionFromItemDescription for per-version status derivation
Tasks.jsx + ProjectDetail.jsx:
- Fetch invoice_items joined with invoice.status (team only)
- allRows/rows now flatMap per version (one row per R##)
- Status derived from: invoice_items > past version > task.status
- R00 paid shows as paid; R01 in_progress shows separately
- tr keys use rowKey (taskId:version) to avoid duplicate key warnings
Invoice lifecycle (TeamInvoiceDetail, TeamInvoices, TeamCreateInvoice):
- Remove task.status sync on invoice paid/sent/created
- Keep invoiced:true flag for double-billing prevention
- Task work status (not_started → client_approved) stays work-flow only
ProjectDetail completion bar uses task.status === client_approved only
(no longer polluted by invoiced/paid status from invoice sync)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 'PURCHASE ORDER' → 'SUBCONTRACTOR INVOICE'
- Items loop now calls addPage() when hitting safeBottom (792-80pt)
- Continuation pages get header with invoice number + '(continued)'
- Summary/Notes sections also page-break if needed
- Footer text updated to match invoice context
- Footer line position dynamic (tracks y), not hardcoded at 704
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- filebrowserFolders.js: createTaskFolder now creates Old Books
- fbq-backfill: creates Old Books; migrateOldBook() merges/renames
existing Old Book folders into Old Books on each backfill run
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Unified Tasks page: 3 role render blocks → 1, normalized row shape, single renderRow/sort/tabs
- Fixed role scoping: external = all tasks in member projects, client = all tasks in company projects
- Fixed client bug: was scoped by submitted_by, now company→project→tasks
- Aligned dashboard client scope to match tasks page
- Hot tasks dashboard: now filters to active statuses only (not completed/invoiced/paid)
- Removed Projects.jsx (dead), fixed /project/ → /projects/ links
- Renamed all page files to match folder path (Team*, External*, Client* prefixes)
- Renamed: RequestsPage→Tasks, Settings→Profile, CompaniesPage→Companies, ProjectDetailPage→ProjectDetail
- Dropped dead fetches from Tasks page (invoices, invoice_items, subcontractor_invoice_items)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- DashboardPage, Projects, RequestsPage, ProjectDetailPage, RequestDetail: each now handles team/external/client in one file via role flags — removed 10 old role-specific sub-files
- Layout: client Company nav link goes directly to /company/:id when user has a single company
- FileBrowser: replace emoji icons with colored extension-text badges (square); folder icon stays 📁; Adobe/Figma/design-tool colors for design files
- CompaniesPage: merged team Companies + client company routing (single-company redirect, multi-company list)
- FileSharing: integrated FileBrowser component
- Removed: seafile API + lib, old ServerStatus, TaskDetail, role-split page files
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove recursive directory size calculations (single Seafile API call per list)
- Remove 'Used in this location' usage display
- Fix move using v2 per-type endpoints instead of broken batch endpoint
- Send entry type from frontend for correct move routing
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Store stripe_fee on invoices when webhook receives checkout.session.completed
- Display Stripe fee and net received in InvoiceDetail when paid via Stripe
- Add backfill-stripe-fees edge function to populate fee on existing paid invoices
- Migration: add stripe_fee column to invoices table
- Includes all pending portal changes (brand book, sign survey, task/project/company updates, etc.)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>