import os from flask import Flask, render_template from tools.eib import eib_bp from tools.donor_report import donor_report_bp from tools.donor_report_gl import donor_report_gl_bp from tools.financial_reports import financial_reports_bp from tools.payslip import payslip_bp from tools.receipt import receipt_bp from tools.pdf_unlock import pdf_unlock_bp from tools.summary_check import summary_check_bp from tools.gl_analyzer import gl_analyzer_bp # ── Tool registry ──────────────────────────────────────────────────────────── # Each entry drives one card on the landing page. Add a new tool by # registering its blueprint below and appending an entry here — nothing # else on the home page needs to change. TOOLS = [ { "name": "EIB Processor", "tagline": "Equals Money → Workday EIB", "description": ( "Converts raw Equals Money card-spend exports into clean Workday " "EIB files, with an optional per-cardholder statement audit " "against CSV or PDF statements." ), "url": "/eib/", "status": "online", }, { "name": "Donor Revenue Report", "tagline": "Trial Balance → Per-Donor Financial Extract", "description": ( "Generates a formatted financial extract workbook from the " "revenue trial balance, with one sheet per donor." ), "url": "/donor-report/", "status": "online", }, { "name": "Donor Revenue Report (GL Only)", "tagline": "GL Dump alone → Per-Donor Financial Extract", "description": ( "Same per-donor financial extract as Donor Revenue Report, but " "needs only a GL Dump - no trial balance required. Canada entity " "only, since a GL Dump has no US-entity activity to draw on." ), "url": "/donor-report-gl/", "status": "online", }, { "name": "Financial Reports", "tagline": "Trial Balance → Category Summary & Balance Sheet", "description": ( "Generates a Category Summary (Account/Category/Project Code, " "Canada/US split) and a Balance Sheet snapshot from the revenue " "and expense trial balances, reconciled back to the source files." ), "url": "/financial-reports/", "status": "online", }, { "name": "Payslip Generator", "tagline": "Fill in, preview, download PDF", "description": ( "Generates a formatted payslip from company/employee details and " "earnings/deductions lines, entirely in the browser - nothing is " "uploaded to a server." ), "url": "/payslip/", "status": "online", }, { "name": "Receipt Generator", "tagline": "Fill in, preview, download PDF", "description": ( "Generates a formatted point-of-sale style receipt from business " "details, line items, discount/tax/tip, entirely in the browser - " "nothing is uploaded to a server." ), "url": "/receipt/", "status": "online", }, { "name": "PDF Unlock", "tagline": "Remove PDF password protection", "description": ( "Strips owner-set restrictions (no printing, no copying, etc) from " "a PDF, and removes its open password too when you supply it - " "leaves you with a plain, unrestricted PDF." ), "url": "/pdf-unlock/", "status": "online", }, { "name": "Summary Reconciliation Check", "tagline": "Find which TB lines the Summary formulas are missing", "description": ( "Reproduces the per-account balance check from '1. Summary " "(Manual)' columns AE-AJ - flags any account where the manual " "E/F formula mapping doesn't fully cover the trial balance, and " "(with an optional prior-period workbook) points at new TB " "lines that likely need a mapping added." ), "url": "/summary-check/", "status": "online", }, { "name": "GL Analyzer", "tagline": "Any account, any field - what's driving the balance", "description": ( "Upload a GL extract, pick any account(s) - revenue, expense, " "balance sheet, any - and pick which field to group by and which " "extra fields to show. Nets out reversing/wash entries the same " "way the Financial Reports tool's Balance Sheet schedules do, " "then shows exactly what's making up the balance." ), "url": "/gl-analyzer/", "status": "online", }, ] def create_app(): app = Flask(__name__, template_folder="../templates", static_folder="../static") app.config["UPLOAD_FOLDER"] = os.environ.get("UPLOAD_FOLDER", "/app/uploads") app.config["OUTPUT_FOLDER"] = os.environ.get("OUTPUT_FOLDER", "/app/outputs") app.config["MAX_CONTENT_LENGTH"] = 50 * 1024 * 1024 # 50MB app.register_blueprint(eib_bp) app.register_blueprint(donor_report_bp) app.register_blueprint(donor_report_gl_bp) app.register_blueprint(financial_reports_bp) app.register_blueprint(payslip_bp) app.register_blueprint(receipt_bp) app.register_blueprint(pdf_unlock_bp) app.register_blueprint(summary_check_bp) app.register_blueprint(gl_analyzer_bp) @app.route("/") def home(): return render_template("home.html", tools=TOOLS) return app app = create_app() if __name__ == "__main__": os.makedirs(app.config["UPLOAD_FOLDER"], exist_ok=True) os.makedirs(app.config["OUTPUT_FOLDER"], exist_ok=True) port = int(os.environ.get("PORT", 8080)) app.run(host="0.0.0.0", port=port, debug=False, threaded=True)