Interactive demo of sqlalchemy-accumulator — the type-safe Python adapter for pg_accumulator
{{ r.name }} ({{ r.kind }}){% if not loop.last %}, {% endif %}
{% endfor %}
Record inventory receipt or shipment via handle.post()
Cancel all movements for a recorder via handle.unpost()
Atomically replace movements via handle.repost()
Record double-entry posting to the General Ledger via handle.post()
Reverses a posted ledger document and restores account balances via handle.unpost()
Consolidated ledger account balances
| Account | Type | Subconto Details | Debit (DR) | Credit (CR) | Balance | Currency |
|---|---|---|---|---|---|---|
| {{ b.get('account', '') }} | {% if b.get('acc_type', '') == 'A' %} Active {% else %} Passive {% endif %} | {{ b.get('subconto', '') }} | {{ "%.2f"|format(b.get('amount_dr', 0) | float) }} | {{ "%.2f"|format(b.get('amount_cr', 0) | float) }} | {{ "%.2f"|format(b.get('balance', 0) | float) }} | {{ b.get('currency', '') }} |
| Total transaction sums: | {{ "%.2f"|format(total_dr[0]) }} | {{ "%.2f"|format(total_cr[0]) }} | {% if "%.2f"|format(total_dr[0]) == "%.2f"|format(total_cr[0]) %} ✓ Totals match {% else %} ⚠ Mismatch detected! {% endif %} | |||
| Asset & Liability totals: | Total assets: {{ "%.2f"|format(active_total[0]) }} USD | Total liabilities & equity: {{ "%.2f"|format(passive_total[0]) }} USD | ||||
Recent ledger entries (double-entry movements)
| Document | Date | Debit Account | Debit Subconto | Credit Account | Credit Subconto | Amount | Currency | Recorded At |
|---|---|---|---|---|---|---|---|---|
{{ lm.get('recorder', '') }} |
{{ lm.get('period', '') | string | truncate(10, True, '') }} | Dr{{ lm.get('account_dr', '') }} | {{ lm.get('subconto_dr', '') }} | Cr{{ lm.get('account_cr', '') }} | {{ lm.get('subconto_cr', '') }} | {{ "%.2f"|format(lm.get('amount', 0) | float) }} | {{ lm.get('currency', '') }} | {{ lm.get('recorded_at', '') | string | truncate(19, True, '') }} |
Creates an ORM Order and posts inventory movement in a single transaction
| # | Client | Warehouse | Status | Action |
|---|---|---|---|---|
| {{ o.id }} | {{ o.client.name if o.client else '?' }} | {{ o.warehouse.name if o.warehouse else '?' }} | {% if o.status == 'posted' %} ● posted {% elif o.status == 'cancelled' %} ● cancelled {% else %} ● {{ o.status }} {% endif %} | {% if o.status == 'posted' %} {% endif %} |
| ID | Name | Address |
|---|---|---|
| {{ w.id }} | {{ w.name }} | {{ w.address or '—' }} |
| ID | SKU | Name | Price | Category |
|---|---|---|---|---|
| {{ p.id }} | {{ p.sku }} |
{{ p.name }} | ${{ p.unit_price }} | {{ p.category or '—' }} |
| ID | Name | Phone | |
|---|---|---|---|
| {{ c.id }} | {{ c.name }} | {{ c.email or '—' }} | {{ c.phone or '—' }} |
| Warehouse | Product | Quantity | Amount |
|---|---|---|---|
| {{ b.warehouse }} — {{ b.warehouse_name }} | {{ b.product }} — {{ b.product_name }} | {{ b.quantity }} | {{ b.amount }} |
| Recorder | Period | Warehouse | Product | Quantity | Amount |
|---|---|---|---|---|---|
| {{ m.get('recorder', '') }} | {{ m.get('period', '')[:10] if m.get('period') else '' }} | {{ m.get('warehouse', '') }} — {{ m.get('warehouse_name', '') }} | {{ m.get('product', '') }} — {{ m.get('product_name', '') }} | {{ m.get('quantity', '') }} | {{ m.get('amount', '') }} |
Get instant balance via handle.balance()
Aggregate turnover via handle.turnover()
Browse movement history via handle.movements()