Have a question about CiviCRM? Get it answered quickly at the new CiviCRM Stack Exchange Q+A siteThis forum was archived on 25 November 2017. Learn more.How to get involved.What to do if you think you've found a bug.
There have been various discussions and modules and extensions written to support calculating and storing Canadian taxes for CiviCRM. This is expected to be the first of many similar 4.3+ extensions for various jurisdictions. Lola Slade and Andrew Wasson are pushing this forward at the moment, with Parvez working in parallel on the design for one for VAT in Europe/UK. Lola, it is possible but I think inadvisable to change the one to one relationship currently set up between financial types and financial accounts for a particular kind of account to handle one to many.Let's see if Andrew Perry has advice on Parvez's design on the wiki. Could someone summarize the state of the discussion and provide links to relevant resources?
Allow multiple sales tax accounts to be linked to a single financial typeThis will allow multiple tax rates to be applied to a single entity for example a state tax and a city tax.
"My feeling was that the tax_amount held against the line item would be the total. Unless hooked to be different, this should equate to the summation of the one or many tax account percentages. I know its not ideal but I think to get things going is probably the easiest way? I guess the only other way we could do this is to separate out the tax's into a line_item_tax table or something to indicate the amount of tax and break down."
From my point of view the 'Is Tax?' check box will be a deciding factor on a lot of how this extension evolves. Is this field documented in the API somewhere? I've been looking around the docs and the API Explorer in my 4.3.x site and I can't find a reference of it.
$params = array( //'version' => 3, 'financial_account_type_id' => 2, // Liability 'is_deductible' => '0', 'is_tax' => '1', 'is_active' => '1', 'name' => $tax['name'], 'description' => $tax['description'], 'tax_rate' => $tax['tax_rate'], ); CRM_Financial_BAO_FinancialAccount::add($params, $ids);
Yes, without all of the bits it will be tricky to figure out how to make this work and provide an upgrade path for when all of the bits are in place. With regard to tracking tax information per transaction and reporting, when we modified (hacked) Civi core to add a tax feature to a CiviCRM 3.x installation we added a table to store tax related information (generalized column names):invoice_idtax_percentpre_taxtax_chargedpost_taxWhen we pull up a report we query the custom tax table where invoice_id = the actual invoice id and then added a few extra columns to the report to show per-tax, tax amount and then the total. This was used for HST when we had it and now covers GST so it only deals with a single tax in the system we have running live currently. Moving forward we need to account for multiple taxes. Prior to the addition of CiviAccounts, I was intending to follow this route for the tax extension I was working on and use a couple of other tables to manage the tax rules as well. The Tax rules were going to be handled by two tables; one to define the tax name, type, rate etc... and the other to relate the tax types to the transaction types.I'm not sure how much of this will be helpful moving forward today but this is how I was approaching it.Andrew
One thing we discussed in the earlier emails was an item from the original proposal: Add a tax_amount column to the civicrm_contribution table to store a taxes roll up for easy reporting. The wiki proposal suggests we store a tax_amount column in civicrm_line_item as well. Some had disagreed with adding that much redundancy. I was wondering if anybody has any more input that might lead to a consensus on this?