Special projects

BankGuard

Checks 1C and client-bank exchange files before import: a truncated statement, a repeated document, totals that don’t add up. The source file is never changed.

Type
1C statement checker
Stack
Python
Code
Open on GitHub
Year
2026

A statement inspection bench

Statement sheets pass under a probe and are only read. A counter reconciles the balance: opening plus receipts minus payments must equal closing, and a repeated document raises a flag.

BANKGUARD012345678901234567890123456789
Red flag: an error found, and the file stays as it wasStatement sheet: the probe only reads it, the source file is not changedPunch card: each document punches its own hole, a repeat finds one already punchedA tabletop model of BankGuard, a Python check of 1C and client-bank exchange files before they are loaded. The sheets of a made-up statement of eight documents ride a rail under the probes and are only read. A punch card remembers the documents: a repeat by account, type, date and number punches an already punched hole and a flag goes up. A counter adds receipts and payments, and a balance compares them with the end of the file: opening balance plus receipts minus payments must equal the closing balance. A cut-off file stops at the gate. There are four files: a clean statement, a repeated document, totals that don’t add up and a cut-off file; the sheets always leave the other side exactly as they came in.

Why

If a statement is truncated, repeats a document or its totals don’t match the payments, the error lands in the books. BankGuard reads the file, reports an error code and the line, and fixes nothing itself. It needs no access to the bank or the 1C database.

What it checks

Section structure and file closing, format version and encoding, 20-digit accounts, dates and amounts, and repeated documents by account, type, date and number. Above all: the opening balance plus receipts minus payments must equal the closing balance.

Under the hood

  • Formats 1.01, 1.02 and 1.03.
  • A repeat across files is a warning, within a file an error.
  • A mode for outgoing orders with no posting date yet.
  • JSON output for automation.
Code on GitHub

Shall we talk about your project?

Discuss your project