Re: Tags and formulas

2014-04-02 Thread Jostein Berntsen
On 30.03.14,23:12, Pascal Fleury wrote:
 Hello,
 
 I am trying to get a summary of what my health insurance needs to reimburse
 me. So I started by tracking the bills I pay with tags:
 
 2014/02/19 * Associated Dentists
 ; insurance: dental
 ; patient: pascal
 ; treatment: 2014/02/03
 Expenses:Insurances:Health   68.75 CHF
 Assets:Account:Bank
 
 2014/03/31 * Hospital
 ; insurance: accident
 ; patient: pascal
 ; treatment: 2014/03/29
 Expenses:Insurances:Health   68.75 CHF
 Assets:Account:Bank
 
 The insurance have different ways to reimburse and different coverages
 depending on what is in your contract. Say for accidents, they cover 50% of
 all costs, and for dental 75% and for the remaining part, there is a
 liability of 300 CHF. (that's actually simplified but enough for this
 case...).
 when they reimburse me, I just track it as an income.
 
 I tried this:
 
 ; rounds to the nearest 5 cents limit.
 define swiss_rounding(amount) = (roundto(amount * 20, 0) / 20)
 
 = /Insurances:Health/ and tag insurance = 'accident'
   (Virtual:Summary:Health)(swiss_rounding(amount * 0.50))
 
 = /Insurances:Health/ and tag insurance = 'dental'
   (Virtual:Summary:Health)(swiss_rounding(amount * 0.75))
   ; missing computation of the remaining amount this year @ max 300 CHF
 
 = /Income:Health and tag insurance
   (Virtual:Summary:Health)1.0
 
 Unfortunately I don't seem to be able to use tag values to apply the
 formulas separately depending on that tag value (all transactions tagged
 with 'insurance' get both rules applied), nor did I find a way to do a
 transaction that depends on the current amount in a particular account for
 a given period (typically the calendar year).
 
 Is there a way to do that ? Did I miss some obvious documentation ?
 

Could you use Expenses:Insurances1:Health and Expenses:Insurances:Health
instead and calculate this in a different way? That would also make it
easier to limit it to specific periods?

Jostein


-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Tags and formulas

2014-03-30 Thread Pascal Fleury
Hello,

I am trying to get a summary of what my health insurance needs to reimburse
me. So I started by tracking the bills I pay with tags:

2014/02/19 * Associated Dentists
; insurance: dental
; patient: pascal
; treatment: 2014/02/03
Expenses:Insurances:Health   68.75 CHF
Assets:Account:Bank

2014/03/31 * Hospital
; insurance: accident
; patient: pascal
; treatment: 2014/03/29
Expenses:Insurances:Health   68.75 CHF
Assets:Account:Bank

The insurance have different ways to reimburse and different coverages
depending on what is in your contract. Say for accidents, they cover 50% of
all costs, and for dental 75% and for the remaining part, there is a
liability of 300 CHF. (that's actually simplified but enough for this
case...).
when they reimburse me, I just track it as an income.

I tried this:

; rounds to the nearest 5 cents limit.
define swiss_rounding(amount) = (roundto(amount * 20, 0) / 20)

= /Insurances:Health/ and tag insurance = 'accident'
  (Virtual:Summary:Health)(swiss_rounding(amount * 0.50))

= /Insurances:Health/ and tag insurance = 'dental'
  (Virtual:Summary:Health)(swiss_rounding(amount * 0.75))
  ; missing computation of the remaining amount this year @ max 300 CHF

= /Income:Health and tag insurance
  (Virtual:Summary:Health)1.0

Unfortunately I don't seem to be able to use tag values to apply the
formulas separately depending on that tag value (all transactions tagged
with 'insurance' get both rules applied), nor did I find a way to do a
transaction that depends on the current amount in a particular account for
a given period (typically the calendar year).

Is there a way to do that ? Did I miss some obvious documentation ?

Thanks a lot for any help,
Pascal

-- 

--- 
You received this message because you are subscribed to the Google Groups 
Ledger group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.