Session Log

Development activity and session notes.

Feature Document History and Versioning
Added MatterDocuments table to track all generated CDs. Each CD generation now saves to C:\JTCMedia\{MatterId}\ with version number. New History tab on MatterView shows all document versions with download links.
Bugfix Lookup add item error
Fixed "int() argument must be a string" error when adding new lookup items. SCOPE_IDENTITY() was returning None after commit. Moved identity fetch before commit.
Bugfix Refinance CD checkbox logic
Fixed Cash to Close checkbox on page 1. For refinance: positive amount = To Borrower (cash-out), negative = From Borrower. Was inverted.
Feature Common Charges (Condo) section
Added Common Charges card to Cash to Close tab for condo transactions. Fields: Monthly Common Charge, Proration Period (from/to dates), Adjustment Type (prepaid/unpaid), Adjustment Amount.
Feature Payoffs and Payments section
Added MatterPayoffs table and UI for CD Page 3 Section K. Cash to Close tab now has 10-line payoff grid for entering mortgage payoffs, liens, etc. Data flows to CD generation.
UI Property tab consolidated
Moved Property fields to Transaction tab right column. Removed Property tab. Right column now shows: Status, Key Dates, Property. Renamed Unit/Apt to "Apt/Unit # (Condo)".
UI Loan Number field prominence
Added Loan Number column to matters list (second column after Matter #). Moved field to top of MatterView form in Lender/Client card for easier access.
Feature CD Form Type on Transaction Types
Added CDFormType column to LkpTransactionType lookup. Admin can now select whether each transaction type generates a Purchase CD or Refinance CD. Updated lookups_repo.py to include extra column and LookupsEdit.html to show dropdown.
Bugfix Lookup add item error
Fixed "int() argument must be a string" error when adding new lookup items. SCOPE_IDENTITY() was returning None after commit. Moved identity fetch before commit.
Bugfix Refinance CD checkbox logic
Fixed Cash to Close checkbox on page 1. For refinance: positive amount = To Borrower (cash-out), negative = From Borrower. Was inverted.
Feature Common Charges (Condo) section
Added Common Charges card to Cash to Close tab for condo transactions. Fields: Monthly Common Charge, Proration Period (from/to dates), Adjustment Type (prepaid/unpaid), Adjustment Amount.
Feature Payoffs and Payments section
Added MatterPayoffs table and UI for CD Page 3 Section K. Cash to Close tab now has 10-line payoff grid for entering mortgage payoffs, liens, etc. Data flows to CD generation.
UI Property tab consolidated
Moved Property fields to Transaction tab right column. Removed Property tab. Right column now shows: Status, Key Dates, Property. Renamed Unit/Apt to "Apt/Unit # (Condo)".
UI Loan Number field prominence
Added Loan Number column to matters list (second column after Matter #). Moved field to top of MatterView form in Lender/Client card for easier access.
Feature CD Form Type on Transaction Types
Added CDFormType column to LkpTransactionType lookup. Admin can now select whether each transaction type generates a Purchase CD or Refinance CD. Updated lookups_repo.py to include extra column and LookupsEdit.html to show dropdown.
Bug Fix Lookup add item error
Fixed "int() argument must be a string" error when adding new lookup items. SCOPE_IDENTITY() was returning None after commit. Moved identity fetch before commit.
Bug Fix Refinance CD checkbox logic
Fixed Cash to Close checkbox on page 1. For refinance: positive amount = To Borrower (cash-out), negative = From Borrower. Was inverted.
Enhancement Common Charges (Condo) section
Added Common Charges card to Cash to Close tab for condo transactions. Fields: Monthly Common Charge, Proration Period (from/to dates), Adjustment Type (prepaid/unpaid), Adjustment Amount.
Enhancement Payoffs and Payments section
Added MatterPayoffs table and UI for CD Page 3 Section K. Cash to Close tab now has 10-line payoff grid for entering mortgage payoffs, liens, etc. Data flows to CD generation.
Enhancement Property tab consolidated
Moved Property fields to Transaction tab right column. Removed Property tab. Right column now shows: Status, Key Dates, Property. Renamed Unit/Apt to "Apt/Unit # (Condo)".
Enhancement Loan Number field prominence
Added Loan Number column to matters list (second column after Matter #). Moved field to top of MatterView form in Lender/Client card for easier access.
Enhancement CD Form Type on Transaction Types
Added CDFormType column to LkpTransactionType lookup. Admin can now select whether each transaction type generates a Purchase CD or Refinance CD. Updated lookups_repo.py to include extra column and LookupsEdit.html to show dropdown.
Feature CD PDF โ€” Full 5-Page Field Mapping Complete
Completed mapping of all CD PDF pages 2-5. Page 2: sections A-J with line items, descriptions, and amounts; automatic total calculation for sections D (loan costs), I (other costs), and J (total closing costs). Page 3: cash-to-close breakdown and summaries of transactions. Page 4: all disclosure fields (late payment, escrow, assumption, demand, neg-am). Page 5: loan calculations (TotalOfPayments, FinanceCharge, APR, TIP) and contact info.
Feature CD PDF โ€” Full 5-Page Field Mapping Complete
Completed mapping of all CD PDF pages 2-5. Page 2: sections A-J with line items, descriptions, and amounts mapped to p2_ fields; automatic total calculation for sections D (loan costs), I (other costs), and J (total closing costs). Page 3: cash-to-close breakdown and summaries of transactions. Page 4: all disclosure fields (late payment, escrow, assumption, demand, neg-am). Page 5: loan calculations (TotalOfPayments, FinanceCharge, APR, TIP) and contact info. Updated get_matter_cd_data() to pull MatterClosingCosts and all detail columns.
Data Sample Closing Cost Data Populated
Created and ran population script to fill all active matters with realistic closing cost line items across all sections: origination charges, appraisal/credit fees, title/survey fees, recording/transfer taxes, prepaids (insurance, interest, taxes), escrow deposits, and borrower/seller adjustment items.
Feature MatterView โ€” 8-Tab Consolidated Interface
Redesigned MatterView into single-page tabbed interface: Transaction, Parties, Contacts, Loan Details, Closing Costs, Cash to Close, Disclosures, Calculations. Closing Costs tab has line-item grids for all CFPB sections (A through K) with borrower/seller/other columns. All tabs save via single POST.
Feature Closing Costs Data Model โ€” Complete Schema
Created MatterClosingCosts table for line-item costs (sections A-K). Added 25 columns to Matters table for closing details: MonthlyPI, PrepaymentPenalty, BalloonPayment, Cash-to-Close fields, Page 4 disclosures (late payment, escrow, assumption), Page 5 calculations (TotalOfPayments, FinanceCharge, APR, TIP). Built closing_repo.py with full CRUD.
Enhancement Form Generation Simplified โ€” Auto-Detect & Single Template
Removed manual form type dropdown โ€” now auto-detected from transaction type, property flags, and CEMA status. Consolidated to single CD template and single LE template. Fixed PDF field appearance rendering with white backgrounds. Reordered sidebar (Clients above Matters).
Feature All CD & LE Form Variants Supported
Extended PDF generation to support all form types: PURCHASE_CD, COOP_PURCHASE_CD, CEMA_PURCHASE_CD, COOP_REFINANCE_CD, PURCHASE_LE, REFINANCE_LE. Added SalePrice, InterestRate, LoanTerm columns to Matters table. Updated intake and view forms with new fields.
Feature CD/LE PDF Auto-Generation โ€” Foundation
Implemented automatic PDF form generation from database matter data. Created get_matter_cd_data() to pull matter, property, borrower, lender, and contact info. Built map_cd_fields() for Page 1 field mapping. Added /forms/cd/generate route with form-type auto-detection.
Feature Lenders/Institutions Management โ€” Complete
Built complete Lenders feature: lenders_repo.py with full CRUD operations, LendersList.html grid with search, LenderEdit.html form with all fields (name, prefix, auto-numbering, address, phone, email). Sidebar menu integration under Administration.
Development Codebase Review & Dead Code Cleanup
Full review of application architecture, database schema (30+ tables), and file inventory. Removed dead code: customers_repo.py and crypto_utils.py. Identified unused routes and established cleanup plan.
Feature Added Session Log to home page
Created SessionLog table and read-only display on home page showing development activity grouped by date with color-coded category badges.
Feature Built Lookup Table management
Created /Admin/Lookups page to edit all picklist values (Transaction Types, Client Types, Property Types, etc.) with inline editing and add/deactivate functionality.
UI Implemented collapsible sidebar menu
Changed sidebar to Windows Explorer-style tree with expandable Matters and Administration sections. Removed Workflows section.
UI Consolidated CSS into style.css
Moved all inline styles to single /static/style.css file for consistent formatting across pages.
Feature Built Matters list and view pages
Created MattersList.html with clickable table rows and MatterView.html with two-column layout showing transaction, property, dates, parties, and contacts.
Feature Built Matter Intake form
Created intake form matching NY Title Order Form with sections for Transaction Info, Borrower, Property, and Contacts (Loan Processor, Relationship Manager, Closer, Title Company, Attorney).
Database Created complete intake schema
Added 8 lookup tables (LkpClientType, LkpPropertyType, LkpTransactionType, LkpLoanType, LkpLoanProduct, LkpMatterStatus, LkpContactType, LkpFeeCategory) and 10 main tables (Clients, Properties, Contacts, Matters, MatterParties, MatterContacts, MatterFees, MatterAdjustments, MatterDocuments, MatterNotes).
UI Updated header and footer
Increased header height to 120px, logo to 102px (3x larger), brand text to 22px. Added 48px dark footer with copyright.
Bugfix Fixed routes.py corruption
Removed PowerShell wrapper syntax (@' and '@) that was breaking the Flask application. Restored all email functionality.
Feature Built Lookup Table management
Created /Admin/Lookups page to edit all picklist values (Transaction Types, Client Types, Property Types, etc.) with inline editing and add/deactivate functionality.
UI Implemented collapsible sidebar menu
Changed sidebar to Windows Explorer-style tree with expandable Matters and Administration sections. Removed Workflows section.
UI Consolidated CSS into style.css
Moved all inline styles to single /static/style.css file for consistent formatting across pages.
Feature Built Matters list and view pages
Created MattersList.html with clickable table rows and MatterView.html with two-column layout showing transaction, property, dates, parties, and contacts.
Feature Built Matter Intake form
Created intake form matching NY Title Order Form with sections for Transaction Info, Borrower, Property, and Contacts (Loan Processor, Relationship Manager, Closer, Title Company, Attorney).
Database Created complete intake schema
Added 8 lookup tables (LkpClientType, LkpPropertyType, LkpTransactionType, LkpLoanType, LkpLoanProduct, LkpMatterStatus, LkpContactType, LkpFeeCategory) and 10 main tables (Clients, Properties, Contacts, Matters, MatterParties, MatterContacts, MatterFees, MatterAdjustments, MatterDocuments, MatterNotes).
UI Updated header and footer
Increased header height to 120px, logo to 102px (3x larger), brand text to 22px. Added 48px dark footer with copyright.
Bugfix Fixed routes.py corruption
Removed PowerShell wrapper syntax (@' and '@) that was breaking the Flask application. Restored all email functionality.
Data Sample Closing Cost Data Populated
Created and ran population script to fill all active matters with realistic closing cost line items across all sections: origination charges, appraisal/credit fees, title/survey fees, recording/transfer taxes, prepaids (insurance, interest, taxes), escrow deposits, and borrower/seller adjustment items.
Feature MatterView โ€” 8-Tab Consolidated Interface
Redesigned MatterView into single-page tabbed interface: Transaction, Parties, Contacts, Loan Details, Closing Costs, Cash to Close, Disclosures, Calculations. Closing Costs tab has line-item grids for all CFPB sections (A through K) with borrower/seller/other columns. All tabs save via single POST.
Feature Closing Costs Data Model โ€” Complete Schema
Created MatterClosingCosts table for line-item costs (sections A-K). Added 25 columns to Matters table for closing details: MonthlyPI, PrepaymentPenalty, BalloonPayment, Cash-to-Close fields, Page 4 disclosures (late payment, escrow, assumption), Page 5 calculations (TotalOfPayments, FinanceCharge, APR, TIP). Built closing_repo.py with full CRUD.
Enhancement Form Generation Simplified โ€” Auto-Detect & Single Template
Removed manual form type dropdown โ€” now auto-detected from transaction type, property flags, and CEMA status. Consolidated to single CD template and single LE template. Fixed PDF field appearance rendering with white backgrounds. Reordered sidebar (Clients above Matters).
Feature All CD & LE Form Variants Supported
Extended PDF generation to support all form types: PURCHASE_CD, COOP_PURCHASE_CD, CEMA_PURCHASE_CD, COOP_REFINANCE_CD, PURCHASE_LE, REFINANCE_LE. Added SalePrice, InterestRate, LoanTerm columns to Matters table. Updated intake and view forms with new fields.
Feature CD/LE PDF Auto-Generation โ€” Foundation
Implemented automatic PDF form generation from database matter data. Created get_matter_cd_data() to pull matter, property, borrower, lender, and contact info. Built map_cd_fields() for Page 1 field mapping. Added /forms/cd/generate route with form-type auto-detection.
Feature Lenders/Institutions Management โ€” Complete
Built complete Lenders feature: lenders_repo.py with full CRUD operations, LendersList.html grid with search, LenderEdit.html form with all fields (name, prefix, auto-numbering, address, phone, email). Sidebar menu integration under Administration.
Development Codebase Review & Dead Code Cleanup
Full review of application architecture, database schema (30+ tables), and file inventory. Removed dead code: customers_repo.py and crypto_utils.py. Identified unused routes and established cleanup plan.