[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tax account creation: how to 'detect' tax accounts?



Hi Chris,

On Sun, Jun 19, 2011 at 3:38 PM, Chris Travers <..hidden..> wrote:
> On Sun, Jun 19, 2011 at 5:59 AM, Erik Huelsmann <..hidden..> wrote:
>> In an attempt to fix bug 3321964, I'm running into the situation that
>> our model doesn't seem to be able to detect which accounts are tax
>> accounts. I'm inclined to add a checkmark to the accounts table to
>> that purpose -- including a checkmark in the column where also
>> 'contra' and 'recon' are located.
>>
>> The problem I'm seeing is that the accounts creation functions don't
>> add records to the 'tax' table. But how would they know how to set up
>> the records in that table without integrating the System->Taxes screen
>> into the account creation screen?
>
> select ... from account where id in (select account_id from
> account_link where description like '%_tax');

As we were discussing on gTalk, I'm repeating myself here for others:
the check marks in the screen say "Include in selection list"; a user
might deselect the check marks, resulting in the above logic to
conclude that the account is no longer a tax account. The conclusion
is incorrect of course.

On gTalk, we agreed the best course of action is to add a
characteristic to the account's 'account' record to say it's a tax
account. When that check mark is selected, there should also be a row
in the 'tax' table which describes the calculation rules to be
applied. We should probably deny changing the 'tax' check mark after
the account has been posted to though [if we really want that, I
should look into triggers in the database to achieve that goal; no
idea off hand how to arrange that denial].


Bye,


Erik.