Auto rules, Bank use-case

Hi all,

How do I properly setup these rule scenario?

  1. When money's leaving the account over a certain sum, there's some commission and VAT the bank charges
  2. When money enters the account over a certain sum, the bank is mandated to charge some stamp duty.

The simplest example I could come up with is:

= assets:bank amt:<-50000
  expenses:fees:commission  50 cur
  expenses:tax:vat  3.75 cur
  %account

= assets:bank amt:>10000
  expenses:fees:stamp-duty  50 cur
  %account  -50 cur

2026-07-10 * Payee
  expenses    100000 cur
  assets:bank

When I run the bal report, I get this

      -100103.75 cur  assets:bank
--------------------
      -100103.75 cur  

This is technically wrong because both rules are being applied, when one of the rules has its sign flipped. What's the best way to set this up?

p.s: for some reason, this error only exists when money is leaving the bank. when money is coming in, hledger correctly applies only one of the rules.

That tests the absolute magnitude; you need amt:>+10000 instead.

https://hledger.org/1.52/hledger.html#amt-query