Commit Graph

3 Commits

Author SHA1 Message Date
JasonFraser f89497b25d Add local generation of the Workday upload-ready EIB file
New "Generate EIB File (for Upload)" button, shown after a successful
process run, populates planeterra_equals_cards_transactions_eib_v45.xlsx
(the Workday EIB "Expense Credit Card Transaction" import template)
directly from that run's output, without a re-upload:

- app/tools/eib/logic.py: populate_upload_template() writes Header Key,
  Line Key, Transaction Number/Date, Amount, currencies, description and
  merchant name into the "Expense Credit Card Transaction" sheet, plus a
  per-file metadata row into "Credit Card Transaction Header" (Header
  Key, Credit Card Type, an auto-generated File Name covering the run's
  date range, and today's date). Corporate-card identifiers
  (AK/AM/AN) are resolved by reading eib_pre_template.xlsx's "Equals
  Card IDs" sheet at generation time rather than duplicating that
  mapping, so both output files always agree.
- app/tools/eib/routes.py: new /api/generate-upload route, backed by a
  small module-level "last processed output" holder (same single-user
  pattern as PROCESS_STATUS) so the button can reuse the prior run's
  data.
- templates/eib/index.html: the new button + status note in the result
  panel.
- .gitignore: exception for the new template, same as eib_pre_template.xlsx.

Also includes the user's own edit to eib_pre_template.xlsx (J:M formula
fill range manually extended from row 699 to row 2000).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-18 15:58:52 -04:00
JasonFraser a9df545952 Populate finance's EIB template instead of generating a fresh workbook
Replace build_excel() with populate_template(): loads
app/tools/eib/eib_pre_template.xlsx fresh each run, writes EIB rows into
Final Sheet A2:I<n+1> (clearing prior run's rows first) and the audit
table starting at column AA, then saves a dated copy into outputs/ —
the template itself is never mutated. Columns J:Y (finance's own
corporate-card-ID lookup formulas and a legacy static block) are never
written to; _extend_formulas_down() only fills in a missing J:M formula
within the new data range (the template's formula rows turned out to be
non-contiguous, leftover from old manual test batches) without ever
touching a row that already has one.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-18 15:24:21 -04:00
JasonFraser e4cef1faec Initial commit: EIB processor tool with new landing page preview
Single-tool Flask app (Equals Money -> Workday EIB conversion + audit)
plus a new /home-preview landing page in preparation for turning this
into a multi-tool platform.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-18 10:30:53 -04:00