DOC // AIQ-NDB-001REV / A
SOLUTIONSHEET 10 / BANK DEBIT NOTES
§ Solution · Accounting & treasury

From bank statement to SAP load file, automated/

"The statement comes in by email. Out comes the SAP load file and the audit report — classified, totalized, ready to post."

End-to-end automation of bank debit-note generation for SAP. The process receives statements by email, structures them with AI, cross-references them against accounting catalogs, and delivers two files to Google Drive: the SAP load file and a classified list for audit.

~30 s
Per statement
Before: 30 to 45 minutes of manual classification and file assembly. Now: from email to Drive, in seconds.
8
Auditable business rules
From bank identification to the 67/33 split and totalizer, every rule documented and traceable.
100%
Unattended
No human intervention between sending the email and the files landing in Drive. Auditable log per run.
§01 · The problem

Manual classification, every month


Companies migrating to SAP often inherit a recurring manual process: classify every bank transaction, identify items subject to accounting entry, and assemble the load file. A person opens the CSV, walks the rows, cross-references against an Excel of criteria, splits amounts by internal rules, assembles header and totalizer, and uploads the file to the system.

DimensionBefore (manual)After (automated)
Time per statement30 to 45 minutes~30 seconds
TraceabilityManual / Excel sheetLog + versioned files
Scalability1 bank per operatorN banks in parallel
Error riskHigh — manual classificationLow — auditable rules
§02 · How it works

The flow, in 7 steps


The process runs whenever a statement arrives in a dedicated mailbox. No human intervention between sending the email and the final files in Drive.

01
INTAKE
Mailhook receives the statement
A mailhook detects the inbound email with the bank statement attached as CSV. The trigger is immediate.
02
STRUCTURING
Gemini interprets the CSV
gemini-2.5-pro receives the CSV and returns a JSON object with the statement header and an array of transactions.
03
BANK
Identification against BCRA catalog
The account number is matched against the BCRA Entities catalog. If matched, the BCRA code and official bank name are retrieved.
04
CRITERIA
Accounting classification
For each transaction, its criterion is looked up in the Criteria catalog using the bank operation code as the key. Returns ledger account, tax indicator, cost center, sign, and category (GST− / GST+).
05
RULES
Business-rule application
GST− transactions are included in the SAP file. Special accounts get a 67% expense / 33% computable-asset split. Transactions with no criterion are flagged UNCLASSIFIED.
06
BUILD
Building the two files
The ND_SAP (header + filtered detail + totalizer) and UMSATZ (all classified transactions, for audit) files are built.
07
DELIVERY
Upload to Google Drive
Both files are automatically uploaded to the destination folder, timestamped. Ready for the accounting team to pick up.
§03 · Tech stack

Components and architecture


The automation is implemented on Make.com, which orchestrates the external services. No servers to administer, no code to maintain, no lock-in: if an accounting criterion or BCRA code changes tomorrow, everything is visible and editable.

PlatformMake.com — orchestration and execution engine
AIGoogle Gemini 2.5 Pro — statement structuring
Reference dataGoogle Sheets — BCRA Entities and Criteria catalogs
TriggerEmail (custom mailhook) — statement attachment intake
StorageGoogle Drive — timestamped output repository
SAP outputPlain text (.txt) delimited by pipe (│)
Audit outputCSV — 17 columns
Make.com Gemini 2.5 Pro Google Sheets Google Drive SAP-ready No servers No lock-in
§04 · Business rules

Eight rules, all auditable


Every rule is unambiguously documented. Any functional change starts by updating this section — not by touching the code.

RN-01
Issuer bank identification
Each statement is identified by matching the Cuenta_Banco field in the header against the BCRA Entities catalog. Exact-match. If the bank isn't in the catalog, the run continues with an incomplete header — the catalog must be kept up to date.
RN-02
Derived-field computation
From the BCRA code and statement date, the header fields are computed: Codigo_Proveedor (400000000 + BCRA padded), N_Factura, Folio, Ejercicio, Periodo, and the date in DDMMYY format.
RN-03
Accounting classification
For each transaction, its criterion is looked up in the Criteria catalog, using Cod_Op_Bco as the key. Returns: category, key, ledger account, description, tax indicator, cost center, and sign.
RN-04
SAP inclusion filter
Only transactions with category GST− are included in the SAP file. GST+ and unclassified are excluded from SAP but do appear in the UMSATZ audit file.
RN-05
67% / 33% split on special accounts
If the ledger account is flagged "split" in the catalog, the transaction is divided in two lines: 67% expense in the original account, 33% computable asset in the asset account. Rounded to 2 decimals per line — ±0.01 difference accepted.
RN-06
Handling UNCLASSIFIED
Transactions whose Cod_Op_Bco has no match in Criteria are flagged UNCLASSIFIED in the seven accounting columns of UMSATZ. They don't affect SAP (excluded by RN-04). An operational signal that the catalog should be extended.
RN-07
SAP file totalizer
The SAP file ends with an F line containing the algebraic sum of the original amounts of every GST− transaction. Sign is preserved (debits are negative). The sum is computed on the original amount — not on the split's partial components.
RN-08
Operational constants
Each client sets its own constants: receiver tax ID, currency, document code, computable-asset account for the split, and its own bank and criteria catalogs. All configurable from Google Sheets — changing them does not require touching the scenario.
§05 · Outputs

The two generated files


Every run produces two timestamped, versioned files. The first feeds SAP; the second is for audit.

ND_SAP_<banco>_<timestamp>.txt
SAP load file
Pipe-delimited plain text. Three blocks: an H header line, N detail lines (one per GST− transaction, or two on a split), and an F totalizer line. CRLF at the end of every line.
H|<Banco>|<Codigo_Proveedor>|<Moneda>|<N_Factura>|<Fecha_DDMMYY>|<Fecha_ISO>|<Ejercicio>|<Periodo>|<CUIT>|<Codigo_Doc>|<BCRA_4>|<Folio>

<Cuenta_Contable>|<Concepto>|<Indicador_Impuesto>|<CECO>|<Importe>
...

F|<Suma_GST−>
UMSATZ_<banco>_<timestamp>.csv
Audit file
CSV with every transaction from the statement, classified or UNCLASSIFIED. Header in the first row. 17 columns: bank code, date, voucher, amount, description, operation code, download date, category, key, ledger account, concept, tax indicator, cost center, sign, and two reserved columns.
Codigo_Banco, Fecha, Comprobante, Importe, Descripcion, Cod_Op_Bco, Fecha_Descarga, COD_2, Clave, COD_2, Cuenta_Contable, Concepto, Indicador_Impuesto, CECO, Sentido, Col16, Col17
§06 · Operation & maintenance

How it runs day to day


DAY TO DAY
100% unattended
You send the CSV to the configured mailbox. You wait ~30 seconds. You pick up the two files from Drive. No human intervention in between.
BCRA CATALOG
Add a bank
Add one row per operating account: BCRA code, official name, and account number exactly as it appears in the statement. Test with a real statement before going to production.
CRITERIA CATALOG
Add a criterion
When UNCLASSIFIED appears in UMSATZ, you identify the operation code, define the category (GST−/GST+), account, indicator, and cost center with accounting, and add a row to the catalog.
Monitoring

Make.com keeps an auditable log for every run: email received and attachments, AI model response, bundles processed per module, files uploaded to Drive, errors and retries. Every run can be audited individually from the console.

§07 · Scope & assumptions

What it covers and what it doesn't


§ ASSUMPTIONS● BASE
  • Statements arrive in CSV format with a stable structure.
  • Each email contains a single statement from a single bank.
  • The account structure does not change between statements from the same bank.
  • The BCRA and Criteria catalogs are kept up to date.
§ OUT OF SCOPE (v1)● ROADMAP
  • Automatic notification to the accounting team on completion.
  • Duplicate detection (re-sending generates two runs).
  • Explicit abort if the bank isn't registered.
  • Batch processing (multiple statements in a single email).
  • Tracking dashboard (Looker Studio).
§08 · Next step● ACTION

Migrating to SAP or loading notes by hand?

If your accounting team assembles load files manually every month, book a call. The first conversation is to understand your chart of accounts, your catalogs, and your criteria — and send you a concrete proposal.

END OF SHEET 10 ai-q.fit · debit notes © 2026 · Dr. Federico Andino