SuperOrders Tax Exemption ID
Whether the Tax Exemption ID should be placed under Admin>Config>MyStore, rather than under Admin>Config>SuperOrders, so that other mods may also use the setting (eg All_Invoices).
Better still IMHO would be to place all tax settings under Admin>Location/Taxes, rather than under Admin>Config>MyStore. (Perhaps for zc 1.5.5 or later)
Also change TAX_ID_NUMBER to TAX_EXEMPTION_ID to better indicate its purpose, as certain countries may allocate separate company (ACN), business (ABN) and taxation ID numbers, in addition to tax exemption numbers.
SQL
change
Code:
$sql = "INSERT IGNORE INTO ".DB_PREFIX."configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES (NULL, 'Tax Exemption ID Number', 'TAX_ID_NUMBER', '', 'If your business or organization is tax exempt, then you may have been issued a tax exmption ID number. Enter the number here and the tax columns will not appear on the invoice and the tax exemption ID number will also be displayed at the top of the invoice.', '".$so_configuration_id."', 45, now(), now(), NULL , NULL)";
$db->Execute($sql);
to
Code:
$sql = "INSERT IGNORE INTO ".DB_PREFIX."configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES (NULL, 'Tax Exemption ID', 'TAX_EXEMPTION_ID', '', 'If your business or organization is tax exempt, then you may have been issued a tax exemption ID number. Enter your number here to display the tax exemption ID number and associated blurb on the invoice but not display taxation details on the invoice.', '1', 23, now(), now(), NULL , NULL);
$db->Execute($sql);
or as separate standalone sql
Code:
INSERT IGNORE INTO ".DB_PREFIX."configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES (NULL, 'Tax Exemption ID', 'TAX_EXEMPTION_ID', '', 'If your business or organization is tax exempt, then you may have been issued a tax exemption ID number. Enter the number here for the number and associated blurb to display on the invoice but not display taxation details on the invoice.', '1', 23, now(), now(), NULL , NULL);
Notes:
This places the setting immediately after SHOW_SPLIT_TAX_CHECKOUT (=
22).
The associated blurb may need to be placed in language defines, such as TAX_EXEMPTION_ID_TEXT_START and TAX_EXEMPTION_ID_TEXT_END. In Australia, the associated blurb is prescribed by govt.
Australia requires businesses to issue different invoice types for different business conditions, such as whether the business is tax exempt, the customer is tax exempt, and whether the order was placed or despatched within Australia. My invoices draw upon code from such plugins as SuperOrders_v4.10, Tax_inc_ex_1.5a, Tax Exemption Status_v2.1, All_Invoices_Report_2.1.0 and extra_field_on_customer_sign_up_2-0, for which the following code determines only whether the invoice should be headed "Tax Invoice" or "Invoice". This code must be placed after "$order_check = $db->Execute("SELECT...) and displays immediately below the letterhead and immediately above the BILL/SOLD/SHIP_TO address blocks. This code is by no means complete or final as I may change a few defines or variables, eg TAX_ID_NUMBER to TAX_EXEMPTION_ID used in $display_tax.
Code:
<!-- bof tax invoice or plain invoice -->
<tr>
<?php
// check for store tax exemption, customer tax exemption and Australia billing or delivery
$customer_tax_id = (int)$order_check->fields['customers_id'];
$customer_tax_check = $db->Execute("SELECT customers_id, customers_abn, customers_tax_exempt
FROM " . TABLE_CUSTOMERS . "
WHERE customers_id = '" . (int)$customer_tax_id . "'");
if ($display_tax == 'false' && $customer_tax_check->fields['customers_tax_exempt'] == '' && ($order_check->fields['delivery_country'] == 'Australia' || $order_check->fields['billing_country'] == 'Australia')) {
echo '<td id="headerRight">' . HEADER_INVOICE_TAX . '</td>'; // Tax Invoice
} else {
echo '<td id="headerRight">' . HEADER_INVOICE . '</td>'; // Invoice
}
?>
</tr>
<!-- eof tax invoice or plain invoice -->
Hope this helps
Bookmarks