autobean icon indicating copy to clipboard operation
autobean copied to clipboard

share: `shared_prorated`: split service charge based on consumption

Open SEIAROTg opened this issue 5 years ago • 0 comments

In certain scenarios, it may make sense to split a posting based on the share of other postings. A common example is service charge.

  • The prorated split should be based on the share of a selection of postings. Usually we would like the bases to be postings on Expenses rather than Assets.
  • As prorated postings may be on the same account with their split bases, theirselves should be excluded from the bases.

Sample Input

2020-01-01 *
    Assets:Alice                              -27.50 USD
    Expenses:Alcohol                           10.00 USD
        share-Alice: 1
    Expenses:Alcohol                           15.00 USD
        share-Bob: 1
    Expenses:Meal                              20.00 USD
        share-Alice: 1
        share-Bob: 1
    Expenses:Alcohol                            2.50 USD ;; Alcohol Surcharge
        share_prorated: Expenses:Alcohol

Sample Output

2020-01-01 *
    Assets:Alice:[Alice]                      -47.50 USD
    Assets:Receivable:[Alice]                  26.50 USD
    Assets:Receivable:[Bob]                   -26.50 USD
    Expenses:Alcohol:[Alice]                   10.00 USD
    Expenses:Alcohol:[Bob]                     15.00 USD
    Expenses:Meal:[Alice]                      10.00 USD
    Expenses:Meal:[Bob]                        10.00 USD
    Expenses:Alcohol:[Alice]                    1.00 USD ;; Alcohol Surcharge
    Expenses:Alcohol:[Bob]                      1.50 USD ;; Alcohol Surcharge

SEIAROTg avatar Jan 12 '20 22:01 SEIAROTg