Reports for Store A

This part of example demonstrates how it’s possible to target reports to the specific part of the setup, and also how to verify the reported results.

Reports by HQ

At the HQ’s accounting department, we would like to see some reports based on only Store A’s journal.

To see Store A specific reports, we will utilize Transaction Filters to select only Store A transactions to be reported. To do that, we select all transactions with store-a tag.

It’s also possible to select single commit as a starting point, as is done with Store A’s reports. This same commit Id would work also for HQ journal, as it contains all commits from Store A and B.

Run Store A specific reports at HQ
tackler \
   --config conf/hq-conf.toml \
   --api-filter-def \
      '{ "txnFilter": { "TxnFilterTxnTags" : { "regex": "store-a" }}}' \
   "$@"
Register report for Store A at HQ
Git Storage
      reference : main
      directory : txns
      extension : txn
         commit : 349a6e249add308363ab8a421e6368fbda229611
         author : ACME HQ <hq@acme>
           date : 2024-12-20 16:00:00 +0000
        subject : hq: merge store B

Txn Set Checksum
        SHA-256 : a8efd662df881087f0e0e67c77666988b958916f62a9fe2e687d8758d960130a
       set size : 2

Filter
  Txn Tags: "store-a"

Account Selector Checksum
        SHA-256 : 7d18093d24860c5ccf354bd72b67cbb29ff753d83384367cb86cceade07f1d6b
      selectors : 'Assets(:.*)?'
                | 'Warehouse(:.*)?'

Report Time Zone
        TZ name : UTC


HQ: Register Report
-------------------
2024-12-17 (#001) 'Store-A sales txn
            # uuid: 9b4523b2-00a9-45ef-8f96-1d30a6626574
            # tags: store-a
            Warehouse:Store-A                             -1.00              -1.00 Unit
            Assets:Store-A:Cashier                       123.00             123.00 €
---------------------------------------------------------------------------------------
2024-12-20 (#002) 'Store-A sales txn
            # uuid: 8313ffaf-95e9-40b5-8595-c1e0f7533e94
            # tags: store-a
            Warehouse:Store-A                             -1.00              -2.00 Unit
            Assets:Store-A:Cashier                       123.00             246.00 €
---------------------------------------------------------------------------------------

Reports by Store A

Let’s see how these same reports looks like at Store A’s own accounting department.

The Store A uses local plain filesystem as primary source for reporting, but for this case, the journal is switched to the git backend.

Also the journal state is fixed to the same commit which has been synchronized with HQ. This makes it possible to use same journal data and compare reports, even when Store A would have new sales in their local journal, which haven’t been yet synchronized with HQ.

Run reports at Store A with fixed journal state by commit id
tackler \
    --config conf/store-a-conf.toml \
    --input.storage git \
    --input.git.ref 9f391d6fd78d4 \
    "$@"
Store A’s own Register report with fixed journal state by commit id
Git Storage
      reference : FIXED by commit
      directory : txns
      extension : txn
         commit : 9f391d6fd78d46c26d4cb6f18119c944115ccffa
         author : ACME Store A <store-a@acme>
           date : 2024-12-20 12:00:00 +0000
        subject : store-a: sales txn 002

Txn Set Checksum
        SHA-256 : a8efd662df881087f0e0e67c77666988b958916f62a9fe2e687d8758d960130a
       set size : 2

Account Selector Checksum
        SHA-256 : 7d18093d24860c5ccf354bd72b67cbb29ff753d83384367cb86cceade07f1d6b
      selectors : 'Assets(:.*)?'
                | 'Warehouse(:.*)?'

Report Time Zone
        TZ name : UTC


Store A: Register Report
------------------------
2024-12-17 (#001) 'Store-A sales txn
            # uuid: 9b4523b2-00a9-45ef-8f96-1d30a6626574
            # tags: store-a
            Warehouse:Store-A                             -1.00              -1.00 Unit
            Assets:Store-A:Cashier                       123.00             123.00 €
---------------------------------------------------------------------------------------
2024-12-20 (#002) 'Store-A sales txn
            # uuid: 8313ffaf-95e9-40b5-8595-c1e0f7533e94
            # tags: store-a
            Warehouse:Store-A                             -1.00              -2.00 Unit
            Assets:Store-A:Cashier                       123.00             246.00 €
---------------------------------------------------------------------------------------

Verifying the results

Again, how do we know that this setup is working as intended, and that HQ really has all correct transactions from Store A?

In this case, we can see that HQ reports have the same Txn Set Checksum as Store A’s own reports. This tells that both reports are based on same set of transactions, even though they are run on different, separate systems.

Partial metadata of register report at HQ
         author : ACME HQ <hq@acme>
           date : 2024-12-20 16:00:00 +0000
        subject : hq: merge store B

Txn Set Checksum
        SHA-256 : a8efd662df881087f0e0e67c77666988b958916f62a9fe2e687d8758d960130a
       set size : 2
Partial metadata of register report at Store A
         author : ACME Store A <store-a@acme>
           date : 2024-12-20 12:00:00 +0000
        subject : store-a: sales txn 002

Txn Set Checksum
        SHA-256 : a8efd662df881087f0e0e67c77666988b958916f62a9fe2e687d8758d960130a
       set size : 2