lumnik. / scenarios All scenarios · Français

The aged balance trapped in a print file

Goal Turn a paginated accounting print file into receivables per invoice, keeping the right client across page breaks and dropping headers and totals.

Accounting prints its aged balance to a spool file.

Credit control wants each invoice with its client.

BALAGEE_20261023.lst
DEMO DISTRIBUTION SA          BALANCE AGEE CLIENTS AU 23/10/2026        PAGE   1
CLIENT    RAISON SOCIALE / PIECE   DATE FACT  ECHEANCE       SOLDE  RETARD
--------------------------------------------------------------------------------
411TILL   BOULANGERIE DES TILLEULS
          FA26-0731   28/07/2026 27/08/2026     1 840,20     57
          FA26-0802   11/08/2026 10/09/2026       612,00     43
          FA26-0915   15/09/2026 15/10/2026     2 310,75      8
          TOTAL 411TILL                             4 762,95

411ANSE   BISCUITERIE DE L'ANSE
          FA26-0644   30/06/2026 30/07/2026     4 120,00     85
          FA26-0708   08/07/2026 07/08/2026       985,40     77

DEMO DISTRIBUTION SA          BALANCE AGEE CLIENTS AU 23/10/2026        PAGE   2
CLIENT    RAISON SOCIALE / PIECE   DATE FACT  ECHEANCE       SOLDE  RETARD
--------------------------------------------------------------------------------
          FA26-0810   14/08/2026 13/09/2026     1 276,30     40
          FA26-0901   03/09/2026 03/10/2026       530,00     20
          FA26-0930   30/09/2026 30/10/2026     2 045,60      0
          TOTAL 411ANSE                             8 957,30

… 9 more lines

manifests/20-receivable.yaml
kind: Entityname: receivable_blabel: Créance clientdescription: "One line of the printed aged balance: a client's header, or one of its open invoices with its due date, balance and days late."match: [line]scopes: [credit-b]columns:  line: { label: "Ligne" }  client_code: { label: "Compte" }  client_name: { label: "Client" }  piece: { label: "Pièce" }  invoice_date: { label: "Date facture" }  due_date: { label: "Échéance" }  balance: { label: "Solde" }  days_late: { label: "Retard (j)" }sources:  - table: t_scenario_agedbal_b    map: { line: line, client_code: client_code, client_name: client_name, piece: piece, invoice_date: invoice_date,           due_date: due_date, balance: balance, days_late: days_late }
$ lm entity get receivable_b
LINE                                                             CLIENT_CODE  CLIENT_NAME               PIECE      INVOICE_DATE  DUE_DATE    BALANCE  DAYS_LATE  _CONFLICTS
411ANSE   BISCUITERIE DE L'ANSE                                  411ANSE      BISCUITERIE DE L'ANSE                                                              {}
411AULN   MOULIN DES AULNES                                      411AULN      MOULIN DES AULNES                                                                  {}
411TILL   BOULANGERIE DES TILLEULS                               411TILL      BOULANGERIE DES TILLEULS                                                           {}
          FA26-0644   30/06/2026 30/07/2026     4 120,00     85  411ANSE      BISCUITERIE DE L'ANSE     FA26-0644  2026-06-30    2026-07-30  4120     85         {}
          FA26-0708   08/07/2026 07/08/2026       985,40     77  411ANSE      BISCUITERIE DE L'ANSE     FA26-0708  2026-07-08    2026-08-07  985.4    77         {}
          FA26-0731   28/07/2026 27/08/2026     1 840,20     57  411TILL      BOULANGERIE DES TILLEULS  FA26-0731  2026-07-28    2026-08-27  1840.2   57         {}
          FA26-0755   31/07/2026 30/08/2026     3 300,00     54  411AULN      MOULIN DES AULNES         FA26-0755  2026-07-31    2026-08-30  3300     54         {}
          FA26-0802   11/08/2026 10/09/2026       612,00     43  411TILL      BOULANGERIE DES TILLEULS  FA26-0802  2026-08-11    2026-09-10  612      43         {}
          FA26-0810   14/08/2026 13/09/2026     1 276,30     40  411ANSE      BISCUITERIE DE L'ANSE     FA26-0810  2026-08-14    2026-09-13  1276.3   40         {}
          FA26-0822   22/08/2026 21/09/2026       742,15     32  411AULN      MOULIN DES AULNES         FA26-0822  2026-08-22    2026-09-21  742.15   32         {}
          FA26-0901   03/09/2026 03/10/2026       530,00     20  411ANSE      BISCUITERIE DE L'ANSE     FA26-0901  2026-09-03    2026-10-03  530      20         {}
          FA26-0911   11/09/2026 11/10/2026     1 508,90     12  411AULN      MOULIN DES AULNES         FA26-0911  2026-09-11    2026-10-11  1508.9   12         {}
          FA26-0915   15/09/2026 15/10/2026     2 310,75      8  411TILL      BOULANGERIE DES TILLEULS  FA26-0915  2026-09-15    2026-10-15  2310.75  8          {}
          FA26-0930   30/09/2026 30/10/2026     2 045,60      0  411ANSE      BISCUITERIE DE L'ANSE     FA26-0930  2026-09-30    2026-10-30  2045.6   0          {}
          FA26-1003   03/10/2026 02/11/2026       264,00      0  411AULN      MOULIN DES AULNES         FA26-1003  2026-10-03    2026-11-02  264      0          {}

Limits

  • A line dropped by filter-where carries nothing: the filter must keep the client lines.
  • The entity is keyed by the printed line: an invoice reprinted identically is the same row.
  • Synthetic file, fictitious clients and invoices.

Credit control · printed report

Which client is this invoice for?

The aged balance exists, but only printed.

A spool file: page headers, clients, invoices, totals.

Synthetic file, fictitious clients

The problem

The page break cuts a client in two.

  • Page 1: the client and two invoices.
  • Page 2: three invoices, no client.
  • Credit control retypes the report.

Nothing is changed

The report stays as printed.

  • lumnik reads each line.
  • It drops layout and totals.
  • It carries the client onto its invoices.

What it took to write

- fill-down:
    columns: [client_code, client_name]

The client carries down onto its invoices.

The whole scenario fits in 2 declaration files, 46 lines.

The result

12 invoices, each with its client.

  • 411ANSE: 5 invoices over 2 pages, 8,957.30.
  • The printed totals found again.
  • FA26-0644: 85 days late.

The limit

The filter must keep the client lines.

  • A dropped line carries nothing.
  • An invoice reprinted identically is the same row.

Try it

The scenario replays end to end.

One connector, one entity: each step is published with its output.

This scenario runs on lumnik Open, free and open source.

Try lumnik Open →