Hi,

I'm posting my tag based automated VAT calculation here in case somebody 
needs it. Any suggestions/improvements are appreciated. This example uses 
an example of an invoice received by company Jake which totals €440 
including 21% VAT 

define _myvat=1.21  

= expr 'tag("VAT") =~ /normalvat/'   

    Assets:Claim VAT                    (amount - (amount/_myvat))

    $account                            (-(amount - (amount/_myvat)))


2014/01/02 Jake's

     Costs:MntEquipment                 € 440.00  

     *; VAT: normalvat   *                      

     Liabilities:AccPay:Jake


Results:


] reg @jake

14-Jan-02 *Jake's         *Costs:MntEquipment         € 440.00     € 440.00

                         Liabilitie:AccPay:Jake    € -440.00            0

                         Assets:Claim VAT            € 76.36      € 76.36

                         Costs:MntEquipment         € -76.36            0


] bal @Jake --dc

      € 440.00        € 76.36       € 363.64  Costs:MntEquipment

             0       € 440.00      € -440.00  Liabilities:AccPay:Jake

       € 76.36              0        € 76.36  Assets:Claim VAT

--------------------------------------------

      € 516.36       € 516.36              0


Important: The VAT tag should be included after the "Costs" (expenses) 
account, so ledger subtracts the VAT from the expense account. Moving the 
tag under or after the Liabilities account would subtract the VAT from the 
Liabilities:AccPay:Jake account, resulting in this erroneous balance. 


*] bal @jake --dc *

*      € 440.00              0       € 440.00  Costs:MntEquipment*

*       € 76.36       € 440.00      € -363.64  Liabilities:AccPay:Jake*

*             0        € 76.36       € -76.36  Assets:Claim VAT*

*--------------------------------------------*

*      € 516.36       € 516.36              0*


BR
Dimitri


-- 

--- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to