Taxjar_Salestaxautomation - Version 2.0.1

Version Notes

* Separate SmartCalcs shipping tax amount for orders and invoices.
* Fix display issue after connecting to TaxJar with caching enabled.
* Minor bug fixes for older versions of PHP and strict standards.

Download this release

Release Info

Developer TaxJar
Extension Taxjar_Salestaxautomation
Version 2.0.1
Comparing to
See all releases


Code changes from version 2.0.0 to 2.0.1

app/code/community/Taxjar/SalesTax/Block/Adminhtml/Backup.php CHANGED
@@ -21,7 +21,7 @@
21
  */
22
  class Taxjar_SalesTax_Block_Adminhtml_Backup extends Mage_Adminhtml_Block_System_Config_Form_Field
23
  {
24
- protected function _getElementHtml($element)
25
  {
26
  $apiKey = trim(Mage::getStoreConfig('tax/taxjar/apikey'));
27
 
21
  */
22
  class Taxjar_SalesTax_Block_Adminhtml_Backup extends Mage_Adminhtml_Block_System_Config_Form_Field
23
  {
24
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
25
  {
26
  $apiKey = trim(Mage::getStoreConfig('tax/taxjar/apikey'));
27
 
app/code/community/Taxjar/SalesTax/Block/Adminhtml/Enabled.php CHANGED
@@ -21,7 +21,7 @@
21
  */
22
  class Taxjar_SalesTax_Block_Adminhtml_Enabled extends Mage_Adminhtml_Block_System_Config_Form_Field
23
  {
24
- protected function _getElementHtml($element)
25
  {
26
  $apiKey = trim(Mage::getStoreConfig('tax/taxjar/apikey'));
27
 
21
  */
22
  class Taxjar_SalesTax_Block_Adminhtml_Enabled extends Mage_Adminhtml_Block_System_Config_Form_Field
23
  {
24
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
25
  {
26
  $apiKey = trim(Mage::getStoreConfig('tax/taxjar/apikey'));
27
 
app/code/community/Taxjar/SalesTax/Block/Adminhtml/Multiselect.php CHANGED
@@ -21,7 +21,7 @@
21
  */
22
  class Taxjar_SalesTax_Block_Adminhtml_Multiselect extends Mage_Adminhtml_Block_System_Config_Form_Field
23
  {
24
- protected function _getElementHtml($element)
25
  {
26
  $element->setSize(4);
27
  return parent::_getElementHtml($element);
21
  */
22
  class Taxjar_SalesTax_Block_Adminhtml_Multiselect extends Mage_Adminhtml_Block_System_Config_Form_Field
23
  {
24
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
25
  {
26
  $element->setSize(4);
27
  return parent::_getElementHtml($element);
app/code/community/Taxjar/SalesTax/Model/Comment.php CHANGED
@@ -88,7 +88,7 @@ class Taxjar_SalesTax_Model_Comment
88
  $connectUrl = Mage::helper('adminhtml')->getUrl('adminhtml/taxjar/connect');
89
  $disconnectUrl = Mage::helper('adminhtml')->getUrl('adminhtml/taxjar/disconnect');
90
 
91
- if (!empty($this->_getStoreGeneralEmail())) {
92
  $popupUrl .= '&email=' . urlencode($this->_getStoreGeneralEmail());
93
  }
94
 
88
  $connectUrl = Mage::helper('adminhtml')->getUrl('adminhtml/taxjar/connect');
89
  $disconnectUrl = Mage::helper('adminhtml')->getUrl('adminhtml/taxjar/disconnect');
90
 
91
+ if ($this->_getStoreGeneralEmail()) {
92
  $popupUrl .= '&email=' . urlencode($this->_getStoreGeneralEmail());
93
  }
94
 
app/code/community/Taxjar/SalesTax/Model/Debug.php CHANGED
@@ -49,7 +49,7 @@ class Taxjar_SalesTax_Model_Debug
49
  $states = unserialize(Mage::getStoreConfig('tax/taxjar/states'));
50
  $apiUser = Mage::getModel('api/user');
51
  $existingUserId = $apiUser->load('taxjar', 'username')->getUserId();
52
- $pluginVersion = '1.6.1';
53
  $phpMemory = @ini_get('memory_limit');
54
  $phpVersion = @phpversion();
55
  $magentoVersion = Mage::getVersion();
49
  $states = unserialize(Mage::getStoreConfig('tax/taxjar/states'));
50
  $apiUser = Mage::getModel('api/user');
51
  $existingUserId = $apiUser->load('taxjar', 'username')->getUserId();
52
+ $pluginVersion = '2.0.1';
53
  $phpMemory = @ini_get('memory_limit');
54
  $phpVersion = @phpversion();
55
  $magentoVersion = Mage::getVersion();
app/code/community/Taxjar/SalesTax/Model/Observer/ImportRates.php CHANGED
@@ -69,7 +69,7 @@ class Taxjar_SalesTax_Model_Observer_ImportRates
69
  return;
70
  }
71
 
72
- if (!empty($this->_storeZip) && preg_match("/(\d{5}-\d{4})|(\d{5})/", $this->_storeZip)) {
73
  $ratesJson = $this->_getRatesJson();
74
  } else {
75
  Mage::throwException('Please check that your zip code is a valid US zip code in Shipping Settings.');
69
  return;
70
  }
71
 
72
+ if ($this->_storeZip && preg_match("/(\d{5}-\d{4})|(\d{5})/", $this->_storeZip)) {
73
  $ratesJson = $this->_getRatesJson();
74
  } else {
75
  Mage::throwException('Please check that your zip code is a valid US zip code in Shipping Settings.');
app/code/community/Taxjar/SalesTax/Model/Sales/Total/Quote/Tax.php CHANGED
@@ -44,9 +44,23 @@ class Taxjar_SalesTax_Model_Sales_Total_Quote_Tax extends Mage_Tax_Model_Sales_T
44
  $store = $address->getQuote()->getStore();
45
  $items = $this->_getAddressItems($address);
46
  $rates = $smartCalcsResponse['body']['tax'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
 
48
- $this->_addAmount($store->convertPrice($rates['amount_to_collect']));
49
- $this->_addBaseAmount($rates['amount_to_collect']);
50
 
51
  if (count($items) > 0) {
52
  foreach ($items as $item) {
44
  $store = $address->getQuote()->getStore();
45
  $items = $this->_getAddressItems($address);
46
  $rates = $smartCalcsResponse['body']['tax'];
47
+
48
+ if (isset($rates['breakdown']['shipping']['tax_collectable'])) {
49
+ $shippingTaxAmount = $rates['breakdown']['shipping']['tax_collectable'];
50
+ } else {
51
+ $shippingTaxAmount = 0;
52
+ }
53
+
54
+ $taxAmount = $rates['amount_to_collect'] - $shippingTaxAmount;
55
+
56
+ $this->_addAmount($store->convertPrice($taxAmount));
57
+ $this->_addBaseAmount($taxAmount);
58
+
59
+ $this->_addAmount($store->convertPrice($shippingTaxAmount));
60
+ $this->_addBaseAmount($shippingTaxAmount);
61
 
62
+ $address->setShippingTaxAmount($store->convertPrice($shippingTaxAmount));
63
+ $address->setBaseShippingTaxAmount($shippingTaxAmount);
64
 
65
  if (count($items) > 0) {
66
  foreach ($items as $item) {
app/code/community/Taxjar/SalesTax/Model/Smartcalcs.php CHANGED
@@ -111,7 +111,7 @@ class Taxjar_SalesTax_Model_Smartcalcs
111
  */
112
  public function getResponse()
113
  {
114
- if (isset($this->_response)) {
115
  return array(
116
  'body' => json_decode($this->_response->getBody(), true),
117
  'status' => $this->_response->getStatus(),
@@ -130,8 +130,8 @@ class Taxjar_SalesTax_Model_Smartcalcs
130
  * @return array
131
  */
132
  public function getResponseLineItem($productId)
133
- {
134
- if (isset($this->_response)) {
135
  $responseBody = json_decode($this->_response->getBody(), true);
136
 
137
  if (isset($responseBody['tax']['breakdown']['line_items'])) {
111
  */
112
  public function getResponse()
113
  {
114
+ if ($this->_response) {
115
  return array(
116
  'body' => json_decode($this->_response->getBody(), true),
117
  'status' => $this->_response->getStatus(),
130
  * @return array
131
  */
132
  public function getResponseLineItem($productId)
133
+ {
134
+ if ($this->_response) {
135
  $responseBody = json_decode($this->_response->getBody(), true);
136
 
137
  if (isset($responseBody['tax']['breakdown']['line_items'])) {
app/code/community/Taxjar/SalesTax/controllers/Adminhtml/TaxjarController.php CHANGED
@@ -33,6 +33,7 @@ class Taxjar_SalesTax_Adminhtml_TaxjarController extends Mage_Adminhtml_Controll
33
  Mage::getConfig()->saveConfig('tax/taxjar/apikey', $apiKey);
34
  Mage::getConfig()->saveConfig('tax/taxjar/email', $apiEmail);
35
  Mage::getConfig()->saveConfig('tax/taxjar/connected', 1);
 
36
  Mage::getSingleton('core/session')->addSuccess('TaxJar account for ' . $apiEmail . ' is now connected.');
37
  } else {
38
  Mage::getSingleton('core/session')->addError('Could not connect your TaxJar account. Please make sure you have a valid API token and try again.');
33
  Mage::getConfig()->saveConfig('tax/taxjar/apikey', $apiKey);
34
  Mage::getConfig()->saveConfig('tax/taxjar/email', $apiEmail);
35
  Mage::getConfig()->saveConfig('tax/taxjar/connected', 1);
36
+ Mage::getConfig()->reinit();
37
  Mage::getSingleton('core/session')->addSuccess('TaxJar account for ' . $apiEmail . ' is now connected.');
38
  } else {
39
  Mage::getSingleton('core/session')->addError('Could not connect your TaxJar account. Please make sure you have a valid API token and try again.');
app/code/community/Taxjar/SalesTax/etc/config.xml CHANGED
@@ -19,7 +19,7 @@
19
  <config>
20
  <modules>
21
  <Taxjar_SalesTax>
22
- <version>1.6.1</version>
23
  </Taxjar_SalesTax>
24
  </modules>
25
  <global>
19
  <config>
20
  <modules>
21
  <Taxjar_SalesTax>
22
+ <version>2.0.1</version>
23
  </Taxjar_SalesTax>
24
  </modules>
25
  <global>
package.xml CHANGED
@@ -1,23 +1,20 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Taxjar_Salestaxautomation</name>
4
- <version>2.0.0</version>
5
  <stability>stable</stability>
6
  <license>MIT</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Easily collect sales tax without altering your Magento store&#x2019;s checkout experience or performance.</summary>
10
  <description>TaxJar for Magento allows you to quickly calculate sales tax at checkout using our SmartCalcs API and zip-based rates as a backup.</description>
11
- <notes>* Moved TaxJar configuration to System &gt; Configuration &gt; Tax. This is a breaking change with new configuration fields. If upgrading from a previous version, you'll need to re-connect to TaxJar and re-enable your settings.&#xD;
12
- * Streamlined configuration with focus on SmartCalcs for upcoming free calculations and zip-based rates as a fallback.&#xD;
13
- * New "Connect to TaxJar" button for faster onboarding.&#xD;
14
- * New select fields for assigning backup tax rules to custom product and customer tax classes.&#xD;
15
- * New AJAX sync button for manually refreshing backup rates from TaxJar.&#xD;
16
- * Admin notifications tied to our RSS feed for extension updates and news.</notes>
17
  <authors><author><name>TaxJar</name><user>taxjar</user><email>support@taxjar.com</email></author></authors>
18
- <date>2016-05-22</date>
19
- <time>20:31:31</time>
20
- <contents><target name="magecommunity"><dir name="Taxjar"><dir name="SalesTax"><dir name="Block"><dir name="Adminhtml"><file name="Backup.php" hash="99896b0425b06dbf6ccaa8fbdce96995"/><file name="Enabled.php" hash="aea3371b026dcb77339f67ffbe12c37a"/><file name="Multiselect.php" hash="a4f5750cb3f5139dea6f0a781a523ba2"/><dir name="Tax"><dir name="Class"><dir name="Edit"><file name="Form.php" hash="655e276e44ad233b055eee8965391088"/></dir><file name="Grid.php" hash="a52bbe41bc9255bf54720ab4142bfaa7"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="d19f2af9ff020d2e0d31369cf43eac50"/></dir><dir name="Model"><file name="Calculation.php" hash="89c05ee42f8316563ea610f11b53a26d"/><file name="Categories.php" hash="934947240f1a1c7ae7b9ba323aacabd6"/><file name="Client.php" hash="49a5d39125d60c0d0a6583e726b813bf"/><file name="Comment.php" hash="86ac0f475f9430e32dd80b52cd82d4be"/><file name="Configuration.php" hash="c59b69931392eb896e4d0c46b7d2e38b"/><file name="Debug.php" hash="d170affaf34de16eee0d840e76485e6c"/><dir name="Import"><file name="Comment.php" hash="31294b614dce9d399e18788d5e99e7f3"/><file name="Rate.php" hash="00ad69812c8d2f31915cac959483c1eb"/><file name="Rule.php" hash="597ff0e337b4e04e43660b4d4f05d0e0"/></dir><dir name="Observer"><file name="AdminNotifications.php" hash="462c1210a649d81a2a49db7c03d7f293"/><file name="ConfigChanged.php" hash="45bc280865ee95743dc8c4b188607a62"/><file name="ImportData.php" hash="ca21015ca41f8352fe015b4a82fc428d"/><file name="ImportRates.php" hash="30e9209294e44fe84eede56df8dccd00"/><file name="SalesQuoteCollectTotalsBefore.php" hash="37c28ddaf8a27d548bf463fff1aa7da1"/></dir><dir name="Sales"><dir name="Total"><dir name="Quote"><file name="Tax.php" hash="3763db17501ccd79e8b81f379f0b5607"/></dir></dir></dir><file name="Smartcalcs.php" hash="59c95419e35cce5fa03f46d1917de097"/><dir name="Tax"><dir name="Class"><dir name="Source"><file name="Customer.php" hash="9f2941032dc80219f9def35de5c5afc8"/><file name="Product.php" hash="3e0d0826d3d43e8a7c63f2e2e44b810a"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="TaxjarController.php" hash="40c4c3865ffd7ba0c7bf403965994d46"/></dir></dir><dir name="etc"><file name="config.xml" hash="230b5523931e0d39b8ec3d42c9cf632f"/><file name="system.xml" hash="7307753f550f490112ded20317c1a07d"/></dir><dir name="sql"><dir name="salestax_setup"><file name="install-1.6.0.php" hash="9d400004ec642113a8cc907fe5d33960"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Taxjar_SalesTax.xml" hash="552596be5ec12440753bf69ed6005747"/></dir></target></contents>
21
  <compatible/>
22
  <dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
23
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Taxjar_Salestaxautomation</name>
4
+ <version>2.0.1</version>
5
  <stability>stable</stability>
6
  <license>MIT</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Easily collect sales tax without altering your Magento store&#x2019;s checkout experience or performance.</summary>
10
  <description>TaxJar for Magento allows you to quickly calculate sales tax at checkout using our SmartCalcs API and zip-based rates as a backup.</description>
11
+ <notes>* Separate SmartCalcs shipping tax amount for orders and invoices.&#xD;
12
+ * Fix display issue after connecting to TaxJar with caching enabled.&#xD;
13
+ * Minor bug fixes for older versions of PHP and strict standards.</notes>
 
 
 
14
  <authors><author><name>TaxJar</name><user>taxjar</user><email>support@taxjar.com</email></author></authors>
15
+ <date>2016-05-30</date>
16
+ <time>21:43:41</time>
17
+ <contents><target name="magecommunity"><dir name="Taxjar"><dir name="SalesTax"><dir name="Block"><dir name="Adminhtml"><file name="Backup.php" hash="b7047512edece824e3ec9f3c9b0a8b95"/><file name="Enabled.php" hash="5f4d45af9316a436b682259ed06611ca"/><file name="Multiselect.php" hash="a1a7ea16e85cbc27b3014a2cc7d24c95"/><dir name="Tax"><dir name="Class"><dir name="Edit"><file name="Form.php" hash="655e276e44ad233b055eee8965391088"/></dir><file name="Grid.php" hash="a52bbe41bc9255bf54720ab4142bfaa7"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="d19f2af9ff020d2e0d31369cf43eac50"/></dir><dir name="Model"><file name="Calculation.php" hash="89c05ee42f8316563ea610f11b53a26d"/><file name="Categories.php" hash="934947240f1a1c7ae7b9ba323aacabd6"/><file name="Client.php" hash="49a5d39125d60c0d0a6583e726b813bf"/><file name="Comment.php" hash="fc954d386bffad1ba6f64f58e3053802"/><file name="Configuration.php" hash="c59b69931392eb896e4d0c46b7d2e38b"/><file name="Debug.php" hash="56671642104d339e3cc1cd5c06eb2cfe"/><dir name="Import"><file name="Comment.php" hash="31294b614dce9d399e18788d5e99e7f3"/><file name="Rate.php" hash="00ad69812c8d2f31915cac959483c1eb"/><file name="Rule.php" hash="597ff0e337b4e04e43660b4d4f05d0e0"/></dir><dir name="Observer"><file name="AdminNotifications.php" hash="462c1210a649d81a2a49db7c03d7f293"/><file name="ConfigChanged.php" hash="45bc280865ee95743dc8c4b188607a62"/><file name="ImportData.php" hash="ca21015ca41f8352fe015b4a82fc428d"/><file name="ImportRates.php" hash="c3bcedb6c768ed4d16c9d97e0e5ef89c"/><file name="SalesQuoteCollectTotalsBefore.php" hash="37c28ddaf8a27d548bf463fff1aa7da1"/></dir><dir name="Sales"><dir name="Total"><dir name="Quote"><file name="Tax.php" hash="71399362c1f7d057626f6658f15bbe38"/></dir></dir></dir><file name="Smartcalcs.php" hash="9299cc478a0b7db38ba8213b11e09065"/><dir name="Tax"><dir name="Class"><dir name="Source"><file name="Customer.php" hash="9f2941032dc80219f9def35de5c5afc8"/><file name="Product.php" hash="3e0d0826d3d43e8a7c63f2e2e44b810a"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="TaxjarController.php" hash="c840be97516aef8af4e842128f2551f8"/></dir></dir><dir name="etc"><file name="config.xml" hash="46b477dbebb60822e86bdceb861e8516"/><file name="system.xml" hash="7307753f550f490112ded20317c1a07d"/></dir><dir name="sql"><dir name="salestax_setup"><file name="install-1.6.0.php" hash="9d400004ec642113a8cc907fe5d33960"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Taxjar_SalesTax.xml" hash="552596be5ec12440753bf69ed6005747"/></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
20
  </package>