Final Reports at HQ

Time to report numbers for holiday sales push

Synchronize Journals from Stores

Update sales data from stores to HQ
git remote update -p
git merge --allow-unrelated-histories -m "hq: merge store A" store-a/main
git merge --allow-unrelated-histories -m "hq: merge store B" store-b/main

Run Reports

Run combined sales reports at HQ
tackler \
   --config conf/hq-conf.toml \
   "$@"

Balance Report

Combined balance report for Store-A and Store-B 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 : 940cb81d9f3b728a51d21251b891f62798c081d25e70a838aeb53c8199d33d3e
       set size : 5

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


HQ: Balance Report
------------------
                 0.00          -5.00 Unit  Warehouse
                -2.00          -2.00 Unit  Warehouse:Store-A
                -3.00          -3.00 Unit  Warehouse:Store-B
                 0.00         615.00 €     Assets
                 0.00         246.00 €     Assets:Store-A
               246.00         246.00 €     Assets:Store-A:Cashier
                 0.00         369.00 €     Assets:Store-B
               369.00         369.00 €     Assets:Store-B:Cashier
==========================
                -5.00 Unit
               615.00 €

Register Report

Combined register report for Store-A and Store-B 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 : 940cb81d9f3b728a51d21251b891f62798c081d25e70a838aeb53c8199d33d3e
       set size : 5

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-17 (#001) 'Store-B sales txn
            # uuid: be405a05-2293-45ca-a4c5-2c51e726f078
            # tags: store-b
            Warehouse:Store-B                             -1.00              -1.00 Unit
            Assets:Store-B:Cashier                       123.00             123.00 €
---------------------------------------------------------------------------------------
2024-12-18 (#002) 'Store-B sales txn
            # uuid: 8a8bb8df-7f00-4c3f-9d46-3eddf30a071d
            # tags: store-b
            Warehouse:Store-B                             -1.00              -2.00 Unit
            Assets:Store-B:Cashier                       123.00             246.00 €
---------------------------------------------------------------------------------------
2024-12-19 (#003) 'Store-B sales txn
            # uuid: 075ce01d-fc41-458f-8495-31675801d864
            # tags: store-b
            Warehouse:Store-B                             -1.00              -3.00 Unit
            Assets:Store-B:Cashier                       123.00             369.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 €
---------------------------------------------------------------------------------------

How to verify the Journal at HQ?

How do we know that this setup is working as intended, and that HQ really has all correct transactions from Stores? This is tricky question, especially when it’s not feasible to audit (read) the full journal.

Let’s collect all transaction UUIDs and then calculate manually what is the transaction set checksum. In this example it’s done fully manually, but there is a contrib script to calculate it in tackler’s repository: txn-set-checksum.sh

Verify manually Txn Set Checksum based on collected UUIDs
cat << EOF | sort | sha256sum
9b4523b2-00a9-45ef-8f96-1d30a6626574
8313ffaf-95e9-40b5-8595-c1e0f7533e94
be405a05-2293-45ca-a4c5-2c51e726f078
075ce01d-fc41-458f-8495-31675801d864
8a8bb8df-7f00-4c3f-9d46-3eddf30a071d
EOF

The result is same as reported Txn Set Checksum in reports.

Manually calculated Txn Set Checksum (SHA-256)
940cb81d9f3b728a51d21251b891f62798c081d25e70a838aeb53c8199d33d3e