Adding account vat on payment 7

Moved from https://code.launchpad.net/~domsense/account-payment/adding_account_vat_on_payment_7/+merge/196914
Such a large function (with most of it in 1 to 2 levels of loops) should be split into smaller more maintainable pieces of code.

This does not look good at all.