Back to ER Diagram
Treasury & Cash Flow

Treasury & Cash Flow Logic

Bank account management, cash flow forecasting, bank guarantees, insurance policies, fixed deposits, fund requests, letter of credit, and FX hedging.

PostgreSQL
9 Tables
Schema: treasury
Cash Flow Forecast

Overview

Treasury Management handles all banking and cash management operations. Bank accounts are maintained across multiple banks with real-time balance tracking. Cash flow forecasting uses committed payments (AP) and expected receipts (AR) to project future balances. Bank Guarantees (BG) and Letters of Credit (LC) are tracked with expiry alerts. Insurance policies cover project assets, workers, and third-party liability. Fixed deposits and fund requests manage short-term investments and inter-entity funding.


Bank Accounts

Cash Forecast

BG/LC Mgmt

Insurance

Fund Requests
9
Treasury Tables
Multi-Bank
Account Tracking
90-Day
Forecast Window
Auto
Expiry Alerts

Status States

StatusDescriptionAllowed ActionsNext States
ActiveBank account / BG / Policy activeTransact, MonitorExpiring
ExpiringWithin 30 days of expiryRenew, ExtendActive, Expired
ExpiredValidity period endedRenew or CloseActive, Closed
RequestedFund request submittedApprove, RejectApproved
ApprovedFund request approved for transferExecute TransferCompleted
ClosedAccount / BG / Policy closedArchive

Database Schema

treasury.bank_account

  • account_id — PK
  • tenant_id, entity_id — FK → organization
  • bank_name, branch, account_number, ifsc_code — Bank details
  • account_type — current | savings | overdraft | escrow
  • current_balance, currency — Real-time balance
  • is_primary — Default payment account flag

treasury.cash_flow

  • cashflow_id — PK
  • entity_id, project_id — FK → scope reference
  • forecast_date, amount, direction — Expected date, amount, inflow/outflow
  • source_type — ap_invoice | ar_invoice | payroll | bg | insurance
  • source_id — FK → originating document
  • is_actual — Forecast vs actual flag

treasury.bank_guarantee

  • bg_id — PK
  • project_id — FK → project.project
  • bg_type — performance | advance | retention | bid
  • bank_account_id — FK → treasury.bank_account
  • bg_amount, margin_amount — Guarantee and margin values
  • issue_date, expiry_date — Validity period
  • beneficiary — Client/employer name
  • status — Active / Expiring / Expired / Released

treasury.insurance_policy

  • policy_id — PK
  • project_id — FK → project.project
  • policy_type — car | tpl | wc | marine | professional
  • insurer, policy_number — Policy details
  • sum_insured, premium_amount — Financial details
  • start_date, end_date — Coverage period
  • status — Active / Expiring / Expired / Claimed

treasury.letter_of_credit

  • lc_id — PK
  • vendor_id — FK → vendor.vendor_master
  • lc_number, lc_amount, currency — LC details
  • issuing_bank, advising_bank — Bank references
  • expiry_date, shipment_date — Key dates
  • status — Opened / Amended / Utilized / Expired

Treasury Operations

1

Bank Account Setup

Configure bank accounts with full details. Set primary account for each entity. Enable bank statement import for auto-reconciliation.

2

Cash Flow Forecasting

System auto-generates 90-day cash flow forecast from: AP invoice due dates (outflows), AR invoice expected receipts (inflows), payroll schedules, BG margin requirements, and insurance premiums.

3

Bank Guarantee Management

Track BG lifecycle — issuance, amendment, utilization, and release. System alerts 30 days before expiry. BG margin blocked from available funds. Released BGs free up margin amount.

4

Insurance Management

Maintain project insurance policies — Contractor All Risk (CAR), Third Party Liability (TPL), Workmen Compensation (WC). Track claims against policies. Renewal alerts at 60 days.

5

Fund Requests

Inter-entity or project fund requests flow through approval workflow. Approved requests trigger bank transfer. Reconciled against bank statement import.

Treasury Queries

Cash Flow Forecast

-- 30-day cash flow projection
SELECT forecast_date,
       SUM(CASE WHEN direction = 'inflow' THEN amount ELSE 0 END) AS inflows,
       SUM(CASE WHEN direction = 'outflow' THEN amount ELSE 0 END) AS outflows,
       SUM(CASE WHEN direction = 'inflow' THEN amount ELSE -amount END) AS net_flow
FROM treasury.cash_flow
WHERE entity_id = :entity_id
  AND forecast_date BETWEEN CURRENT_DATE AND CURRENT_DATE + 30
  AND is_actual = FALSE
GROUP BY forecast_date
ORDER BY forecast_date;

Validation Rules

Business Rules

  • BG Margin: Margin amount must be available in bank account before BG issuance
  • Insurance Coverage: Active CAR and TPL policies mandatory for all projects
  • Fund Request Limit: Fund requests above ₹1 Cr require CFO approval
  • LC Expiry: LC cannot be utilized after expiry date

Integration Points

Connected Modules

  • Finance: Bank balances reconciled with GL; BG margin tracked as contingent liability
  • Accounts Payable: AP invoice due dates feed cash outflow forecast
  • Accounts Receivable: AR invoice expected dates feed cash inflow forecast
  • Contract: BG requirements derived from contract terms

Best Practices

Recommended

  • Maintain minimum 15-day cash reserve for each project
  • Review BG/LC portfolio monthly for renewal and release opportunities
  • Automate bank statement import for daily reconciliation
  • Track insurance claim ratio for premium negotiation