in reply to Find combination of numbers whose sum equals X
I don't really have anything of substance to add in helping you solve your problem but it did remind me of this blog post from a few years back describing how someone solved a similar accounting problem using Python!
In Section
Seekers of Perl Wisdom