OnePica_AvaTax - Version 3.0.1

Version Notes

Fixed tax calculation for bundle products

Download this release

Release Info

Developer Astound Commerce
Extension OnePica_AvaTax
Version 3.0.1
Comparing to
See all releases


Code changes from version 3.0.0 to 3.0.1

app/code/community/OnePica/AvaTax/Helper/GiftWrapping/Data.php CHANGED
@@ -1,7 +1,9 @@
1
  <?php
2
  /**
3
  * OnePica_AvaTax
 
4
  * NOTICE OF LICENSE
 
5
  * This source file is subject to the Open Software License (OSL 3.0), a
6
  * copy of which is available through the world-wide-web at this URL:
7
  * http://opensource.org/licenses/osl-3.0.php
@@ -9,12 +11,12 @@
9
  * @category OnePica
10
  * @package OnePica_AvaTax
11
  * @author OnePica Codemaster <codemaster@onepica.com>
12
- * @copyright Copyright (c) 2015 One Pica, Inc.
13
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
  */
15
 
16
  /**
17
- * Class OnePica_AvaTax_Helper_GiftWrapping_Data
18
  */
19
  class OnePica_AvaTax_Helper_GiftWrapping_Data extends Enterprise_GiftWrapping_Helper_Data
20
  {
@@ -26,7 +28,7 @@ class OnePica_AvaTax_Helper_GiftWrapping_Data extends Enterprise_GiftWrapping_He
26
  */
27
  public function displayCartWrappingIncludeTaxPrice($store = null)
28
  {
29
- if ($this->_getDataHelper()->isServiceEnabled($store)) {
30
  return false;
31
  }
32
 
@@ -41,7 +43,7 @@ class OnePica_AvaTax_Helper_GiftWrapping_Data extends Enterprise_GiftWrapping_He
41
  */
42
  public function displayCartWrappingExcludeTaxPrice($store = null)
43
  {
44
- if ($this->_getDataHelper()->isServiceEnabled($store)) {
45
  return true;
46
  }
47
 
@@ -56,11 +58,11 @@ class OnePica_AvaTax_Helper_GiftWrapping_Data extends Enterprise_GiftWrapping_He
56
  */
57
  public function displayCartWrappingBothPrices($store = null)
58
  {
59
- if ($this->_getDataHelper()->isServiceEnabled($store)) {
60
  return false;
61
  }
62
 
63
- return parent::displayCartWrappingBothPrices($store);
64
  }
65
 
66
  /**
@@ -71,7 +73,7 @@ class OnePica_AvaTax_Helper_GiftWrapping_Data extends Enterprise_GiftWrapping_He
71
  */
72
  public function displayCartCardIncludeTaxPrice($store = null)
73
  {
74
- if ($this->_getDataHelper()->isServiceEnabled($store)) {
75
  return false;
76
  }
77
 
@@ -86,7 +88,7 @@ class OnePica_AvaTax_Helper_GiftWrapping_Data extends Enterprise_GiftWrapping_He
86
  */
87
  public function displayCartCardBothPrices($store = null)
88
  {
89
- if ($this->_getDataHelper()->isServiceEnabled($store)) {
90
  return false;
91
  }
92
 
@@ -101,7 +103,7 @@ class OnePica_AvaTax_Helper_GiftWrapping_Data extends Enterprise_GiftWrapping_He
101
  */
102
  public function displaySalesWrappingIncludeTaxPrice($store = null)
103
  {
104
- if ($this->_getDataHelper()->isServiceEnabled($store)) {
105
  return false;
106
  }
107
 
@@ -116,7 +118,7 @@ class OnePica_AvaTax_Helper_GiftWrapping_Data extends Enterprise_GiftWrapping_He
116
  */
117
  public function displaySalesWrappingExcludeTaxPrice($store = null)
118
  {
119
- if ($this->_getDataHelper()->isServiceEnabled($store)) {
120
  return true;
121
  }
122
 
@@ -131,7 +133,7 @@ class OnePica_AvaTax_Helper_GiftWrapping_Data extends Enterprise_GiftWrapping_He
131
  */
132
  public function displaySalesWrappingBothPrices($store = null)
133
  {
134
- if ($this->_getDataHelper()->isServiceEnabled($store)) {
135
  return false;
136
  }
137
 
@@ -139,42 +141,15 @@ class OnePica_AvaTax_Helper_GiftWrapping_Data extends Enterprise_GiftWrapping_He
139
  }
140
 
141
  /**
142
- * Check ability to display prices including tax for printed card in backend sales
143
  *
144
  * @param Mage_Core_Model_Store|int $store
145
  * @return bool
146
  */
147
- public function displaySalesCardIncludeTaxPrice($store = null)
148
- {
149
- if ($this->_getDataHelper()->isServiceEnabled($store)) {
150
- return false;
151
- }
152
-
153
- return parent::displaySalesCardIncludeTaxPrice($store);
154
- }
155
-
156
- /**
157
- * Check ability to display both prices for printed card in backend sales
158
- *
159
- * @param Mage_Core_Model_Store|int $store
160
- * @return bool
161
- */
162
- public function displaySalesCardBothPrices($store = null)
163
- {
164
- if ($this->_getDataHelper()->isServiceEnabled($store)) {
165
- return false;
166
- }
167
-
168
- return parent::displaySalesCardBothPrices($store);
169
- }
170
-
171
- /**
172
- * Get avatax data helper
173
- *
174
- * @return OnePica_AvaTax_Helper_Data
175
- */
176
- protected function _getDataHelper()
177
  {
178
- return Mage::helper('avatax');
 
 
179
  }
180
  }
1
  <?php
2
  /**
3
  * OnePica_AvaTax
4
+ *
5
  * NOTICE OF LICENSE
6
+ *
7
  * This source file is subject to the Open Software License (OSL 3.0), a
8
  * copy of which is available through the world-wide-web at this URL:
9
  * http://opensource.org/licenses/osl-3.0.php
11
  * @category OnePica
12
  * @package OnePica_AvaTax
13
  * @author OnePica Codemaster <codemaster@onepica.com>
14
+ * @copyright Copyright (c) 2009 One Pica, Inc.
15
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
  */
17
 
18
  /**
19
+ * Class OnePica_AvaTax_Helper_Data
20
  */
21
  class OnePica_AvaTax_Helper_GiftWrapping_Data extends Enterprise_GiftWrapping_Helper_Data
22
  {
28
  */
29
  public function displayCartWrappingIncludeTaxPrice($store = null)
30
  {
31
+ if ($this->_isServiceEnable($store)) {
32
  return false;
33
  }
34
 
43
  */
44
  public function displayCartWrappingExcludeTaxPrice($store = null)
45
  {
46
+ if ($this->_isServiceEnable($store)) {
47
  return true;
48
  }
49
 
58
  */
59
  public function displayCartWrappingBothPrices($store = null)
60
  {
61
+ if ($this->_isServiceEnable($store)) {
62
  return false;
63
  }
64
 
65
+ return parent::displayCartCardBothPrices($store);
66
  }
67
 
68
  /**
73
  */
74
  public function displayCartCardIncludeTaxPrice($store = null)
75
  {
76
+ if ($this->_isServiceEnable($store)) {
77
  return false;
78
  }
79
 
88
  */
89
  public function displayCartCardBothPrices($store = null)
90
  {
91
+ if ($this->_isServiceEnable($store)) {
92
  return false;
93
  }
94
 
103
  */
104
  public function displaySalesWrappingIncludeTaxPrice($store = null)
105
  {
106
+ if ($this->_isServiceEnable($store)) {
107
  return false;
108
  }
109
 
118
  */
119
  public function displaySalesWrappingExcludeTaxPrice($store = null)
120
  {
121
+ if ($this->_isServiceEnable($store)) {
122
  return true;
123
  }
124
 
133
  */
134
  public function displaySalesWrappingBothPrices($store = null)
135
  {
136
+ if ($this->_isServiceEnable($store)) {
137
  return false;
138
  }
139
 
141
  }
142
 
143
  /**
144
+ * Is avatax service enabled
145
  *
146
  * @param Mage_Core_Model_Store|int $store
147
  * @return bool
148
  */
149
+ protected function _isServiceEnable($store)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  {
151
+ /** @var OnePica_AvaTax_Helper_Data $dataHelper */
152
+ $dataHelper = Mage::helper('avatax');
153
+ return $dataHelper->isServiceEnabled($store);
154
  }
155
  }
app/code/community/OnePica/AvaTax/Helper/Tax/Data.php CHANGED
@@ -29,34 +29,6 @@ class OnePica_AvaTax_Helper_Tax_Data extends Mage_Tax_Helper_Data
29
  */
30
  const AVATAX_SHIPPING_TAX_CLASS = 'FR020100';
31
 
32
- /**
33
- * Items should not include tax so that AvaTax can calculate it
34
- *
35
- * @param null|bool|int|Mage_Core_Model_Store $store
36
- * @return bool
37
- */
38
- public function priceIncludesTax($store = null)
39
- {
40
- if (Mage::helper('avatax')->isServiceEnabled($store)) {
41
- return false;
42
- }
43
- return parent::priceIncludesTax($store);
44
- }
45
-
46
- /**
47
- * Shipping should not include tax so that AvaTax can calculate it
48
- *
49
- * @param null|bool|int|Mage_Core_Model_Store $store
50
- * @return bool
51
- */
52
- public function shippingPriceIncludesTax($store = null)
53
- {
54
- if (Mage::helper('avatax')->isServiceEnabled($store)) {
55
- return false;
56
- }
57
- return parent::shippingPriceIncludesTax($store);
58
- }
59
-
60
  /**
61
  * Returns AvaTax's hard-coded shipping tax class
62
  *
@@ -112,18 +84,4 @@ class OnePica_AvaTax_Helper_Tax_Data extends Mage_Tax_Helper_Data
112
  }
113
  return parent::applyTaxOnOriginalPrice($store);
114
  }
115
-
116
- /**
117
- * Always apply discount first since AvaTax doesn't support line-level item discount amounts
118
- *
119
- * @param null|bool|int|Mage_Core_Model_Store $store
120
- * @return bool
121
- */
122
- public function applyTaxAfterDiscount($store = null)
123
- {
124
- if (Mage::helper('avatax')->isServiceEnabled($store)) {
125
- return true;
126
- }
127
- return parent::applyTaxAfterDiscount($store);
128
- }
129
  }
29
  */
30
  const AVATAX_SHIPPING_TAX_CLASS = 'FR020100';
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  /**
33
  * Returns AvaTax's hard-coded shipping tax class
34
  *
84
  }
85
  return parent::applyTaxOnOriginalPrice($store);
86
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  }
app/code/community/OnePica/AvaTax/Model/Action/Calculator.php CHANGED
@@ -107,13 +107,31 @@ class OnePica_AvaTax_Model_Action_Calculator extends OnePica_AvaTax_Model_Action
107
  if ($this->isProductCalculated($item)) {
108
  return 0;
109
  } else {
110
- $id = $item->getSku();
111
  $ratesData = $this->_getRates();
112
 
113
  return isset($ratesData['items'][$id]['rate']) ? $ratesData['items'][$id]['rate'] : 0;
114
  }
115
  }
116
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  /**
118
  * Get item tax group
119
  *
@@ -126,7 +144,7 @@ class OnePica_AvaTax_Model_Action_Calculator extends OnePica_AvaTax_Model_Action
126
  return array();
127
  }
128
 
129
- $id = $item->getSku();
130
  $ratesData = $this->_getRates();
131
 
132
  $jurisdictionRates = isset($ratesData['items'][$id]['jurisdiction_rates'])
@@ -166,7 +184,7 @@ class OnePica_AvaTax_Model_Action_Calculator extends OnePica_AvaTax_Model_Action
166
  return 0;
167
  }
168
  $ratesData = $this->_getRates();
169
- $id = $item->getSku();
170
 
171
  return isset($ratesData['gw_items'][$id]['amt']) ? $ratesData['gw_items'][$id]['amt'] : 0;
172
  }
@@ -188,12 +206,13 @@ class OnePica_AvaTax_Model_Action_Calculator extends OnePica_AvaTax_Model_Action
188
  $tax += $this->getItemTax($child);
189
  }
190
 
191
- return $tax;
192
  } else {
193
  $ratesData = $this->_getRates();;
194
- $id = $item->getSku();
 
195
 
196
- return isset($ratesData['items'][$id]['amt']) ? $ratesData['items'][$id]['amt'] : 0;
197
  }
198
  }
199
 
107
  if ($this->isProductCalculated($item)) {
108
  return 0;
109
  } else {
110
+ $id = $item->getId();
111
  $ratesData = $this->_getRates();
112
 
113
  return isset($ratesData['items'][$id]['rate']) ? $ratesData['items'][$id]['rate'] : 0;
114
  }
115
  }
116
 
117
+ /**
118
+ * Get item taxable
119
+ *
120
+ * @param Mage_Sales_Model_Quote_Item $item
121
+ * @return int
122
+ */
123
+ public function getItemTaxable($item)
124
+ {
125
+ if ($this->isProductCalculated($item)) {
126
+ return 0;
127
+ }
128
+
129
+ $id = $item->getId();
130
+ $ratesData = $this->_getRates();
131
+
132
+ return isset($ratesData['items'][$id]['taxable']) ? $ratesData['items'][$id]['taxable'] : 0;
133
+ }
134
+
135
  /**
136
  * Get item tax group
137
  *
144
  return array();
145
  }
146
 
147
+ $id = $item->getId();
148
  $ratesData = $this->_getRates();
149
 
150
  $jurisdictionRates = isset($ratesData['items'][$id]['jurisdiction_rates'])
184
  return 0;
185
  }
186
  $ratesData = $this->_getRates();
187
+ $id = $item->getId();
188
 
189
  return isset($ratesData['gw_items'][$id]['amt']) ? $ratesData['gw_items'][$id]['amt'] : 0;
190
  }
206
  $tax += $this->getItemTax($child);
207
  }
208
 
209
+ return (float)$tax;
210
  } else {
211
  $ratesData = $this->_getRates();;
212
+ $id = $item->getId();
213
+ $tax = isset($ratesData['items'][$id]['amt']) ? $ratesData['items'][$id]['amt'] : 0;
214
 
215
+ return (float)$tax;
216
  }
217
  }
218
 
app/code/community/OnePica/AvaTax/Model/Observer/ControllerActionLayoutGenerateXmlBefore.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * OnePica_AvaTax
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0), a
8
+ * copy of which is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ *
11
+ * @category OnePica
12
+ * @package OnePica_AvaTax
13
+ * @author OnePica Codemaster <codemaster@onepica.com>
14
+ * @copyright Copyright (c) 2015 One Pica, Inc.
15
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
+ */
17
+
18
+ /**
19
+ * Class OnePica_AvaTax_Model_Observer_ControllerActionLayoutGenerateXmlBefore
20
+ */
21
+ class OnePica_AvaTax_Model_Observer_ControllerActionLayoutGenerateXmlBefore
22
+ extends OnePica_AvaTax_Model_Observer_Abstract
23
+ {
24
+ /**
25
+ * Recalculates taxes during order creation in admin panel.
26
+ * quote item is null during first collect totals,
27
+ * that is why rate request does not send to avalara.
28
+ *
29
+ * @param Varien_Event_Observer $observer
30
+ *
31
+ * @return $this
32
+ */
33
+ public function execute(Varien_Event_Observer $observer)
34
+ {
35
+ $action = $observer->getAction();
36
+ if ($action instanceOf Mage_Adminhtml_Sales_Order_CreateController
37
+ && $action->getRequest()->getActionName() == 'loadBlock'
38
+ ) {
39
+ $requestBlocks = $action->getRequest()->getParam('block');
40
+ if (isset($requestBlocks) && strstr($requestBlocks, 'totals')) {
41
+ /* @var Mage_Adminhtml_Model_Session_Quote $adminQuote */
42
+ $adminQuote = Mage::getSingleton('adminhtml/session_quote');
43
+ /* @var Mage_Sales_Model_Quote $quote */
44
+ $quote = (isset($adminQuote)) ? $adminQuote->getQuote() : null;
45
+ if (isset($quote)) {
46
+ $quote->setTotalsCollectedFlag(false);
47
+ $quote->collectTotals();
48
+ $quote->save();
49
+ }
50
+ }
51
+ }
52
+
53
+ return $this;
54
+ }
55
+ }
app/code/community/OnePica/AvaTax/Model/Sales/Quote/Address/Total/Grand.php DELETED
@@ -1,60 +0,0 @@
1
- <?php
2
- /**
3
- * OnePica_AvaTax
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0), a
8
- * copy of which is available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/osl-3.0.php
10
- *
11
- * @category OnePica
12
- * @package OnePica_AvaTax
13
- * @author OnePica Codemaster <codemaster@onepica.com>
14
- * @copyright Copyright (c) 2009 One Pica, Inc.
15
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
- */
17
-
18
- /**
19
- * Grand totals calculation model
20
- *
21
- * @category OnePica
22
- * @package OnePica_AvaTax
23
- * @author OnePica Codemaster <codemaster@onepica.com>
24
- */
25
- class OnePica_AvaTax_Model_Sales_Quote_Address_Total_Grand extends Mage_Sales_Model_Quote_Address_Total_Grand
26
- {
27
- /**
28
- * Collect grand total address amount
29
- *
30
- * @param Mage_Sales_Model_Quote_Address $address
31
- * @return OnePica_AvaTax_Model_Sales_Quote_Address_Total_Grand
32
- */
33
- public function collect(Mage_Sales_Model_Quote_Address $address)
34
- {
35
- $grandTotal = $address->getGrandTotal();
36
- parent::collect($address);
37
-
38
- $shippingAddress = $address->getQuote()->getShippingAddress();
39
- if ($this->_isAddressActionable($shippingAddress) && $address->getGrandTotal() == $grandTotal) {
40
- $address->setGrandTotal($address->getGrandTotal() + $address->getTaxAmount());
41
- $address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBaseTaxAmount());
42
- }
43
-
44
- return $this;
45
- }
46
-
47
- /**
48
- * Check if address actionable to calculate tax
49
- *
50
- * @param Mage_Sales_Model_Quote_Address $address
51
- * @return bool
52
- */
53
- protected function _isAddressActionable($address)
54
- {
55
- /** @var OnePica_AvaTax_Helper_Address $helper */
56
- $helper = Mage::helper('avatax/address');
57
- $storeId = $address->getQuote()->getStoreId();
58
- return $helper->isAddressActionable($address, $storeId, OnePica_AvaTax_Model_Service_Abstract_Config::REGIONFILTER_TAX);
59
- }
60
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/OnePica/AvaTax/Model/Sales/Quote/Address/Total/Tax.php CHANGED
@@ -24,6 +24,13 @@
24
  */
25
  class OnePica_AvaTax_Model_Sales_Quote_Address_Total_Tax extends Mage_Sales_Model_Quote_Address_Total_Abstract
26
  {
 
 
 
 
 
 
 
27
  /**
28
  * Class constructor
29
  */
@@ -46,118 +53,30 @@ class OnePica_AvaTax_Model_Sales_Quote_Address_Total_Tax extends Mage_Sales_Mode
46
  $this->_setAddress($address);
47
  parent::collect($address);
48
 
49
- if ($address->getPostcode() && $address->getPostcode() != '-') {
50
- $store = $address->getQuote()->getStore();
51
-
52
- $address->setTotalAmount($this->getCode(), 0);
53
- $address->setBaseTotalAmount($this->getCode(), 0);
54
-
55
- $address->setTaxAmount(0);
56
- $address->setBaseTaxAmount(0);
57
- $address->setShippingTaxAmount(0);
58
- $address->setBaseShippingTaxAmount(0);
59
-
60
- //Added check for calculating tax for regions filtered in the admin
61
- if (!$this->_isAddressActionable($address) || !$address->hasItems()) {
62
- return $this;
63
- }
64
- $calculator = $this->_getCalculator($address);
65
-
66
- $itemTaxGroups = array();
67
- /** @var Mage_Sales_Model_Quote_Item $item */
68
- foreach ($address->getAllItems() as $item) {
69
- $item->setAddress($address);
70
- $baseAmount = $calculator->getItemTax($item);
71
-
72
- $giftBaseTaxTotalAmount = $calculator->getItemGiftTax($item);
73
- $itemTaxGroups[$item->getId()] = $calculator->getItemTaxGroup($item);
74
- $giftTaxTotalAmount = $store->convertPrice($giftBaseTaxTotalAmount);
75
- $giftBaseTaxAmount = $this->_getDataHelper()
76
- ->roundUp($giftBaseTaxTotalAmount / $item->getQty(), 2);
77
- $giftTaxAmount = $store->convertPrice($giftBaseTaxAmount);
78
-
79
- $amount = $store->convertPrice($baseAmount);
80
- $percent = $calculator->getItemRate($item);
81
-
82
- $item->setTaxAmount($amount);
83
- $item->setBaseTaxAmount($baseAmount);
84
- $item->setTaxPercent($percent);
85
-
86
- $item->setGwBaseTaxAmount($giftBaseTaxAmount);
87
- $item->setGwTaxAmount($giftTaxAmount);
88
-
89
- $item->setPriceInclTax($item->getPrice() + ($amount / $item->getQty()));
90
- $item->setBasePriceInclTax($item->getBasePrice() + ($baseAmount / $item->getQty()));
91
- $item->setRowTotalInclTax($item->getRowTotal() + $amount);
92
- $item->setBaseRowTotalInclTax($item->getBaseRowTotal() + $baseAmount);
93
-
94
- if (!$calculator->isProductCalculated($item)) {
95
- $this->_addAmount($amount);
96
- $this->_addBaseAmount($baseAmount);
97
- }
98
- $this->_addAmount($giftTaxTotalAmount);
99
- $this->_addBaseAmount($giftBaseTaxTotalAmount);
100
- }
101
-
102
- if ($address->getAddressType() == Mage_Sales_Model_Quote_Address::TYPE_SHIPPING
103
- || $address->getUseForShipping()
104
- ) {
105
- $shippingItem = new Varien_Object();
106
- $shippingItem->setSku(Mage::helper('avatax/config')->getShippingSku($store->getId()));
107
- $shippingItem->setProductId(Mage::helper('avatax/config')->getShippingSku($store->getId()));
108
- $shippingItem->setAddress($address);
109
- $baseShippingTax = $calculator->getItemTax($shippingItem);
110
- $shippingTax = $store->convertPrice($baseShippingTax);
111
-
112
- $shippingAmt = $address->getTotalAmount('shipping');
113
- $baseShippingAmt = $address->getBaseTotalAmount('shipping');
114
-
115
- $address->setShippingTaxAmount($shippingTax);
116
- $address->setBaseShippingTaxAmount($baseShippingTax);
117
- $address->setShippingInclTax($shippingAmt + $shippingTax);
118
- $address->setBaseShippingInclTax($baseShippingAmt + $baseShippingTax);
119
- $address->setShippingTaxable($shippingTax ? $shippingAmt : 0);
120
- $address->setBaseShippingTaxable($baseShippingTax ? $baseShippingAmt : 0);
121
- $address->setIsShippingInclTax(false);
122
-
123
- $this->_addAmount($shippingTax);
124
- $this->_addBaseAmount($baseShippingTax);
125
- }
126
-
127
- if ($address->getGwPrice() > 0) {
128
- $gwOrderItem = new Varien_Object();
129
- $gwOrderItem->setSku(Mage::helper('avatax/config')->getGwOrderSku($store->getId()));
130
- $gwOrderItem->setProductId(Mage::helper('avatax/config')->getGwOrderSku($store->getId()));
131
- $gwOrderItem->setAddress($address);
132
- $baseGwOrderTax = $calculator->getItemTax($gwOrderItem);
133
- $gwOrderTax = $store->convertPrice($baseGwOrderTax);
134
-
135
- $address->setGwBaseTaxAmount($baseGwOrderTax);
136
- $address->setGwTaxAmount($gwOrderTax);
137
 
138
- $this->_addAmount($gwOrderTax);
139
- $this->_addBaseAmount($baseGwOrderTax);
140
- }
141
 
142
- if ($address->getGwAddPrintedCard()) {
143
- $gwPrintedCardItem = new Varien_Object();
144
- $gwPrintedCardItem->setSku(Mage::helper('avatax/config')->getGwPrintedCardSku($store->getId()));
145
- $gwPrintedCardItem->setProductId(Mage::helper('avatax/config')->getGwPrintedCardSku($store->getId()));
146
- $gwPrintedCardItem->setAddress($address);
147
- $baseGwPrintedCardTax = $calculator->getItemTax($gwPrintedCardItem);
148
- $gwPrintedCardTax = $store->convertPrice($baseGwPrintedCardTax);
149
 
150
- $address->setGwPrintedCardBaseTaxAmount($baseGwPrintedCardTax);
151
- $address->setGwPrintedCardTaxAmount($gwPrintedCardTax);
152
 
153
- $this->_addAmount($gwPrintedCardTax);
154
- $this->_addBaseAmount($baseGwPrintedCardTax);
155
- }
156
 
157
- $this->_setTaxForItems($address, $itemTaxGroups);
158
- $summary = $calculator->getSummary($address);
159
- $this->_saveAppliedTax($address, $summary);
160
- }
 
 
 
161
 
162
  return $this;
163
  }
@@ -263,8 +182,13 @@ class OnePica_AvaTax_Model_Sales_Quote_Address_Total_Tax extends Mage_Sales_Mode
263
  if (method_exists($config, "displayCartSubtotalBoth") && method_exists($config, "displayCartSubtotalInclTax")
264
  && ($config->displayCartSubtotalBoth($store) || $config->displayCartSubtotalInclTax($store))
265
  ) {
266
- $subtotalInclTax = $address->getSubtotal() + $address->getTaxAmount() - $address->getShippingTaxAmount();
267
- $address->setSubtotalInclTax($subtotalInclTax);
 
 
 
 
 
268
 
269
  $address->addTotal(
270
  array(
@@ -294,6 +218,306 @@ class OnePica_AvaTax_Model_Sales_Quote_Address_Total_Tax extends Mage_Sales_Mode
294
  );
295
  }
296
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
297
  /* BELOW ARE MAGE CORE PROPERTIES AND METHODS ADDED FOR OLDER VERSION COMPATABILITY */
298
 
299
  /**
@@ -363,14 +587,4 @@ class OnePica_AvaTax_Model_Sales_Quote_Address_Total_Tax extends Mage_Sales_Mode
363
 
364
  return $this->_address;
365
  }
366
-
367
- /**
368
- * Get data helper
369
- *
370
- * @return \OnePica_AvaTax_Helper_Data
371
- */
372
- protected function _getDataHelper()
373
- {
374
- return Mage::helper('avatax');
375
- }
376
  }
24
  */
25
  class OnePica_AvaTax_Model_Sales_Quote_Address_Total_Tax extends Mage_Sales_Model_Quote_Address_Total_Abstract
26
  {
27
+ /**
28
+ * Item tax groups
29
+ *
30
+ * @var array
31
+ */
32
+ protected $_itemTaxGroups = array();
33
+
34
  /**
35
  * Class constructor
36
  */
53
  $this->_setAddress($address);
54
  parent::collect($address);
55
 
56
+ if (!$address->getPostcode()
57
+ || ($address->getPostcode() && $address->getPostcode() == '-')
58
+ ) {
59
+ return $this;
60
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
+ $store = $address->getQuote()->getStore();
 
 
63
 
64
+ //Added check for calculating tax for regions filtered in the admin
65
+ if (!$this->_isAddressActionable($address) || !$address->hasItems()) {
66
+ return $this;
67
+ }
 
 
 
68
 
69
+ $this->_resetAddressValues($address);
 
70
 
71
+ $calculator = $this->_getCalculator($address);
 
 
72
 
73
+ $this->_itemTaxGroups = array();
74
+ $this->_applyItemTax($address, $calculator, $store);
75
+ $this->_applyShippingTax($address, $store, $calculator);
76
+ $this->_applyGwTax($address, $store, $calculator);
77
+ $this->_setTaxForItems($address, $this->_itemTaxGroups);
78
+ $summary = $calculator->getSummary($address);
79
+ $this->_saveAppliedTax($address, $summary);
80
 
81
  return $this;
82
  }
182
  if (method_exists($config, "displayCartSubtotalBoth") && method_exists($config, "displayCartSubtotalInclTax")
183
  && ($config->displayCartSubtotalBoth($store) || $config->displayCartSubtotalInclTax($store))
184
  ) {
185
+ if ($address->getSubtotalInclTax() > 0) {
186
+ $subtotalInclTax = $address->getSubtotalInclTax();
187
+ } else {
188
+ $subtotalInclTax = $address->getSubtotal()
189
+ + $address->getTaxAmount()
190
+ - $address->getShippingTaxAmount();
191
+ }
192
 
193
  $address->addTotal(
194
  array(
218
  );
219
  }
220
 
221
+ /**
222
+ * Apply shipping tax
223
+ *
224
+ * @param \Mage_Sales_Model_Quote_Address $address
225
+ * @param Mage_Core_Model_Store|int $store
226
+ * @param OnePica_AvaTax_Model_Action_Calculator $calculator
227
+ * @return $this
228
+ */
229
+ protected function _applyShippingTax(Mage_Sales_Model_Quote_Address $address, $store, $calculator)
230
+ {
231
+ if ($address->getAddressType() == Mage_Sales_Model_Quote_Address::TYPE_SHIPPING
232
+ || $address->getUseForShipping()
233
+ ) {
234
+ $shippingItem = new Varien_Object();
235
+ $shippingItem->setId(Mage::helper('avatax/config')->getShippingSku($store->getId()));
236
+ $shippingItem->setProductId(Mage::helper('avatax/config')->getShippingSku($store->getId()));
237
+ $shippingItem->setAddress($address);
238
+ $baseShippingTax = $calculator->getItemTax($shippingItem);
239
+ $shippingTax = $store->convertPrice($baseShippingTax);
240
+
241
+ $baseShippingAmt = $address->getBaseTotalAmount('shipping');
242
+ $shippingAmt = $address->getTotalAmount('shipping');
243
+
244
+ $baseShippingInclTax = $baseShippingAmt + $baseShippingTax;
245
+ $shippingInclTax = $shippingAmt + $shippingTax;
246
+
247
+ if ($this->_getTaxDataHelper()->priceIncludesTax($store)) {
248
+ $baseShippingInclTax = $baseShippingAmt;
249
+ $shippingInclTax = $shippingAmt;
250
+
251
+ $baseShippingAmt -= $baseShippingTax;
252
+ $shippingAmt = $store->convertPrice($baseShippingAmt);
253
+
254
+ $address->setTotalAmount('shipping', $shippingAmt);
255
+ $address->setBaseTotalAmount('shipping', $baseShippingAmt);
256
+ }
257
+
258
+ $address->setShippingTaxAmount($shippingTax);
259
+ $address->setBaseShippingTaxAmount($baseShippingTax);
260
+
261
+ $address->setShippingInclTax($shippingInclTax);
262
+ $address->setBaseShippingInclTax($baseShippingInclTax);
263
+
264
+ $address->setShippingTaxable($shippingTax ? $shippingAmt : 0);
265
+ $address->setBaseShippingTaxable($baseShippingTax ? $baseShippingAmt : 0);
266
+
267
+ $this->_addAmount($shippingTax);
268
+ $this->_addBaseAmount($baseShippingTax);
269
+ }
270
+
271
+ return $this;
272
+ }
273
+
274
+ /**
275
+ * Apply gift wrapping tax
276
+ *
277
+ * @param Mage_Sales_Model_Quote_Address $address
278
+ * @param Mage_Core_Model_Store|int $store
279
+ * @param OnePica_AvaTax_Model_Action_Calculator $calculator
280
+ * @return $this
281
+ */
282
+ protected function _applyGwTax(Mage_Sales_Model_Quote_Address $address, $store, $calculator)
283
+ {
284
+ if ($address->getGwPrice() > 0) {
285
+ $gwOrderItem = new Varien_Object();
286
+ $gwOrderItem->setId(Mage::helper('avatax/config')->getGwOrderSku($store->getId()));
287
+ $gwOrderItem->setProductId(Mage::helper('avatax/config')->getGwOrderSku($store->getId()));
288
+ $gwOrderItem->setAddress($address);
289
+ $baseGwOrderTax = $calculator->getItemTax($gwOrderItem);
290
+ $gwOrderTax = $store->convertPrice($baseGwOrderTax);
291
+
292
+ $address->setGwBaseTaxAmount($baseGwOrderTax);
293
+ $address->setGwTaxAmount($gwOrderTax);
294
+
295
+ if ($this->_getTaxDataHelper()->priceIncludesTax($store)) {
296
+ $gwBasePriceAmount = $address->getGwBasePrice() - $baseGwOrderTax;
297
+ $gwPriceAmount = $store->convertPrice($gwBasePriceAmount);
298
+ $address->setGwBasePrice($gwBasePriceAmount);
299
+ $address->setGwPrice($gwPriceAmount);
300
+
301
+ $address->setGrandTotal($address->getGrandTotal() - $gwOrderTax);
302
+ $address->setBaseGrandTotal($address->getBaseGrandTotal() - $baseGwOrderTax);
303
+ }
304
+
305
+ $this->_addAmount($gwOrderTax);
306
+ $this->_addBaseAmount($baseGwOrderTax);
307
+ }
308
+
309
+ if ($address->getGwAddPrintedCard()) {
310
+ $gwPrintedCardItem = new Varien_Object();
311
+ $gwPrintedCardItem->setId(Mage::helper('avatax/config')->getGwPrintedCardSku($store->getId()));
312
+ $gwPrintedCardItem->setProductId(Mage::helper('avatax/config')->getGwPrintedCardSku($store->getId()));
313
+ $gwPrintedCardItem->setAddress($address);
314
+
315
+ $baseGwPrintedCardTax = $calculator->getItemTax($gwPrintedCardItem);
316
+ $gwPrintedCardTax = $store->convertPrice($baseGwPrintedCardTax);
317
+ $address->setGwPrintedCardBaseTaxAmount($baseGwPrintedCardTax);
318
+ $address->setGwPrintedCardTaxAmount($gwPrintedCardTax);
319
+
320
+ if ($this->_getTaxDataHelper()->priceIncludesTax($store)) {
321
+ $baseGwPrintedCardAmount = $address->getGwCardBasePrice() - $baseGwPrintedCardTax;
322
+ $gwPrintedCardAmount = $store->convertPrice($baseGwPrintedCardAmount);
323
+ $address->setGwCardPrice($gwPrintedCardAmount);
324
+ $address->setGwCardBasePrice($baseGwPrintedCardAmount);
325
+
326
+ $address->setGrandTotal($address->getGrandTotal() - $gwPrintedCardTax);
327
+ $address->setBaseGrandTotal($address->getBaseGrandTotal() - $baseGwPrintedCardTax);
328
+ }
329
+
330
+ $this->_addAmount($gwPrintedCardTax);
331
+ $this->_addBaseAmount($baseGwPrintedCardTax);
332
+ }
333
+
334
+ return $this;
335
+ }
336
+
337
+ /**
338
+ * Reset address values
339
+ *
340
+ * @param \Mage_Sales_Model_Quote_Address $address
341
+ * @return $this
342
+ */
343
+ protected function _resetAddressValues(Mage_Sales_Model_Quote_Address $address)
344
+ {
345
+ $address->setTotalAmount($this->getCode(), 0);
346
+ $address->setBaseTotalAmount($this->getCode(), 0);
347
+
348
+ $address->setTaxAmount(0);
349
+ $address->setBaseTaxAmount(0);
350
+ $address->setShippingTaxAmount(0);
351
+ $address->setBaseShippingTaxAmount(0);
352
+
353
+ $address->setSubtotal(0);
354
+ $address->setSubtotalInclTax(0);
355
+ $address->setBaseSubtotalInclTax(0);
356
+ $address->setTotalAmount('subtotal', 0);
357
+ $address->setBaseTotalAmount('subtotal', 0);
358
+
359
+ $address->setGwItemsTaxAmount(0);
360
+ $address->setGwItemsBaseTaxAmount(0);
361
+ $address->setGwBaseTaxAmount(0);
362
+ $address->setGwTaxAmount(0);
363
+ $address->setGwCardBaseTaxAmount(0);
364
+ $address->setGwCardTaxAmount(0);
365
+
366
+ return $this;
367
+ }
368
+
369
+ /**
370
+ * Apply item tax
371
+ *
372
+ * @param Mage_Sales_Model_Quote_Address $address
373
+ * @param Mage_Core_Model_Store|int $store
374
+ * @param OnePica_AvaTax_Model_Action_Calculator $calculator
375
+ * @return $this
376
+ */
377
+ protected function _applyItemTax(Mage_Sales_Model_Quote_Address $address, $calculator, $store)
378
+ {
379
+ /** @var Mage_Sales_Model_Quote_Item $item */
380
+ foreach ($address->getAllItems() as $item) {
381
+ $item->setAddress($address);
382
+ $baseAmount = $calculator->getItemTax($item);
383
+
384
+ $giftBaseTaxTotalAmount = $calculator->getItemGiftTax($item);
385
+ $this->_itemTaxGroups[$item->getId()] = $calculator->getItemTaxGroup($item);
386
+ $giftTaxTotalAmount = $store->convertPrice($giftBaseTaxTotalAmount);
387
+ $giftBaseTaxAmount = $this->_getDataHelper()->roundUp($giftBaseTaxTotalAmount / $item->getTotalQty(), 4);
388
+ $giftTaxAmount = $store->convertPrice($giftBaseTaxAmount);
389
+
390
+ $amount = $store->convertPrice($baseAmount);
391
+ $percent = $calculator->getItemRate($item);
392
+
393
+ $item->setTaxAmount($amount);
394
+ $item->setBaseTaxAmount($baseAmount);
395
+ $item->setTaxPercent($percent);
396
+
397
+ $item->setGwBaseTaxAmount($giftBaseTaxAmount);
398
+ $item->setGwTaxAmount($giftTaxAmount);
399
+
400
+ $address->setGwItemsTaxAmount($address->getGwItemsTaxAmount() + $giftTaxTotalAmount);
401
+ $address->setGwItemsBaseTaxAmount($address->getGwItemsBaseTaxAmount() + $giftBaseTaxTotalAmount);
402
+
403
+ if ($this->_getTaxDataHelper()->priceIncludesTax($store)) {
404
+ $basePriceIncTax = $item->getBasePrice();
405
+ $priceIncTax = $item->getCalculationPrice();
406
+
407
+ $baseRowTotalIncTax = $item->getBaseRowTotal();
408
+ $rowTotalIncTax = $item->getRowTotal();
409
+
410
+ $item->setPrice($item->getPrice() - ($baseAmount / $item->getTotalQty()));
411
+ $item->setBasePrice($item->getBasePrice() - ($baseAmount / $item->getTotalQty()));
412
+
413
+ $item->setBaseRowTax($baseAmount);
414
+ $item->setRowTax($amount);
415
+
416
+ $this->_calcItemRowTotal($item);
417
+
418
+ $address->setGwItemsBasePrice($address->getGwItemsBasePrice() - $giftBaseTaxTotalAmount);
419
+ $address->setGwItemsPrice($address->getGwItemsPrice() - $giftTaxTotalAmount);
420
+
421
+ $item->setGwBasePrice($item->getGwBasePrice() - $giftBaseTaxAmount);
422
+ $item->setGwPrice($item->getGwPrice() - $giftTaxAmount);
423
+
424
+ $address->setBaseGrandTotal($address->getBaseGrandTotal() - $giftBaseTaxTotalAmount);
425
+ $address->setGrandTotal($address->getGrandTotal() - $giftTaxTotalAmount);
426
+
427
+ $item->setBasePriceInclTax($basePriceIncTax);
428
+ $item->setPriceInclTax($priceIncTax);
429
+
430
+ $item->setBaseRowTotalInclTax($baseRowTotalIncTax);
431
+ $item->setRowTotalInclTax($rowTotalIncTax);
432
+ } else {
433
+ $item->setBasePriceInclTax($item->getBasePrice() + ($baseAmount / $item->getTotalQty()));
434
+ $item->setPriceInclTax($item->getCalculationPrice() + ($amount / $item->getTotalQty()));
435
+
436
+ $item->setBaseRowTotalInclTax($item->getBaseRowTotal() + $baseAmount);
437
+ $item->setRowTotalInclTax($item->getRowTotal() + $amount);
438
+ }
439
+
440
+ if (!$calculator->isProductCalculated($item)) {
441
+ $this->_addAmount($amount);
442
+ $this->_addBaseAmount($baseAmount);
443
+ }
444
+
445
+ $this->_addAmount($giftTaxTotalAmount);
446
+ $this->_addBaseAmount($giftBaseTaxTotalAmount);
447
+
448
+ if (!$item->getParentItem()) {
449
+ $this->_addSubtotalAmount($address, $item);
450
+ }
451
+ }
452
+
453
+ return $this;
454
+ }
455
+
456
+ /**
457
+ * Add row total item amount to subtotal
458
+ *
459
+ * @param Mage_Sales_Model_Quote_Address $address
460
+ * @param Mage_Sales_Model_Quote_Item $item
461
+ * @return $this
462
+ */
463
+ protected function _addSubtotalAmount(Mage_Sales_Model_Quote_Address $address, $item)
464
+ {
465
+ if ($this->_getTaxDataHelper()->priceIncludesTax($item->getStoreId())) {
466
+ $subTotal = $item->getRowTotalInclTax() - $item->getRowTax();
467
+ $baseSubTotal = $item->getBaseRowTotalInclTax() - $item->getBaseRowTax();
468
+ $address->setTotalAmount('subtotal', $address->getTotalAmount('subtotal') + $subTotal);
469
+ $address->setBaseTotalAmount('subtotal', $address->getBaseTotalAmount('subtotal') + $baseSubTotal);
470
+ } else {
471
+ $address->setTotalAmount('subtotal', $address->getTotalAmount('subtotal') + $item->getRowTotal());
472
+ $address->setBaseTotalAmount('subtotal',
473
+ $address->getBaseTotalAmount('subtotal') + $item->getBaseRowTotal()
474
+ );
475
+ }
476
+
477
+ $address->setSubtotalInclTax($address->getSubtotalInclTax() + $item->getRowTotalInclTax());
478
+ $address->setBaseSubtotalInclTax($address->getBaseSubtotalInclTax() + $item->getBaseRowTotalInclTax());
479
+
480
+ return $this;
481
+ }
482
+
483
+ /**
484
+ * Calculate item row total
485
+ *
486
+ * @param Mage_Sales_Model_Quote_Item $item
487
+ * @return $this
488
+ * @see Mage_Sales_Model_Quote_Item::calcRowTotal()
489
+ */
490
+ protected function _calcItemRowTotal($item)
491
+ {
492
+ $qty = $item->getTotalQty();
493
+ $total = $this->_getDataHelper()->roundUp($item->getCalculationPriceOriginal(), 4) * $qty;
494
+ $baseTotal = $this->_getDataHelper()->roundUp($item->getBaseCalculationPriceOriginal(), 4) * $qty;
495
+ $item->setRowTotal($this->_getDataHelper()->roundUp($total, 4));
496
+ $item->setBaseRowTotal($this->_getDataHelper()->roundUp($baseTotal, 4));
497
+
498
+ return $this;
499
+ }
500
+
501
+ /**
502
+ * Get tax data helper
503
+ *
504
+ * @return Mage_Tax_Helper_Data
505
+ */
506
+ protected function _getTaxDataHelper()
507
+ {
508
+ return Mage::helper('tax');
509
+ }
510
+
511
+ /**
512
+ * Get data helper
513
+ *
514
+ * @return \OnePica_AvaTax_Helper_Data
515
+ */
516
+ protected function _getDataHelper()
517
+ {
518
+ return Mage::helper('avatax');
519
+ }
520
+
521
  /* BELOW ARE MAGE CORE PROPERTIES AND METHODS ADDED FOR OLDER VERSION COMPATABILITY */
522
 
523
  /**
587
 
588
  return $this->_address;
589
  }
 
 
 
 
 
 
 
 
 
 
590
  }
app/code/community/OnePica/AvaTax/Model/Service/Abstract/Tools.php CHANGED
@@ -31,18 +31,24 @@ class OnePica_AvaTax_Model_Service_Abstract_Tools extends Varien_Object
31
  */
32
  const CACHE_TTL = 120;
33
 
34
- //@startSkipCommitHooks
 
 
 
 
 
 
35
  /**
36
  * Alias to the helper translate method.
37
  *
38
  * @return string
 
39
  */
40
  public function __()
41
  {
42
  $args = func_get_args();
43
  return call_user_func_array(array($this->_getHelper(), '__'), $args);
44
  }
45
- //@finishSkipCommitHooks
46
 
47
  /**
48
  * Retrieve converted date taking into account the current time zone and store.
@@ -170,4 +176,27 @@ class OnePica_AvaTax_Model_Service_Abstract_Tools extends Varien_Object
170
  }
171
  return $order->getBillingAddress()->getVatId();
172
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
  }
31
  */
32
  const CACHE_TTL = 120;
33
 
34
+ /**
35
+ * Can send request
36
+ *
37
+ * @var bool
38
+ */
39
+ protected $_canSendRequest = true;
40
+
41
  /**
42
  * Alias to the helper translate method.
43
  *
44
  * @return string
45
+ * @skipPublicMethodNaming __
46
  */
47
  public function __()
48
  {
49
  $args = func_get_args();
50
  return call_user_func_array(array($this->_getHelper(), '__'), $args);
51
  }
 
52
 
53
  /**
54
  * Retrieve converted date taking into account the current time zone and store.
176
  }
177
  return $order->getBillingAddress()->getVatId();
178
  }
179
+
180
+ /**
181
+ * Is can send request
182
+ *
183
+ * @return bool
184
+ */
185
+ public function isCanSendRequest()
186
+ {
187
+ return $this->_canSendRequest;
188
+ }
189
+
190
+ /**
191
+ * Set can send request
192
+ *
193
+ * @param bool $canSendRequest
194
+ * @return $this
195
+ */
196
+ public function setCanSendRequest($canSendRequest)
197
+ {
198
+ $this->_canSendRequest = $canSendRequest;
199
+
200
+ return $this;
201
+ }
202
  }
app/code/community/OnePica/AvaTax/Model/Service/Avatax/Estimate.php CHANGED
@@ -111,6 +111,7 @@ class OnePica_AvaTax_Model_Service_Avatax_Estimate
111
 
112
  /** @var OnePica_AvaTax_Model_Sales_Quote_Address $address */
113
  $this->_lines = array();
 
114
 
115
  //set up request
116
  $quote = $address->getQuote();
@@ -134,17 +135,18 @@ class OnePica_AvaTax_Model_Service_Avatax_Estimate
134
  $makeRequest &= $this->_request->getDestinationAddress() == '' ? false : true;
135
  $makeRequest &= $address->getId() ? true : false;
136
  $makeRequest &= !isset($this->_rates[$requestKey]['failure']);
 
137
  //@finishSkipCommitHooks
138
 
139
  //make request if needed and save results in cache
140
  if ($makeRequest) {
141
  $result = $this->_send($quote->getStoreId());
142
  $this->_rates[$requestKey] = array(
143
- 'timestamp' => $this->_getDateModel()->timestamp(),
144
  'address_id' => $address->getId(),
145
- 'summary' => array(),
146
- 'items' => array(),
147
- 'gw_items' => array()
148
  );
149
 
150
  //success
@@ -155,8 +157,10 @@ class OnePica_AvaTax_Model_Service_Avatax_Estimate
155
  $id = $this->_getItemIdByLine($ctl);
156
  $code = $this->_getTaxArrayCodeByLine($ctl);
157
  $this->_rates[$requestKey][$code][$id] = array(
158
- 'rate' => ($ctl->getTax() ? $ctl->getRate() : 0) * 100,
159
- 'amt' => $ctl->getTax(),
 
 
160
  );
161
  }
162
 
@@ -164,7 +168,7 @@ class OnePica_AvaTax_Model_Service_Avatax_Estimate
164
  $this->_rates[$requestKey]['summary'][] = array(
165
  'name' => $row->getTaxName(),
166
  'rate' => $row->getRate() * 100,
167
- 'amt' => $row->getTax()
168
  );
169
  }
170
  //failure
@@ -176,6 +180,7 @@ class OnePica_AvaTax_Model_Service_Avatax_Estimate
176
  }
177
 
178
  $rates = isset($this->_rates[$requestKey]) ? $this->_rates[$requestKey] : array();
 
179
  return $rates;
180
  }
181
 
@@ -214,7 +219,7 @@ class OnePica_AvaTax_Model_Service_Avatax_Estimate
214
  /**
215
  * Adds shipping cost to request as item
216
  *
217
- * @param Mage_Sales_Model_Quote_Address
218
  * @return int
219
  */
220
  protected function _addShipping($address)
@@ -222,7 +227,11 @@ class OnePica_AvaTax_Model_Service_Avatax_Estimate
222
  $lineNumber = count($this->_lines);
223
  $storeId = $address->getQuote()->getStore()->getId();
224
  $taxClass = Mage::helper('tax')->getShippingTaxClass($storeId);
225
- $shippingAmount = (float) $address->getBaseShippingAmount();
 
 
 
 
226
 
227
  $line = new Line();
228
  $line->setNo($lineNumber);
@@ -232,11 +241,19 @@ class OnePica_AvaTax_Model_Service_Avatax_Estimate
232
  $line->setTaxCode($taxClass);
233
  $line->setQty(1);
234
  $line->setAmount($shippingAmount);
235
- $line->setDiscounted(false);
 
 
 
 
 
 
 
236
 
237
  $this->_lines[$lineNumber] = $line;
238
  $this->_request->setLines($this->_lines);
239
  $this->_lineToLineId[$lineNumber] = $this->_getConfigHelper()->getShippingSku($storeId);
 
240
  return $lineNumber;
241
  }
242
 
@@ -266,6 +283,10 @@ class OnePica_AvaTax_Model_Service_Avatax_Estimate
266
  $line->setAmount($gwOrderAmount);
267
  $line->setDiscounted(false);
268
 
 
 
 
 
269
  $this->_lines[$lineNumber] = $line;
270
  $this->_request->setLines($this->_lines);
271
  $this->_lineToLineId[$lineNumber] = $this->_getConfigHelper()->getGwOrderSku($storeId);
@@ -298,10 +319,14 @@ class OnePica_AvaTax_Model_Service_Avatax_Estimate
298
  $line->setAmount($gwItemsAmount);
299
  $line->setDiscounted(false);
300
 
 
 
 
 
301
  $this->_lines[$lineNumber] = $line;
302
  $this->_request->setLines($this->_lines);
303
  $this->_lineToLineId[$lineNumber] = $this->_getConfigHelper()->getGwItemsSku($storeId);
304
- $this->_productGiftPair[$lineNumber] = $item->getSku();
305
 
306
  return $lineNumber;
307
  }
@@ -332,6 +357,10 @@ class OnePica_AvaTax_Model_Service_Avatax_Estimate
332
  $line->setAmount($gwPrintedCardAmount);
333
  $line->setDiscounted(false);
334
 
 
 
 
 
335
  $this->_lines[$lineNumber] = $line;
336
  $this->_request->setLines($this->_lines);
337
  $this->_lineToLineId[$lineNumber] = $this->_getConfigHelper()->getGwPrintedCardSku($storeId);
@@ -368,13 +397,24 @@ class OnePica_AvaTax_Model_Service_Avatax_Estimate
368
  */
369
  protected function _newLine($item)
370
  {
 
 
 
 
 
 
371
  $this->_addGwItemsAmount($item);
372
  if ($this->isProductCalculated($item)) {
373
  return false;
374
  }
375
  $product = $this->_getProductByProductId($item->getProductId());
376
  $taxClass = $this->_getTaxClassCodeByProduct($product);
377
- $price = $item->getBaseRowTotal() - $item->getBaseDiscountAmount();
 
 
 
 
 
378
  $lineNumber = count($this->_lines);
379
  $line = new Line();
380
  $line->setNo($lineNumber);
@@ -385,9 +425,15 @@ class OnePica_AvaTax_Model_Service_Avatax_Estimate
385
  )
386
  );
387
  $line->setDescription($item->getName());
388
- $line->setQty($item->getQty());
389
  $line->setAmount($price);
390
- $line->setDiscounted((float)$item->getDiscountAmount() ? true : false);
 
 
 
 
 
 
391
 
392
  if ($taxClass) {
393
  $line->setTaxCode($taxClass);
@@ -402,7 +448,8 @@ class OnePica_AvaTax_Model_Service_Avatax_Estimate
402
  }
403
 
404
  $this->_lines[$lineNumber] = $line;
405
- $this->_lineToLineId[$lineNumber] = $item->getSku();
 
406
  return $lineNumber;
407
  }
408
 
@@ -479,4 +526,14 @@ class OnePica_AvaTax_Model_Service_Avatax_Estimate
479
 
480
  return $result;
481
  }
 
 
 
 
 
 
 
 
 
 
482
  }
111
 
112
  /** @var OnePica_AvaTax_Model_Sales_Quote_Address $address */
113
  $this->_lines = array();
114
+ $this->setCanSendRequest(true); //reset flag
115
 
116
  //set up request
117
  $quote = $address->getQuote();
135
  $makeRequest &= $this->_request->getDestinationAddress() == '' ? false : true;
136
  $makeRequest &= $address->getId() ? true : false;
137
  $makeRequest &= !isset($this->_rates[$requestKey]['failure']);
138
+ $makeRequest &= $this->isCanSendRequest();
139
  //@finishSkipCommitHooks
140
 
141
  //make request if needed and save results in cache
142
  if ($makeRequest) {
143
  $result = $this->_send($quote->getStoreId());
144
  $this->_rates[$requestKey] = array(
145
+ 'timestamp' => $this->_getDateModel()->timestamp(),
146
  'address_id' => $address->getId(),
147
+ 'summary' => array(),
148
+ 'items' => array(),
149
+ 'gw_items' => array()
150
  );
151
 
152
  //success
157
  $id = $this->_getItemIdByLine($ctl);
158
  $code = $this->_getTaxArrayCodeByLine($ctl);
159
  $this->_rates[$requestKey][$code][$id] = array(
160
+ 'rate' => ($ctl->getTax() ? $ctl->getRate() : 0) * 100,
161
+ 'amt' => $ctl->getTax(),
162
+ 'taxable' => $ctl->getTaxable(),
163
+ 'tax_included' => $ctl->getTaxIncluded(),
164
  );
165
  }
166
 
168
  $this->_rates[$requestKey]['summary'][] = array(
169
  'name' => $row->getTaxName(),
170
  'rate' => $row->getRate() * 100,
171
+ 'amt' => $row->getTax()
172
  );
173
  }
174
  //failure
180
  }
181
 
182
  $rates = isset($this->_rates[$requestKey]) ? $this->_rates[$requestKey] : array();
183
+
184
  return $rates;
185
  }
186
 
219
  /**
220
  * Adds shipping cost to request as item
221
  *
222
+ * @param Mage_Sales_Model_Quote_Address $address
223
  * @return int
224
  */
225
  protected function _addShipping($address)
227
  $lineNumber = count($this->_lines);
228
  $storeId = $address->getQuote()->getStore()->getId();
229
  $taxClass = Mage::helper('tax')->getShippingTaxClass($storeId);
230
+ $shippingAmount = (float)$address->getBaseShippingAmount();
231
+
232
+ if ($this->_getTaxDataHelper()->applyTaxAfterDiscount($storeId)) {
233
+ $shippingAmount -= (float)$address->getBaseShippingDiscountAmount();
234
+ }
235
 
236
  $line = new Line();
237
  $line->setNo($lineNumber);
241
  $line->setTaxCode($taxClass);
242
  $line->setQty(1);
243
  $line->setAmount($shippingAmount);
244
+ $line->setDiscounted(
245
+ (float)$address->getBaseShippingDiscountAmount()
246
+ && $this->_getTaxDataHelper()->applyTaxAfterDiscount($storeId)
247
+ );
248
+
249
+ if ($this->_getTaxDataHelper()->shippingPriceIncludesTax($storeId)) {
250
+ $line->setTaxIncluded(true);
251
+ }
252
 
253
  $this->_lines[$lineNumber] = $line;
254
  $this->_request->setLines($this->_lines);
255
  $this->_lineToLineId[$lineNumber] = $this->_getConfigHelper()->getShippingSku($storeId);
256
+
257
  return $lineNumber;
258
  }
259
 
283
  $line->setAmount($gwOrderAmount);
284
  $line->setDiscounted(false);
285
 
286
+ if ($this->_getTaxDataHelper()->priceIncludesTax($storeId)) {
287
+ $line->setTaxIncluded(true);
288
+ }
289
+
290
  $this->_lines[$lineNumber] = $line;
291
  $this->_request->setLines($this->_lines);
292
  $this->_lineToLineId[$lineNumber] = $this->_getConfigHelper()->getGwOrderSku($storeId);
319
  $line->setAmount($gwItemsAmount);
320
  $line->setDiscounted(false);
321
 
322
+ if ($this->_getTaxDataHelper()->priceIncludesTax($storeId)) {
323
+ $line->setTaxIncluded(true);
324
+ }
325
+
326
  $this->_lines[$lineNumber] = $line;
327
  $this->_request->setLines($this->_lines);
328
  $this->_lineToLineId[$lineNumber] = $this->_getConfigHelper()->getGwItemsSku($storeId);
329
+ $this->_productGiftPair[$lineNumber] = $item->getId();
330
 
331
  return $lineNumber;
332
  }
357
  $line->setAmount($gwPrintedCardAmount);
358
  $line->setDiscounted(false);
359
 
360
+ if ($this->_getTaxDataHelper()->priceIncludesTax($storeId)) {
361
+ $line->setTaxIncluded(true);
362
+ }
363
+
364
  $this->_lines[$lineNumber] = $line;
365
  $this->_request->setLines($this->_lines);
366
  $this->_lineToLineId[$lineNumber] = $this->_getConfigHelper()->getGwPrintedCardSku($storeId);
397
  */
398
  protected function _newLine($item)
399
  {
400
+ if (!$item->getId()) {
401
+ $this->setCanSendRequest(false);
402
+
403
+ return $this;
404
+ }
405
+
406
  $this->_addGwItemsAmount($item);
407
  if ($this->isProductCalculated($item)) {
408
  return false;
409
  }
410
  $product = $this->_getProductByProductId($item->getProductId());
411
  $taxClass = $this->_getTaxClassCodeByProduct($product);
412
+ $price = $item->getBaseRowTotal();
413
+
414
+ if ($this->_getTaxDataHelper()->applyTaxAfterDiscount($item->getStoreId())) {
415
+ $price = $item->getBaseRowTotal() - $item->getBaseDiscountAmount();
416
+ }
417
+
418
  $lineNumber = count($this->_lines);
419
  $line = new Line();
420
  $line->setNo($lineNumber);
425
  )
426
  );
427
  $line->setDescription($item->getName());
428
+ $line->setQty($item->getTotalQty());
429
  $line->setAmount($price);
430
+ $line->setDiscounted(
431
+ (float)$item->getDiscountAmount() && $this->_getTaxDataHelper()->applyTaxAfterDiscount($item->getStoreId())
432
+ );
433
+
434
+ if ($this->_getTaxDataHelper()->priceIncludesTax($item->getStoreId())) {
435
+ $line->setTaxIncluded(true);
436
+ }
437
 
438
  if ($taxClass) {
439
  $line->setTaxCode($taxClass);
448
  }
449
 
450
  $this->_lines[$lineNumber] = $line;
451
+ $this->_lineToLineId[$lineNumber] = $item->getId();
452
+
453
  return $lineNumber;
454
  }
455
 
526
 
527
  return $result;
528
  }
529
+
530
+ /**
531
+ * Get tax data helper
532
+ *
533
+ * @return Mage_Tax_Helper_Data
534
+ */
535
+ protected function _getTaxDataHelper()
536
+ {
537
+ return Mage::helper('tax');
538
+ }
539
  }
app/code/community/OnePica/AvaTax/Model/Service/Avatax/Invoice.php CHANGED
@@ -220,25 +220,40 @@ class OnePica_AvaTax_Model_Service_Avatax_Invoice extends OnePica_AvaTax_Model_S
220
  return false;
221
  }
222
 
 
 
223
  $lineNumber = count($this->_lines);
224
  $storeId = $object->getStore()->getId();
225
  $taxClass = Mage::helper('tax')->getShippingTaxClass($storeId);
226
 
227
- $amount = $object->getBaseShippingAmount();
 
 
 
 
 
 
 
 
 
 
 
228
  if ($credit) {
229
  //@startSkipCommitHooks
230
  $amount *= -1;
231
  //@finishSkipCommitHooks
232
  }
233
 
234
- $line = new Line();
235
  $line->setNo($lineNumber);
236
  $line->setItemCode($this->_getConfigHelper()->getShippingSku($storeId));
237
  $line->setDescription('Shipping costs');
238
  $line->setTaxCode($taxClass);
239
  $line->setQty(1);
240
  $line->setAmount($amount);
241
- $line->setDiscounted(false);
 
 
 
242
 
243
  $this->_lineToItemId[$lineNumber] = 'shipping';
244
  $this->_lines[$lineNumber] = $line;
@@ -261,14 +276,21 @@ class OnePica_AvaTax_Model_Service_Avatax_Invoice extends OnePica_AvaTax_Model_S
261
 
262
  $lineNumber = count($this->_lines);
263
  $storeId = $object->getStore()->getId();
 
264
  $amount = $object->getGwBasePrice();
 
 
 
 
 
 
 
265
  if ($credit) {
266
  //@startSkipCommitHooks
267
  $amount *= -1;
268
  //@finishSkipCommitHooks
269
  }
270
 
271
- $line = new Line();
272
  $line->setNo($lineNumber);
273
  $line->setItemCode($this->_getConfigHelper()->getGwOrderSku($storeId));
274
  $line->setDescription('Gift Wrap Order Amount');
@@ -300,13 +322,19 @@ class OnePica_AvaTax_Model_Service_Avatax_Invoice extends OnePica_AvaTax_Model_S
300
  $storeId = $object->getStore()->getId();
301
 
302
  $amount = $object->getGwItemsBasePrice();
 
 
 
 
 
 
 
303
  if ($credit) {
304
  //@startSkipCommitHooks
305
  $amount *= -1;
306
  //@finishSkipCommitHooks
307
  }
308
 
309
- $line = new Line();
310
  $line->setNo($lineNumber);
311
  $line->setItemCode($this->_getConfigHelper()->getGwItemsSku($storeId));
312
  $line->setDescription('Gift Wrap Items Amount');
@@ -338,13 +366,19 @@ class OnePica_AvaTax_Model_Service_Avatax_Invoice extends OnePica_AvaTax_Model_S
338
  $storeId = $object->getStore()->getId();
339
 
340
  $amount = $object->getGwPrintedCardBasePrice();
 
 
 
 
 
 
 
341
  if ($credit) {
342
  //@startSkipCommitHooks
343
  $amount *= -1;
344
  //@finishSkipCommitHooks
345
  }
346
 
347
- $line = new Line();
348
  $line->setNo($lineNumber);
349
  $line->setItemCode($this->_getConfigHelper()->getGwPrintedCardSku($storeId));
350
  $line->setDescription('Gift Wrap Printed Card Amount');
@@ -422,15 +456,25 @@ class OnePica_AvaTax_Model_Service_Avatax_Invoice extends OnePica_AvaTax_Model_S
422
  return false;
423
  }
424
 
 
425
  $storeId = $this->_retrieveStoreIdFromItem($item);
426
- $price = $item->getBaseRowTotal() - $item->getBaseDiscountAmount();
 
 
 
 
 
 
 
 
 
 
427
  if ($credit) {
428
  //@startSkipCommitHooks
429
  $price *= -1;
430
  //@finishSkipCommitHooks
431
  }
432
 
433
- $line = new Line();
434
  $line->setNo(count($this->_lines));
435
  $line->setItemCode(
436
  $this->_getCalculationHelper()->getItemCode(
@@ -442,7 +486,10 @@ class OnePica_AvaTax_Model_Service_Avatax_Invoice extends OnePica_AvaTax_Model_S
442
  $line->setDescription($item->getName());
443
  $line->setQty($item->getQty());
444
  $line->setAmount($price);
445
- $line->setDiscounted($item->getBaseDiscountAmount() ? true : false);
 
 
 
446
 
447
  $productData = $this->_getLineProductData($item, $storeId);
448
  $line->setTaxCode($productData->getTaxCode());
@@ -518,4 +565,14 @@ class OnePica_AvaTax_Model_Service_Avatax_Invoice extends OnePica_AvaTax_Model_S
518
 
519
  return $storeId;
520
  }
 
 
 
 
 
 
 
 
 
 
521
  }
220
  return false;
221
  }
222
 
223
+ $order = $object->getOrder();
224
+
225
  $lineNumber = count($this->_lines);
226
  $storeId = $object->getStore()->getId();
227
  $taxClass = Mage::helper('tax')->getShippingTaxClass($storeId);
228
 
229
+ $line = new Line();
230
+ $amount = (float)$object->getBaseShippingAmount();
231
+
232
+ if ($this->_getTaxDataHelper()->priceIncludesTax($storeId)) {
233
+ $amount = (float)$object->getBaseShippingInclTax();
234
+ $line->setTaxIncluded(true);
235
+ }
236
+
237
+ if ($this->_getTaxDataHelper()->applyTaxAfterDiscount()) {
238
+ $amount -= (float)$order->getBaseShippingDiscountAmount();
239
+ }
240
+
241
  if ($credit) {
242
  //@startSkipCommitHooks
243
  $amount *= -1;
244
  //@finishSkipCommitHooks
245
  }
246
 
 
247
  $line->setNo($lineNumber);
248
  $line->setItemCode($this->_getConfigHelper()->getShippingSku($storeId));
249
  $line->setDescription('Shipping costs');
250
  $line->setTaxCode($taxClass);
251
  $line->setQty(1);
252
  $line->setAmount($amount);
253
+ $line->setDiscounted(
254
+ (float)$order->getBaseShippingDiscountAmount()
255
+ && $this->_getTaxDataHelper()->applyTaxAfterDiscount($storeId)
256
+ );
257
 
258
  $this->_lineToItemId[$lineNumber] = 'shipping';
259
  $this->_lines[$lineNumber] = $line;
276
 
277
  $lineNumber = count($this->_lines);
278
  $storeId = $object->getStore()->getId();
279
+
280
  $amount = $object->getGwBasePrice();
281
+
282
+ $line = new Line();
283
+ if ($this->_getTaxDataHelper()->priceIncludesTax($storeId)) {
284
+ $amount += $object->getGwBaseTaxAmount();
285
+ $line->setTaxIncluded(true);
286
+ }
287
+
288
  if ($credit) {
289
  //@startSkipCommitHooks
290
  $amount *= -1;
291
  //@finishSkipCommitHooks
292
  }
293
 
 
294
  $line->setNo($lineNumber);
295
  $line->setItemCode($this->_getConfigHelper()->getGwOrderSku($storeId));
296
  $line->setDescription('Gift Wrap Order Amount');
322
  $storeId = $object->getStore()->getId();
323
 
324
  $amount = $object->getGwItemsBasePrice();
325
+
326
+ $line = new Line();
327
+ if ($this->_getTaxDataHelper()->priceIncludesTax($storeId)) {
328
+ $amount += $object->getGwItemsBaseTaxAmount();
329
+ $line->setTaxIncluded(true);
330
+ }
331
+
332
  if ($credit) {
333
  //@startSkipCommitHooks
334
  $amount *= -1;
335
  //@finishSkipCommitHooks
336
  }
337
 
 
338
  $line->setNo($lineNumber);
339
  $line->setItemCode($this->_getConfigHelper()->getGwItemsSku($storeId));
340
  $line->setDescription('Gift Wrap Items Amount');
366
  $storeId = $object->getStore()->getId();
367
 
368
  $amount = $object->getGwPrintedCardBasePrice();
369
+
370
+ $line = new Line();
371
+ if ($this->_getTaxDataHelper()->priceIncludesTax($storeId)) {
372
+ $amount += $object->getGwCardBaseTaxAmount();
373
+ $line->setTaxIncluded(true);
374
+ }
375
+
376
  if ($credit) {
377
  //@startSkipCommitHooks
378
  $amount *= -1;
379
  //@finishSkipCommitHooks
380
  }
381
 
 
382
  $line->setNo($lineNumber);
383
  $line->setItemCode($this->_getConfigHelper()->getGwPrintedCardSku($storeId));
384
  $line->setDescription('Gift Wrap Printed Card Amount');
456
  return false;
457
  }
458
 
459
+ $line = new Line();
460
  $storeId = $this->_retrieveStoreIdFromItem($item);
461
+ $price = $item->getBaseRowTotal();
462
+
463
+ if ($this->_getTaxDataHelper()->priceIncludesTax($storeId)) {
464
+ $line->setTaxIncluded(true);
465
+ $price = $item->getBaseRowTotalInclTax();
466
+ }
467
+
468
+ if ($this->_getTaxDataHelper()->applyTaxAfterDiscount($storeId)) {
469
+ $price -= $item->getBaseDiscountAmount();
470
+ }
471
+
472
  if ($credit) {
473
  //@startSkipCommitHooks
474
  $price *= -1;
475
  //@finishSkipCommitHooks
476
  }
477
 
 
478
  $line->setNo(count($this->_lines));
479
  $line->setItemCode(
480
  $this->_getCalculationHelper()->getItemCode(
486
  $line->setDescription($item->getName());
487
  $line->setQty($item->getQty());
488
  $line->setAmount($price);
489
+
490
+ $line->setDiscounted(
491
+ (float)$item->getBaseDiscountAmount() && $this->_getTaxDataHelper()->applyTaxAfterDiscount($storeId)
492
+ );
493
 
494
  $productData = $this->_getLineProductData($item, $storeId);
495
  $line->setTaxCode($productData->getTaxCode());
565
 
566
  return $storeId;
567
  }
568
+
569
+ /**
570
+ * Get tax data helper
571
+ *
572
+ * @return Mage_Tax_Helper_Data
573
+ */
574
+ protected function _getTaxDataHelper()
575
+ {
576
+ return Mage::helper('tax');
577
+ }
578
  }
app/code/community/OnePica/AvaTax/Model/Service/Avatax16/Estimate.php CHANGED
@@ -98,6 +98,7 @@ class OnePica_AvaTax_Model_Service_Avatax16_Estimate extends OnePica_AvaTax_Mode
98
  {
99
  /** @var OnePica_AvaTax_Model_Sales_Quote_Address $address */
100
  $this->_lines = array();
 
101
 
102
  $quote = $address->getQuote();
103
  $storeId = $quote->getStore()->getId();
@@ -126,13 +127,7 @@ class OnePica_AvaTax_Model_Service_Avatax16_Estimate extends OnePica_AvaTax_Mode
126
  //@startSkipCommitHooks
127
  $makeRequest &= count($this->_lineToLineId) ? true : false;
128
 
129
- $hasDestinationAddress = false;
130
- if ($this->_request->getHeader() && $this->_request->getHeader()->getDefaultLocations()) {
131
- $locations = $this->_request->getHeader()->getDefaultLocations();
132
- $hasDestinationAddress = isset($locations[self::TAX_LOCATION_PURPOSE_SHIP_TO]) ? true : false;
133
- }
134
-
135
- $makeRequest &= $hasDestinationAddress;
136
  $makeRequest &= $address->getId() ? true : false;
137
  $makeRequest &= !isset($this->_rates[$requestKey]['failure']);
138
  //@finishSkipCommitHooks
@@ -173,6 +168,30 @@ class OnePica_AvaTax_Model_Service_Avatax16_Estimate extends OnePica_AvaTax_Mode
173
  return $rates;
174
  }
175
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
  /**
177
  * Adds all items in the cart to the request
178
  *
@@ -199,17 +218,28 @@ class OnePica_AvaTax_Model_Service_Avatax16_Estimate extends OnePica_AvaTax_Mode
199
  * Makes a Line object from a product item object
200
  *
201
  * @param Varien_Object|Mage_Sales_Model_Quote_Item $item
202
- * @return int|bool
 
203
  */
204
  protected function _newLine($item)
205
  {
 
 
 
 
 
 
206
  $this->_addGwItemsAmount($item);
207
  if ($this->isProductCalculated($item)) {
208
  return false;
209
  }
210
  $product = $this->_getProductByProductId($item->getProductId());
211
  $taxClass = $this->_getTaxClassCodeByProduct($product);
212
- $price = $item->getBaseRowTotal() - $item->getBaseDiscountAmount();
 
 
 
 
213
  $lineNumber = $this->_getNewLineCode();
214
 
215
  $line = $this->_getNewDocumentRequestLineObject();
@@ -220,10 +250,20 @@ class OnePica_AvaTax_Model_Service_Avatax16_Estimate extends OnePica_AvaTax_Mode
220
  $item->getStoreId()
221
  )
222
  );
223
- $line->setNumberOfItems($item->getQty());
224
  $line->setlineAmount($price);
225
  $line->setItemDescription($item->getName());
226
- $line->setDiscounted((float)$item->getDiscountAmount() ? 'true' : 'false');
 
 
 
 
 
 
 
 
 
 
227
 
228
  if ($taxClass) {
229
  $line->setAvalaraGoodsAndServicesType($taxClass);
@@ -243,7 +283,8 @@ class OnePica_AvaTax_Model_Service_Avatax16_Estimate extends OnePica_AvaTax_Mode
243
  }
244
 
245
  $this->_lines[$lineNumber] = $line;
246
- $this->_lineToLineId[$lineNumber] = $item->getSku();
 
247
  return $lineNumber;
248
  }
249
 
@@ -296,10 +337,14 @@ class OnePica_AvaTax_Model_Service_Avatax16_Estimate extends OnePica_AvaTax_Mode
296
  $line->setlineAmount($gwItemsAmount);
297
  $line->setDiscounted('false');
298
 
 
 
 
 
299
  $this->_lines[$lineNumber] = $line;
300
  $this->_setLinesToRequest();
301
  $this->_lineToLineId[$lineNumber] = $this->_getConfigHelper()->getGwItemsSku($storeId);
302
- $this->_productGiftPair[$lineNumber] = $item->getSku();
303
 
304
  return $lineNumber;
305
  }
@@ -317,6 +362,10 @@ class OnePica_AvaTax_Model_Service_Avatax16_Estimate extends OnePica_AvaTax_Mode
317
  $taxClass = Mage::helper('tax')->getShippingTaxClass($storeId);
318
  $shippingAmount = (float) $address->getBaseShippingAmount();
319
 
 
 
 
 
320
  $line = $this->_getNewDocumentRequestLineObject();
321
  $line->setLineCode($lineNumber);
322
  $shippingSku = $this->_getConfigHelper()->getShippingSku($storeId);
@@ -325,7 +374,13 @@ class OnePica_AvaTax_Model_Service_Avatax16_Estimate extends OnePica_AvaTax_Mode
325
  $line->setAvalaraGoodsAndServicesType($taxClass);
326
  $line->setNumberOfItems(1);
327
  $line->setlineAmount($shippingAmount);
328
- $line->setDiscounted('false');
 
 
 
 
 
 
329
 
330
  $this->_lines[$lineNumber] = $line;
331
  $this->_setLinesToRequest();
@@ -359,6 +414,10 @@ class OnePica_AvaTax_Model_Service_Avatax16_Estimate extends OnePica_AvaTax_Mode
359
  $line->setlineAmount($gwOrderAmount);
360
  $line->setDiscounted('false');
361
 
 
 
 
 
362
  $this->_lines[$lineNumber] = $line;
363
  $this->_setLinesToRequest();
364
  $this->_lineToLineId[$lineNumber] = $gwOrderSku;
@@ -391,6 +450,10 @@ class OnePica_AvaTax_Model_Service_Avatax16_Estimate extends OnePica_AvaTax_Mode
391
  $line->setlineAmount($gwPrintedCardAmount);
392
  $line->setDiscounted('false');
393
 
 
 
 
 
394
  $this->_lines[$lineNumber] = $line;
395
  $this->_setLinesToRequest();
396
  $this->_lineToLineId[$lineNumber] = $gwPrintedCardSku;
@@ -673,4 +736,14 @@ class OnePica_AvaTax_Model_Service_Avatax16_Estimate extends OnePica_AvaTax_Mode
673
  {
674
  return $this->_getHelper()->roundUp(($tax / $amount) * 100, 2);
675
  }
 
 
 
 
 
 
 
 
 
 
676
  }
98
  {
99
  /** @var OnePica_AvaTax_Model_Sales_Quote_Address $address */
100
  $this->_lines = array();
101
+ $this->setCanSendRequest(true); //reset flag
102
 
103
  $quote = $address->getQuote();
104
  $storeId = $quote->getStore()->getId();
127
  //@startSkipCommitHooks
128
  $makeRequest &= count($this->_lineToLineId) ? true : false;
129
 
130
+ $makeRequest &= $this->_hasDestinationAddress();
 
 
 
 
 
 
131
  $makeRequest &= $address->getId() ? true : false;
132
  $makeRequest &= !isset($this->_rates[$requestKey]['failure']);
133
  //@finishSkipCommitHooks
168
  return $rates;
169
  }
170
 
171
+ /**
172
+ * Check if destination address have any sense
173
+ *
174
+ * @return bool
175
+ */
176
+ protected function _hasDestinationAddress()
177
+ {
178
+ $hasDestinationAddress = false;
179
+ if ($this->_request->getHeader() && $this->_request->getHeader()->getDefaultLocations()) {
180
+ $locations = $this->_request->getHeader()->getDefaultLocations();
181
+
182
+ if (isset($locations[self::TAX_LOCATION_PURPOSE_SHIP_TO])) {
183
+ $shipToLocation = $locations[self::TAX_LOCATION_PURPOSE_SHIP_TO];
184
+ $address = $shipToLocation->getAddress();
185
+ $city = (string)$address->getCity();
186
+ $zip = $address->getZipcode();
187
+ $state = $address->getState();
188
+ $hasDestinationAddress = (($city && $state) || $zip) ? true : false;
189
+ }
190
+ }
191
+
192
+ return $hasDestinationAddress;
193
+ }
194
+
195
  /**
196
  * Adds all items in the cart to the request
197
  *
218
  * Makes a Line object from a product item object
219
  *
220
  * @param Varien_Object|Mage_Sales_Model_Quote_Item $item
221
+ * @return bool|int
222
+ * @throws \OnePica_AvaTax_Exception
223
  */
224
  protected function _newLine($item)
225
  {
226
+ if (!$item->getId()) {
227
+ $this->setCanSendRequest(false);
228
+
229
+ return false;
230
+ }
231
+
232
  $this->_addGwItemsAmount($item);
233
  if ($this->isProductCalculated($item)) {
234
  return false;
235
  }
236
  $product = $this->_getProductByProductId($item->getProductId());
237
  $taxClass = $this->_getTaxClassCodeByProduct($product);
238
+ $price = $item->getBaseRowTotal();
239
+ if ($this->_getTaxDataHelper()->applyTaxAfterDiscount($item->getStoreId())) {
240
+ $price -= $item->getBaseDiscountAmount();
241
+ }
242
+
243
  $lineNumber = $this->_getNewLineCode();
244
 
245
  $line = $this->_getNewDocumentRequestLineObject();
250
  $item->getStoreId()
251
  )
252
  );
253
+ $line->setNumberOfItems($item->getTotalQty());
254
  $line->setlineAmount($price);
255
  $line->setItemDescription($item->getName());
256
+ $discounted = (float)$item->getDiscountAmount()
257
+ && $this->_getTaxDataHelper()
258
+ ->applyTaxAfterDiscount($item->getStoreId())
259
+ ? 'true'
260
+ : 'false';
261
+
262
+ $line->setDiscounted($discounted);
263
+
264
+ if ($this->_getTaxDataHelper()->priceIncludesTax($item->getStoreId())) {
265
+ $line->setTaxIncluded('true');
266
+ }
267
 
268
  if ($taxClass) {
269
  $line->setAvalaraGoodsAndServicesType($taxClass);
283
  }
284
 
285
  $this->_lines[$lineNumber] = $line;
286
+ $this->_lineToLineId[$lineNumber] = $item->getId();
287
+
288
  return $lineNumber;
289
  }
290
 
337
  $line->setlineAmount($gwItemsAmount);
338
  $line->setDiscounted('false');
339
 
340
+ if ($this->_getTaxDataHelper()->priceIncludesTax($storeId)) {
341
+ $line->setTaxIncluded('true');
342
+ }
343
+
344
  $this->_lines[$lineNumber] = $line;
345
  $this->_setLinesToRequest();
346
  $this->_lineToLineId[$lineNumber] = $this->_getConfigHelper()->getGwItemsSku($storeId);
347
+ $this->_productGiftPair[$lineNumber] = $item->getId();
348
 
349
  return $lineNumber;
350
  }
362
  $taxClass = Mage::helper('tax')->getShippingTaxClass($storeId);
363
  $shippingAmount = (float) $address->getBaseShippingAmount();
364
 
365
+ if ($this->_getTaxDataHelper()->applyTaxAfterDiscount($storeId)) {
366
+ $shippingAmount -= (float)$address->getBaseShippingDiscountAmount();
367
+ }
368
+
369
  $line = $this->_getNewDocumentRequestLineObject();
370
  $line->setLineCode($lineNumber);
371
  $shippingSku = $this->_getConfigHelper()->getShippingSku($storeId);
374
  $line->setAvalaraGoodsAndServicesType($taxClass);
375
  $line->setNumberOfItems(1);
376
  $line->setlineAmount($shippingAmount);
377
+ $discounted = (float)$address->getBaseShippingDiscountAmount()
378
+ && $this->_getTaxDataHelper()->applyTaxAfterDiscount($storeId) ? 'true' : 'false';
379
+ $line->setDiscounted($discounted);
380
+
381
+ if ($this->_getTaxDataHelper()->shippingPriceIncludesTax($storeId)) {
382
+ $line->setTaxIncluded('true');
383
+ }
384
 
385
  $this->_lines[$lineNumber] = $line;
386
  $this->_setLinesToRequest();
414
  $line->setlineAmount($gwOrderAmount);
415
  $line->setDiscounted('false');
416
 
417
+ if ($this->_getTaxDataHelper()->priceIncludesTax($storeId)) {
418
+ $line->setTaxIncluded('true');
419
+ }
420
+
421
  $this->_lines[$lineNumber] = $line;
422
  $this->_setLinesToRequest();
423
  $this->_lineToLineId[$lineNumber] = $gwOrderSku;
450
  $line->setlineAmount($gwPrintedCardAmount);
451
  $line->setDiscounted('false');
452
 
453
+ if ($this->_getTaxDataHelper()->priceIncludesTax($storeId)) {
454
+ $line->setTaxIncluded('true');
455
+ }
456
+
457
  $this->_lines[$lineNumber] = $line;
458
  $this->_setLinesToRequest();
459
  $this->_lineToLineId[$lineNumber] = $gwPrintedCardSku;
736
  {
737
  return $this->_getHelper()->roundUp(($tax / $amount) * 100, 2);
738
  }
739
+
740
+ /**
741
+ * Get tax data helper
742
+ *
743
+ * @return Mage_Tax_Helper_Data
744
+ */
745
+ protected function _getTaxDataHelper()
746
+ {
747
+ return Mage::helper('tax');
748
+ }
749
  }
app/code/community/OnePica/AvaTax/Model/Service/Avatax16/Invoice.php CHANGED
@@ -238,16 +238,28 @@ class OnePica_AvaTax_Model_Service_Avatax16_Invoice extends OnePica_AvaTax_Model
238
  return false;
239
  }
240
 
 
 
241
  $lineNumber = $this->_getNewLineCode();
242
  $storeId = $object->getStore()->getId();
243
  $taxClass = Mage::helper('tax')->getShippingTaxClass($storeId);
244
 
 
245
  $amount = $object->getBaseShippingAmount();
 
 
 
 
 
 
 
 
 
 
246
  //@startSkipCommitHooks
247
  $amount = $credit ? (-1 * $amount) : $amount;
248
  //@finishSkipCommitHooks
249
 
250
- $line = $this->_getNewDocumentRequestLineObject();
251
  $line->setLineCode($lineNumber);
252
  $shippingSku = $this->_getConfigHelper()->getShippingSku($storeId);
253
  $line->setItemCode($shippingSku ? $shippingSku : self::DEFAULT_SHIPPING_ITEMS_SKU);
@@ -255,7 +267,9 @@ class OnePica_AvaTax_Model_Service_Avatax16_Invoice extends OnePica_AvaTax_Model
255
  $line->setAvalaraGoodsAndServicesType($taxClass);
256
  $line->setNumberOfItems(1);
257
  $line->setlineAmount($amount);
258
- $line->setDiscounted('false');
 
 
259
 
260
  $this->_lineToItemId[$lineNumber] = $shippingSku;
261
  $this->_lines[$lineNumber] = $line;
@@ -279,11 +293,17 @@ class OnePica_AvaTax_Model_Service_Avatax16_Invoice extends OnePica_AvaTax_Model
279
  $lineNumber = $this->_getNewLineCode();
280
  $storeId = $object->getStore()->getId();
281
  $amount = $object->getGwBasePrice();
 
 
 
 
 
 
 
282
  //@startSkipCommitHooks
283
  $amount = $credit ? (-1 * $amount) : $amount;
284
  //@finishSkipCommitHooks
285
 
286
- $line = $this->_getNewDocumentRequestLineObject();
287
  $line->setLineCode($lineNumber);
288
  $gwOrderSku = $this->_getConfigHelper()->getGwOrderSku($storeId);
289
  $line->setItemCode($gwOrderSku ? $gwOrderSku : self::DEFAULT_GW_ORDER_SKU);
@@ -316,11 +336,16 @@ class OnePica_AvaTax_Model_Service_Avatax16_Invoice extends OnePica_AvaTax_Model
316
  $storeId = $object->getStore()->getId();
317
 
318
  $amount = $object->getGwItemsBasePrice();
 
 
 
 
 
 
319
  //@startSkipCommitHooks
320
  $amount = $credit ? (-1 * $amount) : $amount;
321
  //@finishSkipCommitHooks
322
 
323
- $line = $this->_getNewDocumentRequestLineObject();
324
  $line->setLineCode($lineNumber);
325
  $gwItemsSku = $this->_getConfigHelper()->getGwItemsSku($storeId);
326
  $line->setItemCode($gwItemsSku ? $gwItemsSku : self::DEFAULT_GW_ITEMS_SKU);
@@ -353,11 +378,17 @@ class OnePica_AvaTax_Model_Service_Avatax16_Invoice extends OnePica_AvaTax_Model
353
  $storeId = $object->getStore()->getId();
354
 
355
  $amount = $object->getGwPrintedCardBasePrice();
 
 
 
 
 
 
 
356
  //@startSkipCommitHooks
357
  $amount = $credit ? (-1 * $amount) : $amount;
358
  //@finishSkipCommitHooks
359
 
360
- $line = $this->_getNewDocumentRequestLineObject();
361
  $line->setLineCode($lineNumber);
362
  $gwPrintedCardSku = $this->_getConfigHelper()->getGwPrintedCardSku($storeId);
363
  $line->setItemCode($gwPrintedCardSku ? $gwPrintedCardSku : self::DEFAULT_GW_PRINTED_CARD_SKU);
@@ -391,20 +422,33 @@ class OnePica_AvaTax_Model_Service_Avatax16_Invoice extends OnePica_AvaTax_Model
391
 
392
  $lineNumber = $this->_getNewLineCode();
393
  $storeId = $this->_retrieveStoreIdFromItem($item);
 
 
 
 
 
 
 
 
 
 
 
 
394
 
395
- $price = $item->getBaseRowTotal() - $item->getBaseDiscountAmount();
396
  //@startSkipCommitHooks
397
  $price = $credit ? (-1 * $price) : $price;
398
  //@finishSkipCommitHooks
399
 
400
- $line = $this->_getNewDocumentRequestLineObject();
401
  $line->setLineCode($lineNumber);
402
  $line->setItemCode($this->_getCalculationHelper()
403
  ->getItemCode($this->_getProductForItemCode($item), $storeId, $item));
404
  $line->setItemDescription($item->getName());
405
  $line->setNumberOfItems($item->getQty());
406
  $line->setlineAmount($price);
407
- $line->setDiscounted($item->getBaseDiscountAmount() ? 'true' : 'false');
 
 
 
408
 
409
  $productData = $this->_getLineProductData($item, $storeId);
410
  $line->setAvalaraGoodsAndServicesType($productData->getTaxCode());
@@ -547,4 +591,14 @@ class OnePica_AvaTax_Model_Service_Avatax16_Invoice extends OnePica_AvaTax_Model
547
 
548
  return $lineProductData;
549
  }
 
 
 
 
 
 
 
 
 
 
550
  }
238
  return false;
239
  }
240
 
241
+ $order = $object->getOrder();
242
+
243
  $lineNumber = $this->_getNewLineCode();
244
  $storeId = $object->getStore()->getId();
245
  $taxClass = Mage::helper('tax')->getShippingTaxClass($storeId);
246
 
247
+ $line = $this->_getNewDocumentRequestLineObject();
248
  $amount = $object->getBaseShippingAmount();
249
+
250
+ if ($this->_getTaxDataHelper()->priceIncludesTax($storeId)) {
251
+ $amount = (float)$object->getBaseShippingInclTax();
252
+ $line->setTaxIncluded('true');
253
+ }
254
+
255
+ if ($this->_getTaxDataHelper()->applyTaxAfterDiscount($storeId)) {
256
+ $amount -= (float)$order->getBaseShippingDiscountAmount();
257
+ }
258
+
259
  //@startSkipCommitHooks
260
  $amount = $credit ? (-1 * $amount) : $amount;
261
  //@finishSkipCommitHooks
262
 
 
263
  $line->setLineCode($lineNumber);
264
  $shippingSku = $this->_getConfigHelper()->getShippingSku($storeId);
265
  $line->setItemCode($shippingSku ? $shippingSku : self::DEFAULT_SHIPPING_ITEMS_SKU);
267
  $line->setAvalaraGoodsAndServicesType($taxClass);
268
  $line->setNumberOfItems(1);
269
  $line->setlineAmount($amount);
270
+ $discounted = (float)$order->getBaseShippingDiscountAmount()
271
+ && $this->_getTaxDataHelper()->applyTaxAfterDiscount($storeId) ? 'true' : 'false';
272
+ $line->setDiscounted($discounted);
273
 
274
  $this->_lineToItemId[$lineNumber] = $shippingSku;
275
  $this->_lines[$lineNumber] = $line;
293
  $lineNumber = $this->_getNewLineCode();
294
  $storeId = $object->getStore()->getId();
295
  $amount = $object->getGwBasePrice();
296
+ $line = $this->_getNewDocumentRequestLineObject();
297
+
298
+ if ($this->_getTaxDataHelper()->priceIncludesTax($storeId)) {
299
+ $amount += $object->getGwBaseTaxAmount();
300
+ $line->setTaxIncluded('true');
301
+ }
302
+
303
  //@startSkipCommitHooks
304
  $amount = $credit ? (-1 * $amount) : $amount;
305
  //@finishSkipCommitHooks
306
 
 
307
  $line->setLineCode($lineNumber);
308
  $gwOrderSku = $this->_getConfigHelper()->getGwOrderSku($storeId);
309
  $line->setItemCode($gwOrderSku ? $gwOrderSku : self::DEFAULT_GW_ORDER_SKU);
336
  $storeId = $object->getStore()->getId();
337
 
338
  $amount = $object->getGwItemsBasePrice();
339
+ $line = $this->_getNewDocumentRequestLineObject();
340
+
341
+ if ($this->_getTaxDataHelper()->priceIncludesTax($storeId)) {
342
+ $amount += $object->getGwItemsBaseTaxAmount();
343
+ $line->setTaxIncluded('true');
344
+ }
345
  //@startSkipCommitHooks
346
  $amount = $credit ? (-1 * $amount) : $amount;
347
  //@finishSkipCommitHooks
348
 
 
349
  $line->setLineCode($lineNumber);
350
  $gwItemsSku = $this->_getConfigHelper()->getGwItemsSku($storeId);
351
  $line->setItemCode($gwItemsSku ? $gwItemsSku : self::DEFAULT_GW_ITEMS_SKU);
378
  $storeId = $object->getStore()->getId();
379
 
380
  $amount = $object->getGwPrintedCardBasePrice();
381
+ $line = $this->_getNewDocumentRequestLineObject();
382
+
383
+ if ($this->_getTaxDataHelper()->priceIncludesTax($storeId)) {
384
+ $amount += $object->getGwCardBaseTaxAmount();
385
+ $line->setTaxIncluded('true');
386
+ }
387
+
388
  //@startSkipCommitHooks
389
  $amount = $credit ? (-1 * $amount) : $amount;
390
  //@finishSkipCommitHooks
391
 
 
392
  $line->setLineCode($lineNumber);
393
  $gwPrintedCardSku = $this->_getConfigHelper()->getGwPrintedCardSku($storeId);
394
  $line->setItemCode($gwPrintedCardSku ? $gwPrintedCardSku : self::DEFAULT_GW_PRINTED_CARD_SKU);
422
 
423
  $lineNumber = $this->_getNewLineCode();
424
  $storeId = $this->_retrieveStoreIdFromItem($item);
425
+ $line = $this->_getNewDocumentRequestLineObject();
426
+
427
+ $price = $item->getBaseRowTotal();
428
+
429
+ if ($this->_getTaxDataHelper()->priceIncludesTax($storeId)) {
430
+ $line->setTaxIncluded('true');
431
+ $price = $item->getBaseRowTotalInclTax();
432
+ }
433
+
434
+ if ($this->_getTaxDataHelper()->applyTaxAfterDiscount($storeId)) {
435
+ $price -= $item->getBaseDiscountAmount();
436
+ }
437
 
 
438
  //@startSkipCommitHooks
439
  $price = $credit ? (-1 * $price) : $price;
440
  //@finishSkipCommitHooks
441
 
 
442
  $line->setLineCode($lineNumber);
443
  $line->setItemCode($this->_getCalculationHelper()
444
  ->getItemCode($this->_getProductForItemCode($item), $storeId, $item));
445
  $line->setItemDescription($item->getName());
446
  $line->setNumberOfItems($item->getQty());
447
  $line->setlineAmount($price);
448
+ $line->setDiscounted(
449
+ $item->getBaseDiscountAmount() && $this->_getTaxDataHelper()->applyTaxAfterDiscount($storeId)
450
+ ? 'true' : 'false'
451
+ );
452
 
453
  $productData = $this->_getLineProductData($item, $storeId);
454
  $line->setAvalaraGoodsAndServicesType($productData->getTaxCode());
591
 
592
  return $lineProductData;
593
  }
594
+
595
+ /**
596
+ * Get tax data helper
597
+ *
598
+ * @return Mage_Tax_Helper_Data
599
+ */
600
+ protected function _getTaxDataHelper()
601
+ {
602
+ return Mage::helper('tax');
603
+ }
604
  }
app/code/community/OnePica/AvaTax/Model/Source/Avatax16/Url.php CHANGED
@@ -24,10 +24,15 @@
24
  */
25
  class OnePica_AvaTax_Model_Source_Avatax16_Url
26
  {
 
 
 
 
 
27
  /**
28
  * Url for development
29
  */
30
- const DEVELOPMENT_URL = 'https://tax-qa.avlr.sh/';
31
 
32
  /**
33
  * Gets the list of urls for the admin config dropdown
@@ -37,6 +42,10 @@ class OnePica_AvaTax_Model_Source_Avatax16_Url
37
  public function toArray()
38
  {
39
  return array(
 
 
 
 
40
  array(
41
  'value' => self::DEVELOPMENT_URL,
42
  'label' => Mage::helper('avatax')->__('Development' . ' (' . self::DEVELOPMENT_URL . ')')
24
  */
25
  class OnePica_AvaTax_Model_Source_Avatax16_Url
26
  {
27
+ /**
28
+ * Url for production
29
+ */
30
+ const PRODUCTION_URL = 'https://tax.api.avalara.com/v2';
31
+
32
  /**
33
  * Url for development
34
  */
35
+ const DEVELOPMENT_URL = 'https://tax-qa.avlr.sh/v2';
36
 
37
  /**
38
  * Gets the list of urls for the admin config dropdown
42
  public function toArray()
43
  {
44
  return array(
45
+ array(
46
+ 'value' => self::PRODUCTION_URL,
47
+ 'label' => Mage::helper('avatax')->__('Production' . ' (' . self::PRODUCTION_URL . ')')
48
+ ),
49
  array(
50
  'value' => self::DEVELOPMENT_URL,
51
  'label' => Mage::helper('avatax')->__('Development' . ' (' . self::DEVELOPMENT_URL . ')')
app/code/community/OnePica/AvaTax/Model/Tax/Calculation.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * OnePica_AvaTax
4
+ * NOTICE OF LICENSE
5
+ * This source file is subject to the Open Software License (OSL 3.0), a
6
+ * copy of which is available through the world-wide-web at this URL:
7
+ * http://opensource.org/licenses/osl-3.0.php
8
+ *
9
+ * @category OnePica
10
+ * @package OnePica_AvaTax
11
+ * @author OnePica Codemaster <codemaster@onepica.com>
12
+ * @copyright Copyright (c) 2016 One Pica, Inc.
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+
16
+ /**
17
+ * Class OnePica_AvaTax_Model_Tax_Calculation
18
+ */
19
+ class OnePica_AvaTax_Model_Tax_Calculation extends Mage_Tax_Model_Calculation
20
+ {
21
+ /**
22
+ * Get calculation tax rate by specific request
23
+ *
24
+ * @param Varien_Object $request
25
+ * @return float
26
+ */
27
+ public function getRate($request)
28
+ {
29
+ if ($this->_getDataHelper()->isServiceEnabled($this->_getStore($request))) {
30
+ return 0;
31
+ }
32
+
33
+ return parent::getRate($request);
34
+ }
35
+
36
+ /**
37
+ * Get avatax data helper
38
+ *
39
+ * @return OnePica_AvaTax_Helper_Data
40
+ */
41
+ protected function _getDataHelper()
42
+ {
43
+ return Mage::helper('avatax');
44
+ }
45
+
46
+ /**
47
+ * Get information about tax rates applied to request
48
+ *
49
+ * @param Varien_Object $request
50
+ * @return array
51
+ */
52
+ public function getAppliedRates($request)
53
+ {
54
+ if ($this->_getDataHelper()->isServiceEnabled($this->_getStore($request))) {
55
+ return array();
56
+ }
57
+
58
+ return parent::getAppliedRates($request);
59
+ }
60
+
61
+ /**
62
+ * Get store
63
+ *
64
+ * @param Varien_Object $request
65
+ * @return \Mage_Core_Model_Store
66
+ */
67
+ protected function _getStore($request)
68
+ {
69
+ $store = Mage::app()->getStore();
70
+ if ($request->getStore() !== null) {
71
+ $store = $request->getStore();
72
+ }
73
+
74
+ return $store;
75
+ }
76
+ }
app/code/community/OnePica/AvaTax/Model/Tax/Config.php CHANGED
@@ -24,6 +24,21 @@
24
  */
25
  class OnePica_AvaTax_Model_Tax_Config extends Mage_Tax_Model_Config
26
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  /**
28
  * Get configuration setting "Apply Discount On Prices Including Tax" value
29
  * Always apply discount first since AvaTax does not support line-level item discount amounts
@@ -41,24 +56,72 @@ class OnePica_AvaTax_Model_Tax_Config extends Mage_Tax_Model_Config
41
  }
42
 
43
  /**
44
- * Check if product prices inputed include tax
45
  *
46
- * @param null|int $store
47
- * @return bool
48
  */
49
- public function priceIncludesTax($store = null)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  {
51
  if ($this->_getDataHelper()->isServiceEnabled($store)) {
52
  return false;
53
  }
54
 
55
- return parent::priceIncludesTax($store);
56
  }
57
 
58
  /**
59
  * Check if shipping prices include tax
60
  *
61
- * @param null|int $store
62
  * @return bool
63
  */
64
  public function shippingPriceIncludesTax($store = null)
@@ -73,7 +136,7 @@ class OnePica_AvaTax_Model_Tax_Config extends Mage_Tax_Model_Config
73
  /**
74
  * Check if display cart prices included tax
75
  *
76
- * @param null|int $store
77
  * @return bool
78
  */
79
  public function displayCartPricesInclTax($store = null)
@@ -88,7 +151,7 @@ class OnePica_AvaTax_Model_Tax_Config extends Mage_Tax_Model_Config
88
  /**
89
  * Check if display cart prices excluded tax
90
  *
91
- * @param null|int $store
92
  * @return bool
93
  */
94
  public function displayCartPricesExclTax($store = null)
@@ -103,7 +166,7 @@ class OnePica_AvaTax_Model_Tax_Config extends Mage_Tax_Model_Config
103
  /**
104
  * Check if display cart prices included and excluded tax
105
  *
106
- * @param null|int $store
107
  * @return bool
108
  */
109
  public function displayCartPricesBoth($store = null)
@@ -340,6 +403,16 @@ class OnePica_AvaTax_Model_Tax_Config extends Mage_Tax_Model_Config
340
  return parent::displaySalesShippingBoth($store);
341
  }
342
 
 
 
 
 
 
 
 
 
 
 
343
  /**
344
  * Get avatax data helper
345
  *
24
  */
25
  class OnePica_AvaTax_Model_Tax_Config extends Mage_Tax_Model_Config
26
  {
27
+ /**
28
+ * Check if product prices inputed include tax
29
+ *
30
+ * @param Mage_Core_Model_Store|int $store
31
+ * @return bool
32
+ */
33
+ public function priceIncludesTax($store = null)
34
+ {
35
+ if ($this->_getDataHelper()->isServiceEnabled($store)) {
36
+ return false;
37
+ }
38
+
39
+ return parent::priceIncludesTax($store);
40
+ }
41
+
42
  /**
43
  * Get configuration setting "Apply Discount On Prices Including Tax" value
44
  * Always apply discount first since AvaTax does not support line-level item discount amounts
56
  }
57
 
58
  /**
59
+ * Check what taxes should be applied after discount
60
  *
61
+ * @param Mage_Core_Model_Store|int $store
62
+ * @return bool
63
  */
64
+ public function applyTaxAfterDiscount($store = null)
65
+ {
66
+ if ($this->_getDataHelper()->isServiceEnabled($store)) {
67
+ return true;
68
+ }
69
+
70
+ return parent::applyTaxAfterDiscount($store);
71
+ }
72
+
73
+ /**
74
+ * Get product price display type
75
+ * 1 - Excluding tax
76
+ * 2 - Including tax
77
+ * 3 - Both
78
+ *
79
+ * @param Mage_Core_Model_Store|int $store
80
+ * @return int
81
+ */
82
+ public function getPriceDisplayType($store = null)
83
+ {
84
+ if ($this->_getDataHelper()->isServiceEnabled($store)) {
85
+ return Mage_Tax_Model_Config::DISPLAY_TYPE_EXCLUDING_TAX;
86
+ }
87
+
88
+ return parent::getPriceDisplayType($store);
89
+ }
90
+
91
+ /**
92
+ * Get shipping methods prices display type
93
+ *
94
+ * @param Mage_Core_Model_Store|int $store
95
+ * @return int
96
+ */
97
+ public function getShippingPriceDisplayType($store = null)
98
+ {
99
+ if ($this->_getDataHelper()->isServiceEnabled($store)) {
100
+ return Mage_Tax_Model_Config::DISPLAY_TYPE_EXCLUDING_TAX;
101
+ }
102
+
103
+ return parent::getShippingPriceDisplayType($store);
104
+ }
105
+
106
+ /**
107
+ * Return the config value for self::CONFIG_XML_PATH_CROSS_BORDER_TRADE_ENABLED
108
+ *
109
+ * @param Mage_Core_Model_Store|int $store
110
+ * @return int
111
+ */
112
+ public function crossBorderTradeEnabled($store = null)
113
  {
114
  if ($this->_getDataHelper()->isServiceEnabled($store)) {
115
  return false;
116
  }
117
 
118
+ return parent::crossBorderTradeEnabled($store);
119
  }
120
 
121
  /**
122
  * Check if shipping prices include tax
123
  *
124
+ * @param Mage_Core_Model_Store|int $store
125
  * @return bool
126
  */
127
  public function shippingPriceIncludesTax($store = null)
136
  /**
137
  * Check if display cart prices included tax
138
  *
139
+ * @param mixed $store
140
  * @return bool
141
  */
142
  public function displayCartPricesInclTax($store = null)
151
  /**
152
  * Check if display cart prices excluded tax
153
  *
154
+ * @param mixed $store
155
  * @return bool
156
  */
157
  public function displayCartPricesExclTax($store = null)
166
  /**
167
  * Check if display cart prices included and excluded tax
168
  *
169
+ * @param mixed $store
170
  * @return bool
171
  */
172
  public function displayCartPricesBoth($store = null)
403
  return parent::displaySalesShippingBoth($store);
404
  }
405
 
406
+ /**
407
+ * Get tax data helper
408
+ *
409
+ * @return Mage_Tax_Helper_Data
410
+ */
411
+ protected function _getTaxDataHelper()
412
+ {
413
+ return Mage::helper('tax');
414
+ }
415
+
416
  /**
417
  * Get avatax data helper
418
  *
app/code/community/OnePica/AvaTax/etc/config.xml CHANGED
@@ -19,7 +19,7 @@
19
  <config>
20
  <modules>
21
  <OnePica_AvaTax>
22
- <version>3.0.0.18</version>
23
  </OnePica_AvaTax>
24
  </modules>
25
  <global>
@@ -56,12 +56,12 @@
56
  <sales>
57
  <rewrite>
58
  <quote_address>OnePica_AvaTax_Model_Sales_Quote_Address</quote_address>
59
- <quote_address_total_grand>OnePica_AvaTax_Model_Sales_Quote_Address_Total_Grand</quote_address_total_grand>
60
  </rewrite>
61
  </sales>
62
  <tax>
63
  <rewrite>
64
  <config>OnePica_AvaTax_Model_Tax_Config</config>
 
65
  </rewrite>
66
  </tax>
67
  <enterprise_giftwrapping>
@@ -135,6 +135,15 @@
135
  </avatax>
136
  </observers>
137
  </sales_order_creditmemo_refund>
 
 
 
 
 
 
 
 
 
138
  <sales_quote_collect_totals_before>
139
  <observers>
140
  <avatax>
19
  <config>
20
  <modules>
21
  <OnePica_AvaTax>
22
+ <version>3.0.1.10</version>
23
  </OnePica_AvaTax>
24
  </modules>
25
  <global>
56
  <sales>
57
  <rewrite>
58
  <quote_address>OnePica_AvaTax_Model_Sales_Quote_Address</quote_address>
 
59
  </rewrite>
60
  </sales>
61
  <tax>
62
  <rewrite>
63
  <config>OnePica_AvaTax_Model_Tax_Config</config>
64
+ <calculation>OnePica_AvaTax_Model_Tax_Calculation</calculation>
65
  </rewrite>
66
  </tax>
67
  <enterprise_giftwrapping>
135
  </avatax>
136
  </observers>
137
  </sales_order_creditmemo_refund>
138
+ <controller_action_layout_generate_xml_before>
139
+ <observers>
140
+ <avatax>
141
+ <type>singleton</type>
142
+ <class>avatax/observer_controllerActionLayoutGenerateXmlBefore</class>
143
+ <method>execute</method>
144
+ </avatax>
145
+ </observers>
146
+ </controller_action_layout_generate_xml_before>
147
  <sales_quote_collect_totals_before>
148
  <observers>
149
  <avatax>
app/code/community/OnePica/AvaTax/etc/system-disabled.xml CHANGED
@@ -31,26 +31,16 @@
31
  </classes>
32
  <calculation>
33
  <fields>
34
- <based_on>
35
- <show_in_default>1</show_in_default>
36
- <show_in_website>1</show_in_website>
37
- <show_in_store>0</show_in_store>
38
- </based_on>
39
  <price_includes_tax>
40
  <show_in_default>1</show_in_default>
41
  <show_in_website>1</show_in_website>
42
  <show_in_store>0</show_in_store>
43
  </price_includes_tax>
44
- <shipping_includes_tax>
45
- <show_in_default>1</show_in_default>
46
- <show_in_website>1</show_in_website>
47
- <show_in_store>0</show_in_store>
48
- </shipping_includes_tax>
49
- <apply_after_discount>
50
  <show_in_default>1</show_in_default>
51
  <show_in_website>1</show_in_website>
52
  <show_in_store>0</show_in_store>
53
- </apply_after_discount>
54
  <discount_tax>
55
  <show_in_default>1</show_in_default>
56
  <show_in_website>1</show_in_website>
@@ -66,6 +56,21 @@
66
  <show_in_website>1</show_in_website>
67
  <show_in_store>0</show_in_store>
68
  </algorithm>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  </fields>
70
  </calculation>
71
  <defaults>
@@ -92,13 +97,8 @@
92
  </shipping>
93
  </fields>
94
  </display>
95
- <sales_display>
96
  <fields>
97
- <full_summary>
98
- <show_in_default>1</show_in_default>
99
- <show_in_website>1</show_in_website>
100
- <show_in_store>1</show_in_store>
101
- </full_summary>
102
  <price>
103
  <show_in_default>1</show_in_default>
104
  <show_in_website>1</show_in_website>
@@ -114,20 +114,15 @@
114
  <show_in_website>1</show_in_website>
115
  <show_in_store>1</show_in_store>
116
  </shipping>
117
- <gift_wrapping>
118
- <show_in_default>1</show_in_default>
119
- <show_in_website>1</show_in_website>
120
- <show_in_store>1</show_in_store>
121
- </gift_wrapping>
122
- <printed_card>
123
  <show_in_default>1</show_in_default>
124
  <show_in_website>1</show_in_website>
125
  <show_in_store>1</show_in_store>
126
- </printed_card>
127
- </fields>
128
- </sales_display>
129
- <cart_display>
130
- <fields>
131
  <price>
132
  <show_in_default>1</show_in_default>
133
  <show_in_website>1</show_in_website>
@@ -143,18 +138,8 @@
143
  <show_in_website>1</show_in_website>
144
  <show_in_store>1</show_in_store>
145
  </shipping>
146
- <gift_wrapping>
147
- <show_in_default>1</show_in_default>
148
- <show_in_website>1</show_in_website>
149
- <show_in_store>1</show_in_store>
150
- </gift_wrapping>
151
- <printed_card>
152
- <show_in_default>1</show_in_default>
153
- <show_in_website>1</show_in_website>
154
- <show_in_store>1</show_in_store>
155
- </printed_card>
156
  </fields>
157
- </cart_display>
158
  </groups>
159
  </tax>
160
  </sections>
31
  </classes>
32
  <calculation>
33
  <fields>
 
 
 
 
 
34
  <price_includes_tax>
35
  <show_in_default>1</show_in_default>
36
  <show_in_website>1</show_in_website>
37
  <show_in_store>0</show_in_store>
38
  </price_includes_tax>
39
+ <based_on>
 
 
 
 
 
40
  <show_in_default>1</show_in_default>
41
  <show_in_website>1</show_in_website>
42
  <show_in_store>0</show_in_store>
43
+ </based_on>
44
  <discount_tax>
45
  <show_in_default>1</show_in_default>
46
  <show_in_website>1</show_in_website>
56
  <show_in_website>1</show_in_website>
57
  <show_in_store>0</show_in_store>
58
  </algorithm>
59
+ <shipping_includes_tax>
60
+ <show_in_default>1</show_in_default>
61
+ <show_in_website>1</show_in_website>
62
+ <show_in_store>0</show_in_store>
63
+ </shipping_includes_tax>
64
+ <cross_border_trade_enabled>
65
+ <show_in_default>1</show_in_default>
66
+ <show_in_website>1</show_in_website>
67
+ <show_in_store>0</show_in_store>
68
+ </cross_border_trade_enabled>
69
+ <apply_after_discount>
70
+ <show_in_default>1</show_in_default>
71
+ <show_in_website>1</show_in_website>
72
+ <show_in_store>0</show_in_store>
73
+ </apply_after_discount>
74
  </fields>
75
  </calculation>
76
  <defaults>
97
  </shipping>
98
  </fields>
99
  </display>
100
+ <cart_display>
101
  <fields>
 
 
 
 
 
102
  <price>
103
  <show_in_default>1</show_in_default>
104
  <show_in_website>1</show_in_website>
114
  <show_in_website>1</show_in_website>
115
  <show_in_store>1</show_in_store>
116
  </shipping>
117
+ </fields>
118
+ </cart_display>
119
+ <sales_display>
120
+ <fields>
121
+ <full_summary>
 
122
  <show_in_default>1</show_in_default>
123
  <show_in_website>1</show_in_website>
124
  <show_in_store>1</show_in_store>
125
+ </full_summary>
 
 
 
 
126
  <price>
127
  <show_in_default>1</show_in_default>
128
  <show_in_website>1</show_in_website>
138
  <show_in_website>1</show_in_website>
139
  <show_in_store>1</show_in_store>
140
  </shipping>
 
 
 
 
 
 
 
 
 
 
141
  </fields>
142
+ </sales_display>
143
  </groups>
144
  </tax>
145
  </sections>
app/code/community/OnePica/AvaTax/etc/system.xml CHANGED
@@ -492,30 +492,17 @@
492
  </classes>
493
  <calculation>
494
  <fields>
495
- <based_on>
496
- <!-- AvaTax always computes tax based on ship from and ship to addresses. -->
497
- <show_in_default>0</show_in_default>
498
- <show_in_website>0</show_in_website>
499
- <show_in_store>0</show_in_store>
500
- </based_on>
501
  <price_includes_tax>
502
- <!-- Items should not include tax so that AvaTax can calculate it. -->
503
  <show_in_default>0</show_in_default>
504
  <show_in_website>0</show_in_website>
505
  <show_in_store>0</show_in_store>
506
  </price_includes_tax>
507
- <shipping_includes_tax>
508
- <!-- Shipping should not include tax so that AvaTax can calculate it. -->
509
- <show_in_default>0</show_in_default>
510
- <show_in_website>0</show_in_website>
511
- <show_in_store>0</show_in_store>
512
- </shipping_includes_tax>
513
- <apply_after_discount>
514
- <!-- Always apply discount first since AvaTax doesn't support line-level item discount amounts -->
515
  <show_in_default>0</show_in_default>
516
  <show_in_website>0</show_in_website>
517
  <show_in_store>0</show_in_store>
518
- </apply_after_discount>
519
  <discount_tax>
520
  <!-- Always apply discount first since AvaTax doesn't support line-level item discount amounts -->
521
  <show_in_default>0</show_in_default>
@@ -534,39 +521,25 @@
534
  <show_in_website>0</show_in_website>
535
  <show_in_store>0</show_in_store>
536
  </algorithm>
537
- </fields>
538
- </calculation>
539
- <defaults>
540
- <fields>
541
- <region translate="comment">
542
- <comment>Set this to "*" (asterisk) to stop unneeded requests to Avalara and to help speed up page loads</comment>
543
- </region>
544
- <postcode translate="comment">
545
- <comment>Set this to "*" (asterisk) to stop unneeded requests to Avalara and to help speed up page loads</comment>
546
- </postcode>
547
- </fields>
548
- </defaults>
549
- <display>
550
- <fields>
551
- <type>
552
  <show_in_default>0</show_in_default>
553
  <show_in_website>0</show_in_website>
554
  <show_in_store>0</show_in_store>
555
- </type>
556
- <shipping>
557
  <show_in_default>0</show_in_default>
558
  <show_in_website>0</show_in_website>
559
  <show_in_store>0</show_in_store>
560
- </shipping>
561
- </fields>
562
- </display>
563
- <sales_display>
564
- <fields>
565
- <full_summary>
566
  <show_in_default>0</show_in_default>
567
  <show_in_website>0</show_in_website>
568
  <show_in_store>0</show_in_store>
569
- </full_summary>
 
 
 
 
570
  <price>
571
  <show_in_default>0</show_in_default>
572
  <show_in_website>0</show_in_website>
@@ -582,19 +555,9 @@
582
  <show_in_website>0</show_in_website>
583
  <show_in_store>0</show_in_store>
584
  </shipping>
585
- <gift_wrapping>
586
- <show_in_default>0</show_in_default>
587
- <show_in_website>0</show_in_website>
588
- <show_in_store>0</show_in_store>
589
- </gift_wrapping>
590
- <printed_card>
591
- <show_in_default>0</show_in_default>
592
- <show_in_website>0</show_in_website>
593
- <show_in_store>0</show_in_store>
594
- </printed_card>
595
  </fields>
596
- </sales_display>
597
- <cart_display>
598
  <fields>
599
  <price>
600
  <show_in_default>0</show_in_default>
@@ -611,18 +574,42 @@
611
  <show_in_website>0</show_in_website>
612
  <show_in_store>0</show_in_store>
613
  </shipping>
614
- <gift_wrapping>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
615
  <show_in_default>0</show_in_default>
616
  <show_in_website>0</show_in_website>
617
  <show_in_store>0</show_in_store>
618
- </gift_wrapping>
619
- <printed_card>
 
 
 
 
620
  <show_in_default>0</show_in_default>
621
  <show_in_website>0</show_in_website>
622
  <show_in_store>0</show_in_store>
623
- </printed_card>
624
  </fields>
625
- </cart_display>
626
  </groups>
627
  </tax>
628
  <shipping>
492
  </classes>
493
  <calculation>
494
  <fields>
 
 
 
 
 
 
495
  <price_includes_tax>
 
496
  <show_in_default>0</show_in_default>
497
  <show_in_website>0</show_in_website>
498
  <show_in_store>0</show_in_store>
499
  </price_includes_tax>
500
+ <based_on>
501
+ <!-- AvaTax always computes tax based on ship from and ship to addresses. -->
 
 
 
 
 
 
502
  <show_in_default>0</show_in_default>
503
  <show_in_website>0</show_in_website>
504
  <show_in_store>0</show_in_store>
505
+ </based_on>
506
  <discount_tax>
507
  <!-- Always apply discount first since AvaTax doesn't support line-level item discount amounts -->
508
  <show_in_default>0</show_in_default>
521
  <show_in_website>0</show_in_website>
522
  <show_in_store>0</show_in_store>
523
  </algorithm>
524
+ <cross_border_trade_enabled>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
525
  <show_in_default>0</show_in_default>
526
  <show_in_website>0</show_in_website>
527
  <show_in_store>0</show_in_store>
528
+ </cross_border_trade_enabled>
529
+ <shipping_includes_tax>
530
  <show_in_default>0</show_in_default>
531
  <show_in_website>0</show_in_website>
532
  <show_in_store>0</show_in_store>
533
+ </shipping_includes_tax>
534
+ <apply_after_discount>
 
 
 
 
535
  <show_in_default>0</show_in_default>
536
  <show_in_website>0</show_in_website>
537
  <show_in_store>0</show_in_store>
538
+ </apply_after_discount>
539
+ </fields>
540
+ </calculation>
541
+ <cart_display>
542
+ <fields>
543
  <price>
544
  <show_in_default>0</show_in_default>
545
  <show_in_website>0</show_in_website>
555
  <show_in_website>0</show_in_website>
556
  <show_in_store>0</show_in_store>
557
  </shipping>
 
 
 
 
 
 
 
 
 
 
558
  </fields>
559
+ </cart_display>
560
+ <sales_display>
561
  <fields>
562
  <price>
563
  <show_in_default>0</show_in_default>
574
  <show_in_website>0</show_in_website>
575
  <show_in_store>0</show_in_store>
576
  </shipping>
577
+ </fields>
578
+ </sales_display>
579
+
580
+ <defaults>
581
+ <fields>
582
+ <region translate="comment">
583
+ <comment>Set this to "*" (asterisk) to stop unneeded requests to Avalara and to help speed up page loads</comment>
584
+ </region>
585
+ <postcode translate="comment">
586
+ <comment>Set this to "*" (asterisk) to stop unneeded requests to Avalara and to help speed up page loads</comment>
587
+ </postcode>
588
+ </fields>
589
+ </defaults>
590
+ <display>
591
+ <fields>
592
+ <type>
593
+ <show_in_default>0</show_in_default>
594
+ <show_in_website>0</show_in_website>
595
+ <show_in_store>0</show_in_store>
596
+ </type>
597
+ <shipping>
598
  <show_in_default>0</show_in_default>
599
  <show_in_website>0</show_in_website>
600
  <show_in_store>0</show_in_store>
601
+ </shipping>
602
+ </fields>
603
+ </display>
604
+ <sales_display>
605
+ <fields>
606
+ <full_summary>
607
  <show_in_default>0</show_in_default>
608
  <show_in_website>0</show_in_website>
609
  <show_in_store>0</show_in_store>
610
+ </full_summary>
611
  </fields>
612
+ </sales_display>
613
  </groups>
614
  </tax>
615
  <shipping>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>OnePica_AvaTax</name>
4
- <version>3.0.0</version>
5
  <stability>stable</stability>
6
  <license>Open Software License (OSL 3.0)</license>
7
  <channel>community</channel>
@@ -18,19 +18,11 @@ Released as a commercial extension, this software will not work unless you have
18
  &#xD;
19
  &#xD;
20
  At One Pica (www.onepica.com), we strive to build increasingly scalable and flexible enterprise systems for all of our clients, large and small. We want to give back to this community both to promote its success and as a sign of our gratitude. Please feel free to contact us on ways we can improve this extension or extend on this framework.</description>
21
- <notes>Improved performance&#xD;
22
- Reduced number of GetTax calls&#xD;
23
- Fixed error displaying&#xD;
24
- Fixed logs export&#xD;
25
- Fixed Customer Tax Code sending for not logged in customer group&#xD;
26
- Fixed tax calculation if change customer group while place order via admin&#xD;
27
- Fixed request settings for Multiple Checkout&#xD;
28
- Fixed buttons "View Shopping Cart" and "Checkout" displaying in the MiniCart if user enters non taxable address during Multiple Checkout&#xD;
29
- Fixed tax rates in checkout when shipping address changing four times</notes>
30
  <authors><author><name>Rostyslav Redko</name><user>marketing</user><email>avalara@onepica.com</email></author></authors>
31
- <date>2016-02-11</date>
32
- <time>09:49:07</time>
33
- <contents><target name="magecommunity"><dir name="OnePica"><dir name="AvaTax"><dir name="Block"><dir name="Adminhtml"><dir name="Export"><dir name="Abstract"><file name="Grid.php" hash="5f96ca490c5f7bd3fac23e30b00336e5"/></dir><dir name="Log"><file name="Grid.php" hash="311c55d8bc770e6d6aa6f377c2eee6fd"/><file name="View.php" hash="097d82a3e2b1a8820d335a63f212451b"/></dir><dir name="Queue"><file name="Grid.php" hash="1ef8ba9bf3e0870ea6dc50bb202a0b91"/></dir></dir><dir name="Notification"><file name="Toolbar.php" hash="26f7e382432289c3ff07647141cf9324"/></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Export.php" hash="3e019b9551b95c71f4cfd67a14d62a27"/></dir></dir></dir></dir><dir name="Tax"><dir name="Class"><dir name="Edit"><file name="Form.php" hash="0e78c592366ee2746f3891cf91a388d3"/></dir><file name="Grid.php" hash="d731eb160457b8a22cfcd28682a1c485"/></dir></dir></dir><dir name="Checkout"><dir name="Onepage"><dir name="Shipping"><dir name="Method"><file name="Available.php" hash="a0bdc5f63955148cf7e755c8803e01de"/></dir></dir></dir></dir></dir><file name="Exception.php" hash="fc752f8da808a402baae2425c4072d22"/><dir name="Helper"><file name="Address.php" hash="df731a75957cf712d0b1410b1d831dd6"/><file name="Calculation.php" hash="3a3bcbd4a33a061700c495a14afd8b3a"/><file name="Config.php" hash="b7a48f682638fca9b53e2db1460e45f4"/><file name="Data.php" hash="111f31427c4cc0d77830643b7271b08c"/><file name="Errors.php" hash="1fc34a932db296ecd1617a4e50e150d7"/><dir name="GiftWrapping"><file name="Data.php" hash="4428b400b540be990dc1bab2d345cb4c"/></dir><file name="Lib.php" hash="ce05e31b4aba7ba84bfc016df8c2a559"/><dir name="Tax"><file name="Data.php" hash="eb76f852d84cf8f498cd0d4b236136db"/></dir></dir><dir name="Model"><dir name="Action"><file name="Abstract.php" hash="de2bc126be0cfe69ffe6af60a8307d16"/><file name="Calculator.php" hash="91bea26e2779235309c881cd1ff08a96"/><file name="Creditmemo.php" hash="23639271a8fad749a3ee3a13fc8b0b27"/><file name="Invoice.php" hash="20458660bda4a277c0677b1406feb481"/><file name="Ping.php" hash="7e08308fff72493e0cb75b9244551de6"/><file name="Validator.php" hash="595d79c22f3027b89498b5c004b8be2b"/></dir><dir name="Admin"><file name="Session.php" hash="e3dc3353c7eebf4e17c22ea4039585c5"/></dir><dir name="Adminhtml"><file name="Config.php" hash="388f532f03fa8dacc9fde122a2fe0c64"/><dir name="Sales"><dir name="Order"><file name="Create.php" hash="2a1b42b629b8da1373e11860c4a2c8c0"/></dir></dir></dir><dir name="Export"><dir name="Adapter"><file name="Abstract.php" hash="840c8b87acd97646572bba9bb3b8f5ea"/><file name="Sql.php" hash="0e9bedb400f411785311f78ebbf676da"/></dir><dir name="Entity"><file name="Abstract.php" hash="d38a2293452c31e92f81bf5be59c3e1c"/><file name="Log.php" hash="a1dd28eee3e72d1a4ef7bddd865ddbae"/><file name="Queue.php" hash="14a97c283aa74f97982ab71160017aa3"/></dir></dir><file name="Export.php" hash="b94613b678b413d6268b07d314ba122e"/><dir name="Observer"><file name="Abstract.php" hash="4cef8e34c047b97e34ab08b0c937082c"/><file name="AdminSystemConfigChangedSectionTax.php" hash="e0e703abb46b48185dc6dda2944b89cc"/><file name="CheckoutSubmitAllAfter.php" hash="4ee09c54a9098b568dac726964d782c0"/><file name="CheckoutTypeMultishippingCreateOrdersSingle.php" hash="eeaffffddd4e2ce387325dfb58381a77"/><file name="CleanLog.php" hash="4043bb0a3df982b756bfb1dfab5d56de"/><file name="ControllerActionPostdispatchCheckoutCartEstimatePost.php" hash="5b2facd906e8fb33a49f23c7f3fe36b7"/><file name="ControllerActionPostdispatchCheckoutCartEstimateUpdatePost.php" hash="4006ae1c1074915312301260ed88925c"/><file name="ControllerActionPostdispatchCheckoutOnepageSaveShippingMethod.php" hash="0b600e585f4b008e457995676019c2b4"/><file name="ControllerActionPredispatchAdminhtmlSalesOrderCreateLoadBlock.php" hash="07ef318adffde6bba762da8300e17324"/><file name="ControllerActionPredispatchCheckoutCartEstimatePost.php" hash="2b2cce8f619488fd795a027b80d20d2a"/><file name="ControllerActionPredispatchCheckoutCartIndex.php" hash="ec46c279439967df90395882a5804de1"/><file name="ControllerActionPredispatchCheckoutMultishippingIndex.php" hash="d6d7a1d0272c51f3ec4cacbce8574da3"/><file name="ControllerActionPredispatchCheckoutOnepageIndex.php" hash="01c4280273e34a2f82ed6764792f3568"/><file name="LoadAvaTaxExternalLib.php" hash="0b10ed2f15ef8202362f4828fad15262"/><file name="MultishippingSetShippingItems.php" hash="e4a1f3c4e1506797692a7b7d2dc23217"/><file name="ProcessQueue.php" hash="35375793d039f6848e7b2af05e0eef41"/><file name="SalesModelServiceQuoteSubmitAfter.php" hash="6499cfe8e1c9176b12af58c0bce331eb"/><file name="SalesModelServiceQuoteSubmitBefore.php" hash="4e67278a1c20a969f8709237f817b6e0"/><file name="SalesOrderCreditmemoRefund.php" hash="3e9049e39b53ec06b8aa1ab274d1e00d"/><file name="SalesOrderCreditmemoSaveAfter.php" hash="a01af2f4a66912383b772be42fddbdea"/><file name="SalesOrderInvoicePay.php" hash="ac7884c312f986d123912f01346b031a"/><file name="SalesOrderInvoiceSaveAfter.php" hash="00279b77e0a3bbac120b9248d6f9223d"/><file name="SalesQuoteCollectTotalsBefore.php" hash="c0ae978e4895cec8a1b4c1ec2a3a5522"/></dir><dir name="Records"><file name="Log.php" hash="32926db85023ad21ea6179bf4ad77ef4"/><dir name="Mysql4"><dir name="Log"><file name="Collection.php" hash="29db8163f4dda862ff822ddffd04554d"/></dir><file name="Log.php" hash="d6fb7997768b7e0f1b39363fd4de5917"/><dir name="Queue"><file name="Collection.php" hash="11bba1561c81f39695f091b94bd81560"/></dir><file name="Queue.php" hash="12ba62949dab080c6dc6ae7fcbbf4838"/></dir><dir name="Queue"><file name="Process.php" hash="82d837f47b78b4a037938dd88dfe3217"/></dir><file name="Queue.php" hash="2906b0c99e686f2e85169cbd49c8af2e"/></dir><dir name="Sales"><dir name="Quote"><dir name="Address"><dir name="Total"><file name="Grand.php" hash="7c2e06c4582f37cfa21d453fb9dfa5ea"/><file name="Tax.php" hash="3d9fa316f2eb70c30e83e2ba2763c054"/></dir></dir><file name="Address.php" hash="7a9717d123bba20ce14144b80d1da5da"/></dir></dir><dir name="Service"><dir name="Abstract"><file name="Config.php" hash="2b5ebe4312f82b0c13b03db2c261964f"/><file name="Tools.php" hash="8268ab2a43b4767c7d18a18ee420ae5f"/></dir><file name="Abstract.php" hash="29cee53a912adeb0f682bc931972823d"/><dir name="Avatax"><file name="Abstract.php" hash="629fc49a518505a87f1548c3b29ef666"/><file name="Address.php" hash="5f6d2257e4132a436dff7cc0cc08eb67"/><file name="Config.php" hash="25198070b781c8ce632b4f3d3c3b21e0"/><file name="Estimate.php" hash="6af94ed789360a60fd5eafb8f75ec06b"/><file name="Invoice.php" hash="4f2c0dbb67b8b5e58fecdcb02d0b7360"/><file name="Ping.php" hash="8dd09babe7e8b206564544b2ace9a661"/><file name="Tax.php" hash="3002e239f7f5a84f3377d288861cf4d2"/></dir><file name="Avatax.php" hash="b6fa49f95a3ab05546bd597689a14ed7"/><dir name="Avatax16"><file name="Abstract.php" hash="9b061b6d7bebc7539efa4a33789c23e2"/><file name="Address.php" hash="834681944f93504537e26217f9690cd5"/><file name="Config.php" hash="34c888b2db0c2c72bfea6ddad0dbf053"/><file name="Estimate.php" hash="e99cbc11369f3dfc40bc0a0747cce2ca"/><file name="Invoice.php" hash="97ef4ebf3df4f6ab854c6224fa22d20b"/><file name="Ping.php" hash="853a6c8078296263adc241befc5eaa92"/><file name="Tax.php" hash="0680fb53318af5eac219909162657037"/></dir><file name="Avatax16.php" hash="cd3743c413edb08904781900c0064eaf"/><dir name="Exception"><file name="Address.php" hash="2519f1a2b302db97337c933d99a6d116"/><file name="Commitfailure.php" hash="7f0c5a5bf9242651d2542336d0b4cb96"/><file name="Unbalanced.php" hash="43595e010b314e8a91dd0fef4fad96c2"/></dir><dir name="Result"><file name="Address.php" hash="7a711e27f7f5e478a8a290a1880586f6"/><file name="AddressValidate.php" hash="62d14d7f4147b83001ef7f64726276c1"/><file name="Creditmemo.php" hash="8b1ac1eda1a522c70bca574b938c6359"/><file name="Invoice.php" hash="83f157b7fd24e5e6c0b51f6a162ee316"/></dir></dir><file name="Service.php" hash="7fda34c9ce1db70ae9757561d505a5b7"/><file name="Session.php" hash="429142089e75418a702e70edc56374cf"/><dir name="Source"><file name="Actions.php" hash="b5392f0820f15c3159e76ea67148992a"/><file name="Addressvalidation.php" hash="9f2315018910f7336ad894156d49d9b9"/><dir name="Avatax"><file name="Actions.php" hash="c72aa0df9013c6d5c5fddc0c4b4027b0"/><file name="Logtype.php" hash="6fde0a0dda9a7884bb13484ffa244409"/><file name="Url.php" hash="cff45c6a590360711867112533b068d8"/></dir><dir name="Avatax16"><file name="Actions.php" hash="86b7d4067faad9478f9b61101d0fd6ae"/><file name="Buyertype.php" hash="6b029a7bbacc0eda36ed4fbb6f6e467b"/><file name="Logtype.php" hash="09ddc0a3106e206e90ed45d8a2539d78"/><file name="Url.php" hash="02ae82a6eae3916f613b0db458b0756a"/><file name="Usetype.php" hash="107c03d384fb6a8b990e4c16f49fab87"/></dir><file name="Customercodeformat.php" hash="cfcfcbaa27ed29add072324816da0c9d"/><file name="Error.php" hash="7f5495a2f295ded2d0a30f2f7108d009"/><file name="Fieldlist.php" hash="18987603d4d58130959a8ac76716ed08"/><file name="Logmode.php" hash="24d61da578a3b4adb896fea7d4d4d8ec"/><file name="Logtype.php" hash="25dce563940ac9763e642e3e96365043"/><file name="Onerrorfrontend.php" hash="ef4154ae563d8157c1083f20e0adf563"/><dir name="Regionfilter"><file name="List.php" hash="d73ebe7197a2c6cfa45d52775d6f0977"/><file name="Mode.php" hash="2216d28bf9adba614025538cc62a49b6"/></dir><file name="Url.php" hash="794ec57a2b350931f70e95eb6677c253"/></dir><dir name="Tax"><file name="Config.php" hash="c3d5778516662f5090aebf25519c2547"/></dir><dir name="Total"><dir name="Quote"><dir name="Tax"><file name="Giftwrapping.php" hash="7b264455ac9084a751468ef6dbc36fe5"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="AvaTax"><file name="ExportController.php" hash="ead5ebea03db8f885d0ec6114dcb185c"/><file name="GridController.php" hash="5c7e822890a6feaec2db348e6c5a19e1"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="aca07ae89478c72fd1d2d41228c28b8e"/><file name="config.xml" hash="0d5f326d815701c9925a15001a0cd596"/><file name="system-avatax16-disabled.xml" hash="b24027def3daab9000047bf7fee41c4f"/><file name="system-avatax16.xml" hash="b5a9543409521633ceec2af4d9c5d1b7"/><file name="system-disabled.xml" hash="1ef23998fa4452c8c4fc68d05b9a2f89"/><file name="system.xml" hash="98797f0be09a53b9c0c7bebdb14bbc4e"/></dir><dir name="sql"><dir name="avatax_records_setup"><file name="mysql4-data-upgrade-2.2.0-2.2.1.php" hash="260d1c57754ebadba00d8ccdbb0ec996"/><file name="mysql4-install-0.1.0.php" hash="3d16899179b36bfde69609a99a2faae6"/><file name="mysql4-upgrade-0.1.4-0.1.5.php" hash="94d0cf2fc0e9bbe2de2829198ce3026f"/><file name="mysql4-upgrade-1.0.1-2.0.0.php" hash="905d7519328cdb1c46bba4221288c41c"/><file name="mysql4-upgrade-2.5.0.0-2.5.0.1.php" hash="4b439957397049bbe01d458fd7cfe0a2"/><file name="mysql4-upgrade-3.0.0.1-3.0.0.2.php" hash="46caa743f17221575b4a639b262a9275"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="OnePica_AvaTax.xml" hash="07fd9423811b4dc084060d6131b889d7"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="onepica"><file name="avatax.xml" hash="de338ca651fcce096d089b2bbbcc1374"/></dir></dir><dir name="template"><dir name="onepica"><dir name="avatax"><dir name="log"><file name="view.phtml" hash="df14eee805bbedd484cf500dbf2335ed"/></dir><dir name="notification"><file name="toolbar.phtml" hash="fd368e043843df76ec3a74290b87dc3e"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="onepica"><file name="avatax.xml" hash="38c6ce2165f6ccfd6641eb1487faad39"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="de_DE"><file name="OnePica_AvaTax.csv" hash="43d2dee74aee6f15abd471a65b4f407c"/></dir><dir name="en_US"><file name="OnePica_AvaTax.csv" hash="43d2dee74aee6f15abd471a65b4f407c"/></dir><dir name="es_ES"><file name="OnePica_AvaTax.csv" hash="43d2dee74aee6f15abd471a65b4f407c"/></dir><dir name="fr_FR"><file name="OnePica_AvaTax.csv" hash="43d2dee74aee6f15abd471a65b4f407c"/></dir><dir name="nl_NL"><file name="OnePica_AvaTax.csv" hash="43d2dee74aee6f15abd471a65b4f407c"/></dir><dir name="pt_BR"><file name="OnePica_AvaTax.csv" hash="43d2dee74aee6f15abd471a65b4f407c"/></dir><dir name="zh_CN"><file name="OnePica_AvaTax.csv" hash="43d2dee74aee6f15abd471a65b4f407c"/></dir></target><target name="magelib"><dir name="AvaTax"><file name="AvaTax.php" hash="46bf3fb7795482b7494b2fdc266af3bc"/><dir name="classes"><file name="ATConfig.class.php" hash="dd1c39643f677e0c3b612c549686812c"/><file name="ATObject.class.php" hash="83359fd7639c98449836dc11d08c899d"/><file name="Address.class.php" hash="68bf4fe1306a60e672b7345a0dc7fcc6"/><file name="AddressServiceSoap.class.php" hash="c59bf4a586da207611f7bace4f08c880"/><file name="AddressType.class.php" hash="62c9ff3c533aaf5ad1fd4de95702be40"/><file name="AdjustTaxRequest.class.php" hash="47dbfa8044ca893bf214d8e71ab4864e"/><file name="AdjustTaxResult.class.php" hash="cf63aa5b7c3b52b3ec86695c4cdf0fcc"/><file name="ApplyPaymentRequest.class.php" hash="69d69dff63cbd284d8aea62247142692"/><file name="ApplyPaymentResult.class.php" hash="0e37bda0f1221c2ed2432717a2d8cc08"/><dir name="AvaCert2Svc"><file name="AvaCert2Soap.class.php" hash="0567793d9e4e496b45c3e8a0459f944a"/><file name="Certificate.class.php" hash="dd3f0dd2a2b03c97552f9dbd5c6463ba"/><file name="CertificateGetRequest.class.php" hash="4c11fd111cab99fa4dbc2c2250e0f3ad"/><file name="CertificateGetResult.class.php" hash="6a95a06e71bd13839c6142bba08bfba5"/><file name="CertificateImageGetRequest.class.php" hash="32f61011abe3d1c74ea7fc209e3e4224"/><file name="CertificateImageGetResult.class.php" hash="beda0f1fd54951b84b7dd77ead92bda3"/><file name="CertificateJurisdiction.class.php" hash="e666d572fb34d17fcd91127a50616195"/><file name="CertificateRequest.class.php" hash="7b76dc3675e507975ae6cf01abfa6059"/><file name="CertificateRequestGetRequest.class.php" hash="0cf2fafae88f795a754d75291947cb56"/><file name="CertificateRequestGetResult.class.php" hash="eceffe3acec787506649669b1b5edcf7"/><file name="CertificateRequestInitiateRequest.class.php" hash="148a5c4c881c885be863f403582b4974"/><file name="CertificateRequestInitiateResult.class.php" hash="a7a55cb398cd2fb9f0e11b8c6b09498d"/><file name="CertificateRequestStage.class.php" hash="92dec7da28f83f1a419d9573e6cec1fa"/><file name="CertificateRequestStatus.class.php" hash="a5d5c1629ce4f5ee0c18a8924204ca22"/><file name="CertificateStatus.class.php" hash="6ae43ab57ae9df37d07ac4203270c25e"/><file name="CertificateUsage.class.php" hash="bad34570daa7679b267f1288bf0a371f"/><file name="CommunicationMode.class.php" hash="71d2743c1d2afffe11d2903e89ff9c0e"/><file name="Customer.class.php" hash="e9f13f38f75cb4e1b845c55e6f26a5ab"/><file name="CustomerSaveRequest.class.php" hash="58ff71b04bb3a308b7f0199c6fae1e56"/><file name="CustomerSaveResult.class.php" hash="98cf79bdb7c0558963670b21e66b7d85"/><file name="FormatType.class.php" hash="714d183d3d365a07ef606d1211c732b0"/><file name="RequestType.class.php" hash="6144c2731baaf67400ea34e50440c1df"/><file name="ReviewStatus.class.php" hash="0dd208ecbf6b45196f51f304b1d48b03"/></dir><file name="AvalaraSoapClient.class.php" hash="dd605cefabb4396ef1b46b6d23b439b5"/><file name="BaseResult.class.php" hash="85d2c23ecc62bf4b828d04f405f83d37"/><dir name="BatchSvc"><file name="AuditMessage.class.php" hash="798d8169506357af02e6912b4bca9148"/><file name="AvaTaxBatchSvc.php" hash="8d65fd4a02cd4fc1104aa9c24b35e4fb"/><file name="BaseResult.class.php" hash="727ef623b821e95a73cf6d1eda891379"/><file name="Batch.class.php" hash="c028822bcf2a4f1fae6fc7dca76f247a"/><file name="BatchDelete.class.php" hash="0bcff09309ccad969d65c2d27fa63dda"/><file name="BatchDeleteResponse.class.php" hash="46afd464673459efb54ccaf509d37eef"/><file name="BatchFetch.class.php" hash="74f96ecc3c2df87271d60c4c969e43f8"/><file name="BatchFetchResponse.class.php" hash="b2acf63deea2c0fd374f80745b60fef5"/><file name="BatchFetchResult.class.php" hash="83d8de067f4bd59acafe4cd065f90163"/><file name="BatchFile.class.php" hash="65cee20383c8040fac1d4c45bbe757dd"/><file name="BatchFileDelete.class.php" hash="01d0bc10cb0ada43a9a00ca0efffef17"/><file name="BatchFileDeleteResponse.class.php" hash="b4e7881d26b7071303650973144f418b"/><file name="BatchFileFetch.class.php" hash="c5e91b8073fb756545d0f74803fdf3d6"/><file name="BatchFileFetchResponse.class.php" hash="c37ce819a975cdae5e7a82432b4b2334"/><file name="BatchFileFetchResult.class.php" hash="6bc54523d34356a83cdc4ecd2f696ea5"/><file name="BatchFileSave.class.php" hash="8434b0ffdd1fba4991535248ee3d618e"/><file name="BatchFileSaveResponse.class.php" hash="d52f79b42467b59f2177359f8a73cd3a"/><file name="BatchFileSaveResult.class.php" hash="19d3a2f20ccc42e80759b280842cf03c"/><file name="BatchProcess.class.php" hash="44d9efe13d01fce15bd444e5729b320c"/><file name="BatchProcessRequest.class.php" hash="04684b987c6d77319cc6881941091de9"/><file name="BatchProcessResponse.class.php" hash="c22b08c125eefc4006495c55984ed91e"/><file name="BatchProcessResult.class.php" hash="f9cac2270aafae49fc0892ea729c3713"/><file name="BatchSave.class.php" hash="d3a397348b905d49a0c91be780f3ec04"/><file name="BatchSaveResponse.class.php" hash="4c3088b85590fd697b5686aa1dddd89e"/><file name="BatchSaveResult.class.php" hash="7ea7fe3dc7d580711f6b52d991c43dce"/><file name="BatchSvc.class.php" hash="fa903f70b06d1e3b86384f2b6fb60616"/><file name="DeleteRequest.class.php" hash="43f945ef1e59ef02494df6df6ec3d1b6"/><file name="DeleteResult.class.php" hash="f7d64582f1182ae0337d6d84a5f60e8d"/><file name="FetchRequest.class.php" hash="7271317a8909672261ea0e00867e810b"/><file name="FilterRequest.class.php" hash="3c1eaec68f84531931a3cd6143533576"/><file name="FilterResult.class.php" hash="f4c0eeac0153b735ec589fcff7accd86"/><file name="IsAuthorized.class.php" hash="8339a2b249d954efaaf64f10665976fc"/><file name="IsAuthorizedResponse.class.php" hash="613c91f36370dc38ca07b83a29f2a45f"/><file name="IsAuthorizedResult.class.php" hash="65f9665508a5e7f33e4aee2835a9806e"/><file name="Message.class.php" hash="576327c8d9cd74bd96d9ccd62a2daa5b"/><file name="Ping.class.php" hash="3a2246f5557a5279fa260c65b36a9b44"/><file name="PingResponse.class.php" hash="b9f5e8b43382ee605d93768db8af1805"/><file name="PingResult.class.php" hash="2e05acfe74aad28003ad7d8ed102c3c6"/><file name="Profile.class.php" hash="a16a4819018dd8510ddab8feb9ee0f7e"/><file name="SeverityLevel.class.php" hash="5736530f3b5fd0cd932c783418563647"/></dir><file name="BoundaryLevel.class.php" hash="e9c2f2e3173e44fa8351f2a6dbb578fe"/><file name="CancelCode.class.php" hash="fd0b8ad2865e8fcf622b1faafc677527"/><file name="CancelTaxRequest.class.php" hash="08a114e32ec9eda9268ec337f79cb86f"/><file name="CancelTaxResult.class.php" hash="687be65bab85e6c6e8f99764c0475d9b"/><file name="CommitTaxRequest.class.php" hash="66ef55bc094d233b75e36b029995aed7"/><file name="CommitTaxResult.class.php" hash="ef90276817207e63e4e96ea518618f50"/><file name="DetailLevel.class.php" hash="2439f7137a4f9f52e28a6b321c4bcf16"/><file name="DocStatus.class.php" hash="9e3384a0f2ace05fa67fe05eba295fcd"/><file name="DocumentType.class.php" hash="94b4509b914d638a94f946b5518b8993"/><file name="DynamicSoapClient.class.php" hash="5bb36f2d4db3955ae059488eb9511ca9"/><file name="Enum.class.php" hash="d3ff4c898aff49f3c425042433826257"/><file name="GetTaxHistoryRequest.class.php" hash="3ed4c54de1e015f476ce7aa58c802468"/><file name="GetTaxHistoryResult.class.php" hash="7e8209e1f64df52b538927312b1bd934"/><file name="GetTaxRequest.class.php" hash="a3343ef6a1e27e48c9a75aa9e02777c4"/><file name="GetTaxResult.class.php" hash="7e2b7415a018fd76b62ab49637833533"/><file name="IsAuthorizedResult.class.php" hash="58164457677a61e93309f788fe61dc0c"/><file name="JurisdictionType.class.php" hash="a345fe5db379af87a6f7ec833ff86586"/><file name="Line.class.php" hash="7fefbd0230ee2fe8a8e6468abf338b80"/><file name="Message.class.php" hash="073be6cbcccacf2d1d55a04c045eab63"/><file name="PingResult.class.php" hash="18f88589588f08b619488c926cf5547c"/><file name="PostTaxRequest.class.php" hash="be8ea4ee2fddb10b62cb1be7e38179e3"/><file name="PostTaxResult.class.php" hash="bf2ee0b1293301ee00ac9b8b8390e780"/><file name="ReconcileTaxHistoryRequest.class.php" hash="41f2cfe04495612a9c293b1bc19220ce"/><file name="ReconcileTaxHistoryResult.class.php" hash="dd20684e0e017f56c98e29297180a0d7"/><file name="SearchTaxHistoryResult.class.php" hash="e3171e00482f7c2c0ed9753ffd05cd14"/><file name="ServiceMode.class.php" hash="0c66b3e25f4466461cebf32735e207e0"/><file name="SeverityLevel.class.php" hash="68fc81e651fe7f01c81b43b0d28ff0dc"/><file name="TaxDetail.class.php" hash="56065f8ea68505152b23e41238b80dfb"/><file name="TaxLine.class.php" hash="05376f01ad9a14f438ad0f1d5d423b61"/><file name="TaxOverride.class.php" hash="94d28efa3cdf58a87ba45a313ce93fc7"/><file name="TaxOverrideType.class.php" hash="d23f90c9ac639954c8fcee57ba763b21"/><file name="TaxRequest.class.php" hash="7339016da0c3cbe51843767987e7fbed"/><file name="TaxServiceSoap.class.php" hash="bc7e4eb0e66dd1bd956e19e0da337171"/><file name="TaxType.class.php" hash="ee87ecc8721076f0cda67fe1cc5b0db7"/><file name="TextCase.class.php" hash="8fb2eccc49eacdc1a4f5624c0716a750"/><file name="ValidAddress.class.php" hash="2f8eebcd379208198cd38632f1e34b0a"/><file name="ValidateRequest.class.php" hash="98faedd50b2f4ea7ffb9d53ab1ca116c"/><file name="ValidateResult.class.php" hash="23de6a26defed9324ddcdcedfd2228bf"/><dir name="wsdl"><file name="Address.wsdl" hash="37ac1778f42147b548e09c8bb39b3cfc"/><file name="AvaCert2Svc.wsdl" hash="60da5aa0484ce00b82d7675ea3fd6454"/><file name="AvaCertSvc.wsdl" hash="25d03720f7018ea027c3345ec2c69c8e"/><file name="BatchSvc.wsdl" hash="798a715e28b9751b01666a29554135f7"/><file name="Tax.wsdl" hash="051420912d3e0b2489ae250c47059166"/></dir></dir><file name="functions.php" hash="57734d162b59cbc65933d25bf3950270"/></dir><dir name="OnePica"><dir name="AvaTax16"><dir name="AddressResolution"><file name="PingResponse.php" hash="42cf1ee8601e559d025b009ecb7201b3"/><file name="ResolveSingleAddressResponse.php" hash="7305c3bbe38e5c440678361847c43e84"/><file name="TaxAuthority.php" hash="86b3584391c9ef8af8ffeda1b7162637"/></dir><file name="AddressResolution.php" hash="3acfa74ff528a1d50d539a756614137c"/><dir name="Calculation"><dir name="ListItemResponse"><dir name="CalculatedTaxSummary"><dir name="TaxByType"><file name="Details.php" hash="53ffdc3b1df7f9ffbe1418d863b279f9"/></dir><file name="TaxByType.php" hash="182d258bad391e4b82406d43dcf9eaca"/></dir><file name="CalculatedTaxSummary.php" hash="d4ae2eeb74d7641db65226f76ee965de"/><file name="Header.php" hash="846a2ef2aa31b271b864b908e43f59e5"/><file name="Line.php" hash="974554064e6a61a4e2b9ab6db5e2fd34"/><file name="ProcessingInfo.php" hash="6ea7c0a0c86036c648ef4e0476eea99e"/></dir><file name="ListItemResponse.php" hash="bbdc204f0d848e992119280761d8d7cc"/><file name="ListResponse.php" hash="2d15f8cdf48993d8ab90938cd4d37190"/></dir><file name="Calculation.php" hash="5311fefa3e82c63ef725f32f84a04aab"/><file name="Config.php" hash="5eb6a3001370bca29d977fe9b24800ea"/><dir name="Document"><dir name="Part"><dir name="Feedback"><file name="LatencyData.php" hash="4f5c765cf6d028bcb4107b01f2e5b807"/></dir><file name="Feedback.php" hash="fac9eb4e3478fc4386567cd41668e1e1"/><dir name="Location"><file name="Address.php" hash="15ee70c3901080d53cef56cd63d4cf57"/><file name="LatLong.php" hash="97b968fdca26d5a8f5602e4f28162190"/></dir><file name="Location.php" hash="6054bcad769a7d7287445aa590ef2a2d"/></dir><file name="Part.php" hash="b1ef99e465e25df5338080610daa977d"/><dir name="Request"><file name="Header.php" hash="92bac296417f904a70287dc55dee9d1c"/><file name="Line.php" hash="0acdeea9894a70410cb64398e90ab7d0"/></dir><file name="Request.php" hash="1440ad02232e98d286ce37f696a086a7"/><dir name="Response"><dir name="CalculatedTaxSummary"><dir name="TaxByType"><file name="Details.php" hash="b0bf6211fa2744285d3b42cd8660c8e5"/></dir><file name="TaxByType.php" hash="6a427c932fe5b60588864fcf5a0c81f2"/></dir><file name="CalculatedTaxSummary.php" hash="86c0321b176d6c52222f6d688408b87c"/><file name="Header.php" hash="787e68feae0eacc4b0359f66cd180cd1"/><dir name="Line"><dir name="CalculatedTax"><file name="Details.php" hash="5a80a57a785b7e4d9b2ce6c946319279"/><file name="TaxByType.php" hash="3267edf3a25c9313dc7f838da7669add"/></dir><file name="CalculatedTax.php" hash="f47fc24daeb236106e52c6309bc1f3e5"/></dir><file name="Line.php" hash="a068c319dfcdc79f63b8ad1291eaf3b2"/><file name="ProcessingInfo.php" hash="b175ab3cffde010db67a666a0ac1f6c6"/></dir><file name="Response.php" hash="b0d922b0a0ff81d9c690828e7149bc29"/></dir><file name="Exception.php" hash="62f3fb8c7fee6758dbf00e9a90053dde"/><dir name="IO"><file name="CaseInsensitiveArray.php" hash="5ff9551b29e56f6fe92ee4f802a983f3"/><file name="Curl.php" hash="90f0df8763a82d597fc0f93deaa13249"/></dir><file name="ResourceAbstract.php" hash="86bb4526bc73b7cf63d675c1f6eaac44"/><file name="TaxService.php" hash="03f1799cd82cd95e5412d4a2ac915361"/><dir name="Transaction"><file name="ListItemResponse.php" hash="3cbe80a9923a0b25e2350c4c6daaa3fc"/><file name="ListResponse.php" hash="491506f6f1e4044e14f1c43b2082a03a"/><file name="TransitionTransactionStateResponse.php" hash="7b9e0beb239ff0679a360d1d14945fba"/></dir><file name="Transaction.php" hash="282113bda5b0abe544fd58c844c9ee87"/></dir><file name="autoload.php" hash="997d00ba2d67253ec64a95c89c92c36b"/></dir></target></contents>
34
  <compatible/>
35
  <dependencies><required><php><min>5.2.3</min><max>6.0.0</max></php><extension><name>Core</name><min/><max/></extension><extension><name>curl</name><min/><max/></extension><extension><name>soap</name><min/><max/></extension></required></dependencies>
36
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>OnePica_AvaTax</name>
4
+ <version>3.0.1</version>
5
  <stability>stable</stability>
6
  <license>Open Software License (OSL 3.0)</license>
7
  <channel>community</channel>
18
  &#xD;
19
  &#xD;
20
  At One Pica (www.onepica.com), we strive to build increasingly scalable and flexible enterprise systems for all of our clients, large and small. We want to give back to this community both to promote its success and as a sign of our gratitude. Please feel free to contact us on ways we can improve this extension or extend on this framework.</description>
21
+ <notes>Fixed tax calculation for bundle products</notes>
 
 
 
 
 
 
 
 
22
  <authors><author><name>Rostyslav Redko</name><user>marketing</user><email>avalara@onepica.com</email></author></authors>
23
+ <date>2016-03-23</date>
24
+ <time>10:14:52</time>
25
+ <contents><target name="magecommunity"><dir name="OnePica"><dir name="AvaTax"><dir name="Block"><dir name="Adminhtml"><dir name="Export"><dir name="Abstract"><file name="Grid.php" hash="5f96ca490c5f7bd3fac23e30b00336e5"/></dir><dir name="Log"><file name="Grid.php" hash="311c55d8bc770e6d6aa6f377c2eee6fd"/><file name="View.php" hash="097d82a3e2b1a8820d335a63f212451b"/></dir><dir name="Queue"><file name="Grid.php" hash="1ef8ba9bf3e0870ea6dc50bb202a0b91"/></dir></dir><dir name="Notification"><file name="Toolbar.php" hash="26f7e382432289c3ff07647141cf9324"/></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Export.php" hash="3e019b9551b95c71f4cfd67a14d62a27"/></dir></dir></dir></dir><dir name="Tax"><dir name="Class"><dir name="Edit"><file name="Form.php" hash="0e78c592366ee2746f3891cf91a388d3"/></dir><file name="Grid.php" hash="d731eb160457b8a22cfcd28682a1c485"/></dir></dir></dir><dir name="Checkout"><dir name="Onepage"><dir name="Shipping"><dir name="Method"><file name="Available.php" hash="a0bdc5f63955148cf7e755c8803e01de"/></dir></dir></dir></dir></dir><file name="Exception.php" hash="fc752f8da808a402baae2425c4072d22"/><dir name="Helper"><file name="Address.php" hash="df731a75957cf712d0b1410b1d831dd6"/><file name="Calculation.php" hash="3a3bcbd4a33a061700c495a14afd8b3a"/><file name="Config.php" hash="b7a48f682638fca9b53e2db1460e45f4"/><file name="Data.php" hash="111f31427c4cc0d77830643b7271b08c"/><file name="Errors.php" hash="1fc34a932db296ecd1617a4e50e150d7"/><dir name="GiftWrapping"><file name="Data.php" hash="a336949d2849baa874f280c7a16316f5"/></dir><file name="Lib.php" hash="ce05e31b4aba7ba84bfc016df8c2a559"/><dir name="Tax"><file name="Data.php" hash="ce4688b06cabe61ac43993fc77a175ca"/></dir></dir><dir name="Model"><dir name="Action"><file name="Abstract.php" hash="de2bc126be0cfe69ffe6af60a8307d16"/><file name="Calculator.php" hash="5c5776e4f6cd95f0daf3d4fa9d45224f"/><file name="Creditmemo.php" hash="23639271a8fad749a3ee3a13fc8b0b27"/><file name="Invoice.php" hash="20458660bda4a277c0677b1406feb481"/><file name="Ping.php" hash="7e08308fff72493e0cb75b9244551de6"/><file name="Validator.php" hash="595d79c22f3027b89498b5c004b8be2b"/></dir><dir name="Admin"><file name="Session.php" hash="e3dc3353c7eebf4e17c22ea4039585c5"/></dir><dir name="Adminhtml"><file name="Config.php" hash="388f532f03fa8dacc9fde122a2fe0c64"/><dir name="Sales"><dir name="Order"><file name="Create.php" hash="2a1b42b629b8da1373e11860c4a2c8c0"/></dir></dir></dir><dir name="Export"><dir name="Adapter"><file name="Abstract.php" hash="840c8b87acd97646572bba9bb3b8f5ea"/><file name="Sql.php" hash="0e9bedb400f411785311f78ebbf676da"/></dir><dir name="Entity"><file name="Abstract.php" hash="d38a2293452c31e92f81bf5be59c3e1c"/><file name="Log.php" hash="a1dd28eee3e72d1a4ef7bddd865ddbae"/><file name="Queue.php" hash="14a97c283aa74f97982ab71160017aa3"/></dir></dir><file name="Export.php" hash="b94613b678b413d6268b07d314ba122e"/><dir name="Observer"><file name="Abstract.php" hash="4cef8e34c047b97e34ab08b0c937082c"/><file name="AdminSystemConfigChangedSectionTax.php" hash="e0e703abb46b48185dc6dda2944b89cc"/><file name="CheckoutSubmitAllAfter.php" hash="4ee09c54a9098b568dac726964d782c0"/><file name="CheckoutTypeMultishippingCreateOrdersSingle.php" hash="eeaffffddd4e2ce387325dfb58381a77"/><file name="CleanLog.php" hash="4043bb0a3df982b756bfb1dfab5d56de"/><file name="ControllerActionLayoutGenerateXmlBefore.php" hash="d533cdc23c1749c87bccdb1e8fd7f947"/><file name="ControllerActionPostdispatchCheckoutCartEstimatePost.php" hash="5b2facd906e8fb33a49f23c7f3fe36b7"/><file name="ControllerActionPostdispatchCheckoutCartEstimateUpdatePost.php" hash="4006ae1c1074915312301260ed88925c"/><file name="ControllerActionPostdispatchCheckoutOnepageSaveShippingMethod.php" hash="0b600e585f4b008e457995676019c2b4"/><file name="ControllerActionPredispatchAdminhtmlSalesOrderCreateLoadBlock.php" hash="07ef318adffde6bba762da8300e17324"/><file name="ControllerActionPredispatchCheckoutCartEstimatePost.php" hash="2b2cce8f619488fd795a027b80d20d2a"/><file name="ControllerActionPredispatchCheckoutCartIndex.php" hash="ec46c279439967df90395882a5804de1"/><file name="ControllerActionPredispatchCheckoutMultishippingIndex.php" hash="d6d7a1d0272c51f3ec4cacbce8574da3"/><file name="ControllerActionPredispatchCheckoutOnepageIndex.php" hash="01c4280273e34a2f82ed6764792f3568"/><file name="LoadAvaTaxExternalLib.php" hash="0b10ed2f15ef8202362f4828fad15262"/><file name="MultishippingSetShippingItems.php" hash="e4a1f3c4e1506797692a7b7d2dc23217"/><file name="ProcessQueue.php" hash="35375793d039f6848e7b2af05e0eef41"/><file name="SalesModelServiceQuoteSubmitAfter.php" hash="6499cfe8e1c9176b12af58c0bce331eb"/><file name="SalesModelServiceQuoteSubmitBefore.php" hash="4e67278a1c20a969f8709237f817b6e0"/><file name="SalesOrderCreditmemoRefund.php" hash="3e9049e39b53ec06b8aa1ab274d1e00d"/><file name="SalesOrderCreditmemoSaveAfter.php" hash="a01af2f4a66912383b772be42fddbdea"/><file name="SalesOrderInvoicePay.php" hash="ac7884c312f986d123912f01346b031a"/><file name="SalesOrderInvoiceSaveAfter.php" hash="00279b77e0a3bbac120b9248d6f9223d"/><file name="SalesQuoteCollectTotalsBefore.php" hash="c0ae978e4895cec8a1b4c1ec2a3a5522"/></dir><dir name="Records"><file name="Log.php" hash="32926db85023ad21ea6179bf4ad77ef4"/><dir name="Mysql4"><dir name="Log"><file name="Collection.php" hash="29db8163f4dda862ff822ddffd04554d"/></dir><file name="Log.php" hash="d6fb7997768b7e0f1b39363fd4de5917"/><dir name="Queue"><file name="Collection.php" hash="11bba1561c81f39695f091b94bd81560"/></dir><file name="Queue.php" hash="12ba62949dab080c6dc6ae7fcbbf4838"/></dir><dir name="Queue"><file name="Process.php" hash="82d837f47b78b4a037938dd88dfe3217"/></dir><file name="Queue.php" hash="2906b0c99e686f2e85169cbd49c8af2e"/></dir><dir name="Sales"><dir name="Quote"><dir name="Address"><dir name="Total"><file name="Tax.php" hash="4d1e38d489de55c889e206ffd42c39a0"/></dir></dir><file name="Address.php" hash="7a9717d123bba20ce14144b80d1da5da"/></dir></dir><dir name="Service"><dir name="Abstract"><file name="Config.php" hash="2b5ebe4312f82b0c13b03db2c261964f"/><file name="Tools.php" hash="8338336a7dccd05c3956f93363a35d6d"/></dir><file name="Abstract.php" hash="29cee53a912adeb0f682bc931972823d"/><dir name="Avatax"><file name="Abstract.php" hash="629fc49a518505a87f1548c3b29ef666"/><file name="Address.php" hash="5f6d2257e4132a436dff7cc0cc08eb67"/><file name="Config.php" hash="25198070b781c8ce632b4f3d3c3b21e0"/><file name="Estimate.php" hash="1d401a859b2362203c517e692e5147f2"/><file name="Invoice.php" hash="856a2a33ee05d1f58bd5cde0171b3254"/><file name="Ping.php" hash="8dd09babe7e8b206564544b2ace9a661"/><file name="Tax.php" hash="3002e239f7f5a84f3377d288861cf4d2"/></dir><file name="Avatax.php" hash="b6fa49f95a3ab05546bd597689a14ed7"/><dir name="Avatax16"><file name="Abstract.php" hash="9b061b6d7bebc7539efa4a33789c23e2"/><file name="Address.php" hash="834681944f93504537e26217f9690cd5"/><file name="Config.php" hash="34c888b2db0c2c72bfea6ddad0dbf053"/><file name="Estimate.php" hash="0a56014549d00c2658ee3c9f0a08d6cc"/><file name="Invoice.php" hash="dd62073b8f573932c3ee9c5cb8fffe0b"/><file name="Ping.php" hash="853a6c8078296263adc241befc5eaa92"/><file name="Tax.php" hash="0680fb53318af5eac219909162657037"/></dir><file name="Avatax16.php" hash="cd3743c413edb08904781900c0064eaf"/><dir name="Exception"><file name="Address.php" hash="2519f1a2b302db97337c933d99a6d116"/><file name="Commitfailure.php" hash="7f0c5a5bf9242651d2542336d0b4cb96"/><file name="Unbalanced.php" hash="43595e010b314e8a91dd0fef4fad96c2"/></dir><dir name="Result"><file name="Address.php" hash="7a711e27f7f5e478a8a290a1880586f6"/><file name="AddressValidate.php" hash="62d14d7f4147b83001ef7f64726276c1"/><file name="Creditmemo.php" hash="8b1ac1eda1a522c70bca574b938c6359"/><file name="Invoice.php" hash="83f157b7fd24e5e6c0b51f6a162ee316"/></dir></dir><file name="Service.php" hash="7fda34c9ce1db70ae9757561d505a5b7"/><file name="Session.php" hash="429142089e75418a702e70edc56374cf"/><dir name="Source"><file name="Actions.php" hash="b5392f0820f15c3159e76ea67148992a"/><file name="Addressvalidation.php" hash="9f2315018910f7336ad894156d49d9b9"/><dir name="Avatax"><file name="Actions.php" hash="c72aa0df9013c6d5c5fddc0c4b4027b0"/><file name="Logtype.php" hash="6fde0a0dda9a7884bb13484ffa244409"/><file name="Url.php" hash="cff45c6a590360711867112533b068d8"/></dir><dir name="Avatax16"><file name="Actions.php" hash="86b7d4067faad9478f9b61101d0fd6ae"/><file name="Buyertype.php" hash="6b029a7bbacc0eda36ed4fbb6f6e467b"/><file name="Logtype.php" hash="09ddc0a3106e206e90ed45d8a2539d78"/><file name="Url.php" hash="ef6524ae8f04b9cc63f0f6e8ba4e63ea"/><file name="Usetype.php" hash="107c03d384fb6a8b990e4c16f49fab87"/></dir><file name="Customercodeformat.php" hash="cfcfcbaa27ed29add072324816da0c9d"/><file name="Error.php" hash="7f5495a2f295ded2d0a30f2f7108d009"/><file name="Fieldlist.php" hash="18987603d4d58130959a8ac76716ed08"/><file name="Logmode.php" hash="24d61da578a3b4adb896fea7d4d4d8ec"/><file name="Logtype.php" hash="25dce563940ac9763e642e3e96365043"/><file name="Onerrorfrontend.php" hash="ef4154ae563d8157c1083f20e0adf563"/><dir name="Regionfilter"><file name="List.php" hash="d73ebe7197a2c6cfa45d52775d6f0977"/><file name="Mode.php" hash="2216d28bf9adba614025538cc62a49b6"/></dir><file name="Url.php" hash="794ec57a2b350931f70e95eb6677c253"/></dir><dir name="Tax"><file name="Calculation.php" hash="8b3ad0ace3967a13364d1475e286b70c"/><file name="Config.php" hash="dfb1ff41c23ed30dc29013dd73a89896"/></dir><dir name="Total"><dir name="Quote"><dir name="Tax"><file name="Giftwrapping.php" hash="7b264455ac9084a751468ef6dbc36fe5"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="AvaTax"><file name="ExportController.php" hash="ead5ebea03db8f885d0ec6114dcb185c"/><file name="GridController.php" hash="5c7e822890a6feaec2db348e6c5a19e1"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="aca07ae89478c72fd1d2d41228c28b8e"/><file name="config.xml" hash="7a5da0ea3fce370c91d9f433851a4006"/><file name="system-avatax16-disabled.xml" hash="b24027def3daab9000047bf7fee41c4f"/><file name="system-avatax16.xml" hash="b5a9543409521633ceec2af4d9c5d1b7"/><file name="system-disabled.xml" hash="f0643182c8bd62674ae091104d6e500e"/><file name="system.xml" hash="5b78ba9932b776c2ce49692d0e51c58c"/></dir><dir name="sql"><dir name="avatax_records_setup"><file name="mysql4-data-upgrade-2.2.0-2.2.1.php" hash="260d1c57754ebadba00d8ccdbb0ec996"/><file name="mysql4-install-0.1.0.php" hash="3d16899179b36bfde69609a99a2faae6"/><file name="mysql4-upgrade-0.1.4-0.1.5.php" hash="94d0cf2fc0e9bbe2de2829198ce3026f"/><file name="mysql4-upgrade-1.0.1-2.0.0.php" hash="905d7519328cdb1c46bba4221288c41c"/><file name="mysql4-upgrade-2.5.0.0-2.5.0.1.php" hash="4b439957397049bbe01d458fd7cfe0a2"/><file name="mysql4-upgrade-3.0.0.1-3.0.0.2.php" hash="46caa743f17221575b4a639b262a9275"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="OnePica_AvaTax.xml" hash="07fd9423811b4dc084060d6131b889d7"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="onepica"><file name="avatax.xml" hash="de338ca651fcce096d089b2bbbcc1374"/></dir></dir><dir name="template"><dir name="onepica"><dir name="avatax"><dir name="log"><file name="view.phtml" hash="df14eee805bbedd484cf500dbf2335ed"/></dir><dir name="notification"><file name="toolbar.phtml" hash="fd368e043843df76ec3a74290b87dc3e"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="onepica"><file name="avatax.xml" hash="38c6ce2165f6ccfd6641eb1487faad39"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="de_DE"><file name="OnePica_AvaTax.csv" hash="43d2dee74aee6f15abd471a65b4f407c"/></dir><dir name="en_US"><file name="OnePica_AvaTax.csv" hash="43d2dee74aee6f15abd471a65b4f407c"/></dir><dir name="es_ES"><file name="OnePica_AvaTax.csv" hash="43d2dee74aee6f15abd471a65b4f407c"/></dir><dir name="fr_FR"><file name="OnePica_AvaTax.csv" hash="43d2dee74aee6f15abd471a65b4f407c"/></dir><dir name="nl_NL"><file name="OnePica_AvaTax.csv" hash="43d2dee74aee6f15abd471a65b4f407c"/></dir><dir name="pt_BR"><file name="OnePica_AvaTax.csv" hash="43d2dee74aee6f15abd471a65b4f407c"/></dir><dir name="zh_CN"><file name="OnePica_AvaTax.csv" hash="43d2dee74aee6f15abd471a65b4f407c"/></dir></target><target name="magelib"><dir name="AvaTax"><file name="AvaTax.php" hash="46bf3fb7795482b7494b2fdc266af3bc"/><dir name="classes"><file name="ATConfig.class.php" hash="dd1c39643f677e0c3b612c549686812c"/><file name="ATObject.class.php" hash="83359fd7639c98449836dc11d08c899d"/><file name="Address.class.php" hash="68bf4fe1306a60e672b7345a0dc7fcc6"/><file name="AddressServiceSoap.class.php" hash="c59bf4a586da207611f7bace4f08c880"/><file name="AddressType.class.php" hash="62c9ff3c533aaf5ad1fd4de95702be40"/><file name="AdjustTaxRequest.class.php" hash="47dbfa8044ca893bf214d8e71ab4864e"/><file name="AdjustTaxResult.class.php" hash="cf63aa5b7c3b52b3ec86695c4cdf0fcc"/><file name="ApplyPaymentRequest.class.php" hash="69d69dff63cbd284d8aea62247142692"/><file name="ApplyPaymentResult.class.php" hash="0e37bda0f1221c2ed2432717a2d8cc08"/><dir name="AvaCert2Svc"><file name="AvaCert2Soap.class.php" hash="0567793d9e4e496b45c3e8a0459f944a"/><file name="Certificate.class.php" hash="dd3f0dd2a2b03c97552f9dbd5c6463ba"/><file name="CertificateGetRequest.class.php" hash="4c11fd111cab99fa4dbc2c2250e0f3ad"/><file name="CertificateGetResult.class.php" hash="6a95a06e71bd13839c6142bba08bfba5"/><file name="CertificateImageGetRequest.class.php" hash="32f61011abe3d1c74ea7fc209e3e4224"/><file name="CertificateImageGetResult.class.php" hash="beda0f1fd54951b84b7dd77ead92bda3"/><file name="CertificateJurisdiction.class.php" hash="e666d572fb34d17fcd91127a50616195"/><file name="CertificateRequest.class.php" hash="7b76dc3675e507975ae6cf01abfa6059"/><file name="CertificateRequestGetRequest.class.php" hash="0cf2fafae88f795a754d75291947cb56"/><file name="CertificateRequestGetResult.class.php" hash="eceffe3acec787506649669b1b5edcf7"/><file name="CertificateRequestInitiateRequest.class.php" hash="148a5c4c881c885be863f403582b4974"/><file name="CertificateRequestInitiateResult.class.php" hash="a7a55cb398cd2fb9f0e11b8c6b09498d"/><file name="CertificateRequestStage.class.php" hash="92dec7da28f83f1a419d9573e6cec1fa"/><file name="CertificateRequestStatus.class.php" hash="a5d5c1629ce4f5ee0c18a8924204ca22"/><file name="CertificateStatus.class.php" hash="6ae43ab57ae9df37d07ac4203270c25e"/><file name="CertificateUsage.class.php" hash="bad34570daa7679b267f1288bf0a371f"/><file name="CommunicationMode.class.php" hash="71d2743c1d2afffe11d2903e89ff9c0e"/><file name="Customer.class.php" hash="e9f13f38f75cb4e1b845c55e6f26a5ab"/><file name="CustomerSaveRequest.class.php" hash="58ff71b04bb3a308b7f0199c6fae1e56"/><file name="CustomerSaveResult.class.php" hash="98cf79bdb7c0558963670b21e66b7d85"/><file name="FormatType.class.php" hash="714d183d3d365a07ef606d1211c732b0"/><file name="RequestType.class.php" hash="6144c2731baaf67400ea34e50440c1df"/><file name="ReviewStatus.class.php" hash="0dd208ecbf6b45196f51f304b1d48b03"/></dir><file name="AvalaraSoapClient.class.php" hash="dd605cefabb4396ef1b46b6d23b439b5"/><file name="BaseResult.class.php" hash="85d2c23ecc62bf4b828d04f405f83d37"/><dir name="BatchSvc"><file name="AuditMessage.class.php" hash="798d8169506357af02e6912b4bca9148"/><file name="AvaTaxBatchSvc.php" hash="8d65fd4a02cd4fc1104aa9c24b35e4fb"/><file name="BaseResult.class.php" hash="727ef623b821e95a73cf6d1eda891379"/><file name="Batch.class.php" hash="c028822bcf2a4f1fae6fc7dca76f247a"/><file name="BatchDelete.class.php" hash="0bcff09309ccad969d65c2d27fa63dda"/><file name="BatchDeleteResponse.class.php" hash="46afd464673459efb54ccaf509d37eef"/><file name="BatchFetch.class.php" hash="74f96ecc3c2df87271d60c4c969e43f8"/><file name="BatchFetchResponse.class.php" hash="b2acf63deea2c0fd374f80745b60fef5"/><file name="BatchFetchResult.class.php" hash="83d8de067f4bd59acafe4cd065f90163"/><file name="BatchFile.class.php" hash="65cee20383c8040fac1d4c45bbe757dd"/><file name="BatchFileDelete.class.php" hash="01d0bc10cb0ada43a9a00ca0efffef17"/><file name="BatchFileDeleteResponse.class.php" hash="b4e7881d26b7071303650973144f418b"/><file name="BatchFileFetch.class.php" hash="c5e91b8073fb756545d0f74803fdf3d6"/><file name="BatchFileFetchResponse.class.php" hash="c37ce819a975cdae5e7a82432b4b2334"/><file name="BatchFileFetchResult.class.php" hash="6bc54523d34356a83cdc4ecd2f696ea5"/><file name="BatchFileSave.class.php" hash="8434b0ffdd1fba4991535248ee3d618e"/><file name="BatchFileSaveResponse.class.php" hash="d52f79b42467b59f2177359f8a73cd3a"/><file name="BatchFileSaveResult.class.php" hash="19d3a2f20ccc42e80759b280842cf03c"/><file name="BatchProcess.class.php" hash="44d9efe13d01fce15bd444e5729b320c"/><file name="BatchProcessRequest.class.php" hash="04684b987c6d77319cc6881941091de9"/><file name="BatchProcessResponse.class.php" hash="c22b08c125eefc4006495c55984ed91e"/><file name="BatchProcessResult.class.php" hash="f9cac2270aafae49fc0892ea729c3713"/><file name="BatchSave.class.php" hash="d3a397348b905d49a0c91be780f3ec04"/><file name="BatchSaveResponse.class.php" hash="4c3088b85590fd697b5686aa1dddd89e"/><file name="BatchSaveResult.class.php" hash="7ea7fe3dc7d580711f6b52d991c43dce"/><file name="BatchSvc.class.php" hash="fa903f70b06d1e3b86384f2b6fb60616"/><file name="DeleteRequest.class.php" hash="43f945ef1e59ef02494df6df6ec3d1b6"/><file name="DeleteResult.class.php" hash="f7d64582f1182ae0337d6d84a5f60e8d"/><file name="FetchRequest.class.php" hash="7271317a8909672261ea0e00867e810b"/><file name="FilterRequest.class.php" hash="3c1eaec68f84531931a3cd6143533576"/><file name="FilterResult.class.php" hash="f4c0eeac0153b735ec589fcff7accd86"/><file name="IsAuthorized.class.php" hash="8339a2b249d954efaaf64f10665976fc"/><file name="IsAuthorizedResponse.class.php" hash="613c91f36370dc38ca07b83a29f2a45f"/><file name="IsAuthorizedResult.class.php" hash="65f9665508a5e7f33e4aee2835a9806e"/><file name="Message.class.php" hash="576327c8d9cd74bd96d9ccd62a2daa5b"/><file name="Ping.class.php" hash="3a2246f5557a5279fa260c65b36a9b44"/><file name="PingResponse.class.php" hash="b9f5e8b43382ee605d93768db8af1805"/><file name="PingResult.class.php" hash="2e05acfe74aad28003ad7d8ed102c3c6"/><file name="Profile.class.php" hash="a16a4819018dd8510ddab8feb9ee0f7e"/><file name="SeverityLevel.class.php" hash="5736530f3b5fd0cd932c783418563647"/></dir><file name="BoundaryLevel.class.php" hash="e9c2f2e3173e44fa8351f2a6dbb578fe"/><file name="CancelCode.class.php" hash="fd0b8ad2865e8fcf622b1faafc677527"/><file name="CancelTaxRequest.class.php" hash="08a114e32ec9eda9268ec337f79cb86f"/><file name="CancelTaxResult.class.php" hash="687be65bab85e6c6e8f99764c0475d9b"/><file name="CommitTaxRequest.class.php" hash="66ef55bc094d233b75e36b029995aed7"/><file name="CommitTaxResult.class.php" hash="ef90276817207e63e4e96ea518618f50"/><file name="DetailLevel.class.php" hash="2439f7137a4f9f52e28a6b321c4bcf16"/><file name="DocStatus.class.php" hash="9e3384a0f2ace05fa67fe05eba295fcd"/><file name="DocumentType.class.php" hash="94b4509b914d638a94f946b5518b8993"/><file name="DynamicSoapClient.class.php" hash="5bb36f2d4db3955ae059488eb9511ca9"/><file name="Enum.class.php" hash="d3ff4c898aff49f3c425042433826257"/><file name="GetTaxHistoryRequest.class.php" hash="3ed4c54de1e015f476ce7aa58c802468"/><file name="GetTaxHistoryResult.class.php" hash="7e8209e1f64df52b538927312b1bd934"/><file name="GetTaxRequest.class.php" hash="a3343ef6a1e27e48c9a75aa9e02777c4"/><file name="GetTaxResult.class.php" hash="7e2b7415a018fd76b62ab49637833533"/><file name="IsAuthorizedResult.class.php" hash="58164457677a61e93309f788fe61dc0c"/><file name="JurisdictionType.class.php" hash="a345fe5db379af87a6f7ec833ff86586"/><file name="Line.class.php" hash="7fefbd0230ee2fe8a8e6468abf338b80"/><file name="Message.class.php" hash="073be6cbcccacf2d1d55a04c045eab63"/><file name="PingResult.class.php" hash="18f88589588f08b619488c926cf5547c"/><file name="PostTaxRequest.class.php" hash="be8ea4ee2fddb10b62cb1be7e38179e3"/><file name="PostTaxResult.class.php" hash="bf2ee0b1293301ee00ac9b8b8390e780"/><file name="ReconcileTaxHistoryRequest.class.php" hash="41f2cfe04495612a9c293b1bc19220ce"/><file name="ReconcileTaxHistoryResult.class.php" hash="dd20684e0e017f56c98e29297180a0d7"/><file name="SearchTaxHistoryResult.class.php" hash="e3171e00482f7c2c0ed9753ffd05cd14"/><file name="ServiceMode.class.php" hash="0c66b3e25f4466461cebf32735e207e0"/><file name="SeverityLevel.class.php" hash="68fc81e651fe7f01c81b43b0d28ff0dc"/><file name="TaxDetail.class.php" hash="56065f8ea68505152b23e41238b80dfb"/><file name="TaxLine.class.php" hash="05376f01ad9a14f438ad0f1d5d423b61"/><file name="TaxOverride.class.php" hash="94d28efa3cdf58a87ba45a313ce93fc7"/><file name="TaxOverrideType.class.php" hash="d23f90c9ac639954c8fcee57ba763b21"/><file name="TaxRequest.class.php" hash="7339016da0c3cbe51843767987e7fbed"/><file name="TaxServiceSoap.class.php" hash="bc7e4eb0e66dd1bd956e19e0da337171"/><file name="TaxType.class.php" hash="ee87ecc8721076f0cda67fe1cc5b0db7"/><file name="TextCase.class.php" hash="8fb2eccc49eacdc1a4f5624c0716a750"/><file name="ValidAddress.class.php" hash="2f8eebcd379208198cd38632f1e34b0a"/><file name="ValidateRequest.class.php" hash="98faedd50b2f4ea7ffb9d53ab1ca116c"/><file name="ValidateResult.class.php" hash="23de6a26defed9324ddcdcedfd2228bf"/><dir name="wsdl"><file name="Address.wsdl" hash="37ac1778f42147b548e09c8bb39b3cfc"/><file name="AvaCert2Svc.wsdl" hash="60da5aa0484ce00b82d7675ea3fd6454"/><file name="AvaCertSvc.wsdl" hash="25d03720f7018ea027c3345ec2c69c8e"/><file name="BatchSvc.wsdl" hash="798a715e28b9751b01666a29554135f7"/><file name="Tax.wsdl" hash="051420912d3e0b2489ae250c47059166"/></dir></dir><file name="functions.php" hash="57734d162b59cbc65933d25bf3950270"/></dir><dir name="OnePica"><dir name="AvaTax16"><dir name="AddressResolution"><file name="PingResponse.php" hash="42cf1ee8601e559d025b009ecb7201b3"/><file name="ResolveSingleAddressResponse.php" hash="7305c3bbe38e5c440678361847c43e84"/><file name="TaxAuthority.php" hash="86b3584391c9ef8af8ffeda1b7162637"/></dir><file name="AddressResolution.php" hash="3acfa74ff528a1d50d539a756614137c"/><dir name="Calculation"><dir name="ListItemResponse"><dir name="CalculatedTaxSummary"><dir name="TaxByType"><file name="Details.php" hash="53ffdc3b1df7f9ffbe1418d863b279f9"/></dir><file name="TaxByType.php" hash="182d258bad391e4b82406d43dcf9eaca"/></dir><file name="CalculatedTaxSummary.php" hash="d4ae2eeb74d7641db65226f76ee965de"/><file name="Header.php" hash="846a2ef2aa31b271b864b908e43f59e5"/><file name="Line.php" hash="974554064e6a61a4e2b9ab6db5e2fd34"/><file name="ProcessingInfo.php" hash="6ea7c0a0c86036c648ef4e0476eea99e"/></dir><file name="ListItemResponse.php" hash="bbdc204f0d848e992119280761d8d7cc"/><file name="ListResponse.php" hash="2d15f8cdf48993d8ab90938cd4d37190"/></dir><file name="Calculation.php" hash="5311fefa3e82c63ef725f32f84a04aab"/><file name="Config.php" hash="5eb6a3001370bca29d977fe9b24800ea"/><dir name="Document"><dir name="Part"><dir name="Feedback"><file name="LatencyData.php" hash="4f5c765cf6d028bcb4107b01f2e5b807"/></dir><file name="Feedback.php" hash="fac9eb4e3478fc4386567cd41668e1e1"/><dir name="Location"><file name="Address.php" hash="15ee70c3901080d53cef56cd63d4cf57"/><file name="LatLong.php" hash="97b968fdca26d5a8f5602e4f28162190"/></dir><file name="Location.php" hash="6054bcad769a7d7287445aa590ef2a2d"/></dir><file name="Part.php" hash="b1ef99e465e25df5338080610daa977d"/><dir name="Request"><file name="Header.php" hash="92bac296417f904a70287dc55dee9d1c"/><file name="Line.php" hash="0acdeea9894a70410cb64398e90ab7d0"/></dir><file name="Request.php" hash="1440ad02232e98d286ce37f696a086a7"/><dir name="Response"><dir name="CalculatedTaxSummary"><dir name="TaxByType"><file name="Details.php" hash="b0bf6211fa2744285d3b42cd8660c8e5"/></dir><file name="TaxByType.php" hash="6a427c932fe5b60588864fcf5a0c81f2"/></dir><file name="CalculatedTaxSummary.php" hash="86c0321b176d6c52222f6d688408b87c"/><file name="Header.php" hash="787e68feae0eacc4b0359f66cd180cd1"/><dir name="Line"><dir name="CalculatedTax"><file name="Details.php" hash="5a80a57a785b7e4d9b2ce6c946319279"/><file name="TaxByType.php" hash="3267edf3a25c9313dc7f838da7669add"/></dir><file name="CalculatedTax.php" hash="f47fc24daeb236106e52c6309bc1f3e5"/></dir><file name="Line.php" hash="a068c319dfcdc79f63b8ad1291eaf3b2"/><file name="ProcessingInfo.php" hash="b175ab3cffde010db67a666a0ac1f6c6"/></dir><file name="Response.php" hash="b0d922b0a0ff81d9c690828e7149bc29"/></dir><file name="Exception.php" hash="62f3fb8c7fee6758dbf00e9a90053dde"/><dir name="IO"><file name="CaseInsensitiveArray.php" hash="5ff9551b29e56f6fe92ee4f802a983f3"/><file name="Curl.php" hash="90f0df8763a82d597fc0f93deaa13249"/></dir><file name="ResourceAbstract.php" hash="86bb4526bc73b7cf63d675c1f6eaac44"/><file name="TaxService.php" hash="03f1799cd82cd95e5412d4a2ac915361"/><dir name="Transaction"><file name="ListItemResponse.php" hash="3cbe80a9923a0b25e2350c4c6daaa3fc"/><file name="ListResponse.php" hash="491506f6f1e4044e14f1c43b2082a03a"/><file name="TransitionTransactionStateResponse.php" hash="7b9e0beb239ff0679a360d1d14945fba"/></dir><file name="Transaction.php" hash="282113bda5b0abe544fd58c844c9ee87"/></dir><file name="autoload.php" hash="997d00ba2d67253ec64a95c89c92c36b"/></dir></target></contents>
26
  <compatible/>
27
  <dependencies><required><php><min>5.2.3</min><max>6.0.0</max></php><extension><name>Core</name><min/><max/></extension><extension><name>curl</name><min/><max/></extension><extension><name>soap</name><min/><max/></extension></required></dependencies>
28
  </package>