SAGA C. (Romanian accounting)
v0.1.1SAGA C. accounting (Romania): balances, invoices, VAT, stock.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
saga_list_firms List SAGA firms
Lists the SAGA firm databases this server can open (code and database path).
saga_firm_info Firm overview
Overview of one firm: last closed period, VAT settings, ledger date range, record counts, Firebird version.
| Parameter | Type | Description |
|---|---|---|
firm | string | Firm code (folder name such as "0001"). Optional when only one firm is configured. |
saga_list_accounts Chart of accounts
Accounts from the chart of accounts (planul de conturi), optionally filtered by prefix or by text in the name.
| Parameter | Type | Description |
|---|---|---|
firm | string | Firm code (folder name such as "0001"). Optional when only one firm is configured. |
limit | integer | Maximum rows to return. |
prefix | string | e.g. "401" or "5121" |
search | string |
saga_trial_balance Trial balance (balanta de verificare)
Trial balance for a period: opening balance at 1 January, previous turnover, period turnover, totals and closing balance per account. level: synthetic (default; e.g. 401), analytic (as stored, e.g. 401.00012) or group3 (first 3 digits).
| Parameter | Type | Description |
|---|---|---|
date_from * | string | Start date, YYYY-MM-DD (inclusive). |
date_to * | string | End date, YYYY-MM-DD (inclusive). |
firm | string | Firm code (folder name such as "0001"). Optional when only one firm is configured. |
include_zero | boolean | |
level | string | |
prefix | string | Only accounts starting with this, e.g. "6" or "401". |
saga_account_ledger Account ledger (fisa contului)
All entries of one account in a period with opening balance, running balance and closing balance. match=account (default) includes analytic sub-accounts ("401" -> 401, 401.x); match=prefix takes every account starting with the text.
| Parameter | Type | Description |
|---|---|---|
account * | string | |
date_from * | string | Start date, YYYY-MM-DD (inclusive). |
date_to * | string | End date, YYYY-MM-DD (inclusive). |
firm | string | Firm code (folder name such as "0001"). Optional when only one firm is configured. |
limit | integer | Maximum rows to return. |
match | string | |
offset | integer | Rows to skip (for paging). |
saga_journal General journal (registru jurnal)
Ledger entries (REGISTRU) in a period, filterable by source (FEL_D: Intrari, Iesiri, Casa, Banca, Inchidere, Salarii, ...), account, partner code, note id, document number or text.
| Parameter | Type | Description |
|---|---|---|
date_from * | string | Start date, YYYY-MM-DD (inclusive). |
date_to * | string | End date, YYYY-MM-DD (inclusive). |
account | string | |
doc_no | string | |
firm | string | Firm code (folder name such as "0001"). Optional when only one firm is configured. |
limit | integer | Maximum rows to return. |
note_id | integer | |
offset | integer | Rows to skip (for paging). |
partner_code | string | |
source | string | |
text | string |
saga_journal_sources Journal sources
Which kinds of ledger entries (FEL_D values) exist and their date ranges.
| Parameter | Type | Description |
|---|---|---|
firm | string | Firm code (folder name such as "0001"). Optional when only one firm is configured. |
saga_partners Suppliers / customers
Search suppliers or customers by name or fiscal code. Personal numeric codes (CNP) are masked.
| Parameter | Type | Description |
|---|---|---|
kind * | string | |
code | string | |
firm | string | Firm code (folder name such as "0001"). Optional when only one firm is configured. |
limit | integer | Maximum rows to return. |
search | string |
saga_open_invoices Open (unpaid) invoices
Unpaid supplier invoices (kind=suppliers) or customer invoices (kind=customers), with due dates and days overdue. Foreign-currency invoices are included with currency and unpaid_currency. as_of (YYYY-MM-DD) gives the situation at a past date.
| Parameter | Type | Description |
|---|---|---|
kind * | string | |
as_of | string | |
firm | string | Firm code (folder name such as "0001"). Optional when only one firm is configured. |
limit | integer | Maximum rows to return. |
only_overdue | boolean | |
partner_code | string |
saga_partner_balances Partner balances
Per supplier or customer: unpaid and overdue totals from open invoices, plus the general-ledger balance of the partner account for reconciliation.
| Parameter | Type | Description |
|---|---|---|
kind * | string | |
as_of | string | |
firm | string | Firm code (folder name such as "0001"). Optional when only one firm is configured. |
limit | integer | Maximum rows to return. |
partner_code | string |
saga_documents Purchase / sales documents
Purchase (intrari) or sales (iesiri) documents in a period with totals. currency=true lists the foreign-currency ones instead (SAGA keeps them apart: purchases in INTRD, sales in EXPORT).
| Parameter | Type | Description |
|---|---|---|
date_from * | string | Start date, YYYY-MM-DD (inclusive). |
date_to * | string | End date, YYYY-MM-DD (inclusive). |
kind * | string | |
currency | boolean | true = foreign-currency documents. |
firm | string | Firm code (folder name such as "0001"). Optional when only one firm is configured. |
limit | integer | Maximum rows to return. |
number | string | |
offset | integer | Rows to skip (for paging). |
only_unposted | boolean | |
partner_code | string |
saga_document One document with lines
One purchase or sales document: header, lines, the ledger entries it produced and the payments linked to it.
| Parameter | Type | Description |
|---|---|---|
id * | integer | Document id (ID_INTRARE / ID_IESIRE) from saga_documents or saga_open_invoices. |
kind * | string | |
currency | boolean | true = a foreign-currency document; when omitted, both kinds are searched. |
firm | string | Firm code (folder name such as "0001"). Optional when only one firm is configured. |
saga_stock Stock by warehouse
Stock quantities (and an estimated value at cost) per warehouse (gestiune) and article at a date.
| Parameter | Type | Description |
|---|---|---|
article | string | |
as_of | string | |
firm | string | Firm code (folder name such as "0001"). Optional when only one firm is configured. |
include_zero | boolean | |
limit | integer | Maximum rows to return. |
search | string | |
warehouse | string |
saga_stock_movements Stock movements of an article
Movements of one article (optionally one warehouse) in a period with running quantity.
| Parameter | Type | Description |
|---|---|---|
article * | string | |
date_from * | string | Start date, YYYY-MM-DD (inclusive). |
date_to * | string | End date, YYYY-MM-DD (inclusive). |
firm | string | Firm code (folder name such as "0001"). Optional when only one firm is configured. |
limit | integer | Maximum rows to return. |
warehouse | string |
saga_cash_bank_balances Cash and bank balances
Balances of all cash (531x) and bank (512x) accounts at a date.
| Parameter | Type | Description |
|---|---|---|
as_of | string | |
firm | string | Firm code (folder name such as "0001"). Optional when only one firm is configured. |
saga_cash_bank_register Cash / bank register
Register of one cash or bank account (e.g. 5311, 5121.1): opening balance, entries with running balance, closing balance.
| Parameter | Type | Description |
|---|---|---|
account * | string | |
date_from * | string | Start date, YYYY-MM-DD (inclusive). |
date_to * | string | End date, YYYY-MM-DD (inclusive). |
firm | string | Firm code (folder name such as "0001"). Optional when only one firm is configured. |
limit | integer | Maximum rows to return. |
offset | integer | Rows to skip (for paging). |
saga_vat_summary VAT summary
VAT accounts turnover (4426, 4427, 4428, 4423, 4424) and sales/purchases net and VAT by rate for a period. Not a D300 return.
| Parameter | Type | Description |
|---|---|---|
date_from * | string | Start date, YYYY-MM-DD (inclusive). |
date_to * | string | End date, YYYY-MM-DD (inclusive). |
firm | string | Firm code (folder name such as "0001"). Optional when only one firm is configured. |
saga_saft_check SAF-T (D406) readiness check
Basic checks before D406: accounts used but missing from the chart or SAF-T mapping, partners without fiscal codes, unposted documents.
| Parameter | Type | Description |
|---|---|---|
date_from * | string | Start date, YYYY-MM-DD (inclusive). |
date_to * | string | End date, YYYY-MM-DD (inclusive). |
firm | string | Firm code (folder name such as "0001"). Optional when only one firm is configured. |
limit | integer | Maximum rows to return. |
saga_list_tables List database tables
Tables in the SAGA database (about 195), optionally with row counts. Payroll tables are flagged.
| Parameter | Type | Description |
|---|---|---|
firm | string | Firm code (folder name such as "0001"). Optional when only one firm is configured. |
search | string | |
with_counts | boolean |
saga_describe_table Describe a table
Columns (name, type, default) and primary key of one table. Shows structure only, no data.
| Parameter | Type | Description |
|---|---|---|
table * | string | |
firm | string | Firm code (folder name such as "0001"). Optional when only one firm is configured. |
saga_query Read-only SQL query
Runs one SELECT (Firebird 3 SQL dialect) inside a READ ONLY transaction. Use FIRST/ROWS for limits, ? for parameters. Text columns are padded with spaces; compare with = (trailing blanks ignored) or TRIM(). Payroll tables are blocked unless the server owner enabled them.
| Parameter | Type | Description |
|---|---|---|
sql * | string | |
firm | string | Firm code (folder name such as "0001"). Optional when only one firm is configured. |
max_rows | integer | |
params | array |