Plank help · updated 2026-11-22
Importing a bank statement into 1C (Kazakhstan)
The working regulation for posting a bank statement into 1C over OData — arithmetic controls, duplicate protection, classifying each operation, taxes and penalties by КНП/КБК, and the five fund payments that need employee lists before they can be created.
Agents: fetch the raw markdown of this page at /en/help/1c-bank-statement-import.md
Importing a bank statement into 1C (Kazakhstan)
This is the working regulation for loading a bank statement into 1C over the standard OData interface, safely and verifiably. It was distilled from a production import against a «Бухгалтерский учет для Казахстана, редакция 2.5» database and is written for both the accountant and the assistant doing the technical work — the assistant runs every command here, and the user never needs a terminal.
The scripts already exist. This whole regulation ships as working, adaptable Python in the 1C starter kit — the parser, the arithmetic controls, the five list-payment recognisers, the dry run, the importer, the reconciliation. Look for
scripts/1c/before writing anything, and install the kit if it isn't there. Each section below names the file that implements it.
Read Working with 1C over OData first. This page assumes its rules and does not repeat them — in particular §3, on establishing what your integration user is allowed to do. If that user can create documents but not edit, delete, or post them, get the role widened before a real import: this workflow produces dozens of documents at a time, and a restricted user turns every mistake into manual cleanup in the 1C interface.
Use it when you need to:
- parse a
1CClientBankExchangestatement; - create incoming and outgoing payment documents;
- handle payment orders from a QR/acquiring provider;
- match counterparties, contracts, and bank accounts;
- form pension, social, and medical-insurance payments with employee lists;
- record taxes and penalties with the right КНП, КБК, and operation type;
- prove every operation in the statement is reflected once and only once;
- create every document unposted, reconcile it, then post it yourself — showing «было → станет» in the chat first.
1. The safety principle
Full verification first, then drafts, then a second reconciliation, and only then — posting.
Until the reconciliation is finished, every created document must have:
Posted=false— not posted;DeletionMark=false— not marked for deletion;Оплачено=true— the operation genuinely appears in the bank statement;- a clear comment saying the document was created from a bank statement and needs review.
Posting changes accounting registers, so it is a separate step after the reconciliation, done with post-documents.py — never by writing Posted. Posting, unposting, marking, unmarking and deleting are the assistant's to do on its own initiative (ADR 0024, PB788): the agent shows «было/станет» in the chat and writes itself, without waiting for a person.
2. What is the source of truth
In priority order:
- The bank statement — the source of operation date, bank document number, amount, direction, purpose, КНП, BIN/IIN, and IBAN.
- The separate bank file with the employee list — the source of each employee's full name, IIN, period, and amount.
- 1C catalogs — the source of internal references to counterparty, individual, contract, bank account, tax, and accounting accounts.
- Previously correct 1C documents — the source of structure and configuration attributes, but never of the current amount or the current bank account.
- The user — the source of decisions on ambiguous classification.
Critically: the "main account" stored on a counterparty card does not outrank the IBAN in the current statement. For each payment, use the account the bank named.
3. Terms
| Term | Meaning |
|---|---|
| КНП | Payment purpose code |
| КБК | Budget classification code |
| ИИК | Bank account in IBAN format |
| Draft | An unposted 1C document, Posted=false |
| Bank number | НомерДокумента from the bank file; stored in 1C as НомерВходящегоДокумента |
| Internal 1C number | The Number field, assigned automatically by 1C |
| Basis document | ОПВПеречислениеВФонды or СОПеречислениеВФонды, carrying the list of individuals |
The OData entity sets involved:
| Purpose | Entity set |
|---|---|
| Outgoing payment order | Document_ПлатежноеПоручениеИсходящее |
| Incoming payment order | Document_ПлатежноеПоручениеВходящее |
| Payment order, debit | Document_ПлатежныйОрдерСписаниеДенежныхСредств |
| Payment order, credit | Document_ПлатежныйОрдерПоступлениеДенежныхСредств |
| Basis for ОПВ/ОПВР | Document_ОПВПеречислениеВФонды |
| Basis for СО/ООСМС/ВОСМС | Document_СОПеречислениеВФонды |
| Counterparties | Catalog_Контрагенты |
| Bank accounts | Catalog_БанковскиеСчета |
| Contracts | Catalog_ДоговорыКонтрагентов |
| Individuals | Catalog_ФизическиеЛица |
| Taxes, duties, contributions | Catalog_НалогиСборыОтчисления |
| VAT rates | Catalog_СтавкиНДС |
4. Input files
Parsed by scripts/1c/bank-statement/_statement.py (the statement) and _employee_lists.py (the list files).
4.1 The statement
Supported format: 1CClientBankExchange. The header must carry ДатаНачала, ДатаКонца, РасчСчет, НачальныйОстаток, ВсегоПоступило, ВсегоСписано, КонечныйОстаток.
Each operation needs at least: НомерДокумента, ДатаДокумента, ДатаОперации, ВидДокумента, payer and payee, BIN/IIN, ИИК, СуммаПриход or СуммаРасход, НазначениеПлатежа, КодНазначенияПлатежа.
Direction is never guessed. A row with only Сумма is read as outgoing when the payer's account is the statement's own and as incoming when the payee's is. A row that says neither — no СуммаПриход/СуммаРасход and our account on neither side — stops the parse with the row's number, because direction decides whether the document is an incoming or an outgoing payment. Until 2026-09-17 such a row was silently written as outgoing.
4.2 Employee-list files
A «Платежное поручение со списком» cannot be created from the main statement alone. It needs a separate 1CClientBankExchange 2.00 file containing a СПИСОКСОТРУДНИКОВ block, where every employee row carries СОТРУДНИК (full name), СотрудникБИН_ИИН, СотрудникДатаРождения, Период in ММГГГГ format, and Сумма.
If the file is absent, the document is not created. Stop that line of the import and ask the user for the list. A list payment created from the aggregate amount alone is a wrong document that you will not be able to repair.
4.3 Whose statement is it?
Before the arithmetic, before anything: confirm the statement belongs to the company this workspace is configured for. The statement's own РасчСчет must equal mapping.organization_account.iban, and the base must actually hold the organisation mapping.json pins.
This is not a formality, and the four arithmetic equalities in §5 do not cover it: they prove the file is internally consistent, which it is just as much when the file belongs to another client. An accountant with 17 companies has 17 bases, and a mapping that was copied and never adapted points at the previous one. The import then succeeds, reconciles, and reports cleanly — into somebody else's books.
import-statement.py now checks both and treats either failure as an error. The full rule, including the case where one base holds two organisations with almost the same name, is §2.5 of the OData rules.
4.4 Several bases in one workspace
One workspace can be set up for several 1C bases — one accounting practice runs four out of a single scripts/1c, another ten. Each base is one pair of files: a credentials.json and a mapping. The mapping is what selects the base, and it is named after the client:
scripts/1c/mapping.json ← the base a run with no --mapping means
scripts/1c/<client>-mapping.json
scripts/1c/<client>-mapping.json
See what is configured — it connects to nothing and takes a second:
python3 scripts/1c/odata/bases.py
It prints, for each base, the --mapping argument to pass, the organisation the mapping pins, the platform connection it uses, and the base profile learned for it.
Three things follow, and they matter more than they look:
- Name the base in every command. With more than one base configured, a run with no
--mappingrefuses instead of guessing, and lists the bases. It used to takemapping.jsonbecause of what that file is called, which is right once and somebody else's books the rest of the time. - Everything learned per base is stored per base.
<client>-mapping.jsongets<client>-base-profile.jsonand its own «Правила учёта» page. A workspace with ONE base is unaffected:mapping.jsonkeepsbase-profile.jsonexactly as before, so there is nothing to move or rename. - A mapping that does not match its base stops the run. If the credentials reach one company's base while the mapping describes another, the run refuses before writing anything and names both files and both companies. That is a configuration mismatch — the two files are from different clients — not a fault in the kit. Fix it by pointing
--mapping(and--credentials) at the pair that belongs together.
4.1 One base, several organisations
A base is not a company. One can hold four — a head office and three branches, each with its own БИН, its own document prefix, and its own or no settlement account. That is not four bases: it is one credential, one mapping and one cached index.
python3 scripts/1c/odata/organizations.py
Reads the base, writes nothing, and prints every organisation — Ref_Key, БИН, prefix, bank accounts — and then the base_organizations block to paste into mapping.json. Two things it says that save you a trip into 1C: an organisation registered from 2019 onwards has no РНН and that is normal, and an organisation with no settlement account cannot have a bank statement at all. Both are answers, not blanks to fill.
Two shapes it handles that are easy to miss when you read the list yourself:
-
A card with no account number is not a settlement account. Deposit cards and the like carry no
НомерСчета, so no statement can belong to them; they are listed separately and never proposed. An organisation whose cards are all like that gets noaccountline at all — the same answer as one with no card. -
The same account number can belong to several of the organisations, because a branch may hold a card for the head office's account. The block says so on every organisation that proposes it, and
--organization <IBAN>then refuses to choose between them rather than picking one. Decide which organisation the statement for that number belongs to, and leave the account on that one only. -
Declare them in ONE mapping, under
base_organizations, instead oforganization/organization_account. Filling both is refused — a question answered in two places is how a run lands in another company's books with every check passing. Four separate mapping files would also work, and would hold four copies of everything that describes the base (entity sets, cash-flow articles, tax fields, every recorded decision). Copies drift. -
Say which organisation each command is for:
--organization <key>. The key, theRef_Key, the IBAN off the statement in front of you, or the full name — exact, never a fragment, because two branch names can differ by one word. A run given none refuses and lists them; it never takes the first. -
For a bank statement you usually do not have to say it.
import-statement.pyoffers the account the statement was issued for as that argument by itself, so a file from any branch finds its own organisation in the list and the run prints which one it chose, by which account and on what basis. Nothing to remember, nothing to match up by hand.Two things that stop it, both of them refusals with the way out printed, never a guess:
- The number belongs to several of your organisations (a branch holding a card for the head office's account). If the file is a bank's XLSX export, it names the account holder's БИН in its preamble and that settles it — a БИН is unique per organisation where an account number is not. A
1CClientBankExchange(.txt) file names no holder, so for those numbers the answer is not in the file at all: the run lists the organisations and the--organizationline that picks each one. - The organisation has several cards for that number. The company is clear; which card the documents should reference is not, and a document references the card. Record the answer once —
organizations.pyprints thebase_organizationsblock with one account per organisation — and it is never asked again.
An organisation you named yourself always wins. What the statement can do is contradict it: if the account the file was issued for belongs to a different one of your companies, the run stops and names both, rather than quietly writing into either.
- The number belongs to several of your organisations (a branch holding a card for the head office's account). If the file is a bank's XLSX export, it names the account holder's БИН in its preamble and that settles it — a БИН is unique per organisation where an account number is not. A
-
Another organisation's document is not your duplicate. A document of the same base with the same type, incoming number, date and amount belonging to another of its companies no longer reads as «already imported» — which it did, and which is why those document prefixes exist. A document the base files under no organisation at all still counts as a possible duplicate: unattributable is not somebody else's.
-
Each organisation gets its own profile (
base-profile-ALM.json) and its own «Правила учёта» page, because a head office and a branch book differently. They share the cached index on purpose: it holds the base's own rows, and those do not depend on which company is asking. -
A branch with no settlement account has no statement to import, and the run says so instead of writing one against a blank account.
5. Arithmetic controls
Implemented by verify_arithmetic() in scripts/1c/bank-statement/_statement.py. Run it on its own, without credentials, with parse-statement.py.
Before touching 1C, four equalities must hold:
- The sum of all
СуммаПриходequalsВсегоПоступило. - The sum of all
СуммаРасходequalsВсегоСписано. Начальный остаток + Поступления − Списания = Конечный остаток.- The number of recognised
СекцияДокумент=выпискаsections equals the number of rows processed.
A figure the bank wrote is checked even when it is 0,00 — ВсегоПоступило=0.00 over a file that holds a receipt is exactly the discrepancy these checks exist to catch, and until 2026-09-25 it passed. A bank that exports a month as one СекцияРасчСчет per day gives one statement: the opening balance is the first day's, the closing balance the last day's, and the turnover is the sum of the days; days whose balances do not chain (a day missing or out of order) are refused, and so is a file naming two different accounts. Keys are read whatever case the bank writes them in (СЕКЦИЯРАСЧСЧЕТ, СУММА=) — a file written in upper case used to parse to zero operations.
If the arithmetic doesn't reconcile, stop the import. Never paper over a discrepancy with a manual correcting row that the bank doesn't explain.
The statement's balance against 1C's (bank kit 1.50.0) — information only. The dry run compares the statement's opening and closing balance with 1C's on account 1030 by the card of the statement's own bank account, and says it in the report: balance-opening-differs means the gap already exists at the statement's first day, before any of its lines, so this import neither caused it nor can fix it (measured by hand on one ИП: 6 727 151,62 ₸ already at 01.01.2026 while the period's turnovers matched); balance-closing-differs says how much of the closing gap carried over and how much the period added (posted documents only); balance-unchecked when 1C could not be read. Since bank kit 1.61.0 the closing balance is re-judged with the documents on this account in the period that 1C does not count yet — unposted drafts of earlier imports, other unposted documents, and the drafts this run would write: balance-closing-matches-after-posting says «1C now X; with N unposted documents — Y; the statement — Z: it closes once they are posted», and balance-closing-differs then names the drafts' sum and the remaining gap apart (and says when the remainder is exactly the opening gap); balance-unposted-documents lists them. Bank cash orders count too: a cash withdrawal (ПКО «ПолучениеНаличныхВБанке») takes money off the account, a cash deposit (РКО «ВзносНаличнымиВБанк») adds it. balance-rest-breakdown splits what is left: lines of this statement you excluded (not in 1C on this account — if you enter them another way, check they are there), declined lines (their reasons are in the report), lines waiting for files, and the opening gap, then «unexplained: …» or «explained in full». A statement that states no opening or closing balance, or whose account card is in a foreign currency (1C keeps 1030 in tenge), is not compared at all: balance-not-stated, never «differs». It never holds a line, never changes the exit code, posts nothing, does not run on --apply, and --no-balance-check skips it.
6. The dry run is mandatory
Implemented by scripts/1c/bank-statement/import-statement.py, which writes nothing without --apply — and refuses --apply until mapping.json names the organisation and its settlement account.
Run without --apply first. The dry run must report:
- how many operations are in the file;
- how many already exist in 1C;
- how many documents would be created;
- the planned total;
- the breakdown by 1C document type;
- missing counterparties;
- missing bank accounts;
- operations that require an employee list;
- tax or otherwise ambiguous operations.
Warnings may be accepted only on a deliberate decision by the user. Errors never yield to that flag.
Write what was approved: --apply --confirm <code>. A dry run that has documents to write ends its notes with plan-confirm and a 16-character code. That code covers every document it would write and every counterparty or bank account it would create. After the user has read the dry run and agreed, run --apply --confirm <code> (plus --accept-warnings if they accepted warnings): the run writes exactly that, and if anything differs by then — a line, an amount, a field, a card to create — it writes nothing and says plan-changed. Run the dry run again and show it. The code is valid for 12 hours. Without --confirm, --apply behaves as before.
After a clean dry run, go straight to --apply --confirm <code>. Do not repeat the dry run with --refresh-index first: --apply always re-reads 1C to decide what already exists, so a second fresh dry run adds nothing — on a real base it cost 251 seconds. Run the dry run again only when the file, the mapping or a decision changed, or when the run says plan-changed.
6.1 One bad line does not hold the good ones
A line the run cannot write is declined — named in the report with its reason and with what you have to supply — while every other line is written. It is not a reason to hold the statement. That used to be the rule, and it cost a real February import 257 lines: 21 were unresolvable and nothing at all was written.
So a run has four outcomes, and the exit code tells them apart:
| exit | what happened |
|---|---|
0 | every line of the statement is in 1C |
3 | partial — the writable lines are in 1C, the rest are listed under «Не записано» |
1 | nothing was written: a problem with the whole run, or 1C refused a write |
4 | held — --apply was not allowed to write because warnings are waiting for the user's decision. Nothing was written. Show the warnings; pass the flags the report names only on the user's deliberate decision |
What still stops everything is what is true of the run rather than of one line: the statement's arithmetic does not reconcile, the base is not the company in the file, this base's rules have never been derived, the duplicate guard cannot be proven, or the final reconciliation does not add up.
Re-running after a partial import is the normal next step. Fix what the report asked for and run it again: the lines that landed are recognised and skipped, and only the ones you have resolved are written. No duplicates — a declined line was never written, so there is nothing to duplicate.
Never report a partial import as a finished one. The report says «ЧАСТИЧНЫЙ ИМПОРТ» in its title when it is one, and the exit code is not 0. Tell the user how many lines landed, how many did not, and what each of the latter needs.
«Write the confirmed lines» is a standing decision — record it once and stop asking. When the accountant says it («Загрузить подтверждённые», «спорные не трогай, остальное записывай»), record it:
python3 scripts/1c/bank-statement/record-run-policy.py --mapping <the import's mapping file> \
--unresolved-lines decline --approval "<who, date: her words>" --apply
That writes "run_policy": {"unresolved_lines": "decline", "approval": "…"} into mapping.json. From then on the report says «По записанному решению спорные строки не будут записаны: N строк на X ₸» (note unresolved-lines-recorded) and you do not ask whether to import the confirmed lines — write with --apply --confirm <code> and give her the «Не записано» list afterwards. A run with declined lines and nothing recorded says unresolved-lines-unrecorded and prints the command with the run's own --mapping: ask once, then record the answer (on a workspace with several bases the recorder refuses without --mapping; re-recording keeps an earlier exclude, --clear-exclude removes it). The record does not answer what holds the whole run — a run-level error, or a warning that needs its own --accept-warning <code> such as identical-rows-undecided; the note then says the run is HELD: resolve that first. Nothing that is checked changes — the duplicate guard, the warnings that need their own --accept-warning <code>, the --confirm code, exit code 3 and «ЧАСТИЧНЫЙ ИМПОРТ» stay. --exclude list_payments adds "exclude": ["list_payments"]: payment orders with an employee list (ОПВ, ОПВР, СО, ООСМС, ВОСМС, by КНП — on an ИП base also the sole trader's own contributions, 010/012/122) are then never imported and are counted under «Не импортируем по вашему решению». Nothing is excluded by a description; a payment recurring to the same payee is a skip with match («Решение на каждый месяц» in the kit README, generalise-decisions.py --recurring-skip).
6.2 The line to read first: «Сверка с источником»
Every report — dry run and result alike — opens with one table: what was written, what was already in 1C, what is waiting on files, what a standing decision excludes, and what was declined, with a count and a sum for each, against the file's own totals.
Read it before anything else in the report. A clean report is not evidence that a statement landed; this is. Every line of the file is in exactly one of those rows and the totals agree to the tiyn — and a run whose arithmetic does not close says so at the top and exits non-zero, because the only way a line can go missing silently is if nothing counts it.
6.3 What you ask the accountant, and in which words
An import never ends with «nothing written» because some lines are open. Asked to import a statement, you import it: everything that can be written is written, and what stays open is a short list of named lines with one accounting question each. «Ничего не записано, следующий безопасный шаг — …» is not an answer to «разнеси выписку». Measured on 2026-10-28: 313 operations, the arithmetic closed, and the turn wrote nothing, because the run listed open lines and the agent stopped there.
Since kit 1.55.0 the kit decides some of these itself, and says so. Every line a rule settled is listed in the report under «Решено по правилу» with the rule, the source document (number and date in 1C) and the figures, and only the accountant's own documents vote. With no approval needed: a buyer's payment is linked to its invoice (one unpaid invoice of that amount; the invoices the purpose names when they add up to the payment; an overpaid invoice, the rest as an advance; the VAT rate from the invoice; no invoice when that buyer's payments never carry one; what is already paid counts cash receipts, card operations and earlier lines of the same statement; invoice numbers restart each year, so the date in the purpose picks the year), and a row's settlement accounts follow the accountant's majority for that counterparty (at least 3 documents and 75 %). With an approval recorded once: a hand-entered document that is exactly this line (hand_entry_duplicates), and a fund payment with no list file that matches the accountant's previous list for that fund (fund_lists_from_previous). A recorded answer, payment_templates and settlement always win over a rule. If 1C does not let the kit read cash receipts or card operations, a link is the question invoice-paid-unknown instead: ask the accountant whether invoices in this base are ever paid in cash or by card — if never, record invoice_links.other_payment_sets: [] with her «approval»; otherwise the document has to be published in OData. What no rule settles is counted at the end of the report, «### Вопросы к человеку: N», one line per closed code with the statement lines it covers — that list is what you turn into the one message below.
Since kit 1.64.0 the kit also decides from the base's own history, and asks only when it has no ground. The ladder is fixed: your rules and recorded answers first (they always win), then the accountant's posted documents in this base — same document type and КНП, at least three, all agreeing, none older than a year; the kit's own documents never vote; a disagreement is a question that names every candidate, not a pick — then the chart of accounts and the Tax Code only where there is exactly one answer. A kind with no recorded «Вид операции» (bank fee, salary, loans, refunds) takes the one your documents of that КНП carry and the report says so under «Решено по правилу» with the rule «история базы», the newest source document and the count. A missing counterparty account that this same run creates on --apply is no longer counted as a question. Tax lines («choose the tax by КБК») are still a question, and so are duplicate guards, split precedents and conflicting rules.
Since kit 1.65.0 the account card of a known counterparty is created from the statement itself. If the counterparty is found exactly once by its БИН/ИИН and no other counterparty's card holds the statement's IBAN, --apply creates the account card and the report says «основание: БИН и IBAN из выписки». catalogs.auto_create_counterparties: false does not stop it (that flag is about counterparties); catalogs.auto_create_accounts: false does. An IBAN already on another counterparty's card, two counterparties with one БИН, or an unknown БИН stay a question.
Since kit 1.75.0 the contract and the cash-flow article come from the accountant's own posted documents, and a repeated question is asked once. Lines of one counterparty, one operation kind and the SAME contract number in the purpose (compared character by character: «ДБЗ-12» is not «ДБЗ-120») that her posted documents of this statement already close give the contract when there are at least three such lines in at least two documents and every one of them is on one card of that counterparty; the report says so under «Решено по правилу» with the document numbers. Any disagreement stays a question, and its text now says why her lines did not settle it. The answer can be recorded once with contract_decisions (counterparty БИН/ИИН + contract number + operation kind → the card's name; written by generalise-decisions.py --contract-decision), after which that agreement is not asked again. The article is taken from at least two of her posted documents of the same counterparty, kind and settlement account when they carry one and the same article; a deposit transfer is not touched. Lines that wait on one answer (the same counterparty, contract number and kind) are shown as ONE question with the list of lines — the lines stay held until it is answered.
Since kit 1.66.0 the run report's analytics event also says why an account line stays a question — the IBAN is already on another counterparty's card (other-owner-card), or account creation is switched off in the mapping (account-creation-off). Counts and closed codes only.
Since kit 1.67.0 two kinds of question are settled or collapsed. A deposit transfer whose card has at least three posted documents of the accountant within a year, all of them with account 1251, is written the way the history has it; the report says «основание: история базы: N образцов». One 1050 document among them, two different accounts or fewer than three documents keeps the question. And a batch with lines the kit cannot check against cash and card payments (invoice-paid-unknown) now asks ONE question per batch: «are your invoices closed only by the bank?». If yes, the kit writes invoice_links.other_payment_sets: [] with your approval and later statements go without it. The duplicate protection itself is unchanged.
Since kit 1.69.0 the acquiring counterparty is taken from the base. «Which counterparty stands in for the payment aggregator?» is no longer asked when at least three incoming payment orders posted by the accountant (this organisation, the same operation kind, within a year) all name the same counterparty and the history was read to the end. The report says «основание: история базы: N образцов». Two different counterparties, fewer than three orders or a cut-short read keeps the question. Penalties, lines without a BIN/IIN and tax lines stay questions.
Do the work in this order:
- Decide and show: find the answer yourself first, for every open question. Before anything reaches the accountant, look for the answer in this order: the decisions already recorded in
mapping.json(§7.2, §7.3, §10.2); the accountant's own posted documents for this counterparty, type and operation — documents this kit wrote never vote, because a kit that has imported a few months is otherwise interviewing itself; earlier statements and employee lists in this workspace; the base's catalogs. The payment aggregator's counterparty, a tax's type when the statement has no КБК, a line's contract, article or settlement account, and «is this already in 1C» are all questions you answer this way. «Follow this database's earlier documents» in a dry-run question is an instruction to you, not a question to forward. - Propose each answer with its basis. Say what you found and how strong it is, so it can be checked in one look: «счёт расчётов 3310 — так в 9 из 10 платежей бухгалтера этому поставщику, последний — п/п № 412 от 05.11», «уже в 1С: п/п № 87 от 03.11 на ту же сумму этому же контрагенту». A possible duplicate names each candidate in the report (number, date, amount,
Ref_Key) — quote it, do not read 1C again for it. When nothing gives a basis, say so plainly and list the candidates instead of choosing one. - Take every exclusion the accountant has already given — «платежи со списком не разносить», a skipped group, «это уже в 1С» — as a recorded decision for this run (§7.2, §7.3), so those lines stop holding the rest.
- Ask once, in one list, for one «да». Put every proposal and every remaining question in ONE message, each item naming its line (date, amount, payee), and ask for «да» or a correction per item — not one question per turn, and not a second round for the lines you could have proposed in the first. On 2026-11-12 this turned 23 questions on a 72-line statement into one «да» on three proposals.
- Record what the accountant confirmed as the kit's decision — the existing keys of §7 and §10, or the approval keys above, with the date and the accountant's own words in
approval— so the next statement does not ask it again. A confirmed proposal is not applied by talking about it: the line is written only once the decision is recorded and the run re-reads it. - Write the rest:
--apply --confirm <code>over everything resolved (§6.1), and list what was left out and why.
These stay a question, with no proposal presented as the answer (show what you found, let the accountant pick): which base or which organisation a statement is for (§4.3); a possible duplicate with several candidates, or two statement lines nothing tells apart (§7); data that exists nowhere — the employee list behind a fund payment is the bank's file, so ask for it unless the approval above covers it (§4.2, §12); and writing to 1C at all, which needs the accountant's «да» on the dry run. Nothing here relaxes the duplicate guard or a check the kit refuses on: a proposal nobody has confirmed is never a reason for --accept-warnings, and a document on ANOTHER of the organisation's accounts is not a duplicate of this line.
If the run will not write anything while some lines are still open, make it write: record the open lines as decisions, or accept the warnings that hold it once the accountant has answered. Saying that the importer cannot do it is not one of the options.
The person running an import is an accountant. A question is worth their time only if it is one an accountant decides, asked in an accountant's words. Measured on 2026-10-28: one July import asked «к кому относится файл?», «как слить изменения манифестов?», and «сначала решить блокировки или загрузить подтверждённые?». The second was answered with «загрузи выписку», the third left blank, and the accountant asked for the kit to be updated because the agent had said it was out of date.
- Ask only what the accountant decides. Is this line already in 1C? Which counterparty, contract, article or tax? Skip this line or write it? Each question names the line (date, amount, payee), says what you found and offers the answers.
- Never ask about the machinery. The kit, its version, manifests,
mapping.jsonkeys, merging files, OData, the dry run, flags and file-format names are yours to handle, and none of them is a question for the accountant. Say «выгрузка из банк-клиента для 1С (.txt)», not «1CClientBankExchange». Say «вид документа», not «ВидДокумента». - Never offer options nobody can tell apart. «Сначала решить блокировки / загрузить подтверждённые» names nothing the accountant can check. If lines are held, ask about each held line in accounting terms, or write the rest and list the held lines with their reasons (§6.1).
- A kit warning (
1С-кит устарел,mapping-key-unread) is not the accountant's. Do not report it as a problem with their setup, and do not ask them how to update anything. If the unread key holds a decision that changes a line of THIS statement, say the decision in accounting words, for example «для платежей с КНП 190 записана статья «…», а эта версия скриптов её не применит». Then ask whether to write those lines with the default or leave them out. That answer is what--accept-warningsrecords. Otherwise carry on and say nothing about it. The check stops nothing, on an older copy too, whose line opens with «1С-кит устарел» and has no sentence for the accountant. If the drift is why something was not written, the accountant gets only this, in a scheduled or triggered run too: «Не записано: <документ, дата, сумма>. Программы Plank для 1С в этом пространстве нужно обновить, это работа команды Plank, от вас ничего не нужно.» Never say the team already knows: nothing reports this to the team. A file that differs is never replaced whole (/help/1c-starter-kit). - Never ask what the file or the base already answers. That includes which company a statement belongs to when its account is the organisation's own (§4.3).
7. Duplicate protection
Implemented by scripts/1c/odata/_signature.py.
Bank numbers repeat across dates and years, so a number alone is not an identity. Use the composite signature — document type + bank number + operation date + amount — corroborated by direction, BIN/IIN, ИИК, purpose, and КНП. The full reasoning is in Working with 1C over OData §6.
That signature is also the only thing that makes a row a duplicate. Two rows that merely look alike — same amount, same day, different bank numbers — are two movements until something proves otherwise; §13.2 is the bar.
And the signature only finds documents that were written the way you write them. A payment the accountant typed into 1C by hand carries no bank number and no anchor, so it can never collide with a statement line however complete the index looks — see Working with 1C over OData §6, "Signable is not matchable". Before writing, sweep the settlement account over the statement period for documents with no anchor of yours and no matching signature, cross-check them against the statement by (date, amount, direction), and put the hits in the dry run as questions. That sweep is the only thing standing between a hand-entered payment and a second copy of it.
7.1 A transfer between the company's own accounts
Money moved from one of the company's accounts to another is one document in 1C and appears in two statements — as a debit on the source account and as a credit on the destination. Whoever imports first creates it; the other statement then offers the same money again under a different bank number.
1C models it as a different operation kind (ПереводНаДругойСчет in a typical Kazakhstan configuration): no counterparty and no contract, with «Счет контрагента» holding the destination account of the same organisation. Configure the kind in mapping.json (operation_types.own_transfer); leave it empty and the kit reports such lines and refuses to guess.
The line is recognised as already imported, not as an error. Erroring would be permanent — the document is never going to stop existing, so the statement could never be imported at all.
Two things make that recognition work, and one breaks it:
- Matching is on the pair of accounts, direction-agnostic, because the same transfer is a debit in one file and a credit in the other.
- It looks across every document type the run read, not just the one this line classifies as. A base may book these as «Платежный ордер» while the statement says «Платежное поручение».
- It goes quiet if a counterparty card in the base carries one of your own IBANs. That card is usually the by-product of an interrupted import: the other side of an own transfer is named in the statement exactly like a counterparty, with the company's own name and БИН. The kit refuses to create one. If you find one, report it — do not work around it, because with it in place four transfers already in the base look like four new payments.
Measured on one April statement: four such lines, 4 400 000 ₸, all already in the base.
The mirror is recognised by the accounts, the date, the amount and the DIRECTION — not by the operation kind. The accountant may have entered the move under a kind of her own; an incoming line on account X from your own account Y moves money Y→X, and the other side is an outgoing document out of Y into X (or an incoming X/Y entered by hand) with the exact date and the same amount; the report names the kind it found. An outgoing X→Y of the same amount that day is the REVERSE transfer, another payment, and is not a mirror. One document is the mirror of one line: two equal transfers in a day and one mirror in 1C are one «already there» and one to write.
The incoming side with no mirror is a question, never a default (kit 1.76.0). An accountant books an own transfer once, as an outgoing document, and never the incoming side. So an incoming КНП 342/343 line that nothing mirrors is refused (own-transfer-incoming-unconfirmed, exit code 3): check first whether the outgoing document sits on another date. It is written only from a narrow recorded answer — cash_flow_articles.by_direction_knp["in:342"], by_signature, payment_families, by_entity_knp — or from the accountant's own precedent: at least two posted incoming own-transfer documents that carry the same article (the kit's own documents never vote). The default article and a rule learned from outgoing payments never apply.
An incoming contribution refund (КНП 010, 012, 089, 121, 122) is refused too (contribution-refund-unmapped): enter it in 1C with the «Возврат…» kind, as you did before; the report names your last such document. in:<КНП> does not lift this — only a narrow record does. The kit does not write «Возврат…» kinds.
A transfer the kit wrote that you later mirrored is named as a duplicate. Every run (reconcile.py and the dry run) looks at the incoming own-transfer documents this kit wrote, not only the statement's month; once the other side exists, the kit's document is the second one. A duplicate dated INSIDE the statement's period makes the reconciliation not OK; one dated outside it (another month's) is named in its own section and in the manifest but does not change the verdict — a June document must not turn November's report red. At most 10 days of the base are read per run, newest first (days of the statement itself are not read again); the rest is named in own-transfer-duplicate-unchecked with the number of days and the range. reconcile.py --duplicates-manifest PATH writes exactly those documents (inside the period or not) as a manifest for mark-for-deletion.py --manifest PATH; marking happens after your «yes».
7.2 Lines you have decided not to import
Some statement lines are not this flow's to book — a company whose salary is paid outside it, or a payment the accountant has already entered by hand under 1C's own number (§7). Record the decision in mapping.json and the run stops asking:
"intentional_source_skips": [
{"source_key": "83|2026-04-03|300000.00",
"reason": "Зарплатная строка. Правило компании: зарплату из выписок не разносить."}
]
The key is the statement's own three facts — номер|дата|сумма — normalised the way the duplicate guard normalises them, so padding or a comma decimal cannot make a decision miss. A skipped line is counted, listed in the report with its amount and your reason, and never written, and it is checked before anything else, so a line nobody is going to write does not fill the report with findings about itself.
Write down why, not just that. The report shows the reason back to whoever reads it next month, and «no reason recorded» is how a rule outlives the situation it was written for. These skips are also the right home for a §7 hand-entered payment once the accountant has confirmed it.
A source_key names one line of one statement, so on its own a skip never covers next month's salary. For a payment that recurs, the skip can also carry match — the payee, the КНП and how the purpose begins — and then it covers the same payment in any statement (§10.2.1 explains match). The line is still counted and listed, with the record that covered it named («your rule recorded for line 37 of 11.03.2026»). A skip whose reason is «Уже в 1С: …» is about one document and is never widened. Widening a skip is the accountant's decision, not the assistant's: generalise-decisions.py --recurring-skip <key> adds match only to the skips she names.
Rows the file cannot tell apart — identical in date, amount, counterparty, КНП and purpose, different only in the bank's own number — are answered by duplicate_decisions.skip_source_groups («one payment exported several times: create none of these», with a reason) or approved_distinct_source_groups («separate payments: write them all»). A skip group suppresses money, so it is checked against the file before it is applied, and its rows — plus every row identical to them — are declined rather than suppressed or written when: the file holds an identical row the group does not name; the rows it names are not identical to each other; one row is named by two groups; or a key is malformed, the group names fewer than two rows, or only part of it is in this file. A padded number or a comma decimal is formatting and still matches. A group only partly approved as distinct still asks about the rest.
7.3 «Это уже в 1С» — записать один раз
A payment the accountant entered by hand carries 1C's own number, not the bank's, so the duplicate guard cannot see it (§7). Once a person has confirmed which document it is, write the answer down and the run stops asking. Three shapes, all read:
"duplicate_decisions": {
"known_existing_by_signature": {
"outgoing_payment_order|91|2026-02-14|1500000.00": "<Ref_Key в 1С>"
}
},
"existing_document_overrides": [
{"source_number": "250", "entity": "outgoing_payment_order", "ref_key": "<Ref_Key>"}
],
"preaccounted_operations": {
"<Ref_Key в 1С>": ["366", "363", "365"]
}
preaccounted_operations is the many-to-one shape: several payments went out, and the accountant entered them as one document. Its only evidence that it names the right document is that the lines add up, so every part of that is checked rather than trusted, and each check is a refusal you can read:
- every number it names must be in this statement. Some present and some missing is refused whole and names the missing ones — a sum cannot be checked against part of a set, and the remainder would read as unaccounted for. None present means the record belongs to another period, and this run says nothing about it;
- the document must be in the base and posted. An unposted draft moves no register, so lines it «covers» would be in no ledger at all;
- «Сумма документа» must equal the lines' total to the tiyn.
Its «Вид операции» is reported, never required: the record says «these lines are that document», not what kind of document it is.
Since kit 1.71.0 the run finds such a document itself and asks (possible-aggregated-duplicate). When a document the accountant wrote — same date, direction, our account and counterparty — is for exactly the sum of 2–6 statement lines that nothing else covers, those lines are not written: the report names the document (number, date, amount, Ref_Key, posted or not) and which lines add up to it. Show the accountant the document and ask one question: is it these payments? If yes (and it is posted) — record preaccounted_operations; if the line is a separate payment — duplicate_decisions.distinct_from_cash_orders with the line's signature and the documents it is not. The report prints both records ready to paste. An unposted draft of that amount asks too. Before 1.71.0 these lines were written a second time.
Since kit 1.72.0, with the hand_entry_duplicates approval, k identical statement lines against exactly k posted documents of the accountant's are «already in 1C» as a group. Same direction, date, amount and counterparty, same date, amount, counterparty and our account on the documents: all k lines are counted as imported, nothing is written, and the report lists one decision per line («строк k, документов k»). It is a group answer — which line is which document does not change the money. If the numbers differ (2 lines, 1 document; 2 lines, 3 documents), a document is unposted, was written by this kit or moves the money the other way, or a candidate belongs to another line, every line stays possible-duplicate-on-this-account and its text says how many lines and documents there were. A line the duplicate check already found by its bank number is left out of the count together with its document. Without the approval nothing changes.
The line is then counted as already imported, never written again, and the report names which of the two records answered — a run that says «already in 1C» without saying how it knows is a run you cannot check.
existing_document_overrides is checked in 1C, not trusted: the document it names must belong to your organisation and to this statement's account (or the account organization_account_overrides records for the row), be dated on the line's date, be for exactly the line's amount, and not be marked for deletion. If any of that fails, the line is declined — neither written (the record may be right about a duplicate) nor counted as imported — and the report says which fact disagreed. The check is free when the document is dated inside the statement (the duplicate check already read it); otherwise the named documents are read by reference, one request per document type per run.
The order matters and it is deliberate: this is asked only after the duplicate index has said «this row is new». A record can never hide a document the guard can see for itself; it only covers the one case the guard structurally cannot.
What the duplicate check reads, and what it does not
It reads the documents dated inside the statement's own period, not the base. That is the difference between a run whose cost is the statement and a run whose cost is the customer: on one real base the three payment document sets hold 216 540, 201 970 and 315 361 documents, and reading all of them to check 263 statement lines is a read that does not finish.
It is safe because a duplicate is matched on тип | номер | дата | сумма — and the anchor this kit writes is a digest of that same identity — so a document dated outside the statement cannot be a duplicate of a line inside it. Every other «is this already here» check (a payment already on this account, the other half of an own transfer, a cash order for the same money) compares the document's own date and amount too.
If your publication will not answer that narrowed read, the run says so and stops. It names the filter and quotes what the base answered, and it does not quietly read the whole set instead. --full-index-read restores the old behaviour for such a base — it is something you pass deliberately, knowing it costs tens of minutes per document type.
The base's own history is a second, slower read that happens only if a line asks for it. «Which contract does this counterparty use», «which of two same-named cash-flow articles», «which tax did this purpose sentence mean» are questions about the whole posted history and cannot be answered from one month of it, so the history is still read in full when one of them comes up. Running learn-base.py first is what keeps most runs from ever asking.
The history is the most recent that can answer, not the whole of it. Which contract a counterparty uses, which article, which tax, which fields to fill are taken from the month before the statement's month first; only if that month holds no answer does the run look at three months, then twelve, then the whole history. A counterparty's contract is read from that counterparty's own payments. So a base that changed a contract or an article recently gets the new one. «This base never does X» is still said only after the whole history has been read. On a real base this is the difference between an hour and under a minute for the first run of the day.
That history is read once per document type per run, and kept for a day. The template for a line, the fields this base fills on every posted document, and the contract/article/tax precedent all read the same whole history of a type — once, shared. A whole read is cached per type under synced_data/1c/index-cache/ (index-….history-….json.gz) and the next run within 24 hours — a dry run or the --apply after it — takes it from there instead of 1C. On a real base that history is ~200 000 documents per payment type and takes 15–25 minutes to read, so the first dry run of the day pays it and the rest do not. When a statement needs several types, they are read together. --refresh-index reads everything from 1C again; deleting those files does the same for the history alone. The history never answers «is this line already in 1C» — that is always the fresh window read above.
7.4 When the base is slow, or stops answering
A partial read makes every unread operation look absent, so the run refuses to write when it could not read everything it asked for.
- A page that takes longer than a minute is a slow publication, not a broken one. Raise
timeout_secondsinscripts/1c/credentials.json(240 is a reasonable first try). - HTTP 503 with a «Service Unavailable» page means the web server did not hand the request to 1C at all. It comes and goes on a hosted base under load, typically right after a long run. Wait; do not go changing publication settings.
- HTTP 403 with «Ошибка разделения доступа к информационной базе» means a file base is being held exclusively — a configurator session, «Тестирование и исправление», or a session that never let go. It is not a rights problem. Wait, or ask whoever is in the base to close it.
- Check the 1C web client to tell these apart. If the browser opens the base normally and OData does not, nothing is misconfigured.
- A file base serves one request at a time. Do not start a second script against it while a long one is running: the second dies on its own timeout and looks exactly like an unreachable base.
--applyholds the base for the whole run. Another chat's write to the same base waits for the import to finish, and the import waits for it — «база занята другой записью агента, жду» on stderr is that queue, not a hang. If the other write held the base past the ceiling (10 minutes), the import stops before writing anything withbase-busy, exit 1, and a report that says «Ничего не записано»: tell the accountant the base is busy and run the same--apply --confirm …again later. Reads and the dry run never wait.
«Вид операции» for fund contributions
A payment of ОПВ, ОПВР, СО, ООСМС or ВОСМС is written as ПеречислениеНалога by default. Some configurations give contributions their own operation kind. If yours does, declare it — and only then does anything change:
"operation_types": {
"pension_contribution": "ПеречислениеПенсионныхВзносов",
"social_contribution": "ПеречислениеСоциальныхОтчислений",
"oosms_contribution": "…",
"vosms_contribution": "…"
}
pension_contribution covers ОПВ and ОПВР (КНП 010, 089), social_contribution covers СО (КНП 012) only, and ООСМС (121) and ВОСМС (122) each have their own key. They used to inherit social_contribution because they share the СО basis document, and a ВОСМС payment went out with the СО operation kind. If your base declares social_contribution but not a medical fund's key, that line is declined (operation-type-unmapped) naming the key, never written as СО. learn-base.py lists the kind your accountant's own posted payment orders carry per КНП; if the configuration has no separate kind and the accountant posts ОСМС with the СО one, record the СО member under the medical key — that is a valid answer. A base that declares none of these behaves exactly as before. Every line decided this way names the key that decided it in the report — and if no document the run read from your base carries that operation kind, it warns: enum values come from $metadata, and one your configuration does not publish fails the write.
Replacing a written document with one of another type
A line was written as one document type (say «Платежное поручение исходящее») and the accountant decides it is another («Платежный ордер (списание)»). The duplicate check will not write the new one — the money is already in the base — so the kit has a replacement, in four steps:
- Record the new type in
mapping.json(classification_overrides,document_type_overridesordocument_type_families). plan-replacement.py statement.txt --from outgoing_payment_order --to payment_order_debitreads 1C only and writes a plan: for every re-filed line, the ONE live original on this account with the same number, date and amount and this kit's anchor for that line. A document somebody entered by hand is taken only when named with--ref <Ref_Key>; two live candidates are a duplicate to resolve first, never a choice. The plan is bound to the statement file's sha256, the organisation and the account, and fingerprints every original.mark-replaced-originals.pymarks the originals for deletion — you run it yourself: show the list its dry run prints in the chat, then--apply --confirm CODE. A posted original is unposted first with--unpost(and one posted after the plan was made is refused), every original checked before the first change, then one at a time with a read-back. Nothing is deleted.import-statement.py statement.txt --replacement-plan PLAN: a fresh dry run, then--apply --confirm CODE.
What does not move: only this plan's verified originals leave the duplicate index — any other document carrying the line still blocks it (replacement-blocked). Each original is re-read right before its replacement is written, and one that changed stops the run (replacement-source-changed). A replacement run writes only the plan's lines, creates no catalog cards (--catalogs-only does that, with its own approval code), and running it again writes nothing (replacement-done). A plan for another statement, organisation or account is refused outright.
A payee with no БИН/ИИН (Kaspi QR)
A Kaspi QR merchant often appears only in the payment purpose — «Жетысу Трейд. Оплата с Kaspi QR», with no БИН/ИИН and no account. The kit never matches by name and never creates a card without an identifier, so such a line is declined (no-identifier), and the refusal names the key that can change it. Only the accountant decides that a payee may have a card without БИН/ИИН. Her decision goes into mapping.json, one entry per payee:
"catalogs": {"approved_name_only_parties": [
{"name": "Жетысу Трейд",
"purpose": "Жетысу Трейд. Оплата с Kaspi QR",
"allow_without_identifier": true,
"approval": "Асель, 15.10.2026: QR без БИН/ИИН, проверить дубли"}
]}
purposeis the payment purpose exactly as the statement writes it, and the entry applies only to a line with no БИН/ИИН and that purpose. An entry for a payee who is not in this statement does nothing.- All four fields are required and
allow_without_identifiermust betrue. An incomplete entry stops the run rather than being skipped. - Duplicates first. The kit looks for a card with the same name, ignoring case, quotes, «ё» and the words ТОО/ИП/АО. One live card → the line uses it and nothing is created. Several, one marked for deletion, or a folder → the line is declined as a question for the accountant (merge or unmark the card in 1C, or record the line in
payment_parties.by_signature). - None → the dry run lists
counterparty-new«WITHOUT БИН/ИИН» with the text of the decision, and the card is part of the--confirmcode. On--applythe decision and the absence of duplicates are checked again, the card is created with an empty БИН/ИИН and the comment «Без БИН/ИИН по решению: …», and it is read back by name. If exactly that card is not found, the run stops before any document is written.
Do not write an entry on your own judgement: propose it, let the accountant confirm it in the chat, and keep who and when in approval.
One account, several cards of one counterparty
An accountant sometimes keeps one IBAN on two cards of the same counterparty on purpose — a state fund's «для ОПВ» and «для ОПВР». That account is not missing, and the kit never creates another card for it (it used to: every run added a duplicate and the next --apply then stopped with «cannot be uniquely re-read»). Which card the document references is decided, in this order:
- a recorded answer —
payment_familiesorpayment_parties.by_signaturenaming the account for that kind of payment, orpinned_refs.bank_accountsnaming one card for every payment to that IBAN; - the accountant's own posted documents of the same type for this counterparty and КНП: at least two, all on one card (
account-from-precedent). Documents this kit wrote never vote; - otherwise the line is declined (
account-ambiguous, exit code 3), listing every card with its name andRef_Key. Ask the accountant which card that payment uses and record it. Never pick the first card, never decide by the card's name, and never create a third card to make the error go away.
The same IBAN on several live cards of other owners is not missing either: the line is declined account-doubled and nothing is created.
7.5 «Этот ключ никто не читает»
Every run that can write checks whether the copy of the kit installed in this workspace still reads the decisions your mapping.json holds, and lists them worst first.
This is not a formality. A kit update can replace the module that used to read a key: nothing errors, the report stays clean, the arithmetic still closes, and the run writes as if you had never answered. That has happened — 22 rows, 6 690 234,00 ₸ an accountant had explicitly ordered suppressed came back silently.
What to do when it fires:
- It holds the run, and you can clear it. Read the findings, decide, and re-run with
--accept-warnings. It never blocks outright, because a run you cannot start at month-end is worse than one you have to think about. - A key read by a kit that is not installed here is only information. A workspace with the ЭСФ scripts and no
bank-statement/folder is told which bank-statement decisions it holds, and its runs are not held over them. Install that kit and the same keys hold again if nothing reads them. - Some key names are also table members —
taxesandbank_accountsare entity sets,own_transferis an operation type. For those, a mention in the code is not enough: the kit has to read the key itself (mapping["taxes"],.get("taxes")). - It reads code, not prose. A key mentioned only in a comment or a docstring does not count as read, however clearly the file talks about it.
- If a decision is genuinely obsolete, rename its key with a leading underscore —
_payment_familiesinstead ofpayment_families. The record stays in the file, in your own words, and the check goes quiet. Deleting it loses the reasoning. - If the decision still applies, do not update the kit yourself in the middle of an import. Updating helps only when the PUBLISHED kit reads that key, and some recorded keys are read by no published kit at all — then an update changes nothing. A workspace's kit is often its own fork, and an overwrite has already deleted an accountant's decisions once, so kit updates on an existing workspace are Plank's team's job. Do not delete the key to silence the warning. What you do instead is in §6.3.
Decisions recorded for ONE line
Where a rule for a whole family of payments cannot answer, the decision is recorded against one statement line and the run obeys it. The order is always the same: a record about this row beats a rule, and a rule beats what the base has done before.
| key | what it decides |
|---|---|
document_type_overrides.by_source_signature | which 1C document your base files this line as. Read FIRST: every key below is keyed by document type, so until this one is settled none of them is visible. The check that no two lines of one file are the same document asks about this type too — the one the line will be written as |
document_type_families | the same, for a KIND of line («Kaspi acquiring is an incoming payment order in this base») — so the decision keeps working next month without being re-recorded |
payment_families | counterparty, account, cash-flow article and VAT for a whole class of payments. If two records match one line the run refuses rather than taking the first |
operation_type_overrides.by_source_signature | «Вид операции» for this line — a transfer between your own accounts, a refund to a customer |
payment_parties.by_signature | «Контрагент» and «Счет контрагента». An empty string means none, not look it up |
organization_account_overrides.by_signature | which of your accounts the payment left, when it is not the account this statement belongs to |
payment_templates.by_signature / .by_entity | a posted document to copy the accounting analytics from; requires_contract: false says this document carries no «Договор»; contract_ref names one outright |
payment_templates.vat_by_signature | «Сумма НДС» and «Ставка НДС» for the row, as an exact amount |
tax_decisions | the tax office for every tax line, and per line the tax itself, its КБК and both settlement accounts. A record that carries match also answers the same payment in later statements — only when every matching record gives the same answer (§10.2.1) |
payment_header_defaults / payment_breakdown_defaults | fields your base puts on every payment header and every breakdown row |
contract_names_by_counterparty | the contract for a counterparty, by name — looked up among that counterparty's own contracts, and asked before the sole-contract and precedent answers: a recorded decision beats an inference. Exactly one contract carries the name → that one is written. None does — including when the counterparty's only contract has a different name — → the line is declined (recorded-contract-not-found, naming the recorded name, the БИН/ИИН and every candidate); two do → declined too (recorded-contract-ambiguous). A differently named contract is never written in its place. «Без договора» that matches no contract means «leave «Договор» empty» |
vat_by_source_number | VAT keyed by the statement's document number. A number is not an identity: a number the file carries twice is refused, not applied to both lines |
vat_overrides | VAT keyed `дата |
preaccounted_operations | SEVERAL statement lines that one posted document already accounts for (§7.3) |
classification_overrides | which document, and which «Вид операции», for a class of lines. A rule states any of source_number, counterparty_id, purpose_contains, doc_kind, knp, direction (all it states must match) and answers entity (one of the four payment documents), operation_type and label. A record about ONE row still beats it. A rule naming an unknown document, or naming nothing to match on, stops the run; one that would move the money the other way between two different parties declines the line |
counterparty_overrides | «money the bank's БИН X moves (under this КНП / direction) belongs to the counterparty with БИН Y» — {counterparty_id, identifier, knp?, direction?}. The card is looked up by Y, and no card is created for X |
cash_flow_articles.by_direction_knp | the cash-flow article for one КНП in one direction, keyed in:342 / out:342 (§9.2.1) |
vat_from_purpose: true | VAT the payment's purpose states («в т.ч. НДС(16%) 16 551,72», «без НДС») is written when the arithmetic agrees to within one tiyn. Off by default. Every record above beats it; text that contradicts its own amount, or does not name exactly one rate and amount, declines the line |
Two behaviours that are deliberate and may look like omissions:
payment_templates.no_vat_when_not_mentionedis read and not applied as a blanket rule. A statement that does not mention VAT is not a statement that there is none. On one client base 214 acquiring lines worth 131 583 704,00 ₸ mention no VAT and carry 16% of it by that base's ownpayment_familiesrecord, so a blanket «Без НДС» would destroy about 20 000 000 ₸ of VAT to fill in an empty field. Lines covered byvat_by_signatureor by apayment_familiesrecord do get their rate and amount; the rest keep an empty «Ставка НДС», and the run prints the reason.- A family describes
ВидДокумента— the one the bank writes on the line itself, and that is the one the parser now reads. A Kaspi export opens every section asСекцияДокумент=выписка— the name of the FILE, not of a document form — and names the real form («Платежный ордер», «Платежное поручение») on the next line. Until 2026-09-14 the parser preferred the section header, so every line'sdoc_kindread «выписка», no line could ever become a payment order, and a family naming the form matched nothing. An emptyВидДокумента=never overwrites the header, and the «со списком» suffix is read from either field. - The 1C field names for a tax are found, never guessed.
tax_decisionsnames a posted document of your base that already carries every value it records, so the field holding that value in that document is the field the run writes it into. A value the example document does not carry is reported instead of being placed by a guessed name — an unknown property makes 1C refuse the whole write, and a wrong КБК never shows up in the journal. - A recorded document type is now APPLIED, with one refusal. These keys are keyed by document type as well as number, date and amount, so the type decides which of your other records the run can see. It obeys yours. The single case it refuses: your record reverses the direction on a line the statement itself shows as being between two DIFFERENT identified parties — that is not an own transfer seen from the other end, and writing it would book the money against the wrong side. A record under a type NOTHING names for the row is still reported by name rather than going silent.
Two things that follow from that change, both worth knowing before you re-run a month:
parse-statement.pysays when the row decided the form — one line for the whole file, naming both words and the number of rows, e.g. «797 lines carry their own ВидДокумента and it disagrees with the section header: «выписка» → «Платежный ордер»». It is not a warning. It is there so you can see which of the file's two fields the parse believed.- Re-importing a month you already imported before this change will not duplicate it. A 1C document's identity includes its type, so a line that moves from «Платежное поручение исходящее» to «Платежный ордер» would otherwise look like a line nobody had imported. The duplicate check now asks all four payment document types, not just the one the run is about to write into: a document found under another type counts as already imported, the run writes nothing, and the report names both types and the document so you can decide. The kit never moves a document from one type to another on its own. When the accountant decides a line should be another type, the replacement below does it: a plan, the originals marked, the new documents written — each step read before it writes.
8. Classifying each operation
Implemented by scripts/1c/bank-statement/_classify.py. What it cannot decide offline — which tax, which aggregator counterparty — it raises as a question rather than guessing.
| Bank data | Direction | 1C document | Typical operation |
|---|---|---|---|
Платежное поручение | Debit | Outgoing payment order | By purpose: supplier, tax, own funds |
Платежное поручение | Credit | Incoming payment order | ОплатаПокупателя |
Платежный ордер | Debit | Payment order, debit | Usually ОплатаПоставщику |
Платежный ордер | Credit | Payment order, credit | Acquiring sale or refund |
Платежное поручение со списком | Debit | Outgoing payment order + basis documents | Only when a separate employee list exists |
| Tax payment | Debit | Outgoing payment order | ПеречислениеНалога |
| Penalty (пеня) | Debit | Outgoing payment order | ПеречислениеНалога, type ПениСам |
Classification is never decided by the words «платежное поручение» alone. Direction, КНП, purpose text, and the presence of a list all matter.
8.1 Cash, bank fees, loans, refunds — the operation kind comes from the КНП
This changed in kit 1.45.0. A line whose КНП names something other than paying for goods used to fall through to «Оплата поставщику» / «Оплата от покупателя» — an ATM withdrawal (КНП 341) was written as a supplier payment with the bank branch as the supplier. The КНП is now read against a table taken from the Правила применения КНП (Постановление НБ РК №203, Приложение 2):
| КНП | Debit | Credit |
|---|---|---|
| 341, 345 | cash_withdrawal — «Приходный кассовый ордер» | — |
| 331 | — | cash_deposit — «Расходный кассовый ордер» |
| 342, 343 | own_transfer | own_transfer |
| 332 | salary | — |
| 333 | — | other_income |
| 411, 413, 419 | loan_issued | loan_received |
| 421, 423, 429 | loan_repayment_out | loan_repayment_in |
| 430 | other_expense (accountable_payment when the purpose says «подотчет») | other_income (accountable_return) |
| 834, 841 | bank_fee when the payee is a bank or the purpose says «комисс» | — |
| 842, 843 | bank_fee | — |
| 780, 880; 390-890 with «возврат» | refund_to_customer | refund_from_supplier |
| 211, 213 (buying currency for tenge) | currency_purchase | currency_purchase |
| 221, 223 (selling currency for tenge) | currency_sale | currency_sale |
| 230 (currency conversion) | currency_conversion | currency_conversion |
Each kind is a key in mapping.json → operation_types, and every one is empty by default. An empty key means the line is declined (operation-type-unmapped, exit code 3) with the key named in the report, while the rest of the statement is written. Fill the key with this base's «Вид операции» member; learn-base.py proposes one from $metadata and the posted documents and only prints it. A recorded override (classification_overrides, document_type_overrides, operation_type_overrides) still wins over the table.
A loan repayment with no precedent (1.77.0). A line of КНП 421/423/429 with an empty operation_types.loan_repayment_out, no row override and no unanimous history of your posted documents is still declined (operation-type-unmapped, nothing is created). Next to the refusal the report adds ONE separate hint line (loan-repayment-type-hint) with the «Вид операции» seen in other bases for that form of the document: «РасчетыПоКредитамИЗаймамСКонтрагентами» for an outgoing payment order (3 bases) and «РасчетыПоКредитамИЗаймам» for a payment order debit (2 bases); 8 or more bases were not read, so it is an observation and not a rule. It is not written and not substituted: the name is offered only if this base's $metadata publishes it (otherwise there is no hint), and it waits for your «да». The answer is recorded on the row — operation_type_overrides.by_source_signature — because operation_types.loan_repayment_out is one key for both forms and would carry one form's name onto the other's lines.
Cash withdrawals and deposits are written as cash orders. Their fields come only from what at least two of the accountant's own posted orders of the same kind agree on — documents the kit wrote do not vote. The date, amount and bank account come from the line, and the statement number goes into «Комментарий» with the anchor that lets the next run recognise the order. A field the precedents disagree on is a question (cash-order-unsettled); fewer than two precedents is cash-order-no-precedent; a base with comments switched off is cash-order-no-anchor. An order the accountant already entered on the same date and amount still declines the line as cash-order-collision.
The owner's Kaspi Gold as cash. An ИП that books transfers to the owner's own card as cash records that account once, in cash_equivalent_accounts (account as an IBAN, or a card mask of the same account with at least four visible characters; owner_id and label optional). A matching debit line becomes a cash receipt order, a matching credit line a cash disbursement order. Nothing is inferred: without the record, a 342/343 line stays a transfer between own accounts, and an entry naming only an IIN is refused. learn-base.py --statement <file> lists candidates — transfers whose payee carries the organisation's own БИН/ИИН — and writes nothing.
The owner's own card held on a counterparty card (1.50.0). When 1C keeps the owner's personal card as a COUNTERPARTY's account (a counterparty carrying the owner's ИИН) and the accountant books the transfer as «ПереводНаДругойСчет» to it, a 342 line to that account is written the same way — if the account is recorded in own_transfer_counterparty_accounts ([{"account": "<IBAN>", "approval": "<who, when>", "label": "…"}]), or, only when the line carries the organisation's own ИИН/БИН, the accountant herself has at least two posted transfers to that very card that agree. Our own documents do not count, a name decides nothing, and a transfer to anyone else's account is still declined (own-transfer-unresolved). Record it by account once instead of per line every month.
«Разнеси по аналогии» (1.50.0). --by-analogy (or "by_analogy": {"approval": "…"} in mapping.json) takes each line's operation kind, cash-flow article, contract and header accounts from the accountant's own newest posted documents for the same counterparty, document type and КНП — only when they all agree; a disagreement declines the line (analogy-split) with the documents named, and nothing found leaves the line to the usual rules. A recorded per-line decision, a tax or a list payment is never overridden, and the dry run names the source document for each line (by-analogy). Use this instead of a one-off prepare-*.py script.
Buying and selling foreign currency (1.56.0). Before 1.56.0 the table had no currency code, so a currency purchase was written as «Оплата поставщику» with the bank as the supplier. КНП 211/213, 221/223 and 230 now have their own kinds on both sides of the account, in a payment order and in a «Платежный ордер» alike. The «Вид операции» comes from operation_types.currency_purchase / currency_sale / currency_conversion. When the key is empty, it comes from the accountant's own posted documents of the same document type and КНП, if at least two of them agree and none disagrees (documents the kit wrote do not vote), and the row accounts then follow as usual. When her documents disagree, the line is declined (operation-type-unmapped) with the candidates and the key named. Fewer than two documents also declines it with the key. A line whose other side is the organisation's own account stays a currency operation and is not written as «ПереводНаДругойСчет». The cash-flow article comes only from a rule for its КНП (cash_flow_articles.by_knp). Exchange differences and revaluation are out of scope. Not yet run against a live base.
Quotes in names from an XLSX statement
An XLSX statement stores " and & escaped. The kit now reads ТОО "Ромашка" & K, where older versions gave ТОО "Ромашка" & K as the counterparty's name and in the purpose. A card is still found by its БИН/ИИН and a duplicate by type, number, date and amount, so nothing is written twice and no second card appears. Records in mapping.json that carry " still match, and there is no need to rewrite them. A card already holding " keeps its name; the kit does not rename cards.
Deposit lines
A transfer between the Kaspi Pay account and the company's own deposit carries КНП 390. The kit recognises it only as a whole: КНП exactly 390, one ИИН on both sides that is the organisation's own, a measured purpose form, and the organisation's own card for the second side's IBAN (a «ДЕПОЗИТ» tail in the number is tolerated on an own card only). It is written as an outgoing payment order in both directions, «ПереводНаДругойСчет», with no counterparty or contract, using the accounts of the accountant's posted transfers with that card. Nothing needs recording.
Refusals: deposit-unresolved (no own card, the refusal names the IBAN), deposit-accounts-unresolved (the transfers disagree on accounts), deposit-account-1251-history (the base already holds the accountant's posted document of this transfer with account 1251 — with this card or a deposit purpose — so the line is not written and she is asked whether it goes to 1050 or 1251; the question names her latest such document by number and date, and the answer is recorded as a template for the line), deposit-interest-out-of-scope (reward and capitalisation), no-cash-flow-article (no article on same-way transfers and no recorded decision). The word «депозит» alone or КНП 390 alone goes the ordinary way. Not yet run against a live base.
9. Ordinary payments
For an outgoing payment, verify: organisation; organisation's settlement account; counterparty; the payee ИИК from the statement; contract; operation type; cash-flow item; accounting and tax accounts; amount; statement date; bank number; purpose; КНП; and VAT where applicable.
For supplier payments, resolve counterparty and account by BIN/IIN and ИИК, and copy the purpose text from the bank without abbreviating. If the purpose references an invoice, check for the matching 1C document where possible — but the absence of a link must never become an invented one.
For an incoming customer payment: match the payer to a counterparty, match their ИИК to a bank account, use operation type ОплатаПокупателя, and copy amount and purpose from the bank. If the purpose states VAT explicitly, take the rate from Catalog_СтавкиНДС and make the VAT amount match the bank's text exactly. If VAT is not stated, do not infer it from the amount.
For contracts, use the counterparty's main contract unless the purpose or a basis document names a different one. Never auto-create a contract just because the main one wasn't found.
Own-funds transfers and acquiring/QR schemes are local accounting policy. How a particular business books a transfer to its owner's card, or which counterparty stands in for a payment aggregator, is a decision confirmed by that user for that database. Follow the scheme already used in that database's earlier documents, record it in the workspace's own notes, and never carry it into another database automatically.
9.1 Settlement or advance — 3310 against 1710
A payment to a supplier who is owed money settles a debt (Дт 3310). A payment to a supplier who is owed nothing is an advance (Дт 1710). A customer receipt is the same question one account over: 1210 against 3510. The two look identical on the bank statement and differ only in what the base already holds.
This is off unless the workspace has configured it, and a workspace that has not is unchanged — the account then comes from what this base puts on comparable posted documents, exactly as before. Where it is configured, the balance is computed from the base's own posted documents, so no register has to be published: each source in mapping.json declares the direction it moves the balance by, +1 for a document that raises what you owe a supplier and -1 for one that reduces it.
Four things it will not do, and each of them is the point:
- A proven settlement changes nothing. That account already comes from this base's own posted history, and replacing it with a constant from the settings would trade evidence for a guess — including on the bases whose accountant leaves the field empty deliberately. Only the advance is written, because the advance is the case that history cannot reveal.
- A zero on a brand-new contract is not «no debt». A supplier moved onto a fresh contract carries a zero there while the debt still stands on the old one. The run says so, names the amount, and changes nothing. Moving a debt between contracts is a correction an accountant makes deliberately — never a mass rewrite of earlier documents.
- A payment larger than the debt is not rounded to one account. It settles the debt and the rest is an advance. Whether the document can carry both accounts is asked of the base itself (
allow_split: "auto", the default): where it cannot, or whereallow_splitisfalse, the run reports both halves and leaves the account alone. - Each account is written only where the document has that field. On the configuration we measured, the advance account (
СчетУчетаРасчетовПоАвансам_Key, without «БУ») exists on the payment breakdown row and not on the document header — and a single field the document does not have makes 1C reject the whole document. So the run reads the base's field list once, writes each account only where it exists, and names in the report any configured field it could not place. - An empty advance account is filled. 1C divides a payment into «Оплата» and «Оплата (аванс)» by itself when it posts, and if the advance account on the row is empty it books the advance to the settlement account without any error. With the accounts configured, a payment row that would carry no advance account gets the configured one; a row that already has one is left as it is, and nothing is filled where the debt may be on another contract.
- Nothing is blocked. Every refusal is a note in the report; the line still imports.
The report distinguishes «3310 (остаток по договору на 22.06.2026: 450 000,00 ₸)» from a line that could not be checked. Those are the same account for two very different reasons, and only the first one is an answer.
Without that configuration, the row's accounts come from the accountant's own documents. «Счёт учёта расчётов с контрагентом (БУ)» and «Счёт учёта расчётов по авансам» live on the payment breakdown row, and a supplier payment written with them empty answers «posted» in 1C and moves no register (measured 2026-10-28: 46 payment orders of one July statement). So for every line with a counterparty and a cash-flow article that is not a tax or a list payment, a row account that would otherwise be empty is taken from the accountant's posted documents of the same type and operation kind: first her newest one for this counterparty, then her newest ten — only if all ten agree. Documents this kit wrote never vote, and a configured settlement answer or an exemplar named in payment_templates always wins. Where she fills the account on every one of those ten but with different values and nothing for this counterparty settles it, the line is declined (row-account-unresolved, exit code 3) with the values and their counts listed: enter this counterparty's first payment in 1C by hand, or name an exemplar in mapping.json → payment_templates, and run again. A field her documents sometimes leave empty is left empty. Our own side's name (ТекстПлательщика on an outgoing payment, ТекстПолучателя on an incoming one) is written the same way — only when her newest documents carry it and agree.
9.2 Every payment carries a cash-flow article
«Статья движения денежных средств» decides which line of the cash-flow statement the money lands on. A payment order without one passes every arithmetic check, looks complete in the journal, and is wrong in the report — which is why it has to be an error rather than a warning.
The kit writes one РасшифровкаПлатежа row carrying the whole amount and the article, and refuses to write anything at all while the article cannot be resolved. Configure it in mapping.json:
"cash_flow_articles": {
"default_incoming": "Реализация работ и услуг",
"default_outgoing": "Расчеты с поставщиками и подрядчиками",
"by_knp": { "851": "Расчеты с поставщиками и подрядчиками" }
}
Do not copy those names as defaults. The article is this company's accounting policy: read what this base's own earlier documents used for the same kind of operation, and record that. by_knp overrides the direction default per КНП. Articles are named, not pinned by Ref_Key, because a Ref_Key means nothing in another database (§11 of the OData rules) and this catalog exposes no other identifier.
This is an error rather than a warning because the failure is invisible: an import can write every line, balance every total, and reconcile clean while the article is empty on most of them. Reconciliation now checks the article too, and treats 1C's all-zeroes GUID as absent rather than as a value.
9.2.1 Which article wins, when more than one rule could apply
Narrowest first, and nothing beyond the last step — guessing the article is guessing which line of the cash-flow statement the money lands on:
by_signature— this one row. An exception only you know about.by_entity_knp— this КНП within one document kind. The same КНП means different things incoming and outgoing, and this is the level that tells them apart.by_direction_knp— this КНП in one direction, keyedin:342/out:342, whichever of the two documents of that direction the line becomes.by_knp— this КНП, in both directions.default_incoming/default_outgoing.
onec_learn_base derives steps 3 and 5 from the base's own posted documents and can never derive step 1 — nobody but you knows that this row is an exception. Since kit 1.59.0 an article it learns per КНП from the base's payments is written as by_direction_knp["out:<КНП>"] and recorded under derived. Before 1.59.0 it went to by_knp, which also applies to receipts, so a receipt with a КНП the company had paid out three times got the payment's article. by_knp is now the accountant's alone: what is written there still decides both directions, learn-base never adds to it, and for a КНП already in by_knp it writes nothing beside it.
9.3 Card payments cannot be posted without an acquiring contract
If the user asks for «Оплата платежными картами» documents alongside the acquiring receipts, check first that Catalog_ДоговорыЭквайринга and Catalog_ВидыОплатЭквайринга are not empty — check-access.py reports this. When they are, Post() answers HTTP 500 with no usable detail, and no payload will fix it: the reference data the posting algorithm needs does not exist in the database.
Say so before creating any. Card payments written against an empty acquiring catalog are not partial progress — they are unpostable drafts sitting in a live base looking like work that got done.
10. Taxes
A tax payment uses operation ПеречислениеНалога and requires ВидНалога_Key, КБК, КНП, the tax authority and its account, accounting and tax accounts, the tax-type subconto, payment type Налог, and the amount and purpose from the statement.
Never choose the tax type from КНП alone. Different taxes share a КНП while differing in КБК and accounting accounts — for example, both withholding income tax and social tax commonly arrive under КНП 911 and are distinguished only by КБК.
10.1 The statement has no КБК — that is normal, and not a reason to stop
Kazakhstan bank statements do not carry a КБК field. Its absence is the ordinary case, not missing information, and it must not by itself become a question for the user. The КБК is not a value you choose — it is an attribute of the catalogue element you choose. The document references the tax by ВидНалога_Key, and Catalog_НалогиСборыОтчисления.КодБК comes along with it. So resolve the element, in this order, and stop at the first step that decides it:
- Match the payment purpose to a catalogue element. Read
Catalog_НалогиСборыОтчисленияand match the statement's назначение платежа againstDescription. «Таможенный сбор», «Таможенная пошлина» and «НДС при импорте» are distinct elements with distinctКодБК— the purpose text separates them even when КНП does not. - Corroborate against posted history. Look for posted documents with the same КНП, the same tax authority, and the same or a near amount. A match confirms the element and is the strongest evidence available; record it in the report.
- Only then ask — and only when two or more elements genuinely fit the purpose and history cannot separate them. Name the candidates and say what distinguishes them, rather than asking the user to supply a code.
Do not invent a КБК that is not on a catalogue element, and do not write the document with an empty one. But equally: a purpose that maps cleanly onto exactly one element, corroborated by posted history, is a resolved row — create it. Asking the user to confirm a code that their own database already stores is not a safety control; it stalls the import and teaches them the assistant cannot read their own 1C.
10.2 When the answer is a standing decision, record it once
Some lines cannot be resolved from the file or from history — a tax this base has never paid, or a bank that exports a КБК the base's own catalogue does not use. That is a decision, and once the accountant makes it, it belongs in mapping.json rather than in a chat message that the next month's run cannot read:
"tax_fields": {
"tax_ref_field": "ВидНалога_Key",
"kbk_field": "КодБК",
"by_kbk": {
"101110": { "name": "Налог на прибыль (корпоративный подоходный налог)", "write_kbk": "101101" }
}
}
The key is the code the statement carries; name is the catalogue element it means. write_kbk is optional and only for the case above — a code in the file that the base holds under a different one — so the report always names both codes when they differ. Two things it will not do: use an element whose own КодБК contradicts the code being written, and fill ВидНалога_Key on a base that does not publish it (leave tax_ref_field empty there — an unknown property loses the whole write).
A recorded rule silences the «which tax is this» question for that КБК and nothing else. Every other question still gets asked.
10.2.1 A decision about one line, for the same payment every month
tax_decisions.by_source_signature is keyed номер|дата|сумма — one line of one statement. A customs payment to the same УГД next month has a new number, date and amount, so on its own a March answer never reaches July, and the same question comes back every month. A record can therefore carry match, the payment's identity:
"tax_decisions": {
"by_source_signature": {
"40|2026-03-12|25950.00": {
"name": "Таможенный сбор", "kbk": "106201",
"match": {"direction": "out", "counterparty_id": "<БИН УГД>", "knp": "911",
"purpose": "Таможенные сборы, уплачиваемые в соответствии с таможенным законодательством РК"}
}
}
}
- Who, under which КНП, for what.
counterparty_id(orcounterparty_accountwhen the file names no БИН),knp, optionaldirection, and the purpose —purposeis compared with dates, months and numbers removed («за март» and «за июль» are the same sentence);purpose_prefixesmatches how it begins. - Only when every matching record agrees. If two records describe the same payment with different taxes, КБК or accounts, nothing is applied: the line is asked, and the report lists each candidate with the line it was recorded for (
tax-decision-conflict). - The report says where the answer came from — «КБК 106201, «Таможенный сбор» — from your decision for line 40 of 12.03.2026». If the record cannot be applied after all (its example document is gone, or the tax is no longer in the catalogue), the questions come back.
- A
matchthe kit cannot use never widens anything. An unknown field, or no payee, КНП or purpose, makes the record mean its own line again, and the report saysrecorded-match-unusable. - Do not write
matchby hand.python3 scripts/1c/bank-statement/generalise-decisions.py march.txtreads the statements the decisions were made on and shows what it would add;--applywritesmapping.json(keeping a copy) and nothing else. It never connects to 1C. Tax decisions getmatchwhenever their line is found; skips only when named with--recurring-skip(§7.2). - The contract comes from the example document, or from the accountant's history. The record's example document supplies «Договор» when a person entered it, it is for the same counterparty, and it names exactly one of that counterparty's contracts. Otherwise the run looks back through the base's history until a payment the accountant posted names one of the counterparty's contracts — documents this kit wrote never count. If none does, the line is asked with the candidates listed; several contracts in her history is also a question, never a pick.
КНП 911 is not only payroll. «Withholding income tax or social tax?» is a payroll question. A КНП 911 line whose purpose names a customs, import or excise payment («таможен…», «ввозн…», «импорт…», «акциз…») and no payroll tax does not get it — the report says knp-911-not-payroll. Which tax it is remains a КБК question, answered as above.
10.4 The accounts and the subconto come from this base's payments of the same tax
A tax payment also carries settlement accounts — СчетУчетаРасчетовСКонтрагентомБУ_Key, its НУ twin — and the tax-type subconto. Since 2026-09-02 the importer fills them from this base's own posted payments of the same tax, and the scope is the load-bearing word: measured across one customer's whole posted history, all 26 posted ПеречислениеНалога carry those fields while 0 of the 151 ordinary payments do, and inside that one operation kind they use four different accounts, one per tax — 3150 for social tax, 3120 for withholding income tax, 3110 for КПН, 3131 for VAT. Asked per operation kind, the answer is the most frequent of the four: a real liability account belonging to another tax, on a draft that reads as finished.
So name the fields — they differ per configuration, and a property this base does not publish makes the whole read answer 400, not just that field — and let the base answer:
"tax_fields": {
"tax_ref_field": "ВидНалога_Key",
"recall_by_tax": [
"СчетУчетаРасчетовСКонтрагентомБУ_Key",
"СчетУчетаРасчетовСКонтрагентомНУ_Key",
"СубконтоДтБУ1", "СубконтоДтБУ1_Type",
"СубконтоДтНУ1", "СубконтоДтНУ1_Type"
]
}
Verify each with check-field.py <entity-set> <field> first. The recall needs tax_ref_field, because that is the field the question is scoped on, and it uses whichever tax the line ended up with — a recorded by_kbk rule or §10.1's purpose recall, whichever answered.
The answer must be unanimous across the posted payments of that tax. One posted payment is an answer, and the report says how many it counted so you can judge how thin that is. A disagreement, a truncated read, or a tax this base has never paid leaves the fields empty and says so — and it also removes any value the wider per-operation template had put there, because a plausible account belonging to another tax is worse than a blank one: the blank is the thing an accountant looks at twice. No history is never an error. A company paying a tax for the first time still gets its statement imported, with those fields for the accountant, exactly as before.
10.3 The tax authority is a counterparty like any other
A tax payment names УГД by БИН in the statement, so it resolves the same way every other counterparty does, and lands on the document in Контрагент and Счет контрагента. Until 2026-09-01 the importer skipped that lookup for tax lines and wrote them empty; if you are looking at older documents, that is where the blanks came from. When the tax office genuinely cannot be resolved the line still gets created without it, with a warning — one unknown УГД does not stop the rest of the statement.
The same reasoning applies wherever the statement lacks a field the database already knows: prefer the catalogue, then the base's own posted history, and reserve questions for real ambiguity and for decisions that are genuinely the accountant's — which rows to skip, which counterparties to create, how to treat an unfamiliar receipt.
11. Penalties (пени)
The КНП tables are in scripts/1c/bank-statement/_kz_codes.py; the classification is in _classify.py.
Penalties on fund contributions are not list payments. They are recorded as:
- operation
ПеречислениеНалога; - payment type
ПениСам; - the matching element of
Catalog_НалогиСборыОтчисления; - КНП and the fund account from the statement;
- amount and purpose from the statement;
- empty pension and social tabular sections.
| КНП | Penalty on | Contribution element |
|---|---|---|
| 098 | Employer pension contributions (ОПВР) | Обязательные пенсионные взносы работодателя |
| 019 | Pension contributions (ОПВ) | Обязательные пенсионные взносы |
| 017 | Social contributions (СО) | Обязательные социальные отчисления |
| 124 | Medical insurance contributions (ВОСМС) | Взносы на обязательное социальное медицинское страхование |
The enum value is ПениСам. There is no Пеня value in this configuration — using it produces an OData error. Read the EnumType from $metadata if in doubt.
12. The five list payments
Recognised by scripts/1c/bank-statement/_employee_lists.py and _kz_codes.py. You should never need to write a parser for these again.
Only these five require employee lists:
| КНП | Payment | 1C basis document | Payment tabular section |
|---|---|---|---|
| 010 | ОПВ | ОПВПеречислениеВФонды | ПеречислениеПенсионныхВзносов |
| 089 | ОПВ работодателя (ОПВР) | ОПВПеречислениеВФонды | ПеречислениеПенсионныхВзносов |
| 122 | ВОСМС | СОПеречислениеВФонды | ПеречислениеСоциальныхОтчислений |
| 121 | ООСМС | СОПеречислениеВФонды | ПеречислениеСоциальныхОтчислений |
| 012 | Социальные отчисления (СО) | СОПеречислениеВФонды | ПеречислениеСоциальныхОтчислений |
12.1 The triple amount control
Three amounts must agree:
payment order amount
= sum of the linked basis documents
= sum of the per-employee rows
Any discrepancy blocks posting.
12.2 Period
Период=062026 becomes 2026-06-01T00:00:00. Write it to ПериодРегистрации, and for social rows also to МесяцПериода.
12.3 Separating the proprietor's own amounts
An ИП paying contributions for himself. When every row of the employee list is the payer's own ИИН, the report says so ONCE per run (ip-own-contributions). The basis lists are still created — the payment order links to them — but a base that keeps no monthly accrual of those contributions has nothing for them to close, so they post with no movements. That is one fact about the base's setup, not a fault in each list, and it does not block the payment orders: post-documents.py posts them regardless and says it once too. Tell the accountant the one setup step: Учетная политика (НУ) → «Учет индивидуального предпринимателя» → «Выполнять ежемесячный расчет взносов и отчислений за ИП»; the ИП as a сотрудник; monthly «Регистрация прочих доходов» → «Расчет удержаний» → «Отражение ЗП»; then repost the lists. Do not recreate them and do not ask about each line.
Where an individual entrepreneur's personal contributions are booked separately from employees', that separation is local accounting policy — follow the pattern used in that database's previous periods, and confirm it with the user rather than inferring it. Typically it means separate basis documents for the personal portion of ОПВ, СО, and ВОСМС, while employer pension contributions go as one basis document covering all rows.
12.4 Basis document operation types
| Payment | ВидОперации of the basis document |
|---|---|
| ОПВ | ПеречислениеОбязательныхПенсионныхВзносов |
| ОПВР | ПеречислениеОбязательныхПенсионныхВзносовРаботодателя |
| СО | ПеречислениеОбязательныхСоциальныхОтчислений |
| ООСМС | ПеречислениеОтчисленийОСМС |
| ВОСМС | ПеречислениеВзносовОСМС |
12.5 Row structure
For ОПВ/ОПВР:
ФизЛицо = Ref_Key of the individual
ФизЛицо_Type = StandardODATA.Catalog_ФизическиеЛица
Сумма = the employee's amount
For СО/ООСМС/ВОСМС, additionally:
МесяцПериода = first day of the accrual month
Employees are matched by IIN via Catalog_ФизическиеЛица.ИдентификационныйКодЛичности, confirmed by name and date of birth. If two individuals share an IIN, use the reference that previous correct documents already used — never pick one at random.
12.6 Linking payment to basis
In the payment order, create a row:
Документ_Key = Ref_Key of the basis document
СуммаКПеречислению = the basis amount
Tabular rows cannot be created through their own entity set, so this row must be part of the payment order's own POST.
12.7 The correct order
- Read the main statement.
- Detect «Платежное поручение со списком».
- Do not create a payment document from the aggregate amount.
- Obtain the separate list file.
- Verify bank number, КНП, period, and total against it.
- Verify the sum of all employees.
- Match each employee by IIN.
- Separate the proprietor's personal amounts if that is the database's practice.
- Create the basis documents, unposted.
- Verify their rows and amounts.
- Create the payment order with the reference rows already filled in.
- Re-read the created document from 1C.
- Run the triple amount control.
- Only now show the document to the user for review.
13. Final reconciliation
Implemented by scripts/1c/bank-statement/reconcile.py.
After the import, build an independent index of 1C documents and re-match every statement line. The required result:
- every statement line found;
- missing lines: 0;
- unexpected duplicates: 0 — counted on the account, by
(date, amount, direction), not on your signature alone. A signature-only count cannot see the twin you just created next to a hand-entered document, which is the duplicate this step exists to catch (§7); - incoming total matches;
- outgoing total matches;
- the statement's own arithmetic is consistent (opening + incoming − outgoing = closing). This is a fact about the file and stays a separate line above the table of checks — «Statement arithmetic (file only)» — never a row in it, because it compares nothing with 1C and used to read as «1C agrees» (27 + 27 lines missing from 1C, and the report said «matches»). A file that does not add up still makes the run not OK. Where 1C's ledger could be read, a second, information-only line «Closing balance vs 1C» gives the comparison and never changes the verdict (
--no-balance-checkskips the read); - the account's own 1C turnover, applied to the statement's opening balance, lands on the statement's closing balance (§13.1);
- every intentionally skipped row is listed with its amount, and the balance variance it causes is stated in advance (§13.1);
- all new documents unposted;
- all new documents not marked for deletion;
- a cash-flow article on every breakdown row — an all-zeroes GUID is absent, not a value, and a section the OData composition does not publish is unchecked, which the report says rather than passing over;
- КНП and КБК match;
- bank accounts match the statement;
- employee lists are populated;
- list sums match.
For each line, check not just presence but the correct document type.
13.1 Reconcile against the bank, not against your own decisions
A reconciliation that matches the rows you decided to import against the rows you decided to expect is comparing a set with itself. Every row dropped along the way — as a suspected duplicate, as ambiguous, as one for the accountant — leaves both sides at once, so the report reads «0 missing», the totals tie, a repeat dry run proposes 0 documents and every test passes. Then the accountant opens the account and it does not tally. That has happened on a real import, and nothing in the run said anything was wrong: the check was blind to the skipped rows by construction.
So put the bank on the other side of the comparison:
- Compare the account's 1C turnover to the statement's own header. Sum the debits and credits actually recorded in 1C on the organisation's settlement account over the statement period, apply them to
НачальныйОстаток, and require the result to equalКонечныйОстаток. This is the only control in the whole regulation with an outside reference. The four §5 equalities prove the file is internally consistent; per-line matching proves each document you created corresponds to a line you kept. Neither one can notice a line you never kept. - Report skipped rows as a named, quantified variance — before the accountant finds it. Every intentionally excluded row belongs in the report by bank number, date, amount and reason, with a total, and the balance check must state the difference it causes explicitly: "1C closing is X below the statement — expected: N rows skipped as Y, totalling Z." A variance you predicted is a decision the accountant can accept or overturn in a minute. The identical variance discovered afterwards is a defect, and what they find first is the missing sum, not the rows behind it.
- Never report a clean reconciliation over a set you narrowed. If rows were skipped, "everything reconciles" is false no matter what the counters say. Say what was excluded, and what the books therefore show.
13.2 The bar for calling a row a duplicate
Same amount on the same day is not, by itself, evidence of a duplicate. Ordinary business produces look-alike movements: merchant and acquiring settlements land repeatedly within a day, a supplier is paid twice for two deliveries, a retried transfer follows a failed one, and a scheduled standing debit — a loan repayment reserve, a daily sweep — fires most business days at a fixed amount, so two or three of them on one date is its normal shape rather than a defect. In a 1CClientBankExchange file each of those carries its own bank document number, and two different bank numbers mean the bank recorded two movements.
Three checks are cheap and usually decisive:
- The statement's own arithmetic. If
Начальный остаток + Поступления − Списанияequals the bank's statedКонечныйОстатокonly when all the look-alike rows are counted, then all of them are real money — the equality is the bank asserting that exact row set. Drop one and it stops holding, which is precisely the shortfall the accountant will see. - How that same row behaves on every other day of the file. Take the amount, purpose and counterparty and count them across the whole statement. A payment that stands alone on twenty dates and doubles up on three of them is a schedule, not a re-export — and a same-day-same-amount rule flags only those three, which is exactly backwards: it clears the days that prove the pattern and stops on the days that follow it. A recurring fixed amount is identical by design, so identity is evidence of a schedule, not of a duplicate.
- The base's own history and the workspace's notes. A company's accumulated knowledge may already have settled a specific look-alike pair as two genuine transactions. Read it before re-opening the question, and write the answer back so the next import does not re-open it either.
A duplicate worth acting on is a re-export artefact: the same document type, bank number, operation date and amount twice in the file, or a document already in 1C carrying that composite signature (§7). That is what «unexpected duplicates: 0» means. Anything weaker is a question for the accountant, not a decision for the assistant — and if they do confirm a skip, it becomes a quantified variance under §13.1 rather than a silent omission.
When the §5 arithmetic balances over the full row set, there is no artefact to find — stop looking. A re-export duplicates a row without the bank duplicating the money, so it breaks the header equalities by exactly its own amount. If Начальный остаток + Поступления − Списания = Конечный остаток holds with every look-alike counted, the bank is asserting that each of them moved money, and the question is closed by the file itself. Do not put it to the accountant anyway. Asking "are these three 347 825 ₸ debits duplicates?" over a file that already proved they are not invites a "yes" that costs real turnover — and the answer arrives as an instruction, so nothing downstream questions it again.
A duplicate decision removes copies. It never removes the original. N look-alike rows can resolve to at most N−1 skips; "skip the whole group" is not a possible outcome of a duplicate finding, whoever proposes it. If the accountant asks for the group to be dropped entirely, that is a different decision — those rows are being excluded for some other reason — and it must be recorded and reported as such under §13.1, not filed under duplicates. This is not a hypothetical distinction: a real import skipped three whole groups on that instruction and lost 2 367 455 ₸ of genuine debits, every one of them a movement the bank had recorded.
A match respects the direction
A document of the same date and amount counts as found only when it moves money the same way as the line. An incoming line is not covered by an outgoing payment order. There is one exception: a transfer between the organisation's own accounts where this statement's account is the receiving side. When the direction cannot be told, the line is shown as «Direction cannot be told», stays out of the found totals, and the import declines it with the code direction-unclear. Show such lines to the accountant.
14. The accountant's manual checklist
Before posting, a human checks:
- Organisation is correct.
- The organisation's settlement account matches the statement.
- Document date and statement date are right.
- The bank number was carried over correctly.
- The amount matches to the tiyn.
- The counterparty was found by BIN/IIN.
- The counterparty's ИИК matches the statement.
- The payment purpose is not distorted.
- КНП matches.
- For taxes, the right КБК was chosen.
- For penalties,
ПениСамwas used. - For list payments, every employee is visible.
- The employees' period is right.
- The employees' total equals the payment.
- VAT matches the bank's purpose text.
- There is no second document with the same signature.
- Every skipped row is listed with its amount, and the balance difference it causes was stated in advance.
- The account's closing balance in 1C matches the statement, or differs by exactly that stated amount.
- The document about to be posted is the corrected version.
15. The report
Rendered by scripts/1c/odata/_report.py; pass --report <path> to any entrypoint.
Every import ends with its own report file — keep them in synced_data/1c/, one per statement — covering: source and period; settlement account; operation count; incoming and outgoing totals; balance control; how many documents already existed; how many were created; which rows were skipped, with their amounts and the balance variance they cause (§13.1); how many duplicates were found; the breakdown by document type; list payments and the result of the triple reconciliation; taxes and penalties with КНП/КБК; missing catalog data; documents that must not be posted; and the table of replacements and documents to delete.
16. The assistant's short checklist
- Read the workspace's
index.md, its context notes, and this regulation. - Check OData access.
- Read only the files the user explicitly named.
- Parse the statement and verify the arithmetic.
- Find existing documents by composite signature.
- Classify the operations.
- Match counterparties by BIN/IIN.
- Match accounts by exact ИИК.
- Halt any list payment that has no separate file.
- Verify taxes and penalties by КНП/КБК and operation type.
- Run the dry run.
- Show the user any warning that affects the accounting.
- Create unposted documents only.
- Re-read the created documents from 1C.
- Reconcile every line and every total.
- Produce the report.
- Post with
post-documents.pyonce the reconciliation is shown — a separate step, never part of the import.
17. When the operation is finished
Technically finished when: every statement line is matched; no lines are missing; there are no unexplained duplicates; amounts and balances agree; catalogs are matched; list payments contain their employees; taxes and penalties are correctly classified; every new document is unposted; and the user has the report and the list of manual actions.
Finished in accounting terms only after wrong drafts are corrected in place or marked for deletion, and the documents are posted and proven — by you, with the kit's commands.
When you post them, post with post-documents.py, giving it every document the import created — of every type — in ONE call (--ref Document_<Name>:<Ref_Key> per document; the dry run prints a code, then --apply --confirm <code>). It counts a document posted only when a register movement is found for it; a document that fails is named and left unposted, and the rest are still posted and proven. Run diagnose-posting.py only on a document post-documents.py reported not posted; it is not a pre-check. See Working with 1C over OData, §3.
Not questions for the accountant — each has a fixed answer, and on 2026-10-14 four of them cost a 34-line statement about 40 minutes:
- «Дата выписки» and «Код БК» come from the statement. «Дата выписки» is the line's own date and the importer writes it. A КБК is needed only on a payment to the budget (a tax, a penalty) and is the one on the line; a contribution order (ОПВ, ОПВР, СО, ВОСМС) or an ordinary payment needs none. Ask only when a budget payment's line carries no КБК.
- Contributions produce more drafts than lines. Each contribution payment order stands on a basis list document (pension or social fund list) written with it. A sole trader's contributions for himself may legitimately move no register on the list — there is no payroll accrual. Post the payment orders regardless and report the lists as they are.
- A wrong unposted draft is corrected in place with
scripts/1c/odata/correct-document.py(for example a bank fee, КНП 841, written as a supplier payment becomes «Прочее списание» with its account and article). Never mark it for deletion in the 1C web client and recreate it. - Removing a run is yours too.
find-runs.py --run <key> --manifest list.jsonwrites the list;mark-for-deletion.py --manifest list.jsonmarks it (a posted document is unposted first),--deletedeletes after marking,--unmarkclears a mark, and--rollback <journal>undoes a run — each a dry run first, then--apply --confirm <code>. With--deletethe dry run lists what references each document as warnings, and the journal keeps the whole document before eachDELETE, so a rollback recreates it unposted with a newRef_Keyand number. On «Нарушение прав доступа» the documents stay marked for «Удаление помеченных объектов». Details: Working with 1C over OData, §10. reconcile.pycounts posted documents; it does not flag them. Posted is the expected end state afterpost-documents.py.
Ask the accountant only what needs her judgement: which contract, which tax a line without a КБК is, whether two identical lines are one payment.