Version Notes
Improved performance
Improved logging
Fixed tax calculation for configurable products
Fixed tax calculation when coupon is applied
Fixed tax calculation with gift wrapping
Fixed filter tax calculation option
Fixed queue clean up process
Download this release
Release Info
Developer | Astound Commerce |
Extension | OnePica_AvaTax |
Version | 2.5.0 |
Comparing to | |
See all releases |
Code changes from version 2.4.3.3 to 2.5.0
- app/code/community/OnePica/AvaTax/.DS_Store +0 -0
- app/code/community/OnePica/AvaTax/Block/Adminhtml/Export/Abstract/Grid.php +68 -113
- app/code/community/OnePica/AvaTax/Block/Adminhtml/Export/Log/Grid.php +79 -71
- app/code/community/OnePica/AvaTax/Block/Adminhtml/Export/Log/View.php +21 -14
- app/code/community/OnePica/AvaTax/Block/Adminhtml/Export/Queue/Grid.php +94 -79
- app/code/community/OnePica/AvaTax/Block/Adminhtml/Notification/Toolbar.php +48 -26
- app/code/community/OnePica/AvaTax/Block/Adminhtml/System/Config/Form/Field/Export.php +25 -6
- app/code/community/OnePica/AvaTax/Block/Adminhtml/Tax/Class/Edit/Form.php +33 -24
- app/code/community/OnePica/AvaTax/Block/Adminhtml/Tax/Class/Grid.php +56 -46
- app/code/community/OnePica/AvaTax/Block/Checkout/Onepage/Shipping/Method/Available.php +106 -78
- app/code/community/OnePica/AvaTax/Helper/Data.php +495 -416
- app/code/community/OnePica/AvaTax/Helper/Tax/Data.php +126 -124
- app/code/community/OnePica/AvaTax/Model/.DS_Store +0 -0
- app/code/community/OnePica/AvaTax/Model/Abstract.php +107 -114
- app/code/community/OnePica/AvaTax/Model/Admin/Session.php +35 -30
- app/code/community/OnePica/AvaTax/Model/Adminhtml/Config.php +54 -42
- app/code/community/OnePica/AvaTax/Model/Adminhtml/Sales/Order/Create.php +68 -64
- app/code/community/OnePica/AvaTax/Model/Avatax/Abstract.php +420 -234
- app/code/community/OnePica/AvaTax/Model/Avatax/Address.php +284 -256
- app/code/community/OnePica/AvaTax/Model/Avatax/Estimate.php +447 -425
- app/code/community/OnePica/AvaTax/Model/Avatax/Exception/Address.php +25 -21
- app/code/community/OnePica/AvaTax/Model/Avatax/Exception/Commitfailure.php +25 -21
- app/code/community/OnePica/AvaTax/Model/Avatax/Exception/Unbalanced.php +25 -21
- app/code/community/OnePica/AvaTax/Model/Avatax/Invoice.php +459 -438
- app/code/community/OnePica/AvaTax/Model/Avatax/Ping.php +65 -49
- app/code/community/OnePica/AvaTax/Model/Config.php +233 -240
- app/code/community/OnePica/AvaTax/{sql/avatax_records_setup/mysql4-upgrade-2.2.0-2.2.1.php → Model/Exception.php} +25 -29
- app/code/community/OnePica/AvaTax/Model/Export.php +105 -0
- app/code/community/OnePica/AvaTax/Model/Export/Adapter/Abstract.php +62 -0
- app/code/community/OnePica/AvaTax/Model/Export/Adapter/Sql.php +117 -0
- app/code/community/OnePica/AvaTax/Model/Export/Entity/Abstract.php +113 -0
- app/code/community/OnePica/AvaTax/Model/Export/Entity/Log.php +52 -0
- app/code/community/OnePica/AvaTax/Model/Export/Entity/Queue.php +57 -0
- app/code/community/OnePica/AvaTax/Model/Observer.php +345 -212
- app/code/community/OnePica/AvaTax/Model/Records/.DS_Store +0 -0
- app/code/community/OnePica/AvaTax/Model/Records/Log.php +103 -55
- app/code/community/OnePica/AvaTax/Model/Records/Mysql4/Log.php +63 -38
- app/code/community/OnePica/AvaTax/Model/Records/Mysql4/Log/Collection.php +35 -25
- app/code/community/OnePica/AvaTax/Model/Records/Mysql4/Queue.php +130 -105
- app/code/community/OnePica/AvaTax/Model/Records/Mysql4/Queue/Collection.php +35 -25
- app/code/community/OnePica/AvaTax/Model/Records/Queue.php +130 -70
- app/code/community/OnePica/AvaTax/Model/Records/Queue/Process.php +210 -143
- app/code/community/OnePica/AvaTax/Model/Sales/Quote/Address.php +221 -203
- app/code/community/OnePica/AvaTax/Model/Sales/Quote/Address/Total/Grand.php +29 -13
- app/code/community/OnePica/AvaTax/Model/Sales/Quote/Address/Total/Tax.php +168 -140
- app/code/community/OnePica/AvaTax/Model/Session.php +36 -27
- app/code/community/OnePica/AvaTax/Model/Source/Actions.php +40 -30
- app/code/community/OnePica/AvaTax/Model/Source/Addressvalidation.php +37 -17
- app/code/community/OnePica/AvaTax/Model/Source/Customercodeformat.php +64 -44
- app/code/community/OnePica/AvaTax/Model/Source/Error.php +45 -37
- app/code/community/OnePica/AvaTax/Model/Source/Fieldlist.php +25 -21
- app/code/community/OnePica/AvaTax/Model/Source/Logmode.php +64 -44
- app/code/community/OnePica/AvaTax/Model/Source/Logtype.php +55 -27
- app/code/community/OnePica/AvaTax/Model/Source/Onerrorfrontend.php +39 -24
- app/code/community/OnePica/AvaTax/Model/Source/Regionfilter/List.php +39 -23
- app/code/community/OnePica/AvaTax/Model/Source/Regionfilter/Mode.php +49 -40
- app/code/community/OnePica/AvaTax/Model/Tax/Config.php +42 -0
- app/code/community/OnePica/AvaTax/controllers/.DS_Store +0 -0
- app/code/community/OnePica/AvaTax/controllers/Adminhtml/ExportController.php +90 -52
- app/code/community/OnePica/AvaTax/controllers/Adminhtml/GridController.php +137 -93
- app/code/community/OnePica/AvaTax/controllers/CartController.php +0 -35
- app/code/community/OnePica/AvaTax/{controllers/OnepageController.php → data/avatax_records_setup/data-upgrade-2.2.0-2.2.1.php} +15 -16
- app/code/community/OnePica/AvaTax/etc/adminhtml.xml +68 -69
- app/code/community/OnePica/AvaTax/etc/config.xml +336 -324
- app/code/community/OnePica/AvaTax/etc/system-disabled.xml +90 -91
- app/code/community/OnePica/AvaTax/etc/system.xml +522 -523
- app/code/community/OnePica/AvaTax/lib/AvaTax.php +1 -6
- app/code/community/OnePica/AvaTax/lib/classes/ATConfig.class.php +0 -4
- app/code/community/OnePica/AvaTax/lib/classes/ATObject.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/AVObject.class.php +0 -0
- app/code/community/OnePica/AvaTax/lib/classes/Address.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/AddressServiceSoap.class.php +0 -4
- app/code/community/OnePica/AvaTax/lib/classes/AddressType.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/AdjustTaxRequest.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/AdjustTaxResult.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/ApplyPaymentRequest.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/ApplyPaymentResult.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/AvalaraSoapClient.class.php +0 -4
- app/code/community/OnePica/AvaTax/lib/classes/BaseResult.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/AuditMessage.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/AvaTaxBatchSvc.php +1 -4
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BaseResult.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/Batch.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchDelete.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchDeleteResponse.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchFetch.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchFetchResponse.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchFetchResult.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchFile.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchFileDelete.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchFileDeleteResponse.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchFileFetch.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchFileFetchResponse.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchFileFetchResult.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchFileSave.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchFileSaveResponse.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchFileSaveResult.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchProcess.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchProcessRequest.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchProcessResponse.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchProcessResult.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchSave.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchSaveResponse.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchSaveResult.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchSvc.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/DeleteRequest.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/DeleteResult.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/FetchRequest.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/FilterRequest.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/FilterResult.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/IsAuthorized.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/IsAuthorizedResponse.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/IsAuthorizedResult.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/Message.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/Ping.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/PingResponse.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/PingResult.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/Profile.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/SeverityLevel.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/BoundaryLevel.class.php +1 -4
- app/code/community/OnePica/AvaTax/lib/classes/CancelCode.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/CancelTaxRequest.class.php +1 -7
- app/code/community/OnePica/AvaTax/lib/classes/CancelTaxResult.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/CommitTaxRequest.class.php +1 -4
- app/code/community/OnePica/AvaTax/lib/classes/CommitTaxResult.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/DetailLevel.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/DocStatus.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/DocumentType.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/DynamicSoapClient.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/Enum.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/GetTaxHistoryRequest.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/GetTaxHistoryResult.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/GetTaxRequest.class.php +12 -14
- app/code/community/OnePica/AvaTax/lib/classes/GetTaxResult.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/IsAuthorizedResult.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/JurisdictionType.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/Line.class.php +12 -15
- app/code/community/OnePica/AvaTax/lib/classes/Message.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/PingResult.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/PostTaxRequest.class.php +1 -6
- app/code/community/OnePica/AvaTax/lib/classes/PostTaxResult.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/ReconcileTaxHistoryRequest.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/ReconcileTaxHistoryResult.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/SearchTaxHistoryResult.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/ServiceMode.class.php +1 -2
- app/code/community/OnePica/AvaTax/lib/classes/SeverityLevel.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/TaxDetail.class.php +1 -7
- app/code/community/OnePica/AvaTax/lib/classes/TaxLine.class.php +1 -2
- app/code/community/OnePica/AvaTax/lib/classes/TaxOverride.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/TaxOverrideType.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/TaxRequest.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/TaxServiceSoap.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/TaxType.class.php +1 -5
- app/code/community/OnePica/AvaTax/lib/classes/TextCase.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/ValidAddress.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/ValidateRequest.class.php +0 -2
- app/code/community/OnePica/AvaTax/lib/classes/ValidateResult.class.php +1 -3
- app/code/community/OnePica/AvaTax/lib/classes/wsdl/Address.wsdl +0 -0
- app/code/community/OnePica/AvaTax/lib/classes/wsdl/BatchSvc.wsdl +0 -0
- app/code/community/OnePica/AvaTax/lib/classes/wsdl/Tax.wsdl +0 -0
- app/code/community/OnePica/AvaTax/lib/functions.php +0 -0
- app/code/community/OnePica/AvaTax/sql/avatax_records_setup/mysql4-install-0.1.0.php +37 -33
- app/code/community/OnePica/AvaTax/sql/avatax_records_setup/mysql4-upgrade-0.1.4-0.1.5.php +81 -34
- app/code/community/OnePica/AvaTax/sql/avatax_records_setup/mysql4-upgrade-1.0.1-2.0.0.php +122 -37
- app/code/community/OnePica/AvaTax/sql/avatax_records_setup/mysql4-upgrade-2.5.0.0-2.5.0.1.php +306 -0
- app/design/adminhtml/default/default/layout/avatax.xml +0 -14
- app/design/adminhtml/default/default/layout/onepica/avatax.xml +43 -0
- app/design/adminhtml/default/default/template/{avatax → onepica/avatax}/log/view.phtml +6 -8
- app/design/adminhtml/default/default/template/onepica/avatax/notification/toolbar.phtml +34 -0
- app/design/frontend/base/default/layout/avatax.xml +0 -12
- app/design/frontend/base/default/layout/onepica/avatax.xml +29 -0
- app/etc/modules/OnePica_AvaTax.xml +23 -6
- app/locale/de_DE/OnePica_AvaTax.csv +13 -0
- app/locale/en_US/OnePica_AvaTax.csv +13 -0
- app/locale/es_ES/OnePica_AvaTax.csv +13 -0
- app/locale/fr_FR/OnePica_AvaTax.csv +13 -0
- app/locale/nl_NL/OnePica_AvaTax.csv +13 -0
- app/locale/pt_BR/OnePica_AvaTax.csv +13 -0
- app/locale/zh_CN/OnePica_AvaTax.csv +13 -0
- package.xml +18 -11
app/code/community/OnePica/AvaTax/.DS_Store
DELETED
Binary file
|
app/code/community/OnePica/AvaTax/Block/Adminhtml/Export/Abstract/Grid.php
CHANGED
@@ -1,113 +1,68 @@
|
|
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 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
$this->getCollection()->getSelect()->limit();
|
70 |
-
$this->getCollection()->setPageSize(0);
|
71 |
-
$this->getCollection()->load();
|
72 |
-
$this->_afterLoadCollection();
|
73 |
-
|
74 |
-
$columns = array();
|
75 |
-
foreach ($this->_columns as $column) {
|
76 |
-
if (!$column->getIsSystem()) {
|
77 |
-
$columns[] = $column->getIndex();
|
78 |
-
}
|
79 |
-
}
|
80 |
-
|
81 |
-
$resourceModel = $this->getCollection()->getResource();
|
82 |
-
$adapter = $resourceModel->getReadConnection();
|
83 |
-
$version = Mage::getResourceModel('core/resource')->getDbVersion('avatax_records_setup');
|
84 |
-
$stores = count(Mage::app()->getStores());
|
85 |
-
|
86 |
-
$sql = '-- ' . strtoupper($resourceModel->getMainTable()) . " EXPORT\n";
|
87 |
-
$sql .= '-- Created at: ' . gmdate(DATE_W3C) . "\n";
|
88 |
-
$sql .= '-- Created by: ' . Mage::getUrl('/') . "\n";
|
89 |
-
$sql .= '-- Magento v' . Mage::getVersion() . ' // OP_AvaTax v' . $version . ' // Stores: ' . $stores . "\n";
|
90 |
-
$sql .= '-- Total rows: ' . $this->getCollection()->count() . "\n\n";
|
91 |
-
|
92 |
-
$rows = array();
|
93 |
-
foreach ($this->getCollection() as $item) {
|
94 |
-
$values = array();
|
95 |
-
foreach($columns as $column) {
|
96 |
-
$values[] = $adapter->quote($item->getData($column));
|
97 |
-
}
|
98 |
-
$rows[] = "(" . implode(", ", $values) . ")";
|
99 |
-
}
|
100 |
-
|
101 |
-
$chunks = array_chunk($rows, 50);
|
102 |
-
unset($rows);
|
103 |
-
|
104 |
-
foreach($chunks as $chunk) {
|
105 |
-
$sql .= 'INSERT INTO `' . $resourceModel->getMainTable() . '` (`' . implode('`, `', $columns) . '`) VALUES ';
|
106 |
-
$sql .= "\n" . implode(",\n", $chunk);
|
107 |
-
$sql .= ";\n\n";
|
108 |
-
}
|
109 |
-
|
110 |
-
return $sql;
|
111 |
-
}
|
112 |
-
|
113 |
-
}
|
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 |
+
* Avatax admin abstract grid
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
abstract class OnePica_AvaTax_Block_Adminhtml_Export_Abstract_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Constructor: sets grid id and sort order
|
29 |
+
*/
|
30 |
+
public function __construct()
|
31 |
+
{
|
32 |
+
parent::__construct();
|
33 |
+
$this->setId('export_grid');
|
34 |
+
$this->setDefaultDir('DESC');
|
35 |
+
$this->setSaveParametersInSession(false);
|
36 |
+
|
37 |
+
$url = Mage::helper('avatax')->getDocumentationUrl();
|
38 |
+
Mage::helper('adminhtml')->setPageHelpUrl($url);
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Mass adds columns based on passed in array
|
43 |
+
*
|
44 |
+
* @param array $columns array(columnName => dataType)
|
45 |
+
* @return $this
|
46 |
+
* @throws Exception
|
47 |
+
*/
|
48 |
+
protected function _addColumns($columns)
|
49 |
+
{
|
50 |
+
foreach ($columns as $name => $type) {
|
51 |
+
if (is_array($type)) {
|
52 |
+
$this->addColumn($name, array(
|
53 |
+
'header' => Mage::helper('avatax')->__(ucwords(str_replace('_', ' ', $name))),
|
54 |
+
'index' => $name,
|
55 |
+
'type' => 'options',
|
56 |
+
'options' => $type
|
57 |
+
));
|
58 |
+
} else {
|
59 |
+
$this->addColumn($name, array(
|
60 |
+
'header' => Mage::helper('avatax')->__(ucwords(str_replace('_', ' ', $name))),
|
61 |
+
'index' => $name,
|
62 |
+
'type' => $type
|
63 |
+
));
|
64 |
+
}
|
65 |
+
}
|
66 |
+
return $this;
|
67 |
+
}
|
68 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/OnePica/AvaTax/Block/Adminhtml/Export/Log/Grid.php
CHANGED
@@ -1,71 +1,79 @@
|
|
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 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* Admin log grid block
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Block_Adminhtml_Export_Log_Grid extends OnePica_AvaTax_Block_Adminhtml_Export_Abstract_Grid
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Construct: Sets default sort to id field
|
29 |
+
*/
|
30 |
+
public function __construct()
|
31 |
+
{
|
32 |
+
parent::__construct();
|
33 |
+
$this->setDefaultSort('log_id');
|
34 |
+
$this->setGridHeader(
|
35 |
+
'<h3 class="icon-head" style="background-image:url('
|
36 |
+
. $this->getSkinUrl('images/fam_application_view_tile.gif') . ');">'
|
37 |
+
. $this->__('AvaTax Action Log') . '</h3>'
|
38 |
+
);
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Adds columns to grid
|
43 |
+
*
|
44 |
+
* @return $this
|
45 |
+
*/
|
46 |
+
protected function _prepareColumns()
|
47 |
+
{
|
48 |
+
return $this->_addColumns(array(
|
49 |
+
'log_id' => 'number',
|
50 |
+
'store_id' => 'number',
|
51 |
+
'level' => Mage::getModel('avatax_records/log')->getLevelOptions(),
|
52 |
+
'type' => Mage::getModel('avatax_records/log')->getTypeOptions(),
|
53 |
+
'created_at' => 'datetime',
|
54 |
+
));
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Adds collection
|
59 |
+
*
|
60 |
+
* @return unknown
|
61 |
+
*/
|
62 |
+
protected function _prepareCollection()
|
63 |
+
{
|
64 |
+
$collection = Mage::getModel('avatax_records/log')->getCollection();
|
65 |
+
$this->setCollection($collection);
|
66 |
+
return parent::_prepareCollection();
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Get row url
|
71 |
+
*
|
72 |
+
* @param OnePica_AvaTax_Model_Records_Log $row
|
73 |
+
* @return string
|
74 |
+
*/
|
75 |
+
public function getRowUrl($row)
|
76 |
+
{
|
77 |
+
return $this->getUrl('*/*/logView', array('id' => $row->getId()));
|
78 |
+
}
|
79 |
+
}
|
app/code/community/OnePica/AvaTax/Block/Adminhtml/Export/Log/View.php
CHANGED
@@ -15,6 +15,13 @@
|
|
15 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
*/
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
class OnePica_AvaTax_Block_Adminhtml_Export_Log_View extends Mage_Adminhtml_Block_Widget_Container
|
19 |
{
|
20 |
/**
|
@@ -25,14 +32,13 @@ class OnePica_AvaTax_Block_Adminhtml_Export_Log_View extends Mage_Adminhtml_Bloc
|
|
25 |
protected $_currentEevent = null;
|
26 |
|
27 |
/**
|
28 |
-
* Add back button
|
29 |
-
*
|
30 |
*/
|
31 |
public function __construct()
|
32 |
{
|
33 |
parent::__construct();
|
34 |
-
|
35 |
-
|
36 |
'label' => Mage::helper('avatax')->__('Back'),
|
37 |
'onclick' => "setLocation('" . Mage::getSingleton('adminhtml/url')->getUrl('*/*/log'). "')",
|
38 |
'class' => 'back'
|
@@ -45,20 +51,22 @@ class OnePica_AvaTax_Block_Adminhtml_Export_Log_View extends Mage_Adminhtml_Bloc
|
|
45 |
* @return string
|
46 |
*/
|
47 |
public function getHeaderText()
|
48 |
-
{
|
49 |
if ($this->getCurrentEvent()) {
|
50 |
-
|
51 |
-
|
52 |
-
|
|
|
53 |
}
|
54 |
-
|
55 |
-
|
56 |
-
|
|
|
57 |
}
|
58 |
|
59 |
/**
|
60 |
* Get current event
|
61 |
-
|
62 |
* @return OnePica_AvaTax_Model_Event|null
|
63 |
*/
|
64 |
public function getCurrentEvent()
|
@@ -68,5 +76,4 @@ class OnePica_AvaTax_Block_Adminhtml_Export_Log_View extends Mage_Adminhtml_Bloc
|
|
68 |
}
|
69 |
return $this->_currentEevent;
|
70 |
}
|
71 |
-
|
72 |
-
}
|
15 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
*/
|
17 |
|
18 |
+
/**
|
19 |
+
* Admin html export detail view block
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
class OnePica_AvaTax_Block_Adminhtml_Export_Log_View extends Mage_Adminhtml_Block_Widget_Container
|
26 |
{
|
27 |
/**
|
32 |
protected $_currentEevent = null;
|
33 |
|
34 |
/**
|
35 |
+
* Construct: Add back button
|
|
|
36 |
*/
|
37 |
public function __construct()
|
38 |
{
|
39 |
parent::__construct();
|
40 |
+
|
41 |
+
$this->_addButton('back', array(
|
42 |
'label' => Mage::helper('avatax')->__('Back'),
|
43 |
'onclick' => "setLocation('" . Mage::getSingleton('adminhtml/url')->getUrl('*/*/log'). "')",
|
44 |
'class' => 'back'
|
51 |
* @return string
|
52 |
*/
|
53 |
public function getHeaderText()
|
54 |
+
{
|
55 |
if ($this->getCurrentEvent()) {
|
56 |
+
return '<h3 class="icon-head" style="background-image:url('
|
57 |
+
. $this->getSkinUrl('images/fam_application_view_tile.gif') . ');">'
|
58 |
+
. $this->__('AvaTax Action Log Entry #%d', $this->getCurrentEvent()->getId())
|
59 |
+
. '</h3>';
|
60 |
}
|
61 |
+
return '<h3 class="icon-head" style="background-image:url('
|
62 |
+
. $this->getSkinUrl('images/fam_application_view_tile.gif') . ');">'
|
63 |
+
. $this->__('AvaTax Action Log Entry Details')
|
64 |
+
. '</h3>';
|
65 |
}
|
66 |
|
67 |
/**
|
68 |
* Get current event
|
69 |
+
*
|
70 |
* @return OnePica_AvaTax_Model_Event|null
|
71 |
*/
|
72 |
public function getCurrentEvent()
|
76 |
}
|
77 |
return $this->_currentEevent;
|
78 |
}
|
79 |
+
}
|
|
app/code/community/OnePica/AvaTax/Block/Adminhtml/Export/Queue/Grid.php
CHANGED
@@ -1,79 +1,94 @@
|
|
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 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* Admin queue grid block
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Block_Adminhtml_Export_Queue_Grid extends OnePica_AvaTax_Block_Adminhtml_Export_Abstract_Grid
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Construct: Sets default sort to id field
|
29 |
+
*/
|
30 |
+
public function __construct()
|
31 |
+
{
|
32 |
+
parent::__construct();
|
33 |
+
$this->setDefaultSort('id');
|
34 |
+
$this->setGridHeader(
|
35 |
+
'<h3 class="icon-head" style="background-image:url('
|
36 |
+
. $this->getSkinUrl('images/fam_application_view_tile.gif') . ');">'
|
37 |
+
. $this->__('AvaTax Order Sync Queue')
|
38 |
+
. '</h3>'
|
39 |
+
);
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Adds custom buttons
|
44 |
+
*
|
45 |
+
* @return string
|
46 |
+
*/
|
47 |
+
public function getMainButtonsHtml()
|
48 |
+
{
|
49 |
+
$html = $this->getButtonHtml(
|
50 |
+
$this->__('Clear Queue Now'),
|
51 |
+
'setLocation(\'' . $this->getUrl('*/*/clearQueue') . '\')'
|
52 |
+
);
|
53 |
+
$html .= $this->getButtonHtml(
|
54 |
+
$this->__('Process Queue Now'),
|
55 |
+
'setLocation(\'' . $this->getUrl('*/*/processQueue') . '\')'
|
56 |
+
);
|
57 |
+
$html .= parent::getMainButtonsHtml();
|
58 |
+
return $html;
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Adds columns to grid
|
63 |
+
*
|
64 |
+
* @return $this
|
65 |
+
*/
|
66 |
+
protected function _prepareColumns()
|
67 |
+
{
|
68 |
+
return $this->_addColumns(array(
|
69 |
+
'queue_id' => 'number',
|
70 |
+
'store_id' => 'number',
|
71 |
+
'entity_id' => 'number',
|
72 |
+
'entity_increment_id' => 'number',
|
73 |
+
'type' => Mage::getModel('avatax/records_queue')->getTypeOptions(),
|
74 |
+
'status' => Mage::getModel('avatax/records_queue')->getStatusOptions(),
|
75 |
+
'attempt' => 'number',
|
76 |
+
'message' => 'default',
|
77 |
+
'created_at' => 'datetime',
|
78 |
+
'updated_at' => 'datetime'
|
79 |
+
));
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Adds collection
|
84 |
+
*
|
85 |
+
* @return $this
|
86 |
+
*/
|
87 |
+
protected function _prepareCollection()
|
88 |
+
{
|
89 |
+
/** @var OnePica_AvaTax_Model_Records_Mysql4_Queue_Collection $collection */
|
90 |
+
$collection = Mage::getModel('avatax_records/queue')->getCollection();
|
91 |
+
$this->setCollection($collection);
|
92 |
+
return parent::_prepareCollection();
|
93 |
+
}
|
94 |
+
}
|
app/code/community/OnePica/AvaTax/Block/Adminhtml/Notification/Toolbar.php
CHANGED
@@ -15,43 +15,65 @@
|
|
15 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
*/
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
class OnePica_AvaTax_Block_Adminhtml_Notification_Toolbar extends Mage_Adminhtml_Block_Notification_Toolbar
|
19 |
{
|
20 |
-
|
21 |
/**
|
22 |
* Count the number of pending_retry items in queue
|
23 |
*
|
24 |
* @return int
|
25 |
*/
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
/**
|
34 |
-
*
|
35 |
*
|
36 |
* @return string
|
37 |
*/
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
|
|
|
|
|
|
|
|
|
|
56 |
}
|
57 |
}
|
15 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
*/
|
17 |
|
18 |
+
/**
|
19 |
+
* Admin notification toolbar block
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
class OnePica_AvaTax_Block_Adminhtml_Notification_Toolbar extends Mage_Adminhtml_Block_Notification_Toolbar
|
26 |
{
|
|
|
27 |
/**
|
28 |
* Count the number of pending_retry items in queue
|
29 |
*
|
30 |
* @return int
|
31 |
*/
|
32 |
+
public function getQueuePendingRetryCount()
|
33 |
+
{
|
34 |
+
return Mage::getModel('avatax_records/queue')->getCollection()
|
35 |
+
->addFieldToFilter('status', OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_RETRY)
|
36 |
+
->load()
|
37 |
+
->count();
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Check if avatax is allowed
|
42 |
+
*
|
43 |
+
* @return bool
|
44 |
+
*/
|
45 |
+
public function isAllowed()
|
46 |
+
{
|
47 |
+
return Mage::getSingleton('admin/session')->isAllowed('avatax');
|
48 |
+
}
|
49 |
|
50 |
/**
|
51 |
+
* Get queue grid url
|
52 |
*
|
53 |
* @return string
|
54 |
*/
|
55 |
+
public function getQueueGridUrl()
|
56 |
+
{
|
57 |
+
return $this->getUrl('avatax/adminhtml_grid/queue');
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Check if avatax toolbar is enabled
|
62 |
+
*
|
63 |
+
* @return boolean
|
64 |
+
*/
|
65 |
+
public function isEnabled()
|
66 |
+
{
|
67 |
+
return Mage::getStoreConfigFlag('tax/avatax/error_notification_toolbar');
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Get Queue attempt max value
|
72 |
+
*
|
73 |
+
* @return int
|
74 |
+
*/
|
75 |
+
public function getQueueAttemptMaxValue()
|
76 |
+
{
|
77 |
+
return OnePica_AvaTax_Model_Config::QUEUE_ATTEMPT_MAX;
|
78 |
}
|
79 |
}
|
app/code/community/OnePica/AvaTax/Block/Adminhtml/System/Config/Form/Field/Export.php
CHANGED
@@ -15,22 +15,41 @@
|
|
15 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
*/
|
17 |
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
{
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
$params = array(
|
23 |
'website' => $buttonBlock->getRequest()->getParam('website')
|
24 |
);
|
25 |
|
26 |
$data1 = array(
|
27 |
'label' => Mage::helper('avatax')->__('Export Logs'),
|
28 |
-
'onclick' => 'setLocation(\''.Mage::helper('adminhtml')->getUrl("avatax/adminhtml_export/log", $params)
|
|
|
29 |
'class' => '',
|
30 |
);
|
31 |
$data2 = array(
|
32 |
'label' => Mage::helper('avatax')->__('Export Queue'),
|
33 |
-
'onclick' => 'setLocation(\''
|
|
|
|
|
34 |
'class' => '',
|
35 |
);
|
36 |
|
@@ -38,5 +57,5 @@ class OnePica_AvaTax_Block_Adminhtml_System_Config_Form_Field_Export extends Mag
|
|
38 |
$html .= $buttonBlock->setData($data2)->toHtml();
|
39 |
|
40 |
return $html;
|
41 |
-
|
42 |
}
|
15 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
*/
|
17 |
|
18 |
+
/**
|
19 |
+
* Config form field export block
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Block_Adminhtml_System_Config_Form_Field_Export
|
26 |
+
extends Mage_Adminhtml_Block_System_Config_Form_Field
|
27 |
{
|
28 |
+
/**
|
29 |
+
* Get element html
|
30 |
+
*
|
31 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
32 |
+
* @return string
|
33 |
+
* @throws Exception
|
34 |
+
*/
|
35 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
36 |
+
{
|
37 |
+
$buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button');
|
38 |
$params = array(
|
39 |
'website' => $buttonBlock->getRequest()->getParam('website')
|
40 |
);
|
41 |
|
42 |
$data1 = array(
|
43 |
'label' => Mage::helper('avatax')->__('Export Logs'),
|
44 |
+
'onclick' => 'setLocation(\'' . Mage::helper('adminhtml')->getUrl("avatax/adminhtml_export/log", $params)
|
45 |
+
. '\')',
|
46 |
'class' => '',
|
47 |
);
|
48 |
$data2 = array(
|
49 |
'label' => Mage::helper('avatax')->__('Export Queue'),
|
50 |
+
'onclick' => 'setLocation(\''
|
51 |
+
. Mage::helper('adminhtml')->getUrl("avatax/adminhtml_export/queue", $params)
|
52 |
+
. '\')',
|
53 |
'class' => '',
|
54 |
);
|
55 |
|
57 |
$html .= $buttonBlock->setData($data2)->toHtml();
|
58 |
|
59 |
return $html;
|
60 |
+
}
|
61 |
}
|
app/code/community/OnePica/AvaTax/Block/Adminhtml/Tax/Class/Edit/Form.php
CHANGED
@@ -1,30 +1,39 @@
|
|
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 |
class OnePica_AvaTax_Block_Adminhtml_Tax_Class_Edit_Form extends Mage_Adminhtml_Block_Tax_Class_Edit_Form
|
20 |
{
|
21 |
-
|
|
|
|
|
|
|
|
|
22 |
protected function _prepareForm()
|
23 |
-
{
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
$model = Mage::registry('tax_class');
|
28 |
$fieldset->addField('op_avatax_code', 'text',
|
29 |
array(
|
30 |
'name' => 'op_avatax_code',
|
@@ -35,4 +44,4 @@ class OnePica_AvaTax_Block_Adminhtml_Tax_Class_Edit_Form extends Mage_Adminhtml_
|
|
35 |
|
36 |
return $this;
|
37 |
}
|
38 |
-
}
|
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 |
+
* Admin tax edit form block
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
class OnePica_AvaTax_Block_Adminhtml_Tax_Class_Edit_Form extends Mage_Adminhtml_Block_Tax_Class_Edit_Form
|
26 |
{
|
27 |
+
/**
|
28 |
+
* Prepare form
|
29 |
+
*
|
30 |
+
* @return $this|Mage_Adminhtml_Block_Widget_Form
|
31 |
+
*/
|
32 |
protected function _prepareForm()
|
33 |
+
{
|
34 |
+
parent::_prepareForm();
|
35 |
+
$fieldset = $this->getForm()->getElement('base_fieldset');
|
36 |
+
$model = Mage::registry('tax_class');
|
|
|
37 |
$fieldset->addField('op_avatax_code', 'text',
|
38 |
array(
|
39 |
'name' => 'op_avatax_code',
|
44 |
|
45 |
return $this;
|
46 |
}
|
47 |
+
}
|
app/code/community/OnePica/AvaTax/Block/Adminhtml/Tax/Class/Grid.php
CHANGED
@@ -1,46 +1,56 @@
|
|
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 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* Admin tax grid
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Block_Adminhtml_Tax_Class_Grid extends Mage_Adminhtml_Block_Tax_Class_Grid
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Construct: Set the help url
|
29 |
+
*/
|
30 |
+
public function __construct()
|
31 |
+
{
|
32 |
+
$url = Mage::helper('avatax')->getDocumentationUrl();
|
33 |
+
Mage::helper('adminhtml')->setPageHelpUrl($url);
|
34 |
+
return parent::__construct();
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Prepare columns
|
39 |
+
*
|
40 |
+
* @return $this
|
41 |
+
* @throws Exception
|
42 |
+
*/
|
43 |
+
protected function _prepareColumns()
|
44 |
+
{
|
45 |
+
$this->addColumn('op_avatax_code',
|
46 |
+
array(
|
47 |
+
'header' => Mage::helper('avatax')->__('AvaTax Code'),
|
48 |
+
'align' => 'left',
|
49 |
+
'index' => 'op_avatax_code',
|
50 |
+
'width' => '175px'
|
51 |
+
)
|
52 |
+
);
|
53 |
+
|
54 |
+
return parent::_prepareColumns();
|
55 |
+
}
|
56 |
+
}
|
app/code/community/OnePica/AvaTax/Block/Checkout/Onepage/Shipping/Method/Available.php
CHANGED
@@ -1,78 +1,106 @@
|
|
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 |
-
* The Onepage Shipping Method Available block
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
*
|
36 |
-
*
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
*
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* The Onepage Shipping Method Available block
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Block_Checkout_Onepage_Shipping_Method_Available extends Mage_Core_Block_Abstract
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Quote address
|
29 |
+
*
|
30 |
+
* @var Mage_Sales_Model_Quote_Address
|
31 |
+
*/
|
32 |
+
protected $_address;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Checkout session
|
36 |
+
*
|
37 |
+
* @var Mage_Checkout_Model_Session
|
38 |
+
*/
|
39 |
+
protected $_checkout;
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Sales quote
|
43 |
+
*
|
44 |
+
* @var Mage_Sales_Model_Quote
|
45 |
+
*/
|
46 |
+
protected $_quote;
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Get quote address
|
50 |
+
*
|
51 |
+
* @return Mage_Sales_Model_Quote_Address
|
52 |
+
*/
|
53 |
+
public function getAddress()
|
54 |
+
{
|
55 |
+
if (empty($this->_address)) {
|
56 |
+
$this->_address = $this->getQuote()->getShippingAddress();
|
57 |
+
}
|
58 |
+
return $this->_address;
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Retrieve checkout session model
|
63 |
+
*
|
64 |
+
* @return Mage_Checkout_Model_Session
|
65 |
+
*/
|
66 |
+
public function getCheckout()
|
67 |
+
{
|
68 |
+
if (empty($this->_checkout)) {
|
69 |
+
$this->_checkout = Mage::getSingleton('checkout/session');
|
70 |
+
}
|
71 |
+
return $this->_checkout;
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Retrieve sales quote model
|
76 |
+
*
|
77 |
+
* @return Mage_Sales_Model_Quote
|
78 |
+
*/
|
79 |
+
public function getQuote()
|
80 |
+
{
|
81 |
+
if (empty($this->_quote)) {
|
82 |
+
$this->_quote = $this->getCheckout()->getQuote();
|
83 |
+
}
|
84 |
+
return $this->_quote;
|
85 |
+
}
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Overriding parent to insert session message block if an address has been validated.
|
89 |
+
*
|
90 |
+
* @return string
|
91 |
+
*/
|
92 |
+
protected function _toHtml ()
|
93 |
+
{
|
94 |
+
$additional = parent::_toHtml();
|
95 |
+
if ($this->getAddress()->getAddressNormalized()) {
|
96 |
+
$notice = Mage::getSingleton('avatax/config')->getConfig('onepage_normalize_message');
|
97 |
+
if ($notice) {
|
98 |
+
Mage::getSingleton('core/session')->addNotice($notice);
|
99 |
+
$additional .= $this->getMessagesBlock()->getGroupedHtml();
|
100 |
+
}
|
101 |
+
} elseif ($this->getAddress()->getAddressNotified()) {
|
102 |
+
$additional .= $this->getMessagesBlock()->getGroupedHtml();
|
103 |
+
}
|
104 |
+
return $additional;
|
105 |
+
}
|
106 |
+
}
|
app/code/community/OnePica/AvaTax/Helper/Data.php
CHANGED
@@ -1,416 +1,495 @@
|
|
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 |
-
* The base AvaTax Helper class
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
public function
|
183 |
-
{
|
184 |
-
return $this->_getConfig('
|
185 |
-
}
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
public function
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* The base AvaTax Helper class
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Helper_Data extends Mage_Core_Helper_Abstract
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Identifier for error message
|
29 |
+
*/
|
30 |
+
const CALCULATE_ERROR_MESSAGE_IDENTIFIER = 'avatax_calculate_error';
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Check if avatax extension is enabled
|
34 |
+
*
|
35 |
+
* @param null|bool|int|Mage_Core_Model_Store $store $store
|
36 |
+
* @return bool
|
37 |
+
*/
|
38 |
+
public function isAvataxEnabled($store = null)
|
39 |
+
{
|
40 |
+
return ($this->_getConfig('action', $store) != OnePica_AvaTax_Model_Config::ACTION_DISABLE);
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Gets the documenation url
|
45 |
+
*
|
46 |
+
* @return string
|
47 |
+
*/
|
48 |
+
public function getDocumentationUrl()
|
49 |
+
{
|
50 |
+
return 'http://www.onepica.com/magento-extensions/avatax/';
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Loads a class from the AvaTax library.
|
55 |
+
*
|
56 |
+
* @param string $className
|
57 |
+
* @return OnePica_AvaTax_Helper_Data
|
58 |
+
*/
|
59 |
+
public function loadClass($className)
|
60 |
+
{
|
61 |
+
require_once $this->getLibPath() . DS . 'classes' . DS . $className . '.class.php';
|
62 |
+
return $this;
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Loads an array of AvaTax classes.
|
67 |
+
*
|
68 |
+
* @param array $classes
|
69 |
+
* @return OnePica_AvaTax_Helper_Data
|
70 |
+
*/
|
71 |
+
public function loadClasses(array $classes)
|
72 |
+
{
|
73 |
+
foreach ($classes as $class) {
|
74 |
+
$this->loadClass($class);
|
75 |
+
}
|
76 |
+
return $this;
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Load functions required to work with Avalara API
|
81 |
+
*
|
82 |
+
* @return $this
|
83 |
+
*/
|
84 |
+
public function loadFunctions()
|
85 |
+
{
|
86 |
+
require_once $this->getLibPath() . DS . 'functions.php';
|
87 |
+
return $this;
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Returns the path to the etc directory.
|
92 |
+
*
|
93 |
+
* @return string
|
94 |
+
*/
|
95 |
+
public function getEtcPath ()
|
96 |
+
{
|
97 |
+
return dirname(dirname(__FILE__)) . DS . 'etc';
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Returns the path to the AvaTax SDK lib directory.
|
102 |
+
*
|
103 |
+
* @return string
|
104 |
+
*/
|
105 |
+
public function getLibPath ()
|
106 |
+
{
|
107 |
+
return Mage::getModuleDir('', 'OnePica_AvaTax') . DS . 'lib';
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Returns the path to the AvaTax SDK WSDL directory.
|
112 |
+
*
|
113 |
+
* @return string
|
114 |
+
*/
|
115 |
+
public function getWsdlPath ()
|
116 |
+
{
|
117 |
+
return $this->getLibPath() . DS . 'wsdl';
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* Returns a config value from the admin.
|
122 |
+
*
|
123 |
+
* @param string $path
|
124 |
+
* @param null|bool|int|Mage_Core_Model_Store $store
|
125 |
+
* @return string
|
126 |
+
*/
|
127 |
+
protected function _getConfig ($path, $store = null)
|
128 |
+
{
|
129 |
+
return Mage::getSingleton('avatax/config')->getConfig($path, $store);
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Returns the logging level
|
134 |
+
*
|
135 |
+
* @param null|bool|int|Mage_Core_Model_Store $store
|
136 |
+
* @return int
|
137 |
+
*/
|
138 |
+
public function getLogMode($store = null)
|
139 |
+
{
|
140 |
+
return $this->_getConfig('log_status', $store);
|
141 |
+
}
|
142 |
+
|
143 |
+
/**
|
144 |
+
* Returns the logging type
|
145 |
+
*
|
146 |
+
* @param null|bool|int|Mage_Core_Model_Store $store
|
147 |
+
* @return string
|
148 |
+
*/
|
149 |
+
public function getLogType($store = null)
|
150 |
+
{
|
151 |
+
return explode(",", $this->_getConfig('log_type_list', $store));
|
152 |
+
}
|
153 |
+
|
154 |
+
/**
|
155 |
+
* Returns shipping line item faked sku
|
156 |
+
*
|
157 |
+
* @param null|bool|int|Mage_Core_Model_Store $store
|
158 |
+
* @return string
|
159 |
+
*/
|
160 |
+
public function getShippingSku($store = null)
|
161 |
+
{
|
162 |
+
return $this->_getConfig('shipping_sku', $store);
|
163 |
+
}
|
164 |
+
|
165 |
+
/**
|
166 |
+
* Returns giftwraporder line item faked sku
|
167 |
+
*
|
168 |
+
* @param null|bool|int|Mage_Core_Model_Store $store
|
169 |
+
* @return string
|
170 |
+
*/
|
171 |
+
public function getGwOrderSku($store = null)
|
172 |
+
{
|
173 |
+
return $this->_getConfig('gw_order_sku', $store);
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
* Returns giftwrapitems line item faked sku
|
178 |
+
*
|
179 |
+
* @param null|bool|int|Mage_Core_Model_Store $store
|
180 |
+
* @return string
|
181 |
+
*/
|
182 |
+
public function getGwItemsSku($store = null)
|
183 |
+
{
|
184 |
+
return $this->_getConfig('gw_items_sku', $store);
|
185 |
+
}
|
186 |
+
|
187 |
+
/**
|
188 |
+
* Returns giftwrapprintedcard line item faked sku
|
189 |
+
*
|
190 |
+
* @param null|bool|int|Mage_Core_Model_Store $store
|
191 |
+
* @return string
|
192 |
+
*/
|
193 |
+
public function getGwPrintedCardSku($store = null)
|
194 |
+
{
|
195 |
+
return $this->_getConfig('gw_printed_card_sku', $store);
|
196 |
+
}
|
197 |
+
|
198 |
+
/**
|
199 |
+
* Returns shipping line item faked sku
|
200 |
+
*
|
201 |
+
* @param null|bool|int|Mage_Core_Model_Store $store
|
202 |
+
* @return string
|
203 |
+
*/
|
204 |
+
public function getSalesPersonCode($store = null)
|
205 |
+
{
|
206 |
+
return $this->_getConfig('sales_person_code', $store);
|
207 |
+
}
|
208 |
+
|
209 |
+
/**
|
210 |
+
* Returns attribute code for the location code to send to Avalara
|
211 |
+
*
|
212 |
+
* @param null|bool|int|Mage_Core_Model_Store $store
|
213 |
+
* @return string
|
214 |
+
*/
|
215 |
+
public function getLocationCode($store = null)
|
216 |
+
{
|
217 |
+
return $this->_getConfig('location_code', $store);
|
218 |
+
}
|
219 |
+
|
220 |
+
/**
|
221 |
+
* Returns attribute code for the reference code 1 to send to Avalara
|
222 |
+
*
|
223 |
+
* @param null|bool|int|Mage_Core_Model_Store $store
|
224 |
+
* @return string
|
225 |
+
*/
|
226 |
+
public function getRef1AttributeCode($store = null)
|
227 |
+
{
|
228 |
+
return $this->_getConfig('line_ref1_code', $store);
|
229 |
+
}
|
230 |
+
|
231 |
+
/**
|
232 |
+
* Returns attribute code for the reference code 2 to send to Avalara
|
233 |
+
*
|
234 |
+
* @param null|bool|int|Mage_Core_Model_Store $store
|
235 |
+
* @return string
|
236 |
+
*/
|
237 |
+
public function getRef2AttributeCode($store = null)
|
238 |
+
{
|
239 |
+
return $this->_getConfig('line_ref2_code', $store);
|
240 |
+
}
|
241 |
+
|
242 |
+
/**
|
243 |
+
* Returns the positive adjustment identifier to send to Avalara
|
244 |
+
*
|
245 |
+
* @param null|bool|int|Mage_Core_Model_Store $store
|
246 |
+
* @return string
|
247 |
+
*/
|
248 |
+
public function getPositiveAdjustmentSku($store = null)
|
249 |
+
{
|
250 |
+
return $this->_getConfig('adjustment_positive_sku', $store);
|
251 |
+
}
|
252 |
+
|
253 |
+
/**
|
254 |
+
* Returns the negative adjustment identifier to send to Avalara
|
255 |
+
*
|
256 |
+
* @param null|bool|int|Mage_Core_Model_Store $store
|
257 |
+
* @return string
|
258 |
+
*/
|
259 |
+
public function getNegativeAdjustmentSku($store = null)
|
260 |
+
{
|
261 |
+
return $this->_getConfig('adjustment_negative_sku', $store);
|
262 |
+
}
|
263 |
+
|
264 |
+
/**
|
265 |
+
* Returns the required field list
|
266 |
+
*
|
267 |
+
* @param null|bool|int|Mage_Core_Model_Store $store
|
268 |
+
* @return string
|
269 |
+
*/
|
270 |
+
public function getFieldRequiredList($store = null)
|
271 |
+
{
|
272 |
+
return $this->_getConfig('field_required_list', $store);
|
273 |
+
}
|
274 |
+
|
275 |
+
/**
|
276 |
+
* Returns the rules for field
|
277 |
+
*
|
278 |
+
* @param null|bool|int|Mage_Core_Model_Store $store
|
279 |
+
* @return string
|
280 |
+
*/
|
281 |
+
public function getFieldRule($store = null)
|
282 |
+
{
|
283 |
+
return $this->_getConfig('field_rule', $store);
|
284 |
+
}
|
285 |
+
|
286 |
+
/**
|
287 |
+
* Returns full stop on error
|
288 |
+
*
|
289 |
+
* @param null|bool|int|Mage_Core_Model_Store $store
|
290 |
+
* @return bool
|
291 |
+
*/
|
292 |
+
public function fullStopOnError($store = null)
|
293 |
+
{
|
294 |
+
return (bool)$this->_getConfig('error_full_stop', $store);
|
295 |
+
}
|
296 |
+
|
297 |
+
/**
|
298 |
+
* Adds error message if there is an error
|
299 |
+
*
|
300 |
+
* @param null|bool|int|Mage_Core_Model_Store $store
|
301 |
+
* @return string
|
302 |
+
*/
|
303 |
+
public function addErrorMessage($store = null)
|
304 |
+
{
|
305 |
+
$message = $this->getErrorMessage($store);
|
306 |
+
if (Mage::app()->getStore()->isAdmin()) {
|
307 |
+
/** @var Mage_Adminhtml_Model_Session_Quote $session */
|
308 |
+
$session = Mage::getSingleton('adminhtml/session_quote');
|
309 |
+
} else {
|
310 |
+
/** @var Mage_Checkout_Model_Session $session */
|
311 |
+
$session = Mage::getSingleton('checkout/session');
|
312 |
+
}
|
313 |
+
|
314 |
+
$messages = $session->getMessages();
|
315 |
+
if (!$messages->getMessageByIdentifier(self::CALCULATE_ERROR_MESSAGE_IDENTIFIER)) {
|
316 |
+
/** @var Mage_Core_Model_Message_Error $error */
|
317 |
+
$error = Mage::getSingleton('core/message')->error($message);
|
318 |
+
$error->setIdentifier(self::CALCULATE_ERROR_MESSAGE_IDENTIFIER);
|
319 |
+
$session->addMessage($error);
|
320 |
+
}
|
321 |
+
return $message;
|
322 |
+
}
|
323 |
+
|
324 |
+
/**
|
325 |
+
* Remove error message
|
326 |
+
*
|
327 |
+
* @return $this
|
328 |
+
*/
|
329 |
+
public function removeErrorMessage()
|
330 |
+
{
|
331 |
+
if (Mage::app()->getStore()->isAdmin()) {
|
332 |
+
/** @var Mage_Adminhtml_Model_Session_Quote $session */
|
333 |
+
$session = Mage::getSingleton('adminhtml/session_quote');
|
334 |
+
} else {
|
335 |
+
/** @var Mage_Checkout_Model_Session $session */
|
336 |
+
$session = Mage::getSingleton('checkout/session');
|
337 |
+
}
|
338 |
+
/** @var Mage_Core_Model_Message_Collection $messages */
|
339 |
+
$messages = $session->getMessages();
|
340 |
+
$messages->deleteMessageByIdentifier(self::CALCULATE_ERROR_MESSAGE_IDENTIFIER);
|
341 |
+
return $this;
|
342 |
+
}
|
343 |
+
|
344 |
+
/**
|
345 |
+
* Gets error message
|
346 |
+
*
|
347 |
+
* @param null|bool|int|Mage_Core_Model_Store $store
|
348 |
+
* @return string
|
349 |
+
*/
|
350 |
+
public function getErrorMessage($store = null)
|
351 |
+
{
|
352 |
+
if (Mage::app()->getStore()->isAdmin()) {
|
353 |
+
return $this->_getConfig('error_backend_message', $store);
|
354 |
+
} else {
|
355 |
+
return $this->_getConfig('error_frontend_message', $store);
|
356 |
+
}
|
357 |
+
}
|
358 |
+
|
359 |
+
/**
|
360 |
+
* Does any store have this extension disabled?
|
361 |
+
*
|
362 |
+
* @return bool
|
363 |
+
*/
|
364 |
+
public function isAnyStoreDisabled()
|
365 |
+
{
|
366 |
+
$disabled = false;
|
367 |
+
$storeCollection = Mage::app()->getStores();
|
368 |
+
|
369 |
+
foreach ($storeCollection as $store) {
|
370 |
+
//@startSkipCommitHooks
|
371 |
+
$disabled |= Mage::getStoreConfig('tax/avatax/action', $store->getId()) == OnePica_AvaTax_Model_Config::ACTION_DISABLE;
|
372 |
+
//@finishSkipCommitHooks
|
373 |
+
}
|
374 |
+
|
375 |
+
return $disabled;
|
376 |
+
}
|
377 |
+
|
378 |
+
/**
|
379 |
+
* Determines if address validation is enabled
|
380 |
+
*
|
381 |
+
* @param Mage_Customer_Model_Address $address
|
382 |
+
* @param int $storeId
|
383 |
+
* @return bool
|
384 |
+
*/
|
385 |
+
public function isAddressValidationOn($address, $storeId)
|
386 |
+
{
|
387 |
+
if (!$this->isAddressActionable($address, $storeId)) {
|
388 |
+
return false;
|
389 |
+
}
|
390 |
+
return Mage::getStoreConfig('tax/avatax/validate_address', $storeId);
|
391 |
+
}
|
392 |
+
|
393 |
+
/**
|
394 |
+
* Determines if address normalization is enabled
|
395 |
+
*
|
396 |
+
* @param Mage_Customer_Model_Address $address
|
397 |
+
* @param int $storeId
|
398 |
+
* @return bool
|
399 |
+
*/
|
400 |
+
public function isAddressNormalizationOn($address, $storeId)
|
401 |
+
{
|
402 |
+
if (!$this->isAddressActionable($address, $storeId)) {
|
403 |
+
return false;
|
404 |
+
}
|
405 |
+
return Mage::getStoreConfig('tax/avatax/normalize_address', $storeId);
|
406 |
+
}
|
407 |
+
|
408 |
+
/**
|
409 |
+
* Determines if the address should be filtered
|
410 |
+
*
|
411 |
+
* @param Mage_Customer_Model_Address
|
412 |
+
* @param int $storeId
|
413 |
+
* @param int $filterMode
|
414 |
+
* @return bool
|
415 |
+
*/
|
416 |
+
public function isAddressActionable($address, $storeId, $filterMode = OnePica_AvaTax_Model_Config::REGIONFILTER_ALL)
|
417 |
+
{
|
418 |
+
$filter = false;
|
419 |
+
|
420 |
+
if (Mage::getStoreConfig('tax/avatax/action', $storeId) == OnePica_AvaTax_Model_Config::ACTION_DISABLE) {
|
421 |
+
return false;
|
422 |
+
}
|
423 |
+
|
424 |
+
if (Mage::getStoreConfig('tax/avatax/region_filter_mode', $storeId) >= $filterMode) {
|
425 |
+
$regionFilters = explode(',', Mage::getStoreConfig('tax/avatax/region_filter_list', $storeId));
|
426 |
+
if (!in_array($address->getRegionId(), $regionFilters)) {
|
427 |
+
$filter = 'region';
|
428 |
+
}
|
429 |
+
}
|
430 |
+
|
431 |
+
$countryFilters = explode(',', Mage::getStoreConfig('tax/avatax/country_filter_list', $storeId));
|
432 |
+
if (!in_array($address->getCountryId(), $countryFilters)) {
|
433 |
+
$filter = 'country';
|
434 |
+
}
|
435 |
+
|
436 |
+
if ($filter && $this->getLogMode($storeId)) {
|
437 |
+
$filterLog = Mage::getSingleton('avatax/session')->getFilterLog();
|
438 |
+
if (!is_array($filterLog)) {
|
439 |
+
$filterLog = array();
|
440 |
+
}
|
441 |
+
$key = $address->getCacheHashKey();
|
442 |
+
|
443 |
+
//did we already log this filtered address?
|
444 |
+
if (!in_array($key, $filterLog)) {
|
445 |
+
$filterLog[] = $key;
|
446 |
+
Mage::getSingleton('avatax/session')->setFilterLog($filterLog);
|
447 |
+
|
448 |
+
$type = ($filterMode == OnePica_AvaTax_Model_Config::REGIONFILTER_TAX) ?
|
449 |
+
'tax_calc' : 'tax_calc|address_opts';
|
450 |
+
Mage::getModel('avatax_records/log')
|
451 |
+
->setStoreId($storeId)
|
452 |
+
->setLevel('Success')
|
453 |
+
->setType('Filter')
|
454 |
+
->setRequest(print_r($address->debug(), true))
|
455 |
+
->setResult('filter: ' . $filter . ', type: ' . $type)
|
456 |
+
->save();
|
457 |
+
}
|
458 |
+
}
|
459 |
+
|
460 |
+
return $filter ? false : true;
|
461 |
+
}
|
462 |
+
|
463 |
+
/**
|
464 |
+
* Determines if the object (quote, invoice, or credit memo) should use AvaTax services
|
465 |
+
*
|
466 |
+
* @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order_Invoice|Mage_Sales_Model_Order_Creditmemo $object
|
467 |
+
* @param Mage_Sales_Model_Quote_Address $shippingAddress
|
468 |
+
* @return bool
|
469 |
+
*/
|
470 |
+
public function isObjectActionable($object, $shippingAddress = null)
|
471 |
+
{
|
472 |
+
$storeId = $object->getStore()->getId();
|
473 |
+
|
474 |
+
//is action enabled?
|
475 |
+
$action = $object->getOrder() ?
|
476 |
+
OnePica_AvaTax_Model_Config::ACTION_CALC_SUBMIT : OnePica_AvaTax_Model_Config::ACTION_CALC;
|
477 |
+
if (Mage::getStoreConfig('tax/avatax/action', $storeId) < $action) {
|
478 |
+
return false;
|
479 |
+
}
|
480 |
+
|
481 |
+
if (!$shippingAddress) {
|
482 |
+
$shippingAddress = $object->getShippingAddress();
|
483 |
+
}
|
484 |
+
if (!$shippingAddress) {
|
485 |
+
$shippingAddress = $object->getBillingAddress();
|
486 |
+
}
|
487 |
+
|
488 |
+
//is the region filtered?
|
489 |
+
if (!$this->isAddressActionable($shippingAddress, $storeId, OnePica_AvaTax_Model_Config::REGIONFILTER_TAX)) {
|
490 |
+
return false;
|
491 |
+
}
|
492 |
+
|
493 |
+
return true;
|
494 |
+
}
|
495 |
+
}
|
app/code/community/OnePica/AvaTax/Helper/Tax/Data.php
CHANGED
@@ -1,124 +1,126 @@
|
|
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 |
-
|
20 |
-
*
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
if (Mage::helper('avatax')->isAvataxEnabled($store)) {
|
83 |
-
|
84 |
-
}
|
85 |
-
return parent::
|
86 |
-
}
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
|
|
|
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 |
+
* Catalog data helper
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Helper_Tax_Data extends Mage_Tax_Helper_Data
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Avatax shipping tax class
|
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')->isAvataxEnabled($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')->isAvataxEnabled($store)) {
|
55 |
+
return false;
|
56 |
+
}
|
57 |
+
return parent::shippingPriceIncludesTax($store);
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Returns AvaTax's hard-coded shipping tax class
|
62 |
+
*
|
63 |
+
* @param null|bool|int|Mage_Core_Model_Store $store
|
64 |
+
* @return string
|
65 |
+
*/
|
66 |
+
public function getShippingTaxClass($store)
|
67 |
+
{
|
68 |
+
if (Mage::helper('avatax')->isAvataxEnabled($store)) {
|
69 |
+
return self::AVATAX_SHIPPING_TAX_CLASS;
|
70 |
+
}
|
71 |
+
return parent::getShippingTaxClass($store);
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* AvaTax always computes tax based on ship from and ship to addresses
|
76 |
+
*
|
77 |
+
* @param null|bool|int|Mage_Core_Model_Store $store
|
78 |
+
* @return string
|
79 |
+
*/
|
80 |
+
public function getTaxBasedOn($store = null)
|
81 |
+
{
|
82 |
+
if (Mage::helper('avatax')->isAvataxEnabled($store)) {
|
83 |
+
return 'shipping';
|
84 |
+
}
|
85 |
+
return parent::getTaxBasedOn($store);
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Always apply tax on custom price
|
90 |
+
*
|
91 |
+
* @param null|bool|int|Mage_Core_Model_Store $store
|
92 |
+
* @return bool
|
93 |
+
*/
|
94 |
+
public function applyTaxOnCustomPrice($store = null) {
|
95 |
+
if (Mage::helper('avatax')->isAvataxEnabled($store)) {
|
96 |
+
return true;
|
97 |
+
}
|
98 |
+
return parent::applyTaxOnCustomPrice($store);
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Always apply tax on custom price (not original)
|
103 |
+
*
|
104 |
+
* @param null|bool|int|Mage_Core_Model_Store $store
|
105 |
+
* @return bool
|
106 |
+
*/
|
107 |
+
public function applyTaxOnOriginalPrice($store = null) {
|
108 |
+
if (Mage::helper('avatax')->isAvataxEnabled($store)) {
|
109 |
+
return false;
|
110 |
+
}
|
111 |
+
return parent::applyTaxOnOriginalPrice($store);
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Always apply discount first since AvaTax doesn't support line-level item discount amounts
|
116 |
+
*
|
117 |
+
* @param null|bool|int|Mage_Core_Model_Store $store
|
118 |
+
* @return bool
|
119 |
+
*/
|
120 |
+
public function applyTaxAfterDiscount($store = null) {
|
121 |
+
if (Mage::helper('avatax')->isAvataxEnabled($store)) {
|
122 |
+
return true;
|
123 |
+
}
|
124 |
+
return parent::applyTaxAfterDiscount($store);
|
125 |
+
}
|
126 |
+
}
|
app/code/community/OnePica/AvaTax/Model/.DS_Store
DELETED
Binary file
|
app/code/community/OnePica/AvaTax/Model/Abstract.php
CHANGED
@@ -1,114 +1,107 @@
|
|
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 |
-
* The abstract base AvaTax model
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
*/
|
109 |
-
public function __ ($message)
|
110 |
-
{
|
111 |
-
$args = func_get_args();
|
112 |
-
return call_user_func_array(array($this->getHelper(), '__'), $args);
|
113 |
-
}
|
114 |
-
}
|
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 |
+
* The abstract base AvaTax model
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
abstract class OnePica_AvaTax_Model_Abstract extends Varien_Object
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* The module helper
|
29 |
+
*
|
30 |
+
* @var OnePica_AvaTax_Helper_Data
|
31 |
+
*/
|
32 |
+
protected $_helper = null;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Logs a debug message
|
36 |
+
*
|
37 |
+
* @param string $type
|
38 |
+
* @param string $request the request string
|
39 |
+
* @param string $result the result string
|
40 |
+
* @param int $storeId id of the store the call is make for
|
41 |
+
* @param mixed $additional any other info
|
42 |
+
* @return $this
|
43 |
+
*/
|
44 |
+
protected function _log($type, $request, $result, $storeId = null, $additional = null)
|
45 |
+
{
|
46 |
+
if ($result->getResultCode() == SeverityLevel::$Success) {
|
47 |
+
switch (Mage::helper('avatax')->getLogMode($storeId)) {
|
48 |
+
case OnePica_AvaTax_Model_Source_Logmode::ERRORS:
|
49 |
+
return;
|
50 |
+
break;
|
51 |
+
case OnePica_AvaTax_Model_Source_Logmode::NORMAL:
|
52 |
+
$additional = null;
|
53 |
+
break;
|
54 |
+
}
|
55 |
+
}
|
56 |
+
|
57 |
+
if (in_array($type, Mage::helper('avatax')->getLogType($storeId))) {
|
58 |
+
Mage::getModel('avatax_records/log')
|
59 |
+
->setStoreId($storeId)
|
60 |
+
->setLevel($result->getResultCode())
|
61 |
+
->setType($type)
|
62 |
+
->setRequest(print_r($request, true))
|
63 |
+
->setResult(print_r($result, true))
|
64 |
+
->setAdditional($additional)
|
65 |
+
->save();
|
66 |
+
}
|
67 |
+
return $this;
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Returns the AvaTax session.
|
72 |
+
*
|
73 |
+
* @return OnePica_AvaTax_Model_Session
|
74 |
+
*/
|
75 |
+
public function getSession ()
|
76 |
+
{
|
77 |
+
return Mage::getSingleton('avatax/session');
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Returns the AvaTax helper.
|
82 |
+
*
|
83 |
+
* @return OnePica_AvaTax_Helper_Data
|
84 |
+
*/
|
85 |
+
public function getHelper ()
|
86 |
+
{
|
87 |
+
if (!$this->_helper) {
|
88 |
+
$this->_helper = Mage::helper('avatax');
|
89 |
+
}
|
90 |
+
return $this->_helper;
|
91 |
+
}
|
92 |
+
|
93 |
+
//@startSkipCommitHooks
|
94 |
+
/**
|
95 |
+
* Alias to the helper translate method.
|
96 |
+
*
|
97 |
+
* @param string $message
|
98 |
+
* @param string var number of replacement vars
|
99 |
+
* @return string
|
100 |
+
*/
|
101 |
+
public function __($message)
|
102 |
+
{
|
103 |
+
$args = func_get_args();
|
104 |
+
return call_user_func_array(array($this->getHelper(), '__'), $args);
|
105 |
+
}
|
106 |
+
//@finishSkipCommitHooks
|
107 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/OnePica/AvaTax/Model/Admin/Session.php
CHANGED
@@ -1,24 +1,29 @@
|
|
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 |
class OnePica_AvaTax_Model_Admin_Session extends Mage_Admin_Model_Session
|
20 |
{
|
21 |
-
|
22 |
/**
|
23 |
* Check current user permission on resource and privilege
|
24 |
*
|
@@ -29,18 +34,18 @@ class OnePica_AvaTax_Model_Admin_Session extends Mage_Admin_Model_Session
|
|
29 |
* @param string $privilege
|
30 |
* @return boolean
|
31 |
*/
|
32 |
-
public function isAllowed($resource, $privilege=null)
|
33 |
{
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
}
|
46 |
}
|
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 |
+
* Admin session model
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
class OnePica_AvaTax_Model_Admin_Session extends Mage_Admin_Model_Session
|
26 |
{
|
|
|
27 |
/**
|
28 |
* Check current user permission on resource and privilege
|
29 |
*
|
34 |
* @param string $privilege
|
35 |
* @return boolean
|
36 |
*/
|
37 |
+
public function isAllowed($resource, $privilege = null)
|
38 |
{
|
39 |
+
$block = array(
|
40 |
+
'admin/sales/tax/rules',
|
41 |
+
'admin/sales/tax/rates',
|
42 |
+
'admin/sales/tax/import_export'
|
43 |
+
);
|
44 |
+
|
45 |
+
if (in_array($resource, $block) && !Mage::helper('avatax')->isAnyStoreDisabled()) {
|
46 |
+
return false;
|
47 |
+
} else {
|
48 |
+
return parent::isAllowed($resource, $privilege);
|
49 |
+
}
|
50 |
}
|
51 |
}
|
app/code/community/OnePica/AvaTax/Model/Adminhtml/Config.php
CHANGED
@@ -1,42 +1,54 @@
|
|
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 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* Admin config model
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Model_Adminhtml_Config extends Mage_Adminhtml_Model_Config
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Init modules configuration
|
29 |
+
*
|
30 |
+
* @return $this
|
31 |
+
*/
|
32 |
+
protected function _initSectionsAndTabs()
|
33 |
+
{
|
34 |
+
if (Mage::helper('avatax')->isAnyStoreDisabled()) {
|
35 |
+
$config = Mage::getConfig()->loadModulesConfiguration('system.xml')
|
36 |
+
->applyExtends();
|
37 |
+
|
38 |
+
Mage::dispatchEvent('adminhtml_init_system_config', array('config' => $config));
|
39 |
+
|
40 |
+
//these 4 lines are the only added content
|
41 |
+
$configFile = Mage::helper('avatax')->getEtcPath() . DS . 'system-disabled.xml';
|
42 |
+
/** @var Mage_Core_Model_Config_Base $mergeModel */
|
43 |
+
$mergeModel = Mage::getModel('core/config_base');
|
44 |
+
$mergeModel->loadFile($configFile);
|
45 |
+
$config = $config->extend($mergeModel, true);
|
46 |
+
$this->_sections = $config->getNode('sections');
|
47 |
+
$this->_tabs = $config->getNode('tabs');
|
48 |
+
} else {
|
49 |
+
parent::_initSectionsAndTabs();
|
50 |
+
}
|
51 |
+
|
52 |
+
return $this;
|
53 |
+
}
|
54 |
+
}
|
app/code/community/OnePica/AvaTax/Model/Adminhtml/Sales/Order/Create.php
CHANGED
@@ -1,64 +1,68 @@
|
|
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 |
-
* The Admin Sales Order Create model
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
}
|
|
|
|
|
|
|
|
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 |
+
* The Admin Sales Order Create model
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Model_Adminhtml_Sales_Order_Create extends Mage_Adminhtml_Model_Sales_Order_Create
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* If a session message has been added.
|
29 |
+
*
|
30 |
+
* @var bool
|
31 |
+
*/
|
32 |
+
protected $_messageAdded = false;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Overrides the parent to validate the shipping address.
|
36 |
+
*
|
37 |
+
* @param array $address
|
38 |
+
* @return $this
|
39 |
+
* @throws Mage_Core_Exception
|
40 |
+
*/
|
41 |
+
public function setShippingAddress($address)
|
42 |
+
{
|
43 |
+
parent::setShippingAddress($address);
|
44 |
+
|
45 |
+
if ($this->getQuote()->getIsVirtual()) {
|
46 |
+
return $this;
|
47 |
+
}
|
48 |
+
|
49 |
+
if (Mage::helper('avatax')->isAvataxEnabled()) {
|
50 |
+
if (!Mage::app()->getFrontController()->getRequest()->getParam('isAjax')) {
|
51 |
+
$result = $this->getShippingAddress()->validate();
|
52 |
+
if ($result !== true) {
|
53 |
+
$storeId = $this->_session->getStore()->getId();
|
54 |
+
if (Mage::helper('avatax')->fullStopOnError($storeId)) {
|
55 |
+
foreach ($result as $error) {
|
56 |
+
$this->getSession()->addError($error);
|
57 |
+
}
|
58 |
+
throw new Mage_Core_Exception(implode('<br />', $result));
|
59 |
+
}
|
60 |
+
} elseif ($this->getShippingAddress()->getAddressNormalized() && !$this->_messageAdded) {
|
61 |
+
Mage::getSingleton('avatax/session')->addNotice(Mage::helper('avatax')->__('The shipping address has been modified during the validation process. Please confirm the address below is accurate.'));
|
62 |
+
$this->_messageAdded = true; // only add the message once
|
63 |
+
}
|
64 |
+
}
|
65 |
+
}
|
66 |
+
return $this;
|
67 |
+
}
|
68 |
+
}
|
app/code/community/OnePica/AvaTax/Model/Avatax/Abstract.php
CHANGED
@@ -1,234 +1,420 @@
|
|
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 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
$
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* Avatax abstract model
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
abstract class OnePica_AvaTax_Model_Avatax_Abstract extends OnePica_AvaTax_Model_Abstract
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Flag that states if there was an error
|
29 |
+
*
|
30 |
+
* @var bool
|
31 |
+
*/
|
32 |
+
protected static $_hasError = false;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* The request data object
|
36 |
+
*
|
37 |
+
* @var mixed
|
38 |
+
*/
|
39 |
+
protected $_request = null;
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Product collection for items to be calculated
|
43 |
+
*
|
44 |
+
* @var Mage_Catalog_Model_Resource_Product_Collection
|
45 |
+
*/
|
46 |
+
protected $_productCollection = null;
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Tax class collection for items to be calculated
|
50 |
+
*
|
51 |
+
* @var Mage_Tax_Model_Resource_Class_Collection
|
52 |
+
*/
|
53 |
+
protected $_taxClassCollection = null;
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Sets the company code on the request
|
57 |
+
*
|
58 |
+
* @param int|null $storeId
|
59 |
+
* @return $this
|
60 |
+
*/
|
61 |
+
protected function _setCompanyCode($storeId = null)
|
62 |
+
{
|
63 |
+
$config = Mage::getSingleton('avatax/config');
|
64 |
+
$this->_request->setCompanyCode($config->getCompanyCode($storeId));
|
65 |
+
return $this;
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Sends a request to the Avatax server
|
70 |
+
*
|
71 |
+
* @param int $storeId
|
72 |
+
* @return mixed
|
73 |
+
*/
|
74 |
+
protected function _send($storeId)
|
75 |
+
{
|
76 |
+
/** @var OnePica_AvaTax_Model_Config $config */
|
77 |
+
$config = Mage::getSingleton('avatax/config')->init($storeId);
|
78 |
+
$connection = $config->getTaxConnection();
|
79 |
+
$result = null;
|
80 |
+
$message = null;
|
81 |
+
|
82 |
+
try {
|
83 |
+
$result = $connection->getTax($this->_request);
|
84 |
+
} catch (Exception $exception) {
|
85 |
+
$message = new Message();
|
86 |
+
$message->setSummary($exception->getMessage());
|
87 |
+
}
|
88 |
+
|
89 |
+
if (!isset($result) || !is_object($result) || !$result->getResultCode()) {
|
90 |
+
$actualResult = $result;
|
91 |
+
$result = new Varien_Object();
|
92 |
+
$result->setResultCode(SeverityLevel::$Exception)
|
93 |
+
->setActualResult($actualResult)
|
94 |
+
->setMessages(array($message));
|
95 |
+
}
|
96 |
+
|
97 |
+
$this->_log(
|
98 |
+
OnePica_AvaTax_Model_Source_Logtype::GET_TAX,
|
99 |
+
$this->_request,
|
100 |
+
$result,
|
101 |
+
$storeId,
|
102 |
+
$config->getParams()
|
103 |
+
);
|
104 |
+
|
105 |
+
if ($result->getResultCode() != SeverityLevel::$Success) {
|
106 |
+
self::$_hasError = true;
|
107 |
+
if (Mage::helper('avatax')->fullStopOnError($storeId)) {
|
108 |
+
Mage::helper('avatax')->addErrorMessage($storeId);
|
109 |
+
}
|
110 |
+
} else {
|
111 |
+
Mage::helper('avatax')->removeErrorMessage();
|
112 |
+
}
|
113 |
+
|
114 |
+
return $result;
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Adds additional transaction based data
|
119 |
+
*
|
120 |
+
* @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order $object
|
121 |
+
* @return $this
|
122 |
+
*/
|
123 |
+
protected function _addGeneralInfo($object)
|
124 |
+
{
|
125 |
+
$storeId = $object->getStoreId();
|
126 |
+
$this->_setCompanyCode($storeId);
|
127 |
+
$this->_request->setDetailLevel(DetailLevel::$Document);
|
128 |
+
$this->_request->setDocDate(date('Y-m-d'));
|
129 |
+
$this->_request->setExemptionNo('');
|
130 |
+
$this->_request->setDiscount(0.00); //cannot be used in Magento
|
131 |
+
$this->_request->setSalespersonCode(Mage::helper('avatax')->getSalesPersonCode($storeId));
|
132 |
+
$this->_request->setLocationCode(Mage::helper('avatax')->getLocationCode($storeId));
|
133 |
+
$this->_request->setCountry(Mage::getStoreConfig('shipping/origin/country_id', $storeId));
|
134 |
+
$this->_request->setCurrencyCode(Mage::app()->getStore()->getBaseCurrencyCode());
|
135 |
+
$this->_addCustomer($object);
|
136 |
+
if ($object instanceof Mage_Sales_Model_Order && $object->getIncrementId()) {
|
137 |
+
$this->_request->setReferenceCode('Magento Order #' . $object->getIncrementId());
|
138 |
+
}
|
139 |
+
return $this;
|
140 |
+
}
|
141 |
+
|
142 |
+
/**
|
143 |
+
* Sets the customer info if available
|
144 |
+
*
|
145 |
+
* @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order $object
|
146 |
+
* @return $this
|
147 |
+
*/
|
148 |
+
protected function _addCustomer($object)
|
149 |
+
{
|
150 |
+
$format = Mage::getStoreConfig('tax/avatax/cust_code_format', $object->getStoreId());
|
151 |
+
$customer = Mage::getModel('customer/customer');
|
152 |
+
|
153 |
+
if ($object->getCustomerId()) {
|
154 |
+
$customer->load($object->getCustomerId());
|
155 |
+
$taxClass = Mage::getModel('tax/class')->load($customer->getTaxClassId())->getOpAvataxCode();
|
156 |
+
$this->_request->setCustomerUsageType($taxClass);
|
157 |
+
}
|
158 |
+
|
159 |
+
switch ($format) {
|
160 |
+
case OnePica_AvaTax_Model_Source_Customercodeformat::LEGACY:
|
161 |
+
if ($customer->getId()) {
|
162 |
+
$customerCode = $customer->getName() . ' (' . $customer->getId() . ')';
|
163 |
+
} else {
|
164 |
+
$address = $object->getBillingAddress() ? $object->getBillingAddress() : $object;
|
165 |
+
$customerCode = $address->getFirstname() . ' ' . $address->getLastname() . ' (Guest)';
|
166 |
+
}
|
167 |
+
break;
|
168 |
+
case OnePica_AvaTax_Model_Source_Customercodeformat::CUST_EMAIL:
|
169 |
+
$customerCode = $object->getCustomerEmail() ? $object->getCustomerEmail() : $customer->getEmail();
|
170 |
+
break;
|
171 |
+
case OnePica_AvaTax_Model_Source_Customercodeformat::CUST_ID:
|
172 |
+
default:
|
173 |
+
$customerCode = $object->getCustomerId() ? $object->getCustomerId() : 'guest-'.$object->getId();
|
174 |
+
break;
|
175 |
+
}
|
176 |
+
|
177 |
+
$this->_request->setCustomerCode($customerCode);
|
178 |
+
return $this;
|
179 |
+
}
|
180 |
+
|
181 |
+
/**
|
182 |
+
* Adds the orgin address to the request
|
183 |
+
*
|
184 |
+
* @param null|bool|int|Mage_Core_Model_Store $store
|
185 |
+
* @return Address
|
186 |
+
*/
|
187 |
+
protected function _setOriginAddress($store = null)
|
188 |
+
{
|
189 |
+
$country = Mage::getStoreConfig('shipping/origin/country_id', $store);
|
190 |
+
$zip = Mage::getStoreConfig('shipping/origin/postcode', $store);
|
191 |
+
$regionId = Mage::getStoreConfig('shipping/origin/region_id', $store);
|
192 |
+
$state = Mage::getModel('directory/region')->load($regionId)->getCode();
|
193 |
+
$city = Mage::getStoreConfig('shipping/origin/city', $store);
|
194 |
+
$street = Mage::getStoreConfig('shipping/origin/street', $store);
|
195 |
+
$address = $this->_newAddress($street, '', $city, $state, $zip, $country);
|
196 |
+
return $this->_request->setOriginAddress($address);
|
197 |
+
}
|
198 |
+
|
199 |
+
/**
|
200 |
+
* Adds the shipping address to the request
|
201 |
+
*
|
202 |
+
* @param Address
|
203 |
+
* @return bool
|
204 |
+
*/
|
205 |
+
protected function _setDestinationAddress($address)
|
206 |
+
{
|
207 |
+
$street1 = $address->getStreet(1);
|
208 |
+
$street2 = $address->getStreet(2);
|
209 |
+
$city = $address->getCity();
|
210 |
+
$zip = $address->getPostcode();
|
211 |
+
$state = Mage::getModel('directory/region')->load($address->getRegionId())->getCode();
|
212 |
+
$country = $address->getCountry();
|
213 |
+
|
214 |
+
if (($city && $state) || $zip) {
|
215 |
+
$address = $this->_newAddress($street1, $street2, $city, $state, $zip, $country);
|
216 |
+
return $this->_request->setDestinationAddress($address);
|
217 |
+
} else {
|
218 |
+
return false;
|
219 |
+
}
|
220 |
+
}
|
221 |
+
|
222 |
+
/**
|
223 |
+
* Generic address maker
|
224 |
+
*
|
225 |
+
* @param string $line1
|
226 |
+
* @param string $line2
|
227 |
+
* @param string $city
|
228 |
+
* @param string $state
|
229 |
+
* @param string $zip
|
230 |
+
* @param string $country
|
231 |
+
* @return Address
|
232 |
+
*/
|
233 |
+
protected function _newAddress($line1, $line2, $city, $state, $zip, $country = 'USA')
|
234 |
+
{
|
235 |
+
$address = new Address();
|
236 |
+
$address->setLine1($line1);
|
237 |
+
$address->setLine2($line2);
|
238 |
+
$address->setCity($city);
|
239 |
+
$address->setRegion($state);
|
240 |
+
$address->setPostalCode($zip);
|
241 |
+
$address->setCountry($country);
|
242 |
+
return $address;
|
243 |
+
}
|
244 |
+
|
245 |
+
/**
|
246 |
+
* Test to see if the product carries its own numbers or is calculated based on parent or children
|
247 |
+
*
|
248 |
+
* @param Mage_Sales_Model_Quote_Item|Mage_Sales_Model_Order_Item|mixed $item
|
249 |
+
* @return bool
|
250 |
+
*/
|
251 |
+
public function isProductCalculated($item)
|
252 |
+
{
|
253 |
+
// check if item has methods as far as shipping, gift wrapping, printed card item comes as Varien_Object
|
254 |
+
// TODO: Refactor OnePica_AvaTax_Model_Sales_Quote_Address_Total_Tax::collect method
|
255 |
+
if (method_exists($item, 'isChildrenCalculated') && method_exists($item, 'getParentItem')) {
|
256 |
+
if ($item->isChildrenCalculated() && !$item->getParentItem()) {
|
257 |
+
return true;
|
258 |
+
}
|
259 |
+
if (!$item->isChildrenCalculated() && $item->getParentItem()) {
|
260 |
+
return true;
|
261 |
+
}
|
262 |
+
}
|
263 |
+
return false;
|
264 |
+
}
|
265 |
+
|
266 |
+
/**
|
267 |
+
* Adds a comment to order history. Method choosen based on Magento version.
|
268 |
+
*
|
269 |
+
* @param Mage_Sales_Model_Order
|
270 |
+
* @param string
|
271 |
+
* @return self
|
272 |
+
*/
|
273 |
+
protected function _addStatusHistoryComment($order, $comment)
|
274 |
+
{
|
275 |
+
if (method_exists($order, 'addStatusHistoryComment')) {
|
276 |
+
$order->addStatusHistoryComment($comment)->save();
|
277 |
+
} elseif (method_exists($order, 'addStatusToHistory')) {
|
278 |
+
$order->addStatusToHistory($order->getStatus(), $comment, false)->save();;
|
279 |
+
}
|
280 |
+
return $this;
|
281 |
+
}
|
282 |
+
|
283 |
+
/**
|
284 |
+
* Init product collection for items to be calculated
|
285 |
+
*
|
286 |
+
* @param Mage_Sales_Model_Mysql4_Order_Invoice_Item_Collection|array $items
|
287 |
+
* @return $this
|
288 |
+
*/
|
289 |
+
protected function _initProductCollection($items)
|
290 |
+
{
|
291 |
+
$productIds = array();
|
292 |
+
foreach ($items as $item) {
|
293 |
+
if (!$this->isProductCalculated($item)) {
|
294 |
+
$productIds[] = $item->getProductId();
|
295 |
+
}
|
296 |
+
}
|
297 |
+
$this->_productCollection = Mage::getModel('catalog/product')->getCollection()
|
298 |
+
->addAttributeToSelect('*')
|
299 |
+
->addAttributeToFilter('entity_id', array('in' => $productIds));
|
300 |
+
return $this;
|
301 |
+
}
|
302 |
+
|
303 |
+
/**
|
304 |
+
* Init tax class collection for items to be calculated
|
305 |
+
*
|
306 |
+
* @return $this
|
307 |
+
* @throws OnePica_AvaTax_Model_Exception
|
308 |
+
*/
|
309 |
+
protected function _initTaxClassCollection()
|
310 |
+
{
|
311 |
+
$taxClassIds = array();
|
312 |
+
foreach ($this->_getProductCollection() as $product) {
|
313 |
+
if (!in_array($product->getTaxClassId(), $taxClassIds)) {
|
314 |
+
$taxClassIds[] = $product->getTaxClassId();
|
315 |
+
}
|
316 |
+
}
|
317 |
+
$this->_taxClassCollection = Mage::getModel('tax/class')->getCollection()
|
318 |
+
->addFieldToSelect(array('class_id', 'op_avatax_code'))
|
319 |
+
->addFieldToFilter('class_id', array('in' => $taxClassIds));
|
320 |
+
return $this;
|
321 |
+
}
|
322 |
+
|
323 |
+
/**
|
324 |
+
* Get product collection for items to be calculated
|
325 |
+
*
|
326 |
+
* @return Mage_Catalog_Model_Resource_Product_Collection
|
327 |
+
* @throws OnePica_AvaTax_Model_Exception
|
328 |
+
*/
|
329 |
+
protected function _getProductCollection()
|
330 |
+
{
|
331 |
+
if (!$this->_productCollection) {
|
332 |
+
throw new OnePica_AvaTax_Model_Exception('Product collection should be set before usage');
|
333 |
+
}
|
334 |
+
|
335 |
+
return $this->_productCollection;
|
336 |
+
}
|
337 |
+
|
338 |
+
/**
|
339 |
+
* Get tax class collection for items to be calculated
|
340 |
+
*
|
341 |
+
* @return Mage_Tax_Model_Resource_Class_Collection
|
342 |
+
* @throws OnePica_AvaTax_Model_Exception
|
343 |
+
*/
|
344 |
+
protected function _getTaxClassCollection()
|
345 |
+
{
|
346 |
+
if (!$this->_taxClassCollection) {
|
347 |
+
throw new OnePica_AvaTax_Model_Exception('Tax class collection should be set before usage');
|
348 |
+
}
|
349 |
+
|
350 |
+
return $this->_taxClassCollection;
|
351 |
+
}
|
352 |
+
|
353 |
+
/**
|
354 |
+
* Get Avatax class for given product
|
355 |
+
*
|
356 |
+
* @param Mage_Catalog_Model_Product $product
|
357 |
+
* @return string
|
358 |
+
*/
|
359 |
+
protected function _getTaxClassByProduct($product)
|
360 |
+
{
|
361 |
+
$taxClass = '';
|
362 |
+
if ($product->getTaxClassId()) {
|
363 |
+
$taxClass = $this->_getTaxClassCollection()
|
364 |
+
->getItemById($product->getTaxClassId())
|
365 |
+
->getOpAvataxCode();
|
366 |
+
}
|
367 |
+
return $taxClass;
|
368 |
+
}
|
369 |
+
|
370 |
+
/**
|
371 |
+
* Get product from collection by given product id
|
372 |
+
*
|
373 |
+
* @param int $productId
|
374 |
+
* @return Mage_Catalog_Model_Product
|
375 |
+
* @throws OnePica_AvaTax_Model_Exception
|
376 |
+
*/
|
377 |
+
protected function _getProductByProductId($productId)
|
378 |
+
{
|
379 |
+
return $this->_getProductCollection()->getItemById($productId);
|
380 |
+
}
|
381 |
+
|
382 |
+
/**
|
383 |
+
* Get proper ref value for given product
|
384 |
+
*
|
385 |
+
* @param Mage_Catalog_Model_Product $product
|
386 |
+
* @param int $refNumber
|
387 |
+
* @return null|string
|
388 |
+
*/
|
389 |
+
protected function _getRefValueByProductAndNumber($product, $refNumber)
|
390 |
+
{
|
391 |
+
$value = null;
|
392 |
+
$helperMethod = 'getRef' . $refNumber . 'AttributeCode';
|
393 |
+
$refCode = Mage::helper('avatax')->{$helperMethod}($product->getStoreId());
|
394 |
+
if ($refCode && $product->getResource()->getAttribute($refCode)) {
|
395 |
+
try {
|
396 |
+
$value = (string)$product->getResource()->getAttribute($refCode)->getFrontend()->getValue($product);
|
397 |
+
} catch (Exception $e) {
|
398 |
+
Mage::logException($e);
|
399 |
+
}
|
400 |
+
}
|
401 |
+
return $value;
|
402 |
+
}
|
403 |
+
|
404 |
+
/**
|
405 |
+
* Init tax override object
|
406 |
+
*
|
407 |
+
* @param string $taxOverrideType
|
408 |
+
* @param string $reason
|
409 |
+
* @param float $taxAmount
|
410 |
+
* @return TaxOverride
|
411 |
+
*/
|
412 |
+
protected function _getTaxOverrideObject($taxOverrideType, $reason, $taxAmount)
|
413 |
+
{
|
414 |
+
$taxOverride = new TaxOverride();
|
415 |
+
$taxOverride->setTaxOverrideType($taxOverrideType);
|
416 |
+
$taxOverride->setReason($reason);
|
417 |
+
$taxOverride->setTaxAmount($taxAmount);
|
418 |
+
return $taxOverride;
|
419 |
+
}
|
420 |
+
}
|
app/code/community/OnePica/AvaTax/Model/Avatax/Address.php
CHANGED
@@ -1,256 +1,284 @@
|
|
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 |
-
* The AvaTax Address Validator model
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* The AvaTax Address Validator model
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Model_Avatax_Address extends OnePica_AvaTax_Model_Abstract
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* An array of previously checked addresses
|
29 |
+
* Example: $_cache[$key] = serialize($resultObjectFromAvalara)
|
30 |
+
*
|
31 |
+
* @var array
|
32 |
+
*/
|
33 |
+
protected $_cache = array();
|
34 |
+
|
35 |
+
/**
|
36 |
+
* The Mage Address object
|
37 |
+
*
|
38 |
+
* @var Mage_Customer_Model_Address_Abstract
|
39 |
+
*/
|
40 |
+
protected $_mageAddress = null;
|
41 |
+
|
42 |
+
/**
|
43 |
+
* The AvaTax Request Address object.
|
44 |
+
* This is a Ava address copy of the Mage address attributes.
|
45 |
+
*
|
46 |
+
* @var Address
|
47 |
+
*/
|
48 |
+
protected $_requestAddress = null;
|
49 |
+
|
50 |
+
/**
|
51 |
+
* The AvaTax Response (Normalized) Address object.
|
52 |
+
* This is the normalized Ava address returned by the validation request.
|
53 |
+
*
|
54 |
+
* @var ValidAddress
|
55 |
+
*/
|
56 |
+
protected $_responseAddress = null;
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Saves the store id
|
60 |
+
*
|
61 |
+
* @var int
|
62 |
+
*/
|
63 |
+
protected $_storeId = null;
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Loads any saved addresses in session
|
67 |
+
*/
|
68 |
+
public function __construct()
|
69 |
+
{
|
70 |
+
$addresses = Mage::getSingleton('avatax/session')->getAddresses();
|
71 |
+
if (is_array($addresses)) {
|
72 |
+
$this->_cache = $addresses;
|
73 |
+
}
|
74 |
+
parent::__construct();
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Saves any current addresses to session
|
79 |
+
*/
|
80 |
+
public function __destruct()
|
81 |
+
{
|
82 |
+
Mage::getSingleton('avatax/session')->setAddresses($this->_cache);
|
83 |
+
|
84 |
+
if (method_exists(get_parent_class(), '__destruct')) {
|
85 |
+
parent::__destruct();
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Sets the Mage address.
|
91 |
+
*
|
92 |
+
* @param Mage_Customer_Model_Address_Abstract $address
|
93 |
+
* @return $this
|
94 |
+
*/
|
95 |
+
public function setAddress(Mage_Customer_Model_Address_Abstract $address)
|
96 |
+
{
|
97 |
+
$this->_storeId = Mage::app()->getStore()->getId();
|
98 |
+
$this->_mageAddress = $address;
|
99 |
+
$this->_convertRequestAddress();
|
100 |
+
return $this;
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Sets attributes from the Mage address on the AvaTax Request address.
|
105 |
+
*
|
106 |
+
* @return $this
|
107 |
+
*/
|
108 |
+
protected function _convertRequestAddress()
|
109 |
+
{
|
110 |
+
if (!$this->_requestAddress) {
|
111 |
+
$this->_requestAddress = new Address();
|
112 |
+
}
|
113 |
+
$this->_requestAddress->setLine1($this->_mageAddress->getStreet(1));
|
114 |
+
$this->_requestAddress->setLine2($this->_mageAddress->getStreet(2));
|
115 |
+
$this->_requestAddress->setCity($this->_mageAddress->getCity());
|
116 |
+
$this->_requestAddress->setRegion($this->_mageAddress->getRegionCode());
|
117 |
+
$this->_requestAddress->setCountry($this->_mageAddress->getCountry());
|
118 |
+
$this->_requestAddress->setPostalCode($this->_mageAddress->getPostcode());
|
119 |
+
|
120 |
+
return $this;
|
121 |
+
}
|
122 |
+
|
123 |
+
/**
|
124 |
+
* Sets attributes from the AvaTax Response address on the Mage address.
|
125 |
+
*
|
126 |
+
* @return $this
|
127 |
+
*/
|
128 |
+
protected function _convertResponseAddress()
|
129 |
+
{
|
130 |
+
$street = array($this->_responseAddress->getLine1(), $this->_responseAddress->getLine2());
|
131 |
+
$region = Mage::getModel('directory/region')
|
132 |
+
->loadByCode($this->_responseAddress->getRegion(), $this->_mageAddress->getCountryId());
|
133 |
+
|
134 |
+
$this->_mageAddress->setStreet($street)
|
135 |
+
->setCity($this->_responseAddress->getCity())
|
136 |
+
->setRegionId($region->getId())
|
137 |
+
->setPostcode($this->_responseAddress->getPostalCode())
|
138 |
+
->setCountryId($this->_responseAddress->getCountry())
|
139 |
+
->save()
|
140 |
+
->setAddressNormalized(true);
|
141 |
+
return $this;
|
142 |
+
}
|
143 |
+
|
144 |
+
/**
|
145 |
+
* Validates the address with the AvaTax validation API.
|
146 |
+
* Returns true on success and an array with an error on failure.
|
147 |
+
*
|
148 |
+
* @return array|bool
|
149 |
+
* @throws OnePica_AvaTax_Model_Avatax_Address_Exception
|
150 |
+
*/
|
151 |
+
public function validate()
|
152 |
+
{
|
153 |
+
if (!$this->_mageAddress) {
|
154 |
+
throw new OnePica_AvaTax_Model_Avatax_Address_Exception(
|
155 |
+
$this->__('An address must be set before validation.')
|
156 |
+
);
|
157 |
+
}
|
158 |
+
|
159 |
+
/** @var OnePica_AvaTax_Model_Config $config */
|
160 |
+
$config = Mage::getSingleton('avatax/config')->init($this->_storeId);
|
161 |
+
/** @var Mage_Sales_Model_Quote $quote */
|
162 |
+
$quote = $this->_mageAddress->getQuote();
|
163 |
+
$isAddressValidationOn = $this->_getDataHelper()->isAddressValidationOn($this->_mageAddress, $this->_storeId);
|
164 |
+
$isAddressNormalizationOn = $this->_getDataHelper()
|
165 |
+
->isAddressNormalizationOn($this->_mageAddress, $this->_storeId);
|
166 |
+
$isAddressActionable = $this->_getDataHelper()->isAddressActionable($this->_mageAddress, $quote->getStoreId());
|
167 |
+
//if there is no use cases for AvaTax services, return address as valid without doing a lookup
|
168 |
+
if (!$isAddressValidationOn && !$isAddressNormalizationOn && !$isAddressActionable) {
|
169 |
+
return true;
|
170 |
+
}
|
171 |
+
|
172 |
+
//lookup in AvaTax (with caching)
|
173 |
+
$key = $this->_mageAddress->getCacheHashKey();
|
174 |
+
if (array_key_exists($key, $this->_cache)) {
|
175 |
+
$result = unserialize($this->_cache[$key]);
|
176 |
+
} elseif ($this->_mageAddress->getPostcode() && $this->_mageAddress->getPostcode() != '-') {
|
177 |
+
$session = Mage::getSingleton('checkout/session');
|
178 |
+
if ($session->getPostType() == 'onepage') {
|
179 |
+
$requiredFields = explode(",", $this->getHelper()->getFieldRequiredList());
|
180 |
+
$fieldRules = explode(",", $this->getHelper()->getFieldRule());
|
181 |
+
foreach ($requiredFields as $field) {
|
182 |
+
$requiredFlag = 0;
|
183 |
+
foreach ($fieldRules as $rule) {
|
184 |
+
if (preg_match("/street\d/", $field)) {
|
185 |
+
$field = "street";
|
186 |
+
}
|
187 |
+
if ($field == "country") {
|
188 |
+
$field = "country_id";
|
189 |
+
}
|
190 |
+
if ($this->_mageAddress->getData($field) == $rule || !$this->_mageAddress->getData($field)) {
|
191 |
+
$requiredFlag = 1;
|
192 |
+
}
|
193 |
+
}
|
194 |
+
if ($requiredFlag) {
|
195 |
+
$errors = array();
|
196 |
+
$errors[] = $this->__('Invalid ') . $this->__($field);
|
197 |
+
return $errors;
|
198 |
+
}
|
199 |
+
}
|
200 |
+
}
|
201 |
+
|
202 |
+
$client = $config->getAddressConnection();
|
203 |
+
$request = new ValidateRequest($this->_requestAddress, TextCase::$Mixed, 0);
|
204 |
+
$request->setTaxability(true);
|
205 |
+
$result = $client->Validate($request);
|
206 |
+
$this->_log(
|
207 |
+
OnePica_AvaTax_Model_Source_Logtype::VALIDATE,
|
208 |
+
$request,
|
209 |
+
$result,
|
210 |
+
$this->_storeId,
|
211 |
+
$config->getParams()
|
212 |
+
);
|
213 |
+
$this->_cache[$key] = serialize($result);
|
214 |
+
} else {
|
215 |
+
$errors = array();
|
216 |
+
$errors[] = $this->__('Invalid ZIP/Postal Code.');
|
217 |
+
return $errors;
|
218 |
+
}
|
219 |
+
|
220 |
+
//normalization
|
221 |
+
if ($isAddressNormalizationOn && $result->getResultCode() == SeverityLevel::$Success) {
|
222 |
+
$responseAddress = $result->getValidAddresses();
|
223 |
+
$responseAddress = array_pop($responseAddress);
|
224 |
+
if ($responseAddress instanceof ValidAddress) {
|
225 |
+
$this->_responseAddress = $responseAddress;
|
226 |
+
$this->_convertResponseAddress();
|
227 |
+
} else {
|
228 |
+
throw new OnePica_AvaTax_Model_Avatax_Address_Exception($this->__('Invalid response address type.'));
|
229 |
+
}
|
230 |
+
}
|
231 |
+
|
232 |
+
//validation
|
233 |
+
if ($isAddressValidationOn == 1) {
|
234 |
+
if ($result->getResultCode() == SeverityLevel::$Success) {
|
235 |
+
$this->_mageAddress->setAddressValidated(true);
|
236 |
+
return true;
|
237 |
+
} else {
|
238 |
+
$errors = array();
|
239 |
+
foreach ($result->getMessages() as $message) {
|
240 |
+
$errors[] = $this->__($message->getSummary());
|
241 |
+
}
|
242 |
+
return $errors;
|
243 |
+
}
|
244 |
+
} elseif ($isAddressValidationOn == 2) {
|
245 |
+
$this->_mageAddress->setAddressValidated(true);
|
246 |
+
if ($result->getResultCode() == SeverityLevel::$Success) {
|
247 |
+
return true;
|
248 |
+
} else {
|
249 |
+
if (!$this->_mageAddress->getAddressNotified()) {
|
250 |
+
$this->_mageAddress->setAddressNotified(true);
|
251 |
+
foreach ($result->getMessages() as $message) {
|
252 |
+
Mage::getSingleton('core/session')->addNotice($this->__($message->getSummary()));
|
253 |
+
}
|
254 |
+
}
|
255 |
+
return true;
|
256 |
+
}
|
257 |
+
|
258 |
+
//a valid address isn't required, but Avalara has to say there is
|
259 |
+
//enough info to drill down to a tax jurisdiction to calc on
|
260 |
+
} elseif (!$isAddressValidationOn && $isAddressActionable) {
|
261 |
+
if ($result->isTaxable()) {
|
262 |
+
$this->_mageAddress->setAddressValidated(true);
|
263 |
+
return true;
|
264 |
+
} else {
|
265 |
+
$errors = array();
|
266 |
+
foreach ($result->getMessages() as $message) {
|
267 |
+
$errors[] = $this->__($message->getSummary());
|
268 |
+
}
|
269 |
+
return $errors;
|
270 |
+
}
|
271 |
+
}
|
272 |
+
return true;
|
273 |
+
}
|
274 |
+
|
275 |
+
/**
|
276 |
+
* Get data helper
|
277 |
+
*
|
278 |
+
* @return OnePica_AvaTax_Helper_Data
|
279 |
+
*/
|
280 |
+
protected function _getDataHelper()
|
281 |
+
{
|
282 |
+
return Mage::helper('avatax');
|
283 |
+
}
|
284 |
+
}
|
app/code/community/OnePica/AvaTax/Model/Avatax/Estimate.php
CHANGED
@@ -1,425 +1,447 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* OnePica_AvaTax
|
5 |
-
*
|
6 |
-
* NOTICE OF LICENSE
|
7 |
-
*
|
8 |
-
* This source file is subject to the Open Software License (OSL 3.0), a
|
9 |
-
* copy of which is available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
*
|
12 |
-
* @category OnePica
|
13 |
-
* @package OnePica_AvaTax
|
14 |
-
* @author OnePica Codemaster <codemaster@onepica.com>
|
15 |
-
* @copyright Copyright (c) 2009 One Pica, Inc.
|
16 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
-
*/
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
*
|
30 |
-
*
|
31 |
-
*
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
*
|
37 |
-
*
|
38 |
-
*
|
39 |
-
*
|
40 |
-
*
|
41 |
-
*
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
*
|
47 |
-
*
|
48 |
-
*
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
*
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
$this->
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
$
|
174 |
-
$
|
175 |
-
$
|
176 |
-
$
|
177 |
-
$
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
)
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
$
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
$
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
$
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
$
|
271 |
-
$
|
272 |
-
|
273 |
-
$
|
274 |
-
|
275 |
-
$line
|
276 |
-
$line->
|
277 |
-
$
|
278 |
-
$line->
|
279 |
-
|
280 |
-
$line
|
281 |
-
$
|
282 |
-
$
|
283 |
-
$
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
$
|
301 |
-
|
302 |
-
|
303 |
-
$
|
304 |
-
|
305 |
-
$line
|
306 |
-
$line->
|
307 |
-
$
|
308 |
-
$line->
|
309 |
-
$line->
|
310 |
-
$line->
|
311 |
-
|
312 |
-
$
|
313 |
-
$
|
314 |
-
|
315 |
-
$
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
*
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
$
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
$line
|
336 |
-
$
|
337 |
-
$
|
338 |
-
$line->
|
339 |
-
$line->
|
340 |
-
$line->
|
341 |
-
$line->
|
342 |
-
$line->
|
343 |
-
|
344 |
-
|
345 |
-
$this->_lines
|
346 |
-
$this->
|
347 |
-
$
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
*
|
353 |
-
*
|
354 |
-
* @
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
if (
|
359 |
-
|
360 |
-
}
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
$
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
$
|
421 |
-
$
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* OnePica_AvaTax
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0), a
|
9 |
+
* copy of which is available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category OnePica
|
13 |
+
* @package OnePica_AvaTax
|
14 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
15 |
+
* @copyright Copyright (c) 2009 One Pica, Inc.
|
16 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
+
|
19 |
+
/**
|
20 |
+
* The AvaTax Address Estimate model
|
21 |
+
*
|
22 |
+
* @category OnePica
|
23 |
+
* @package OnePica_AvaTax
|
24 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
25 |
+
*/
|
26 |
+
class OnePica_AvaTax_Model_Avatax_Estimate extends OnePica_AvaTax_Model_Avatax_Abstract
|
27 |
+
{
|
28 |
+
/**
|
29 |
+
* Length of time in minutes for cached rates
|
30 |
+
*
|
31 |
+
* @var int
|
32 |
+
*/
|
33 |
+
const CACHE_TTL = 120;
|
34 |
+
|
35 |
+
/**
|
36 |
+
* An array of rates that acts as a cache
|
37 |
+
* Example: $_rates[$cachekey] = array(
|
38 |
+
* 'timestamp' => 1325015952
|
39 |
+
* 'summary' => array(
|
40 |
+
* array('name'=>'NY STATE TAX', 'rate'=>4, 'amt'=>6),
|
41 |
+
* array('name'=>'NY CITY TAX', 'rate'=>4.50, 'amt'=>6.75),
|
42 |
+
* array('name'=>'NY SPECIAL TAX', 'rate'=>4.375, 'amt'=>0.56)
|
43 |
+
* ),
|
44 |
+
* 'items' => array(
|
45 |
+
* 5 => array('rate'=>8.875, 'amt'=>13.31),
|
46 |
+
* 'Shipping' => array('rate'=>0, 'amt'=>0)
|
47 |
+
* )
|
48 |
+
* )
|
49 |
+
*
|
50 |
+
* @var array
|
51 |
+
*/
|
52 |
+
protected $_rates = array();
|
53 |
+
|
54 |
+
/**
|
55 |
+
* An array of line items
|
56 |
+
*
|
57 |
+
* @var array
|
58 |
+
*/
|
59 |
+
protected $_lines = array();
|
60 |
+
|
61 |
+
/**
|
62 |
+
* An array of line numbers to quote item ids
|
63 |
+
*
|
64 |
+
* @var array
|
65 |
+
*/
|
66 |
+
protected $_lineToLineId = array();
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Loads any saved rates in session
|
70 |
+
*/
|
71 |
+
protected function _construct()
|
72 |
+
{
|
73 |
+
$rates = Mage::getSingleton('avatax/session')->getRates();
|
74 |
+
if (is_array($rates)) {
|
75 |
+
foreach ($rates as $key => $rate) {
|
76 |
+
if ($rate['timestamp'] < strtotime('-' . self::CACHE_TTL . ' minutes')) {
|
77 |
+
unset($rates[$key]);
|
78 |
+
}
|
79 |
+
}
|
80 |
+
$this->_rates = $rates;
|
81 |
+
}
|
82 |
+
return parent::_construct();
|
83 |
+
}
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Estimates tax rate for one item.
|
87 |
+
*
|
88 |
+
* @param Varien_Object $item
|
89 |
+
* @return int
|
90 |
+
*/
|
91 |
+
public function getItemRate($item)
|
92 |
+
{
|
93 |
+
if ($this->isProductCalculated($item)) {
|
94 |
+
return 0;
|
95 |
+
} else {
|
96 |
+
$key = $this->_getRates($item);
|
97 |
+
$id = $item->getId();
|
98 |
+
return isset($this->_rates[$key]['items'][$id]['rate']) ? $this->_rates[$key]['items'][$id]['rate'] : 0;
|
99 |
+
}
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Estimates tax amount for one item. Does not trigger a call if the shipping
|
104 |
+
* address has no postal code, or if the postal code is set to "-" (OneStepCheckout)
|
105 |
+
*
|
106 |
+
* @param Varien_Object $item
|
107 |
+
* @return int
|
108 |
+
*/
|
109 |
+
public function getItemTax($item)
|
110 |
+
{
|
111 |
+
if ($item->getAddress()->getPostcode() && $item->getAddress()->getPostcode() != '-') {
|
112 |
+
if ($this->isProductCalculated($item)) {
|
113 |
+
$tax = 0;
|
114 |
+
foreach ($item->getChildren() as $child) {
|
115 |
+
$child->setAddress($item->getAddress());
|
116 |
+
$tax += $this->getItemTax($child);
|
117 |
+
}
|
118 |
+
return $tax;
|
119 |
+
} else {
|
120 |
+
$key = $this->_getRates($item);
|
121 |
+
$id = $item->getId();
|
122 |
+
return isset($this->_rates[$key]['items'][$id]['amt']) ? $this->_rates[$key]['items'][$id]['amt'] : 0;
|
123 |
+
}
|
124 |
+
}
|
125 |
+
return 0;
|
126 |
+
}
|
127 |
+
|
128 |
+
/**
|
129 |
+
* Get tax detail summary
|
130 |
+
*
|
131 |
+
* @param int|null $addressId
|
132 |
+
* @return array
|
133 |
+
*/
|
134 |
+
public function getSummary($addressId = null)
|
135 |
+
{
|
136 |
+
$summary = null;
|
137 |
+
|
138 |
+
if ($addressId) {
|
139 |
+
$timestamp = 0;
|
140 |
+
foreach ($this->_rates as $row) {
|
141 |
+
if (isset($row['address_id']) && $row['address_id'] == $addressId && $row['timestamp'] > $timestamp) {
|
142 |
+
$summary = $row['summary'];
|
143 |
+
$timestamp = $row['timestamp'];
|
144 |
+
}
|
145 |
+
}
|
146 |
+
}
|
147 |
+
|
148 |
+
if ($summary === null) {
|
149 |
+
$requestKey = Mage::getSingleton('avatax/session')->getLastRequestKey();
|
150 |
+
$summary = isset($this->_rates[$requestKey]['summary']) ? $this->_rates[$requestKey]['summary'] : array();
|
151 |
+
}
|
152 |
+
|
153 |
+
return $summary;
|
154 |
+
}
|
155 |
+
|
156 |
+
/**
|
157 |
+
* Get rates from Avalara
|
158 |
+
*
|
159 |
+
* @param Varien_Object $item
|
160 |
+
* @return string
|
161 |
+
*/
|
162 |
+
protected function _getRates($item)
|
163 |
+
{
|
164 |
+
if (self::$_hasError) {
|
165 |
+
return 'error';
|
166 |
+
}
|
167 |
+
|
168 |
+
$address = $item->getAddress();
|
169 |
+
$this->_lines = array();
|
170 |
+
|
171 |
+
//set up request
|
172 |
+
$this->_request = new GetTaxRequest();
|
173 |
+
$this->_request->setDocType(DocumentType::$SalesOrder);
|
174 |
+
$this->_request->setDocCode('quote-' . $address->getId());
|
175 |
+
$this->_addGeneralInfo($address);
|
176 |
+
$this->_setOriginAddress($address->getStoreId());
|
177 |
+
$this->_setDestinationAddress($address);
|
178 |
+
$this->_request->setDetailLevel(DetailLevel::$Line);
|
179 |
+
$this->_addCustomer($address);
|
180 |
+
$this->_addItemsInCart($item);
|
181 |
+
$this->_addShipping($address);
|
182 |
+
//Added code for calculating tax for giftwrap items
|
183 |
+
$this->_addGwOrderAmount($address);
|
184 |
+
$this->_addGwItemsAmount($address);
|
185 |
+
$this->_addGwPrintedCardAmount($address);
|
186 |
+
//check to see if we can/need to make the request to Avalara
|
187 |
+
$requestKey = $this->_genRequestKey();
|
188 |
+
$makeRequest = !isset($this->_rates[$requestKey]['items'][$item->getId()]);
|
189 |
+
//@startSkipCommitHooks
|
190 |
+
$makeRequest &= count($this->_lineToLineId) ? true : false;
|
191 |
+
$makeRequest &= $this->_request->getDestinationAddress() == '' ? false : true;
|
192 |
+
$makeRequest &= $address->getId() ? true : false;
|
193 |
+
$makeRequest &= !isset($this->_rates[$requestKey]['failure']);
|
194 |
+
//@finishSkipCommitHooks
|
195 |
+
|
196 |
+
//make request if needed and save results in cache
|
197 |
+
if ($makeRequest) {
|
198 |
+
$result = $this->_send($address->getQuote()->getStoreId());
|
199 |
+
|
200 |
+
//success
|
201 |
+
if ($result->getResultCode() == SeverityLevel::$Success) {
|
202 |
+
$this->_rates[$requestKey] = array(
|
203 |
+
'timestamp' => time(),
|
204 |
+
'address_id' => $address->getId(),
|
205 |
+
'summary' => array(),
|
206 |
+
'items' => array()
|
207 |
+
);
|
208 |
+
|
209 |
+
foreach ($result->getTaxLines() as $ctl) {
|
210 |
+
$id = $this->_lineToLineId[$ctl->getNo()];
|
211 |
+
$this->_rates[$requestKey]['items'][$id] = array(
|
212 |
+
'rate' => ($ctl->getTax() ? $ctl->getRate() : 0) * 100,
|
213 |
+
'amt' => $ctl->getTax()
|
214 |
+
);
|
215 |
+
}
|
216 |
+
|
217 |
+
foreach ($result->getTaxSummary() as $row) {
|
218 |
+
$this->_rates[$requestKey]['summary'][] = array(
|
219 |
+
'name' => $row->getTaxName(),
|
220 |
+
'rate' => $row->getRate() * 100,
|
221 |
+
'amt' => $row->getTax()
|
222 |
+
);
|
223 |
+
}
|
224 |
+
//failure
|
225 |
+
} else {
|
226 |
+
$this->_rates[$requestKey] = array(
|
227 |
+
'timestamp' => time(),
|
228 |
+
'address_id' => $address->getId(),
|
229 |
+
'summary' => array(),
|
230 |
+
'items' => array(),
|
231 |
+
'failure' => true
|
232 |
+
);
|
233 |
+
if (Mage::helper('avatax')->fullStopOnError($address->getStoreId())) {
|
234 |
+
$address->getQuote()->setHasError(true);
|
235 |
+
}
|
236 |
+
}
|
237 |
+
|
238 |
+
Mage::getSingleton('avatax/session')->setRates($this->_rates);
|
239 |
+
}
|
240 |
+
|
241 |
+
//return $requestKey so it doesn't have to be calculated again
|
242 |
+
return $requestKey;
|
243 |
+
}
|
244 |
+
|
245 |
+
/**
|
246 |
+
* Generates a hash key for the exact request
|
247 |
+
*
|
248 |
+
* @return string
|
249 |
+
*/
|
250 |
+
protected function _genRequestKey()
|
251 |
+
{
|
252 |
+
$hash = sprintf("%u", crc32(serialize($this->_request)));
|
253 |
+
Mage::getSingleton('avatax/session')->setLastRequestKey($hash);
|
254 |
+
return $hash;
|
255 |
+
}
|
256 |
+
|
257 |
+
/**
|
258 |
+
* Adds shipping cost to request as item
|
259 |
+
*
|
260 |
+
* @param Mage_Sales_Model_Quote_Address
|
261 |
+
* @return int
|
262 |
+
*/
|
263 |
+
protected function _addShipping($address)
|
264 |
+
{
|
265 |
+
$lineNumber = count($this->_lines);
|
266 |
+
$storeId = Mage::app()->getStore()->getId();
|
267 |
+
$taxClass = Mage::helper('tax')->getShippingTaxClass($storeId);
|
268 |
+
$shippingAmount = (float) $address->getBaseShippingAmount();
|
269 |
+
|
270 |
+
$line = new Line();
|
271 |
+
$line->setNo($lineNumber);
|
272 |
+
$shippingSku = Mage::helper('avatax')->getShippingSku($storeId);
|
273 |
+
$line->setItemCode($shippingSku ? $shippingSku : 'Shipping');
|
274 |
+
$line->setDescription('Shipping costs');
|
275 |
+
$line->setTaxCode($taxClass);
|
276 |
+
$line->setQty(1);
|
277 |
+
$line->setAmount($shippingAmount);
|
278 |
+
$line->setDiscounted(false);
|
279 |
+
|
280 |
+
$this->_lines[$lineNumber] = $line;
|
281 |
+
$this->_request->setLines($this->_lines);
|
282 |
+
$this->_lineToLineId[$lineNumber] = Mage::helper('avatax')->getShippingSku($storeId);
|
283 |
+
return $lineNumber;
|
284 |
+
}
|
285 |
+
|
286 |
+
/**
|
287 |
+
* Adds giftwraporder cost to request as item
|
288 |
+
*
|
289 |
+
* @param Mage_Sales_Model_Quote_Address
|
290 |
+
* @return int|bool
|
291 |
+
*/
|
292 |
+
protected function _addGwOrderAmount($address)
|
293 |
+
{
|
294 |
+
if (!$address->getGwPrice()) {
|
295 |
+
return false;
|
296 |
+
}
|
297 |
+
$lineNumber = count($this->_lines);
|
298 |
+
$storeId = Mage::app()->getStore()->getId();
|
299 |
+
//Add gift wrapping price(for entire order)
|
300 |
+
$gwOrderAmount = $address->getGwBasePrice();
|
301 |
+
|
302 |
+
$line = new Line();
|
303 |
+
$line->setNo($lineNumber);
|
304 |
+
$gwOrderSku = Mage::helper('avatax')->getGwOrderSku($storeId);
|
305 |
+
$line->setItemCode($gwOrderSku ? $gwOrderSku : 'GwOrderAmount');
|
306 |
+
$line->setDescription('Gift Wrap Order Amount');
|
307 |
+
$line->setTaxCode('');
|
308 |
+
$line->setQty(1);
|
309 |
+
$line->setAmount($gwOrderAmount);
|
310 |
+
$line->setDiscounted(false);
|
311 |
+
|
312 |
+
$this->_lines[$lineNumber] = $line;
|
313 |
+
$this->_request->setLines($this->_lines);
|
314 |
+
$this->_lineToLineId[$lineNumber] = Mage::helper('avatax')->getGwOrderSku($storeId);
|
315 |
+
return $lineNumber;
|
316 |
+
}
|
317 |
+
|
318 |
+
/**
|
319 |
+
* Adds giftwrapitems cost to request as item
|
320 |
+
*
|
321 |
+
* @param Mage_Sales_Model_Quote
|
322 |
+
* @return int|bool
|
323 |
+
*/
|
324 |
+
protected function _addGwItemsAmount($address)
|
325 |
+
{
|
326 |
+
if (!$address->getGwItemsPrice()) {
|
327 |
+
return false;
|
328 |
+
}
|
329 |
+
$lineNumber = count($this->_lines);
|
330 |
+
$storeId = Mage::app()->getStore()->getId();
|
331 |
+
//Add gift wrapping price(for individual items)
|
332 |
+
$gwItemsAmount = $address->getGwItemsBasePrice();
|
333 |
+
|
334 |
+
$line = new Line();
|
335 |
+
$line->setNo($lineNumber);
|
336 |
+
$gwItemsSku = Mage::helper('avatax')->getGwItemsSku($storeId);
|
337 |
+
$line->setItemCode($gwItemsSku ? $gwItemsSku : 'GwItemsAmount');
|
338 |
+
$line->setDescription('Gift Wrap Items Amount');
|
339 |
+
$line->setTaxCode('');
|
340 |
+
$line->setQty(1);
|
341 |
+
$line->setAmount($gwItemsAmount);
|
342 |
+
$line->setDiscounted(false);
|
343 |
+
|
344 |
+
$this->_lines[$lineNumber] = $line;
|
345 |
+
$this->_request->setLines($this->_lines);
|
346 |
+
$this->_lineToLineId[$lineNumber] = Mage::helper('avatax')->getGwItemsSku($storeId);
|
347 |
+
return $lineNumber;
|
348 |
+
}
|
349 |
+
|
350 |
+
/**
|
351 |
+
* Adds giftwrap printed card cost to request as item
|
352 |
+
*
|
353 |
+
* @param Mage_Sales_Model_Quote
|
354 |
+
* @return int|bool
|
355 |
+
*/
|
356 |
+
protected function _addGwPrintedCardAmount($address)
|
357 |
+
{
|
358 |
+
if (!$address->getGwPrintedCardPrice()) {
|
359 |
+
return false;
|
360 |
+
}
|
361 |
+
$lineNumber = count($this->_lines);
|
362 |
+
$storeId = Mage::app()->getStore()->getId();
|
363 |
+
//Add printed card price
|
364 |
+
$gwPrintedCardAmount = $address->getGwPrintedCardBasePrice();
|
365 |
+
|
366 |
+
$line = new Line();
|
367 |
+
$line->setNo($lineNumber);
|
368 |
+
$gwPrintedCardSku = Mage::helper('avatax')->getGwPrintedCardSku($storeId);
|
369 |
+
$line->setItemCode($gwPrintedCardSku ? $gwPrintedCardSku : 'GwPrintedCardAmount');
|
370 |
+
$line->setDescription('Gift Wrap Printed Card Amount');
|
371 |
+
$line->setTaxCode('');
|
372 |
+
$line->setQty(1);
|
373 |
+
$line->setAmount($gwPrintedCardAmount);
|
374 |
+
$line->setDiscounted(false);
|
375 |
+
|
376 |
+
$this->_lines[$lineNumber] = $line;
|
377 |
+
$this->_request->setLines($this->_lines);
|
378 |
+
$this->_lineToLineId[$lineNumber] = Mage::helper('avatax')->getGwPrintedCardSku($storeId);
|
379 |
+
return $lineNumber;
|
380 |
+
}
|
381 |
+
|
382 |
+
/**
|
383 |
+
* Adds all items in the cart to the request
|
384 |
+
*
|
385 |
+
* @param Mage_Sales_Model_Quote_item|Mage_Sales_Model_Quote_Address_item
|
386 |
+
* @return int
|
387 |
+
*/
|
388 |
+
protected function _addItemsInCart($item)
|
389 |
+
{
|
390 |
+
if ($item->getAddress() instanceof Mage_Sales_Model_Quote_Address) {
|
391 |
+
$items = $item->getAddress()->getAllItems();
|
392 |
+
} elseif ($item->getQuote() instanceof Mage_Sales_Model_Quote) {
|
393 |
+
$items = $item->getQuote()->getAllItems();
|
394 |
+
} else {
|
395 |
+
$items = array();
|
396 |
+
}
|
397 |
+
|
398 |
+
if (count($items) > 0) {
|
399 |
+
$this->_initProductCollection($items);
|
400 |
+
$this->_initTaxClassCollection();
|
401 |
+
foreach ($items as $item) {
|
402 |
+
$this->_newLine($item);
|
403 |
+
}
|
404 |
+
$this->_request->setLines($this->_lines);
|
405 |
+
}
|
406 |
+
return count($this->_lines);
|
407 |
+
}
|
408 |
+
|
409 |
+
/**
|
410 |
+
* Makes a Line object from a product item object
|
411 |
+
*
|
412 |
+
* @param Varien_Object $item
|
413 |
+
* @return int|bool
|
414 |
+
*/
|
415 |
+
protected function _newLine($item)
|
416 |
+
{
|
417 |
+
if ($this->isProductCalculated($item)) {
|
418 |
+
return false;
|
419 |
+
}
|
420 |
+
$product = $this->_getProductByProductId($item->getProductId());
|
421 |
+
$taxClass = $this->_getTaxClassByProduct($product);
|
422 |
+
$price = $item->getBaseRowTotal() - $item->getBaseDiscountAmount();
|
423 |
+
$lineNumber = count($this->_lines);
|
424 |
+
$line = new Line();
|
425 |
+
$line->setNo($lineNumber);
|
426 |
+
$line->setItemCode(substr($product->getSku(), 0, 50));
|
427 |
+
$line->setDescription($product->getName());
|
428 |
+
$line->setQty($item->getQty());
|
429 |
+
$line->setAmount($price);
|
430 |
+
$line->setDiscounted($item->getDiscountAmount() ? true : false);
|
431 |
+
if ($taxClass) {
|
432 |
+
$line->setTaxCode($taxClass);
|
433 |
+
}
|
434 |
+
$ref1Value = $this->_getRefValueByProductAndNumber($product, 1);
|
435 |
+
if ($ref1Value) {
|
436 |
+
$line->setRef1($ref1Value);
|
437 |
+
}
|
438 |
+
$ref2Value = $this->_getRefValueByProductAndNumber($product, 2);
|
439 |
+
if ($ref2Value) {
|
440 |
+
$line->setRef2($ref2Value);
|
441 |
+
}
|
442 |
+
|
443 |
+
$this->_lines[$lineNumber] = $line;
|
444 |
+
$this->_lineToLineId[$lineNumber] = $item->getId();
|
445 |
+
return $lineNumber;
|
446 |
+
}
|
447 |
+
}
|
app/code/community/OnePica/AvaTax/Model/Avatax/Exception/Address.php
CHANGED
@@ -1,21 +1,25 @@
|
|
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 |
-
* The AvaTax Validation Exception class
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
|
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 |
+
* The AvaTax Validation Exception class
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Model_Avatax_Address_Exception extends Exception {}
|
app/code/community/OnePica/AvaTax/Model/Avatax/Exception/Commitfailure.php
CHANGED
@@ -1,21 +1,25 @@
|
|
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 |
-
*
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
|
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 |
+
* Commit Failure Exception class
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Model_Avatax_Exception_Commitfailure extends Exception {}
|
app/code/community/OnePica/AvaTax/Model/Avatax/Exception/Unbalanced.php
CHANGED
@@ -1,21 +1,25 @@
|
|
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 |
-
*
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
|
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 |
+
* Unbalanced Exception class
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Model_Avatax_Exception_Unbalanced extends Exception {}
|
app/code/community/OnePica/AvaTax/Model/Avatax/Invoice.php
CHANGED
@@ -1,438 +1,459 @@
|
|
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 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
$
|
57 |
-
|
58 |
-
|
59 |
-
$
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
$
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
$line
|
237 |
-
$line->
|
238 |
-
$line->
|
239 |
-
$line->
|
240 |
-
|
241 |
-
$
|
242 |
-
$
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
$
|
267 |
-
$
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
$
|
274 |
-
$
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
$
|
302 |
-
$
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* The AvaTax Address Invoice model
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Model_Avatax_Invoice extends OnePica_AvaTax_Model_Avatax_Abstract
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* An array of line items
|
29 |
+
*
|
30 |
+
* @var array
|
31 |
+
*/
|
32 |
+
protected $_lines = array();
|
33 |
+
|
34 |
+
/**
|
35 |
+
* An array of line numbers to product ids
|
36 |
+
*
|
37 |
+
* @var array
|
38 |
+
*/
|
39 |
+
protected $_lineToItemId = array();
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Save order in AvaTax system
|
43 |
+
*
|
44 |
+
* @see OnePica_AvaTax_Model_Observer::salesOrderPlaceAfter()
|
45 |
+
* @param Mage_Sales_Model_Order_Invoice $invoice
|
46 |
+
* @param OnePica_AvaTax_Model_Records_Queue $queue
|
47 |
+
* @return bool
|
48 |
+
* @throws Exception
|
49 |
+
* @throws OnePica_AvaTax_Model_Avatax_Exception_Commitfailure
|
50 |
+
* @throws OnePica_AvaTax_Model_Avatax_Exception_Unbalanced
|
51 |
+
*/
|
52 |
+
public function invoice($invoice, $queue)
|
53 |
+
{
|
54 |
+
$order = $invoice->getOrder();
|
55 |
+
$invoiceDate = $order->getInvoiceCollection()->getFirstItem()->getCreatedAt();
|
56 |
+
$orderDate = $order->getCreatedAt();
|
57 |
+
$statusDate = $queue->getUpdatedAt();
|
58 |
+
|
59 |
+
$shippingAddress = ($order->getShippingAddress()) ? $order->getShippingAddress() : $order->getBillingAddress();
|
60 |
+
if (!$shippingAddress) {
|
61 |
+
throw new Exception($this->__('There is no address attached to this order'));
|
62 |
+
}
|
63 |
+
|
64 |
+
$this->_request = new GetTaxRequest();
|
65 |
+
$this->_request->setDocCode($invoice->getIncrementId());
|
66 |
+
$this->_request->setDocType(DocumentType::$SalesInvoice);
|
67 |
+
|
68 |
+
$this->_addGeneralInfo($order);
|
69 |
+
$this->_addShipping($invoice);
|
70 |
+
//Added code for calculating tax for giftwrap items
|
71 |
+
$this->_addGwOrderAmount($invoice);
|
72 |
+
$this->_addGwItemsAmount($invoice);
|
73 |
+
$this->_addGwPrintedCardAmount($invoice);
|
74 |
+
|
75 |
+
$this->_setOriginAddress($order->getStoreId());
|
76 |
+
$this->_setDestinationAddress($shippingAddress);
|
77 |
+
//$this->_request->setPaymentDate(date('Y-m-d'));
|
78 |
+
$this->_request->setDocDate(substr($invoiceDate, 0, 10));
|
79 |
+
$this->_request->setPaymentDate(substr($invoiceDate, 0, 10));
|
80 |
+
$this->_request->setTaxDate(substr($orderDate, 0, 10));
|
81 |
+
$this->_request->setStatusDate(substr($statusDate, 0, 10));
|
82 |
+
|
83 |
+
$configAction = Mage::getStoreConfig('tax/avatax/action', $order->getStoreId());
|
84 |
+
$commitAction = OnePica_AvaTax_Model_Config::ACTION_CALC_SUBMIT_COMMIT;
|
85 |
+
$this->_request->setCommit(($configAction == $commitAction) ? true : false);
|
86 |
+
|
87 |
+
$items = $invoice->getItemsCollection();
|
88 |
+
$this->_initProductCollection($items);
|
89 |
+
$this->_initTaxClassCollection();
|
90 |
+
foreach ($items as $item) {
|
91 |
+
/** @var Mage_Sales_Model_Order_Invoice_Item $item */
|
92 |
+
$this->_newLine($item);
|
93 |
+
}
|
94 |
+
$this->_request->setLines($this->_lines);
|
95 |
+
|
96 |
+
//send to AvaTax
|
97 |
+
$result = $this->_send($order->getStoreId());
|
98 |
+
|
99 |
+
//if successful
|
100 |
+
if ($result->getResultCode() == SeverityLevel::$Success) {
|
101 |
+
$message = Mage::helper('avatax')->__('Invoice #%s was saved to AvaTax', $result->getDocCode());
|
102 |
+
$this->_addStatusHistoryComment($order, $message);
|
103 |
+
|
104 |
+
if ($result->getTotalTax() != $invoice->getBaseTaxAmount()) {
|
105 |
+
throw new OnePica_AvaTax_Model_Avatax_Exception_Unbalanced(
|
106 |
+
'Collected: '. $invoice->getBaseTaxAmount() . ', Actual: ' . $result->getTotalTax()
|
107 |
+
);
|
108 |
+
}
|
109 |
+
|
110 |
+
//if not successful
|
111 |
+
} else {
|
112 |
+
$messages = array();
|
113 |
+
foreach ($result->getMessages() as $message) {
|
114 |
+
$messages[] = $message->getSummary();
|
115 |
+
}
|
116 |
+
throw new OnePica_AvaTax_Model_Avatax_Exception_Commitfailure(implode(' // ', $messages));
|
117 |
+
}
|
118 |
+
|
119 |
+
return true;
|
120 |
+
}
|
121 |
+
|
122 |
+
/**
|
123 |
+
* Save order in AvaTax system
|
124 |
+
*
|
125 |
+
* @see OnePica_AvaTax_Model_Observer::salesOrderPlaceAfter()
|
126 |
+
* @param Mage_Sales_Model_Order_Creditmemo $creditmemo
|
127 |
+
* @param OnePica_AvaTax_Model_Records_Queue $queue
|
128 |
+
* @return mixed
|
129 |
+
* @throws Exception
|
130 |
+
* @throws OnePica_AvaTax_Model_Avatax_Exception_Commitfailure
|
131 |
+
* @throws OnePica_AvaTax_Model_Avatax_Exception_Unbalanced
|
132 |
+
*/
|
133 |
+
public function creditmemo($creditmemo, $queue)
|
134 |
+
{
|
135 |
+
$order = $creditmemo->getOrder();
|
136 |
+
$orderDate = $order->getCreatedAt();
|
137 |
+
$statusDate = $queue->getUpdatedAt();
|
138 |
+
$creditmemoDate = $order->getCreditmemosCollection()->getFirstItem()->getCreatedAt();
|
139 |
+
|
140 |
+
$shippingAddress = ($order->getShippingAddress()) ? $order->getShippingAddress() : $order->getBillingAddress();
|
141 |
+
if (!$shippingAddress) {
|
142 |
+
throw new Exception($this->__('There is no address attached to this order'));
|
143 |
+
}
|
144 |
+
|
145 |
+
$this->_request = new GetTaxRequest();
|
146 |
+
$this->_request->setDocCode($creditmemo->getIncrementId());
|
147 |
+
$this->_request->setDocType(DocumentType::$ReturnInvoice);
|
148 |
+
|
149 |
+
$this->_addGeneralInfo($order);
|
150 |
+
$this->_addShipping($creditmemo, true);
|
151 |
+
//Added code for calculating tax for giftwrap items
|
152 |
+
$this->_addGwOrderAmount($creditmemo);
|
153 |
+
$this->_addGwItemsAmount($creditmemo);
|
154 |
+
$this->_addGwPrintedCardAmount($creditmemo);
|
155 |
+
|
156 |
+
$this->_addAdjustments($creditmemo->getAdjustmentPositive(), $creditmemo->getAdjustmentNegative());
|
157 |
+
$this->_setOriginAddress($order->getStoreId());
|
158 |
+
$this->_setDestinationAddress($shippingAddress);
|
159 |
+
|
160 |
+
// Set the tax date for calculation.
|
161 |
+
//$invoiceDate = $order->getInvoiceCollection()->getFirstItem()->getCreatedAt();
|
162 |
+
$override = new TaxOverride();
|
163 |
+
//$override->setTaxDate(substr($invoiceDate, 0, 10));
|
164 |
+
$override->setTaxDate(substr($orderDate, 0, 10));
|
165 |
+
$override->setTaxOverrideType(TaxOverrideType::$TaxDate);
|
166 |
+
$override->setReason('Credit memo - refund');
|
167 |
+
$this->_request->setTaxOverride($override);
|
168 |
+
|
169 |
+
$this->_request->setDocDate(substr($creditmemoDate, 0, 10));
|
170 |
+
$this->_request->setPaymentDate(substr($creditmemoDate, 0, 10));
|
171 |
+
$this->_request->setTaxDate(substr($orderDate, 0, 10));
|
172 |
+
$this->_request->setStatusDate(substr($statusDate, 0, 10));
|
173 |
+
|
174 |
+
$configAction = Mage::getStoreConfig('tax/avatax/action', $order->getStoreId());
|
175 |
+
$commitAction = OnePica_AvaTax_Model_Config::ACTION_CALC_SUBMIT_COMMIT;
|
176 |
+
$this->_request->setCommit(($configAction == $commitAction) ? true : false);
|
177 |
+
|
178 |
+
$items = $creditmemo->getAllItems();
|
179 |
+
$this->_initProductCollection($items);
|
180 |
+
$this->_initTaxClassCollection();
|
181 |
+
foreach ($items as $item) {
|
182 |
+
/** @var Mage_Sales_Model_Order_Creditmemo_Item $item */
|
183 |
+
$this->_newLine($item, true);
|
184 |
+
}
|
185 |
+
$this->_request->setLines($this->_lines);
|
186 |
+
|
187 |
+
//send to AvaTax
|
188 |
+
$result = $this->_send($order->getStoreId());
|
189 |
+
|
190 |
+
//if successful
|
191 |
+
if ($result->getResultCode() == SeverityLevel::$Success) {
|
192 |
+
$message = Mage::helper('avatax')->__('Credit memo #%s was saved to AvaTax', $result->getDocCode());
|
193 |
+
$this->_addStatusHistoryComment($order, $message);
|
194 |
+
|
195 |
+
if ($result->getTotalTax() != ($creditmemo->getTaxAmount() * -1)) {
|
196 |
+
throw new OnePica_AvaTax_Model_Avatax_Exception_Unbalanced(
|
197 |
+
'Collected: ' . $creditmemo->getTaxAmount() . ', Actual: ' . $result->getTotalTax()
|
198 |
+
);
|
199 |
+
}
|
200 |
+
//if not successful
|
201 |
+
} else {
|
202 |
+
$messages = array();
|
203 |
+
foreach ($result->getMessages() as $message) {
|
204 |
+
$messages[] = $message->getSummary();
|
205 |
+
}
|
206 |
+
throw new OnePica_AvaTax_Model_Avatax_Exception_Commitfailure(implode(' // ', $messages));
|
207 |
+
}
|
208 |
+
|
209 |
+
return $result;
|
210 |
+
}
|
211 |
+
|
212 |
+
/**
|
213 |
+
* Adds shipping cost to request as item
|
214 |
+
*
|
215 |
+
* @param Mage_Sales_Model_Order_Invoice|Mage_Sales_Model_Order_Creditmemo $object
|
216 |
+
* @param bool $credit
|
217 |
+
* @return int|bool
|
218 |
+
*/
|
219 |
+
protected function _addShipping($object, $credit = false)
|
220 |
+
{
|
221 |
+
if ($object->getBaseShippingAmount() == 0) {
|
222 |
+
return false;
|
223 |
+
}
|
224 |
+
|
225 |
+
$lineNumber = count($this->_lines);
|
226 |
+
$storeId = Mage::app()->getStore()->getId();
|
227 |
+
$taxClass = Mage::helper('tax')->getShippingTaxClass($storeId);
|
228 |
+
|
229 |
+
$amount = $object->getBaseShippingAmount();
|
230 |
+
if ($credit) {
|
231 |
+
//@startSkipCommitHooks
|
232 |
+
$amount *= -1;
|
233 |
+
//@finishSkipCommitHooks
|
234 |
+
}
|
235 |
+
|
236 |
+
$line = new Line();
|
237 |
+
$line->setNo($lineNumber);
|
238 |
+
$line->setItemCode(Mage::helper('avatax')->getShippingSku($storeId));
|
239 |
+
$line->setDescription('Shipping costs');
|
240 |
+
$line->setTaxCode($taxClass);
|
241 |
+
$line->setQty(1);
|
242 |
+
$line->setAmount($amount);
|
243 |
+
$line->setDiscounted(false);
|
244 |
+
|
245 |
+
$this->_lineToItemId[$lineNumber] = 'shipping';
|
246 |
+
$this->_lines[$lineNumber] = $line;
|
247 |
+
$this->_request->setLines($this->_lines);
|
248 |
+
return $lineNumber;
|
249 |
+
}
|
250 |
+
|
251 |
+
/**
|
252 |
+
* Adds giftwraporder cost to request as item
|
253 |
+
*
|
254 |
+
* @param Mage_Sales_Model_Order_Invoice|Mage_Sales_Model_Order_Creditmemo $object
|
255 |
+
* @param bool $credit
|
256 |
+
* @return int|bool
|
257 |
+
*/
|
258 |
+
protected function _addGwOrderAmount($object, $credit = false) {
|
259 |
+
if ($object->getGwPrice() == 0) {
|
260 |
+
return false;
|
261 |
+
}
|
262 |
+
|
263 |
+
$lineNumber = count($this->_lines);
|
264 |
+
$storeId = Mage::app()->getStore()->getId();
|
265 |
+
|
266 |
+
$amount = $object->getGwBasePrice();
|
267 |
+
if ($credit) {
|
268 |
+
//@startSkipCommitHooks
|
269 |
+
$amount *= -1;
|
270 |
+
//@finishSkipCommitHooks
|
271 |
+
}
|
272 |
+
|
273 |
+
$line = new Line();
|
274 |
+
$line->setNo($lineNumber);
|
275 |
+
$line->setItemCode(Mage::helper('avatax')->getGwOrderSku($storeId));
|
276 |
+
$line->setDescription('Gift Wrap Order Amount');
|
277 |
+
$line->setTaxCode('');
|
278 |
+
$line->setQty(1);
|
279 |
+
$line->setAmount($amount);
|
280 |
+
$line->setDiscounted(false);
|
281 |
+
|
282 |
+
$this->_lineToItemId[$lineNumber] = Mage::helper('avatax')->getGwOrderSku($storeId);
|
283 |
+
$this->_lines[$lineNumber] = $line;
|
284 |
+
$this->_request->setLines($this->_lines);
|
285 |
+
return $lineNumber;
|
286 |
+
}
|
287 |
+
|
288 |
+
/**
|
289 |
+
* Adds giftwrapitems cost to request as item
|
290 |
+
*
|
291 |
+
* @param Mage_Sales_Model_Order_Invoice|Mage_Sales_Model_Order_Creditmemo $object
|
292 |
+
* @param bool $credit
|
293 |
+
* @return int|bool
|
294 |
+
*/
|
295 |
+
protected function _addGwItemsAmount($object, $credit = false)
|
296 |
+
{
|
297 |
+
if ($object->getGwItemsPrice() == 0) {
|
298 |
+
return false;
|
299 |
+
}
|
300 |
+
|
301 |
+
$lineNumber = count($this->_lines);
|
302 |
+
$storeId = Mage::app()->getStore()->getId();
|
303 |
+
|
304 |
+
$amount = $object->getGwItemsBasePrice();
|
305 |
+
if ($credit) {
|
306 |
+
//@startSkipCommitHooks
|
307 |
+
$amount *= -1;
|
308 |
+
//@finishSkipCommitHooks
|
309 |
+
}
|
310 |
+
|
311 |
+
$line = new Line();
|
312 |
+
$line->setNo($lineNumber);
|
313 |
+
$line->setItemCode(Mage::helper('avatax')->getGwItemsSku($storeId));
|
314 |
+
$line->setDescription('Gift Wrap Items Amount');
|
315 |
+
$line->setTaxCode('');
|
316 |
+
$line->setQty(1);
|
317 |
+
$line->setAmount($amount);
|
318 |
+
$line->setDiscounted(false);
|
319 |
+
|
320 |
+
$this->_lineToItemId[$lineNumber] = Mage::helper('avatax')->getGwItemsSku($storeId);
|
321 |
+
$this->_lines[$lineNumber] = $line;
|
322 |
+
$this->_request->setLines($this->_lines);
|
323 |
+
return $lineNumber;
|
324 |
+
}
|
325 |
+
|
326 |
+
/**
|
327 |
+
* Adds giftwrap printed card cost to request as item
|
328 |
+
*
|
329 |
+
* @param Mage_Sales_Model_Order_Invoice|Mage_Sales_Model_Order_Creditmemo $object
|
330 |
+
* @param bool $credit
|
331 |
+
* @return int|bool
|
332 |
+
*/
|
333 |
+
protected function _addGwPrintedCardAmount($object, $credit = false)
|
334 |
+
{
|
335 |
+
if ($object->getGwPrintedCardSku() == 0) {
|
336 |
+
return false;
|
337 |
+
}
|
338 |
+
|
339 |
+
$lineNumber = count($this->_lines);
|
340 |
+
$storeId = Mage::app()->getStore()->getId();
|
341 |
+
|
342 |
+
$amount = $object->getGwPrintedCardBasePrice();
|
343 |
+
if ($credit) {
|
344 |
+
//@startSkipCommitHooks
|
345 |
+
$amount *= -1;
|
346 |
+
//@finishSkipCommitHooks
|
347 |
+
}
|
348 |
+
|
349 |
+
$line = new Line();
|
350 |
+
$line->setNo($lineNumber);
|
351 |
+
$line->setItemCode(Mage::helper('avatax')->getGwPrintedCardSku($storeId));
|
352 |
+
$line->setDescription('Gift Wrap Printed Card Amount');
|
353 |
+
$line->setTaxCode('');
|
354 |
+
$line->setQty(1);
|
355 |
+
$line->setAmount($amount);
|
356 |
+
$line->setDiscounted(false);
|
357 |
+
|
358 |
+
$this->_lineToItemId[$lineNumber] = Mage::helper('avatax')->getGwPrintedCardSku($storeId);
|
359 |
+
$this->_lines[$lineNumber] = $line;
|
360 |
+
$this->_request->setLines($this->_lines);
|
361 |
+
return $lineNumber;
|
362 |
+
}
|
363 |
+
|
364 |
+
/**
|
365 |
+
* Adds adjustments to request as items
|
366 |
+
*
|
367 |
+
* @param float $positive
|
368 |
+
* @param float $negative
|
369 |
+
* @return array
|
370 |
+
*/
|
371 |
+
protected function _addAdjustments($positive, $negative)
|
372 |
+
{
|
373 |
+
$storeId = Mage::app()->getStore()->getId();
|
374 |
+
|
375 |
+
if ($positive != 0) {
|
376 |
+
$lineNumber = count($this->_lines);
|
377 |
+
$identifier = Mage::helper('avatax')->getPositiveAdjustmentSku($storeId);
|
378 |
+
|
379 |
+
$line = new Line();
|
380 |
+
$line->setNo($lineNumber);
|
381 |
+
$line->setItemCode($identifier ? $identifier : 'adjustment');
|
382 |
+
$line->setDescription('Adjustment refund');
|
383 |
+
$line->setTaxCode($identifier);
|
384 |
+
$line->setQty(1);
|
385 |
+
$line->setAmount($positive * -1);
|
386 |
+
$line->setDiscounted(false);
|
387 |
+
$line->setTaxIncluded(true);
|
388 |
+
$this->_lineToItemId[$lineNumber] = 'positive-adjustment';
|
389 |
+
$this->_lines[$lineNumber] = $line;
|
390 |
+
$this->_request->setLines($this->_lines);
|
391 |
+
}
|
392 |
+
|
393 |
+
if ($negative != 0) {
|
394 |
+
$lineNumber = count($this->_lines);
|
395 |
+
$identifier = Mage::helper('avatax')->getNegativeAdjustmentSku($storeId);
|
396 |
+
|
397 |
+
$line = new Line();
|
398 |
+
$line->setNo($lineNumber);
|
399 |
+
$line->setItemCode($identifier ? $identifier : 'adjustment');
|
400 |
+
$line->setDescription('Adjustment fee');
|
401 |
+
$line->setTaxCode($identifier);
|
402 |
+
$line->setQty(1);
|
403 |
+
$line->setAmount($negative);
|
404 |
+
$line->setDiscounted(false);
|
405 |
+
$line->setTaxIncluded(true);
|
406 |
+
$this->_lineToItemId[$lineNumber] = 'negative-adjustment';
|
407 |
+
$this->_lines[$lineNumber] = $line;
|
408 |
+
$this->_request->setLines($this->_lines);
|
409 |
+
}
|
410 |
+
}
|
411 |
+
|
412 |
+
/**
|
413 |
+
* Makes a Line object from a product item object
|
414 |
+
*
|
415 |
+
* @param Mage_Sales_Model_Order_Invoice_Item|Mage_Sales_Model_Order_Creditmemo_Item $item
|
416 |
+
* @param bool $credit
|
417 |
+
* @return null
|
418 |
+
*/
|
419 |
+
protected function _newLine($item, $credit = false)
|
420 |
+
{
|
421 |
+
if ($this->isProductCalculated($item->getOrderItem())) {
|
422 |
+
return false;
|
423 |
+
}
|
424 |
+
if ($item->getQty() == 0) {
|
425 |
+
return false;
|
426 |
+
}
|
427 |
+
|
428 |
+
$product = $this->_getProductByProductId($item->getProductId());
|
429 |
+
$taxClass = $this->_getTaxClassByProduct($product);
|
430 |
+
$price = $item->getBaseRowTotal() - $item->getBaseDiscountAmount();
|
431 |
+
if ($credit) {
|
432 |
+
//@startSkipCommitHooks
|
433 |
+
$price *= -1;
|
434 |
+
//@finishSkipCommitHooks
|
435 |
+
}
|
436 |
+
|
437 |
+
$line = new Line();
|
438 |
+
$line->setNo(count($this->_lines));
|
439 |
+
$line->setItemCode(substr($item->getSku(), 0, 50));
|
440 |
+
$line->setDescription($item->getName());
|
441 |
+
$line->setQty($item->getQty());
|
442 |
+
$line->setAmount($price);
|
443 |
+
$line->setDiscounted($item->getBaseDiscountAmount() ? true : false);
|
444 |
+
if ($taxClass) {
|
445 |
+
$line->setTaxCode($taxClass);
|
446 |
+
}
|
447 |
+
$ref1Value = $this->_getRefValueByProductAndNumber($product, 1);
|
448 |
+
if ($ref1Value) {
|
449 |
+
$line->setRef1($ref1Value);
|
450 |
+
}
|
451 |
+
$ref2Value = $this->_getRefValueByProductAndNumber($product, 2);
|
452 |
+
if ($ref2Value) {
|
453 |
+
$line->setRef2($ref2Value);
|
454 |
+
}
|
455 |
+
|
456 |
+
$this->_lineToItemId[count($this->_lines)] = $item->getOrderItemId();
|
457 |
+
$this->_lines[] = $line;
|
458 |
+
}
|
459 |
+
}
|
app/code/community/OnePica/AvaTax/Model/Avatax/Ping.php
CHANGED
@@ -1,49 +1,65 @@
|
|
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 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* The AvaTax Address Ping model
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Model_Avatax_Ping extends OnePica_AvaTax_Model_Avatax_Abstract
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Tries to ping AvaTax service with provided credentials
|
29 |
+
*
|
30 |
+
* @param int $storeId
|
31 |
+
* @return bool|array
|
32 |
+
*/
|
33 |
+
public function ping($storeId = null)
|
34 |
+
{
|
35 |
+
/** @var OnePica_AvaTax_Model_Config $config */
|
36 |
+
$config = Mage::getSingleton('avatax/config')->init($storeId);
|
37 |
+
$connection = $config->getTaxConnection();
|
38 |
+
$result = null;
|
39 |
+
$message = null;
|
40 |
+
|
41 |
+
try {
|
42 |
+
$result = $connection->ping();
|
43 |
+
} catch (Exception $exception) {
|
44 |
+
$message = $exception->getMessage();
|
45 |
+
}
|
46 |
+
|
47 |
+
if (!isset($result) || !is_object($result) || !$result->getResultCode()) {
|
48 |
+
$actualResult = $result;
|
49 |
+
$result = new Varien_Object();
|
50 |
+
$result->setResultCode(SeverityLevel::$Exception);
|
51 |
+
$result->setActualResult($actualResult);
|
52 |
+
$result->setMessage($message);
|
53 |
+
}
|
54 |
+
|
55 |
+
$this->_log(
|
56 |
+
OnePica_AvaTax_Model_Source_Logtype::PING,
|
57 |
+
new stdClass(),
|
58 |
+
$result,
|
59 |
+
$storeId,
|
60 |
+
$config->getParams()
|
61 |
+
);
|
62 |
+
|
63 |
+
return ($result->getResultCode() == SeverityLevel::$Success) ? true : $result->getMessage();
|
64 |
+
}
|
65 |
+
}
|
app/code/community/OnePica/AvaTax/Model/Config.php
CHANGED
@@ -1,240 +1,233 @@
|
|
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 |
-
|
20 |
-
|
21 |
-
|
22 |
-
*
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
* @return string
|
235 |
-
*/
|
236 |
-
public function getCompanyCode ($store=null)
|
237 |
-
{
|
238 |
-
return $this->getConfig('company_code', $store);
|
239 |
-
}
|
240 |
-
}
|
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 |
+
require_once(Mage::getModuleDir('', 'OnePica_AvaTax') . DS . 'lib' . DS.'functions.php');
|
19 |
+
|
20 |
+
/**
|
21 |
+
* The AvaTax Config Model, which registers config settings with the AvaTax SDK
|
22 |
+
*
|
23 |
+
* @category OnePica
|
24 |
+
* @package OnePica_AvaTax
|
25 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
26 |
+
*/
|
27 |
+
class OnePica_AvaTax_Model_Config extends Varien_Object
|
28 |
+
{
|
29 |
+
/**
|
30 |
+
* Config key
|
31 |
+
*/
|
32 |
+
const CONFIG_KEY = 'Magento';
|
33 |
+
|
34 |
+
/**
|
35 |
+
* App name
|
36 |
+
*/
|
37 |
+
const APP_NAME = 'OP_AvaTax by One Pica';
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Disable action
|
41 |
+
*/
|
42 |
+
const ACTION_DISABLE = 0;
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Calculate action
|
46 |
+
*/
|
47 |
+
const ACTION_CALC = 1;
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Calculate, submit action
|
51 |
+
*/
|
52 |
+
const ACTION_CALC_SUBMIT = 2;
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Calculate, submit, commit action
|
56 |
+
*/
|
57 |
+
const ACTION_CALC_SUBMIT_COMMIT = 3;
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Region filter disable mode
|
61 |
+
*/
|
62 |
+
const REGIONFILTER_OFF = 0;
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Region filter tax mode
|
66 |
+
*/
|
67 |
+
const REGIONFILTER_TAX = 1;
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Region filter all mode
|
71 |
+
*/
|
72 |
+
const REGIONFILTER_ALL = 2;
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Number of times a queue item will try to send
|
76 |
+
*/
|
77 |
+
const QUEUE_ATTEMPT_MAX = 5;
|
78 |
+
|
79 |
+
/**
|
80 |
+
* The AvaTax ATConfig object.
|
81 |
+
*
|
82 |
+
* @var ATConfig
|
83 |
+
*/
|
84 |
+
protected $_config = null;
|
85 |
+
|
86 |
+
/**
|
87 |
+
* The AvaTax TaxServiceSoap object.
|
88 |
+
*
|
89 |
+
* @var TaxServiceSoap
|
90 |
+
*/
|
91 |
+
protected $_taxConnection;
|
92 |
+
|
93 |
+
/**
|
94 |
+
* The AvaTax AddressServiceSoap object.
|
95 |
+
*
|
96 |
+
* @var AddressServiceSoap
|
97 |
+
*/
|
98 |
+
protected $_addressConnection;
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Initializes the AvaTax SDK with connection settings found in the Admin config.
|
102 |
+
*
|
103 |
+
* @param int $storeId
|
104 |
+
* @return OnePica_AvaTax_Model_Config
|
105 |
+
*/
|
106 |
+
public function init($storeId)
|
107 |
+
{
|
108 |
+
if (!$this->_config) {
|
109 |
+
$this->_config = new ATConfig(self::CONFIG_KEY, array(
|
110 |
+
'url' => $this->getConfig('url', $storeId),
|
111 |
+
'account' => $this->getConfig('account', $storeId),
|
112 |
+
'license' => $this->getConfig('license', $storeId),
|
113 |
+
'trace' => (Mage::helper('avatax')
|
114 |
+
->getLogMode($storeId) == OnePica_AvaTax_Model_Source_Logmode::DEBUG) ? true : false,
|
115 |
+
'client' => $this->getClientName()
|
116 |
+
));
|
117 |
+
}
|
118 |
+
return $this;
|
119 |
+
}
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Generates client name to pass with communications
|
123 |
+
*
|
124 |
+
* Parts:
|
125 |
+
* - MyERP: the ERP that this connector is for (not always applicable)
|
126 |
+
* - Majver: version info for the ERP (not always applicable)
|
127 |
+
* - MinVer: version info for the ERP (not always applicable)
|
128 |
+
* - MyConnector: Name of the OEM�s connector AND the name of the OEM (company) *required*
|
129 |
+
* - Majver: OEM�s connector version *required*
|
130 |
+
* - MinVer: OEM�s connector version *required*
|
131 |
+
*
|
132 |
+
* @example Magento,1.4,.0.1,OP_AvaTax by One Pica,2,0.1
|
133 |
+
* @return string
|
134 |
+
*/
|
135 |
+
public function getClientName()
|
136 |
+
{
|
137 |
+
$mageVersion = Mage::getVersion();
|
138 |
+
$mageVerParts = explode('.', $mageVersion, 2);
|
139 |
+
|
140 |
+
$opVersion = Mage::getResourceModel('core/resource')->getDbVersion('avatax_records_setup');
|
141 |
+
$opVerParts = explode('.', $opVersion, 2);
|
142 |
+
|
143 |
+
$part = array();
|
144 |
+
$part[] = self::CONFIG_KEY;
|
145 |
+
$part[] = $mageVerParts[0];
|
146 |
+
$part[] = $mageVerParts[1];
|
147 |
+
$part[] = self::APP_NAME;
|
148 |
+
$part[] = $opVerParts[0];
|
149 |
+
$part[] = $opVerParts[1];
|
150 |
+
return implode(',', $part);
|
151 |
+
}
|
152 |
+
|
153 |
+
/**
|
154 |
+
* Returns the AvaTax Address soap connection client.
|
155 |
+
*
|
156 |
+
* @return AddressServiceSoap
|
157 |
+
*/
|
158 |
+
public function getAddressConnection()
|
159 |
+
{
|
160 |
+
if (!$this->_addressConnection) {
|
161 |
+
$this->_addressConnection = new AddressServiceSoap(self::CONFIG_KEY);
|
162 |
+
}
|
163 |
+
return $this->_addressConnection;
|
164 |
+
}
|
165 |
+
|
166 |
+
/**
|
167 |
+
* Returns the AvaTax Address soap connection client.
|
168 |
+
*
|
169 |
+
* @return AddressServiceSoap
|
170 |
+
*/
|
171 |
+
public function getTaxConnection()
|
172 |
+
{
|
173 |
+
if (!$this->_taxConnection) {
|
174 |
+
$this->_taxConnection = new TaxServiceSoap(self::CONFIG_KEY);
|
175 |
+
}
|
176 |
+
return $this->_taxConnection;
|
177 |
+
}
|
178 |
+
|
179 |
+
/**
|
180 |
+
* Returns a parameter from the AvaTax ATConfig object.
|
181 |
+
*
|
182 |
+
* @param string $param
|
183 |
+
* @return string
|
184 |
+
*/
|
185 |
+
public function getParam($param)
|
186 |
+
{
|
187 |
+
return $this->_config->$param;
|
188 |
+
}
|
189 |
+
|
190 |
+
/**
|
191 |
+
* Returns the AvaTax ATConfig object
|
192 |
+
*
|
193 |
+
* @return ATConfig
|
194 |
+
*/
|
195 |
+
public function getParams()
|
196 |
+
{
|
197 |
+
return $this->_config;
|
198 |
+
}
|
199 |
+
|
200 |
+
/**
|
201 |
+
* Returns data from the admin system config.
|
202 |
+
*
|
203 |
+
* @param string $path
|
204 |
+
* @param int $store
|
205 |
+
* @return string
|
206 |
+
*/
|
207 |
+
public function getConfig($path, $store = null)
|
208 |
+
{
|
209 |
+
return Mage::getStoreConfig('tax/avatax/' . $path, $store);
|
210 |
+
}
|
211 |
+
|
212 |
+
/**
|
213 |
+
* Returns true if the admin is configured to normalize addresses.
|
214 |
+
*
|
215 |
+
* @return boolean
|
216 |
+
*/
|
217 |
+
public function normalizeAddress()
|
218 |
+
{
|
219 |
+
$storeId = Mage::app()->getStore()->getId();
|
220 |
+
return $this->getConfig('normalize_address', $storeId);
|
221 |
+
}
|
222 |
+
|
223 |
+
/**
|
224 |
+
* Returns the company code to use from the AvaTax dashboard
|
225 |
+
*
|
226 |
+
* @param null|bool|int|Mage_Core_Model_Store $store
|
227 |
+
* @return string
|
228 |
+
*/
|
229 |
+
public function getCompanyCode($store = null)
|
230 |
+
{
|
231 |
+
return $this->getConfig('company_code', $store);
|
232 |
+
}
|
233 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/OnePica/AvaTax/{sql/avatax_records_setup/mysql4-upgrade-2.2.0-2.2.1.php → Model/Exception.php}
RENAMED
@@ -1,29 +1,25 @@
|
|
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 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
WHERE `class_name`='Shipping' AND `class_type`='" . Mage_Tax_Model_Class::TAX_CLASS_TYPE_PRODUCT . "';
|
27 |
-
");
|
28 |
-
|
29 |
-
$this->endSetup();
|
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 |
+
* The AvaTax Exception class
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Model_Exception extends Mage_Core_Exception {}
|
|
|
|
|
|
|
|
app/code/community/OnePica/AvaTax/Model/Export.php
ADDED
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* Export model
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Model_Export
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Entity
|
29 |
+
*
|
30 |
+
* @var OnePica_AvaTax_Model_Export_Entity_Abstract
|
31 |
+
*/
|
32 |
+
protected $_entity = null;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Adapter
|
36 |
+
*
|
37 |
+
* @var OnePica_AvaTax_Model_Export_Adapter_Abstract
|
38 |
+
*/
|
39 |
+
protected $_adapter = null;
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Get entity
|
43 |
+
*
|
44 |
+
* @return OnePica_AvaTax_Model_Export_Entity_Abstract
|
45 |
+
*/
|
46 |
+
public function getEntity()
|
47 |
+
{
|
48 |
+
return $this->_entity;
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Set entity
|
53 |
+
*
|
54 |
+
* @param OnePica_AvaTax_Model_Export_Entity_Abstract $entity
|
55 |
+
* @return $this
|
56 |
+
*/
|
57 |
+
public function setEntity($entity)
|
58 |
+
{
|
59 |
+
$this->_entity = $entity;
|
60 |
+
return $this;
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Get adapter
|
65 |
+
*
|
66 |
+
* @return OnePica_AvaTax_Model_Export_Adapter_Abstract
|
67 |
+
*/
|
68 |
+
public function getAdapter()
|
69 |
+
{
|
70 |
+
return $this->_adapter;
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Set adapter
|
75 |
+
*
|
76 |
+
* @param OnePica_AvaTax_Model_Export_Adapter_Abstract $adapter
|
77 |
+
* @return $this
|
78 |
+
*/
|
79 |
+
public function setAdapter($adapter)
|
80 |
+
{
|
81 |
+
$this->_adapter = $adapter;
|
82 |
+
return $this;
|
83 |
+
}
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Get export content
|
87 |
+
*
|
88 |
+
* @return string
|
89 |
+
* @throws OnePica_AvaTax_Model_Exception
|
90 |
+
*/
|
91 |
+
public function getContent()
|
92 |
+
{
|
93 |
+
if (!$this->getEntity()) {
|
94 |
+
throw new OnePica_AvaTax_Model_Exception('Entity should be set before export process');
|
95 |
+
}
|
96 |
+
|
97 |
+
if (!$this->getAdapter()) {
|
98 |
+
throw new OnePica_AvaTax_Model_Exception('Adapter should be set before export process');
|
99 |
+
}
|
100 |
+
|
101 |
+
return $this->getEntity()
|
102 |
+
->setAdapter($this->getAdapter())
|
103 |
+
->getContent();
|
104 |
+
}
|
105 |
+
}
|
app/code/community/OnePica/AvaTax/Model/Export/Adapter/Abstract.php
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* Abstract export adapter
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
abstract class OnePica_AvaTax_Model_Export_Adapter_Abstract
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Collection to export
|
29 |
+
*
|
30 |
+
* @var Mage_Core_Model_Mysql4_Collection_Abstract
|
31 |
+
*/
|
32 |
+
protected $_collection;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Get collection
|
36 |
+
*
|
37 |
+
* @return Mage_Core_Model_Mysql4_Collection_Abstract
|
38 |
+
*/
|
39 |
+
public function getCollection()
|
40 |
+
{
|
41 |
+
return $this->_collection;
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Set collection
|
46 |
+
*
|
47 |
+
* @param Mage_Core_Model_Mysql4_Collection_Abstract $collection
|
48 |
+
* @return $this
|
49 |
+
*/
|
50 |
+
public function setCollection($collection)
|
51 |
+
{
|
52 |
+
$this->_collection = $collection;
|
53 |
+
return $this;
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Generate content
|
58 |
+
*
|
59 |
+
* @return string
|
60 |
+
*/
|
61 |
+
abstract public function getContent();
|
62 |
+
}
|
app/code/community/OnePica/AvaTax/Model/Export/Adapter/Sql.php
ADDED
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* Sql export adapter
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Model_Export_Adapter_Sql extends OnePica_AvaTax_Model_Export_Adapter_Abstract
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Columns to export
|
29 |
+
*
|
30 |
+
* @var array
|
31 |
+
*/
|
32 |
+
protected $_columns = null;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Get content
|
36 |
+
*
|
37 |
+
* @return string
|
38 |
+
* @throws OnePica_AvaTax_Model_Exception
|
39 |
+
*/
|
40 |
+
public function getContent()
|
41 |
+
{
|
42 |
+
if (!$this->getCollection()) {
|
43 |
+
throw new OnePica_AvaTax_Model_Exception('Collection should be set before export process');
|
44 |
+
}
|
45 |
+
|
46 |
+
$content = $this->_getExportHeader();
|
47 |
+
$content .= $this->_getExportQueries();
|
48 |
+
return $content;
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Get export header
|
53 |
+
*
|
54 |
+
* @return string
|
55 |
+
*/
|
56 |
+
protected function _getExportHeader()
|
57 |
+
{
|
58 |
+
$version = Mage::getResourceModel('core/resource')->getDbVersion('avatax_records_setup');
|
59 |
+
$stores = count(Mage::app()->getStores());
|
60 |
+
$content = '-- ' . strtoupper($this->getCollection()->getMainTable()) . " EXPORT\n";
|
61 |
+
$content .= '-- Created at: ' . gmdate(DATE_W3C) . "\n";
|
62 |
+
$content .= '-- Created by: ' . Mage::getUrl('/') . "\n";
|
63 |
+
$content .= '-- Magento v' . Mage::getVersion() . ' // OP_AvaTax v' . $version . ' // Stores: ' . $stores . "\n";
|
64 |
+
$content .= '-- Total rows: ' . $this->getCollection()->count() . "\n\n";
|
65 |
+
return $content;
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Get columns to export
|
70 |
+
*
|
71 |
+
* @return array
|
72 |
+
*/
|
73 |
+
protected function _getColumns()
|
74 |
+
{
|
75 |
+
if ($this->_columns === null) {
|
76 |
+
$this->_columns = array_keys($this->getCollection()->getFirstItem()->getData());
|
77 |
+
}
|
78 |
+
return $this->_columns;
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Get export queries
|
83 |
+
*
|
84 |
+
* @return string
|
85 |
+
*/
|
86 |
+
protected function _getExportQueries()
|
87 |
+
{
|
88 |
+
$content = '';
|
89 |
+
$chunks = array_chunk($this->_getInsertValues(), 50);
|
90 |
+
foreach ($chunks as $chunk) {
|
91 |
+
$content .= 'INSERT INTO `' . $this->getCollection()->getMainTable()
|
92 |
+
. '` (`'. implode('`, `', $this->_getColumns()) . '`) VALUES ';
|
93 |
+
$content .= "\n" . implode(",\n", $chunk);
|
94 |
+
$content .= ";\n\n";
|
95 |
+
}
|
96 |
+
return $content;
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Get array with insert values
|
101 |
+
*
|
102 |
+
* @return array
|
103 |
+
*/
|
104 |
+
protected function _getInsertValues()
|
105 |
+
{
|
106 |
+
$items = $this->getCollection();
|
107 |
+
$rows = array();
|
108 |
+
foreach ($items as $item) {
|
109 |
+
$values = array();
|
110 |
+
foreach ($this->_getColumns() as $column) {
|
111 |
+
$values[] = $this->getCollection()->getResource()->getReadConnection()->quote($item->getData($column));
|
112 |
+
}
|
113 |
+
$rows[] = "(" . implode(", ", $values) . ")";
|
114 |
+
}
|
115 |
+
return $rows;
|
116 |
+
}
|
117 |
+
}
|
app/code/community/OnePica/AvaTax/Model/Export/Entity/Abstract.php
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* Abstract export entity model
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
abstract class OnePica_AvaTax_Model_Export_Entity_Abstract
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Adapter
|
29 |
+
*
|
30 |
+
* @var OnePica_AvaTax_Model_Export_Adapter_Abstract
|
31 |
+
*/
|
32 |
+
protected $_adapter;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Collection
|
36 |
+
*
|
37 |
+
* @var Mage_Core_Model_Mysql4_Collection_Abstract
|
38 |
+
*/
|
39 |
+
protected $_collection = null;
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Get adapter
|
43 |
+
*
|
44 |
+
* @return OnePica_AvaTax_Model_Export_Adapter_Abstract
|
45 |
+
*/
|
46 |
+
public function getAdapter()
|
47 |
+
{
|
48 |
+
return $this->_adapter;
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Set adapter
|
53 |
+
*
|
54 |
+
* @param OnePica_AvaTax_Model_Export_Adapter_Abstract $adapter
|
55 |
+
* @return $this
|
56 |
+
*/
|
57 |
+
public function setAdapter($adapter)
|
58 |
+
{
|
59 |
+
$this->_adapter = $adapter;
|
60 |
+
return $this;
|
61 |
+
}
|
62 |
+
/**
|
63 |
+
* Get export columns list
|
64 |
+
*
|
65 |
+
* @return array
|
66 |
+
*/
|
67 |
+
abstract protected function _getExportColumns();
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Get collection
|
71 |
+
*
|
72 |
+
* @return Mage_Core_Model_Mysql4_Collection_Abstract
|
73 |
+
*/
|
74 |
+
abstract protected function _getCollection();
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Get collection
|
78 |
+
*
|
79 |
+
* @return Mage_Core_Model_Mysql4_Collection_Abstract
|
80 |
+
*/
|
81 |
+
public function getCollection()
|
82 |
+
{
|
83 |
+
if ($this->_collection === null) {
|
84 |
+
$this->_collection = $this->_getCollection();
|
85 |
+
}
|
86 |
+
return $this->_collection;
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Get content
|
91 |
+
*
|
92 |
+
* @return string
|
93 |
+
* @throws OnePica_AvaTax_Model_Exception
|
94 |
+
*/
|
95 |
+
public function getContent()
|
96 |
+
{
|
97 |
+
if (!$this->getAdapter()) {
|
98 |
+
throw new OnePica_AvaTax_Model_Exception('Adapter should be set before export process');
|
99 |
+
}
|
100 |
+
|
101 |
+
if (!$this->getCollection()) {
|
102 |
+
throw new OnePica_AvaTax_Model_Exception('Collection should be set before export process');
|
103 |
+
}
|
104 |
+
|
105 |
+
$collection = $this->getCollection()
|
106 |
+
->addFieldToSelect($this->_getExportColumns())
|
107 |
+
->setOrder($this->getCollection()->getResource()->getIdFieldName(), 'DESC');
|
108 |
+
|
109 |
+
return $this->getAdapter()
|
110 |
+
->setCollection($collection)
|
111 |
+
->getContent();
|
112 |
+
}
|
113 |
+
}
|
app/code/community/OnePica/AvaTax/Model/Export/Entity/Log.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* Log export entity model
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Model_Export_Entity_Log extends OnePica_AvaTax_Model_Export_Entity_Abstract
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Get export columns list
|
29 |
+
*
|
30 |
+
* @return array
|
31 |
+
*/
|
32 |
+
protected function _getExportColumns()
|
33 |
+
{
|
34 |
+
return array(
|
35 |
+
'log_id',
|
36 |
+
'store_id',
|
37 |
+
'level',
|
38 |
+
'type',
|
39 |
+
'created_at'
|
40 |
+
);
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Get collection
|
45 |
+
*
|
46 |
+
* @return Mage_Core_Model_Mysql4_Collection_Abstract
|
47 |
+
*/
|
48 |
+
protected function _getCollection()
|
49 |
+
{
|
50 |
+
return Mage::getResourceModel('avatax_records/log_collection');
|
51 |
+
}
|
52 |
+
}
|
app/code/community/OnePica/AvaTax/Model/Export/Entity/Queue.php
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* Queue export entity model
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Model_Export_Entity_Queue extends OnePica_AvaTax_Model_Export_Entity_Abstract
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Get export columns list
|
29 |
+
*
|
30 |
+
* @return array
|
31 |
+
*/
|
32 |
+
protected function _getExportColumns()
|
33 |
+
{
|
34 |
+
return array(
|
35 |
+
'queue_id',
|
36 |
+
'store_id',
|
37 |
+
'entity_id',
|
38 |
+
'entity_increment_id',
|
39 |
+
'type',
|
40 |
+
'status',
|
41 |
+
'attempt',
|
42 |
+
'message',
|
43 |
+
'created_at',
|
44 |
+
'updated_at'
|
45 |
+
);
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Get collection
|
50 |
+
*
|
51 |
+
* @return Mage_Core_Model_Mysql4_Collection_Abstract
|
52 |
+
*/
|
53 |
+
protected function _getCollection()
|
54 |
+
{
|
55 |
+
return Mage::getResourceModel('avatax_records/queue_collection');
|
56 |
+
}
|
57 |
+
}
|
app/code/community/OnePica/AvaTax/Model/Observer.php
CHANGED
@@ -1,212 +1,345 @@
|
|
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 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* Avatax Observer
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Model_Observer extends Mage_Core_Model_Abstract
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Avalara lib classes
|
29 |
+
*
|
30 |
+
* @var array
|
31 |
+
*/
|
32 |
+
protected static $_classes = array(
|
33 |
+
'TaxRequest',
|
34 |
+
'PostTaxRequest',
|
35 |
+
'PostTaxResult',
|
36 |
+
'CommitTaxRequest',
|
37 |
+
'CommitTaxResult',
|
38 |
+
'CancelTaxRequest',
|
39 |
+
'CancelTaxResult',
|
40 |
+
'Enum',
|
41 |
+
'CancelCode',
|
42 |
+
'ATConfig',
|
43 |
+
'ATObject',
|
44 |
+
'DynamicSoapClient',
|
45 |
+
'AvalaraSoapClient',
|
46 |
+
'AddressServiceSoap',
|
47 |
+
'Address',
|
48 |
+
'Enum',
|
49 |
+
'TextCase',
|
50 |
+
'Message',
|
51 |
+
'SeverityLevel',
|
52 |
+
'ValidateRequest',
|
53 |
+
'ValidateResult',
|
54 |
+
'ValidAddress',
|
55 |
+
'TaxServiceSoap',
|
56 |
+
'GetTaxRequest',
|
57 |
+
'DocumentType',
|
58 |
+
'DetailLevel',
|
59 |
+
'Line',
|
60 |
+
'ServiceMode',
|
61 |
+
'GetTaxResult',
|
62 |
+
'TaxLine',
|
63 |
+
'TaxDetail',
|
64 |
+
'PingResult',
|
65 |
+
'TaxOverride',
|
66 |
+
'TaxOverrideType'
|
67 |
+
);
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Sets the collectTotals tax node based on the extensions enabled/disabled status
|
71 |
+
*
|
72 |
+
* @param Varien_Event_Observer $observer
|
73 |
+
* @return $this
|
74 |
+
*/
|
75 |
+
public function salesQuoteCollectTotalsBefore(Varien_Event_Observer $observer)
|
76 |
+
{
|
77 |
+
$storeId = $observer->getEvent()->getQuote()->getStoreId();
|
78 |
+
if (Mage::getStoreConfig('tax/avatax/action', $storeId) != OnePica_AvaTax_Model_Config::ACTION_DISABLE) {
|
79 |
+
Mage::getConfig()->setNode('global/sales/quote/totals/tax/class', 'avatax/sales_quote_address_total_tax');
|
80 |
+
}
|
81 |
+
return $this;
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Create a sales invoice record in Avalara
|
86 |
+
*
|
87 |
+
* @param Varien_Event_Observer $observer
|
88 |
+
* @return $this
|
89 |
+
*/
|
90 |
+
public function salesOrderInvoiceSaveAfter(Varien_Event_Observer $observer)
|
91 |
+
{
|
92 |
+
/** @var Mage_Sales_Model_Order_Invoice $invoice */
|
93 |
+
$invoice = $observer->getEvent()->getInvoice();
|
94 |
+
|
95 |
+
$existingInvoiceInQueue = Mage::getModel('avatax_records/queue')
|
96 |
+
->loadInvoiceByIncrementId($invoice->getIncrementId());
|
97 |
+
if ($existingInvoiceInQueue->getId()) {
|
98 |
+
return $this;
|
99 |
+
}
|
100 |
+
|
101 |
+
/* do not post pending or cancelled invoices */
|
102 |
+
if ($invoice->getState() != Mage_Sales_Model_Order_Invoice::STATE_PAID) {
|
103 |
+
return $this;
|
104 |
+
}
|
105 |
+
/* if the previous state was unpaid, process now */
|
106 |
+
if (!$invoice->getOrigData($invoice->getIdFieldName()
|
107 |
+
&& $invoice->getOrigData('state') != Mage_Sales_Model_Order_Invoice::STATE_OPEN)
|
108 |
+
&& Mage::helper('avatax')->isObjectActionable($invoice)) {
|
109 |
+
Mage::getModel('avatax_records/queue')
|
110 |
+
->setEntity($invoice)
|
111 |
+
->setType(OnePica_AvaTax_Model_Records_Queue::QUEUE_TYPE_INVOICE)
|
112 |
+
->setStatus(OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_PENDING)
|
113 |
+
->save();
|
114 |
+
}
|
115 |
+
return $this;
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Create a return invoice record in Avalara
|
120 |
+
*
|
121 |
+
* @param Varien_Event_Observer $observer
|
122 |
+
* @return $this
|
123 |
+
*/
|
124 |
+
public function salesOrderCreditmemoSaveAfter(Varien_Event_Observer $observer)
|
125 |
+
{
|
126 |
+
/* @var $creditmemo Mage_Sales_Model_Order_Creditmemo */
|
127 |
+
$creditmemo = $observer->getEvent()->getCreditmemo();
|
128 |
+
if(!$creditmemo->getOrigData($creditmemo->getIdFieldName())
|
129 |
+
&& Mage::helper('avatax')->isObjectActionable($creditmemo)) {
|
130 |
+
Mage::getModel('avatax_records/queue')
|
131 |
+
->setEntity($creditmemo)
|
132 |
+
->setType(OnePica_AvaTax_Model_Records_Queue::QUEUE_TYPE_CREDITMEMEO)
|
133 |
+
->setStatus(OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_PENDING)
|
134 |
+
->save();
|
135 |
+
}
|
136 |
+
return $this;
|
137 |
+
}
|
138 |
+
|
139 |
+
/**
|
140 |
+
* Validate addresses when multishipping checkout on set shipping items
|
141 |
+
*
|
142 |
+
* @param Varien_Event_Observer $observer
|
143 |
+
* @return $this
|
144 |
+
* @throws Mage_Core_Exception
|
145 |
+
*/
|
146 |
+
public function multishippingSetShippingItems(Varien_Event_Observer $observer)
|
147 |
+
{
|
148 |
+
/* @var $quote Mage_Sales_Model_Quote */
|
149 |
+
$quote = $observer->getEvent()->getQuote();
|
150 |
+
|
151 |
+
$errors = array();
|
152 |
+
$normalized = false;
|
153 |
+
$store = Mage::getModel('core/store')->load($quote->getStoreId());
|
154 |
+
$addresses = $quote->getAllShippingAddresses();
|
155 |
+
$message = Mage::getStoreConfig('tax/avatax/validate_address_message', $store);
|
156 |
+
foreach ($addresses as $address) {
|
157 |
+
/* @var $address OnePica_AvaTax_Model_Sales_Quote_Address */
|
158 |
+
if ($address->validate() !== true) {
|
159 |
+
$errors[] = sprintf($message, $address->format('oneline'));
|
160 |
+
}
|
161 |
+
if ($address->getAddressNormalized()) {
|
162 |
+
$normalized = true;
|
163 |
+
}
|
164 |
+
}
|
165 |
+
|
166 |
+
$session = Mage::getSingleton('checkout/session');
|
167 |
+
if ($normalized) {
|
168 |
+
$session->addNotice(Mage::getStoreConfig('tax/avatax/multiaddress_normalize_message', $store));
|
169 |
+
}
|
170 |
+
|
171 |
+
if (!empty($errors)) {
|
172 |
+
throw new Mage_Core_Exception(implode('<br />', $errors));
|
173 |
+
}
|
174 |
+
return $this;
|
175 |
+
}
|
176 |
+
|
177 |
+
/**
|
178 |
+
* Observer push data to Avalara
|
179 |
+
*
|
180 |
+
* @param Mage_Cron_Model_Schedule $schedule
|
181 |
+
* @return $this;
|
182 |
+
*/
|
183 |
+
public function processQueue($schedule)
|
184 |
+
{
|
185 |
+
Mage::getModel('avatax_records/queue_process')->run();
|
186 |
+
return $this;
|
187 |
+
}
|
188 |
+
|
189 |
+
/**
|
190 |
+
* Test for required values when admin config setting related to the this extension are changed
|
191 |
+
*
|
192 |
+
* @param Varien_Event_Observer $observer
|
193 |
+
* @return bool
|
194 |
+
*/
|
195 |
+
public function adminSystemConfigChangedSectionTax(Varien_Event_Observer $observer)
|
196 |
+
{
|
197 |
+
Mage::app()->cleanCache('block_html');
|
198 |
+
|
199 |
+
$session = Mage::getSingleton('adminhtml/session');
|
200 |
+
$storeId = Mage::getModel('core/store')->load($observer->getEvent()->getStore())->getStoreId();
|
201 |
+
$warnings = array();
|
202 |
+
$errors = array();
|
203 |
+
|
204 |
+
if (strpos(Mage::getStoreConfig('tax/avatax/url', $storeId), 'development.avalara.net') !== false) {
|
205 |
+
$warnings[] = Mage::helper('avatax')->__('You are using the AvaTax development connection URL. If you are receiving errors about authentication, please ensure that you have a development account.');
|
206 |
+
}
|
207 |
+
if (Mage::getStoreConfig('tax/avatax/action', $storeId) == OnePica_AvaTax_Model_Config::ACTION_DISABLE) {
|
208 |
+
$warnings[] = Mage::helper('avatax')->__('All AvaTax services are disabled');
|
209 |
+
}
|
210 |
+
if (Mage::getStoreConfig('tax/avatax/action', $storeId) == OnePica_AvaTax_Model_Config::ACTION_CALC) {
|
211 |
+
$warnings[] = Mage::helper('avatax')->__('Orders will not be sent to the AvaTax system');
|
212 |
+
}
|
213 |
+
if (Mage::getStoreConfig('tax/avatax/action', $storeId) == OnePica_AvaTax_Model_Config::ACTION_CALC_SUBMIT) {
|
214 |
+
$warnings[] = Mage::helper('avatax')->__('Orders will be sent but never committed to the AvaTax system');
|
215 |
+
}
|
216 |
+
|
217 |
+
$ping = Mage::getSingleton('avatax/avatax_ping')->ping($storeId);
|
218 |
+
if ($ping !== true) {
|
219 |
+
$errors[] = $ping;
|
220 |
+
}
|
221 |
+
if (!Mage::getStoreConfig('tax/avatax/url', $storeId)) {
|
222 |
+
$errors[] = Mage::helper('avatax')->__('You must enter a connection URL');
|
223 |
+
}
|
224 |
+
if (!Mage::getStoreConfig('tax/avatax/account', $storeId)) {
|
225 |
+
$errors[] = Mage::helper('avatax')->__('You must enter an account number');
|
226 |
+
}
|
227 |
+
if (!Mage::getStoreConfig('tax/avatax/license', $storeId)) {
|
228 |
+
$errors[] = Mage::helper('avatax')->__('You must enter a license key');
|
229 |
+
}
|
230 |
+
if (!is_numeric(Mage::getStoreConfig('tax/avatax/log_lifetime'))) {
|
231 |
+
$errors[] = Mage::helper('avatax')->__('You must enter the number of days to keep log entries');
|
232 |
+
}
|
233 |
+
if (!Mage::getStoreConfig('tax/avatax/company_code', $storeId)) {
|
234 |
+
$errors[] = Mage::helper('avatax')->__('You must enter a company code');
|
235 |
+
}
|
236 |
+
if (!Mage::getStoreConfig('tax/avatax/shipping_sku', $storeId)) {
|
237 |
+
$errors[] = Mage::helper('avatax')->__('You must enter a shipping sku');
|
238 |
+
}
|
239 |
+
if (!Mage::getStoreConfig('tax/avatax/adjustment_positive_sku', $storeId)) {
|
240 |
+
$errors[] = Mage::helper('avatax')->__('You must enter an adjustment refund sku');
|
241 |
+
}
|
242 |
+
if (!Mage::getStoreConfig('tax/avatax/adjustment_negative_sku', $storeId)) {
|
243 |
+
$errors[] = Mage::helper('avatax')->__('You must enter an adjustment fee sku');
|
244 |
+
}
|
245 |
+
|
246 |
+
if (!class_exists('SoapClient')) {
|
247 |
+
$errors[] = Mage::helper('avatax')->__('The PHP class SoapClient is missing. It must be enabled to use this extension. See %s for details.', '<a href="http://www.php.net/manual/en/book.soap.php" target="_blank">http://www.php.net/manual/en/book.soap.php</a>');
|
248 |
+
}
|
249 |
+
|
250 |
+
if (!function_exists('openssl_sign') && count($errors)) {
|
251 |
+
$key = array_search(Mage::helper('avatax')->__('SSL support is not available in this build'), $errors);
|
252 |
+
if (isset($errors[$key])) {
|
253 |
+
unset($errors[$key]);
|
254 |
+
}
|
255 |
+
$errors[] = Mage::helper('avatax')->__('SSL must be enabled in PHP to use this extension. Typically, OpenSSL is used but it is not enabled on your server. This may not be a problem if you have some other form of SSL in place. For more information about OpenSSL, see %s.', '<a href="http://www.php.net/manual/en/book.openssl.php" target="_blank">http://www.php.net/manual/en/book.openssl.php</a>');
|
256 |
+
}
|
257 |
+
|
258 |
+
if (!Mage::getResourceModel('cron/schedule_collection')->count()) {
|
259 |
+
$warnings[] = Mage::helper('avatax')->__('It appears that Magento\'s cron scheduler is not running. For more information, see %s.', '<a href="http://www.magentocommerce.com/wiki/how_to_setup_a_cron_job" target="_black">How to Set Up a Cron Job</a>');
|
260 |
+
}
|
261 |
+
|
262 |
+
if (count($errors) == 1) {
|
263 |
+
$session->addError(implode('', $errors));
|
264 |
+
} elseif (count($errors)) {
|
265 |
+
$session->addError(Mage::helper('avatax')->__('Please fix the following issues:') . '<br /> - '
|
266 |
+
. implode('<br /> - ', $errors));
|
267 |
+
}
|
268 |
+
|
269 |
+
if (count($warnings) == 1) {
|
270 |
+
$session->addWarning(implode('', $warnings));
|
271 |
+
} elseif (count($warnings)) {
|
272 |
+
$session->addWarning(Mage::helper('avatax')->__('Please be aware of the following warnings:')
|
273 |
+
. '<br /> - '
|
274 |
+
. implode('<br /> - ', $warnings));
|
275 |
+
}
|
276 |
+
}
|
277 |
+
|
278 |
+
/**
|
279 |
+
* Observer to clean the log every so often so it does not get too big.
|
280 |
+
*
|
281 |
+
* @param Mage_Cron_Model_Schedule $schedule
|
282 |
+
* @return $this
|
283 |
+
*/
|
284 |
+
public function cleanLog($schedule)
|
285 |
+
{
|
286 |
+
$days = floatval(Mage::getStoreConfig('tax/avatax/log_lifetime'));
|
287 |
+
Mage::getModel('avatax_records/log')->deleteLogsByInterval($days);
|
288 |
+
return $this;
|
289 |
+
}
|
290 |
+
|
291 |
+
/**
|
292 |
+
* This an observer function for the event 'controller_front_init_before' and 'default'
|
293 |
+
* It prepends our autoloader, so we can load the extra libraries.
|
294 |
+
*
|
295 |
+
* @param Varien_Event_Observer $observer
|
296 |
+
* @return $this
|
297 |
+
*/
|
298 |
+
public function loadAvaTaxExternalLib(Varien_Event_Observer $observer)
|
299 |
+
{
|
300 |
+
spl_autoload_register(array($this, 'loadLib'), true, true);
|
301 |
+
return $this;
|
302 |
+
}
|
303 |
+
|
304 |
+
/**
|
305 |
+
* This function can autoloads classes to work with Avalara API
|
306 |
+
*
|
307 |
+
* @param string $class
|
308 |
+
*/
|
309 |
+
public static function loadLib($class)
|
310 |
+
{
|
311 |
+
if (in_array($class, self::$_classes)) {
|
312 |
+
/** @var OnePica_AvaTax_Helper_Data $helper */
|
313 |
+
$helper = Mage::helper('avatax');
|
314 |
+
$helper->loadFunctions();
|
315 |
+
$helper->loadClass($class);
|
316 |
+
}
|
317 |
+
return;
|
318 |
+
}
|
319 |
+
|
320 |
+
/**
|
321 |
+
* Set post type for checkout session when 'controller_action_predispatch_checkout_cart_estimatePost' event
|
322 |
+
*
|
323 |
+
* @param Varien_Event_Observer $observer
|
324 |
+
* @return $this
|
325 |
+
*/
|
326 |
+
public function controllerActionPredispatchCheckoutCartEstimatePost(Varien_Event_Observer $observer)
|
327 |
+
{
|
328 |
+
$session = Mage::getSingleton('checkout/session');
|
329 |
+
$session->setPostType('estimate');
|
330 |
+
return $this;
|
331 |
+
}
|
332 |
+
|
333 |
+
/**
|
334 |
+
* Set post type for checkout session when 'controller_action_predispatch_checkout_onepage_index' event
|
335 |
+
*
|
336 |
+
* @param Varien_Event_Observer $observer
|
337 |
+
* @return $this
|
338 |
+
*/
|
339 |
+
public function controllerActionPredispatchCheckoutOnepageIndex(Varien_Event_Observer $observer)
|
340 |
+
{
|
341 |
+
$session = Mage::getSingleton('checkout/session');
|
342 |
+
$session->setPostType('onepage');
|
343 |
+
return $this;
|
344 |
+
}
|
345 |
+
}
|
app/code/community/OnePica/AvaTax/Model/Records/.DS_Store
DELETED
Binary file
|
app/code/community/OnePica/AvaTax/Model/Records/Log.php
CHANGED
@@ -1,55 +1,103 @@
|
|
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 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
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) 2009 One Pica, Inc.
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Log model
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Model_Records_Log extends Mage_Core_Model_Abstract
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Success log level
|
29 |
+
*/
|
30 |
+
const LOG_LEVEL_SUCCESS = 'Success';
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Error log level
|
34 |
+
*/
|
35 |
+
const LOG_LEVEL_ERROR = 'Error';
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Internal constructor
|
39 |
+
*/
|
40 |
+
protected function _construct()
|
41 |
+
{
|
42 |
+
parent::_construct();
|
43 |
+
$this->_init('avatax_records/log');
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Set additional data
|
48 |
+
*
|
49 |
+
* @param string|null $value
|
50 |
+
* @return $this
|
51 |
+
*/
|
52 |
+
public function setAdditional($value = null)
|
53 |
+
{
|
54 |
+
if ($value) {
|
55 |
+
$value = str_replace(
|
56 |
+
Mage::getStoreConfig('tax/avatax/license'),
|
57 |
+
'[MASKED::LICENSE_KEY]',
|
58 |
+
print_r($value, true)
|
59 |
+
);
|
60 |
+
}
|
61 |
+
$this->setData('additional', $value);
|
62 |
+
return $this;
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Get type options
|
67 |
+
*
|
68 |
+
* @return array
|
69 |
+
*/
|
70 |
+
public function getTypeOptions()
|
71 |
+
{
|
72 |
+
$result = array();
|
73 |
+
$storeId = Mage::app()->getStore()->getId();
|
74 |
+
$types = Mage::helper('avatax')->getLogType($storeId);
|
75 |
+
foreach ($types as $key => $value) {
|
76 |
+
$result[$value] = $value;
|
77 |
+
}
|
78 |
+
return $result;
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Get level options
|
83 |
+
*
|
84 |
+
* @return array
|
85 |
+
*/
|
86 |
+
public function getLevelOptions() {
|
87 |
+
return array(
|
88 |
+
self::LOG_LEVEL_SUCCESS => self::LOG_LEVEL_SUCCESS,
|
89 |
+
self::LOG_LEVEL_ERROR => self::LOG_LEVEL_ERROR
|
90 |
+
);
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Delete logs for given interval
|
95 |
+
*
|
96 |
+
* @param int $days
|
97 |
+
* @return int
|
98 |
+
*/
|
99 |
+
public function deleteLogsByInterval($days)
|
100 |
+
{
|
101 |
+
return $this->getResource()->deleteLogsByInterval($days);
|
102 |
+
}
|
103 |
+
}
|
app/code/community/OnePica/AvaTax/Model/Records/Mysql4/Log.php
CHANGED
@@ -1,38 +1,63 @@
|
|
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 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
$
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* Log resource model
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Model_Records_Mysql4_Log extends Mage_Core_Model_Mysql4_Abstract
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Construct
|
29 |
+
*/
|
30 |
+
protected function _construct()
|
31 |
+
{
|
32 |
+
$this->_init('avatax_records/log', 'log_id');
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Sets various dates before the model is saved.
|
37 |
+
*
|
38 |
+
* @param Mage_Core_Model_Abstract $object
|
39 |
+
* @return $this
|
40 |
+
*/
|
41 |
+
protected function _beforeSave(Mage_Core_Model_Abstract $object)
|
42 |
+
{
|
43 |
+
$object->setCreatedAt(gmdate('Y-m-d H:i:s'));
|
44 |
+
if ($object->getLevel() != OnePica_AvaTax_Model_Records_Log::LOG_LEVEL_SUCCESS) {
|
45 |
+
$object->setLevel(OnePica_AvaTax_Model_Records_Log::LOG_LEVEL_ERROR);
|
46 |
+
}
|
47 |
+
return $this;
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Delete logs for given interval
|
52 |
+
*
|
53 |
+
* @param int $days
|
54 |
+
* @return int
|
55 |
+
*/
|
56 |
+
public function deleteLogsByInterval($days)
|
57 |
+
{
|
58 |
+
return $this->_getWriteAdapter()->delete(
|
59 |
+
$this->getTable('avatax_records/log'),
|
60 |
+
$this->_getWriteAdapter()->quoteInto('created_at < DATE_SUB(UTC_DATE(), INTERVAL ? DAY)', $days)
|
61 |
+
);
|
62 |
+
}
|
63 |
+
}
|
app/code/community/OnePica/AvaTax/Model/Records/Mysql4/Log/Collection.php
CHANGED
@@ -1,25 +1,35 @@
|
|
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 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* Log collection model
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Model_Records_Mysql4_Log_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Construct
|
29 |
+
*/
|
30 |
+
protected function _construct()
|
31 |
+
{
|
32 |
+
parent::_construct();
|
33 |
+
$this->_init('avatax_records/log');
|
34 |
+
}
|
35 |
+
}
|
app/code/community/OnePica/AvaTax/Model/Records/Mysql4/Queue.php
CHANGED
@@ -1,105 +1,130 @@
|
|
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 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
* @param $
|
89 |
-
* @
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
$
|
95 |
-
|
96 |
-
->
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* Queue resource model
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Model_Records_Mysql4_Queue extends Mage_Core_Model_Mysql4_Abstract
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Saved result
|
29 |
+
*/
|
30 |
+
const SAVED_RESULT = 'Saved';
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Deleted result
|
34 |
+
*/
|
35 |
+
const DELETED_RESULT = 'Deleted';
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Construct
|
39 |
+
*/
|
40 |
+
protected function _construct()
|
41 |
+
{
|
42 |
+
$this->_init('avatax_records/queue', 'queue_id');
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Sets various dates before the model is saved.
|
47 |
+
*
|
48 |
+
* @param Mage_Core_Model_Abstract $object
|
49 |
+
* @return $this
|
50 |
+
*/
|
51 |
+
protected function _beforeSave(Mage_Core_Model_Abstract $object)
|
52 |
+
{
|
53 |
+
if (!$object->hasCreatedAt()) {
|
54 |
+
$object->setCreatedAt(gmdate('Y-m-d H:i:s'));
|
55 |
+
}
|
56 |
+
$object->setUpdatedAt(gmdate('Y-m-d H:i:s'));
|
57 |
+
return $this;
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Log the save
|
62 |
+
*
|
63 |
+
* @param Mage_Core_Model_Abstract $object
|
64 |
+
* @return $this
|
65 |
+
*/
|
66 |
+
protected function _afterSave(Mage_Core_Model_Abstract $object)
|
67 |
+
{
|
68 |
+
$this->_logAction($object, self::SAVED_RESULT);
|
69 |
+
return $this;
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Log the delete
|
74 |
+
*
|
75 |
+
* @param Mage_Core_Model_Abstract $object
|
76 |
+
* @return $this
|
77 |
+
*/
|
78 |
+
protected function _afterDelete(Mage_Core_Model_Abstract $object)
|
79 |
+
{
|
80 |
+
$this->_logAction($object, self::DELETED_RESULT);
|
81 |
+
return $this;
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Log action
|
86 |
+
*
|
87 |
+
* @param Mage_Core_Model_Abstract $object
|
88 |
+
* @param string $result
|
89 |
+
* @return $this
|
90 |
+
*/
|
91 |
+
protected function _logAction(Mage_Core_Model_Abstract $object, $result)
|
92 |
+
{
|
93 |
+
$storeId = $object->getStoreId();
|
94 |
+
$logStatus = Mage::getStoreConfig('tax/avatax/log_status', $storeId);
|
95 |
+
if ($logStatus) {
|
96 |
+
$logTypes = Mage::helper('avatax')->getLogType($storeId);
|
97 |
+
if (in_array(OnePica_AvaTax_Model_Source_Logtype::QUEUE, $logTypes)) {
|
98 |
+
Mage::getModel('avatax_records/log')
|
99 |
+
->setStoreId($object->getStoreId())
|
100 |
+
->setLevel(OnePica_AvaTax_Model_Records_Log::LOG_LEVEL_SUCCESS)
|
101 |
+
->setType(OnePica_AvaTax_Model_Source_Logtype::QUEUE)
|
102 |
+
->setRequest(print_r($object->getData(), true))
|
103 |
+
->setResult($result)
|
104 |
+
->save();
|
105 |
+
}
|
106 |
+
}
|
107 |
+
return $this;
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Load invoice by increment id
|
112 |
+
*
|
113 |
+
* @param OnePica_AvaTax_Model_Records_Queue $queue
|
114 |
+
* @param int $invoiceIncrementId
|
115 |
+
* @return $this
|
116 |
+
*/
|
117 |
+
public function loadInvoiceByIncrementId($queue, $invoiceIncrementId)
|
118 |
+
{
|
119 |
+
$adapter = $this->_getReadAdapter();
|
120 |
+
$select = $adapter->select()
|
121 |
+
->from($this->getMainTable())
|
122 |
+
->where('entity_increment_id = ?', $invoiceIncrementId)
|
123 |
+
->where('type = ?', OnePica_AvaTax_Model_Records_Queue::QUEUE_TYPE_INVOICE);
|
124 |
+
|
125 |
+
$data = $adapter->fetchRow($select);
|
126 |
+
$queue->setData($data);
|
127 |
+
|
128 |
+
return $this;
|
129 |
+
}
|
130 |
+
}
|
app/code/community/OnePica/AvaTax/Model/Records/Mysql4/Queue/Collection.php
CHANGED
@@ -1,25 +1,35 @@
|
|
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 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* Queue collection model
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Model_Records_Mysql4_Queue_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Construct
|
29 |
+
*/
|
30 |
+
protected function _construct()
|
31 |
+
{
|
32 |
+
parent::_construct();
|
33 |
+
$this->_init('avatax_records/queue');
|
34 |
+
}
|
35 |
+
}
|
app/code/community/OnePica/AvaTax/Model/Records/Queue.php
CHANGED
@@ -1,70 +1,130 @@
|
|
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 |
-
* @method OnePica_AvaTax_Model_Records_Mysql4_Queue _getResource()
|
18 |
-
*/
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* @method OnePica_AvaTax_Model_Records_Mysql4_Queue _getResource()
|
18 |
+
*/
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Queue model
|
22 |
+
*
|
23 |
+
* @category OnePica
|
24 |
+
* @package OnePica_AvaTax
|
25 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
26 |
+
*/
|
27 |
+
class OnePica_AvaTax_Model_Records_Queue extends Mage_Core_Model_Abstract
|
28 |
+
{
|
29 |
+
/**
|
30 |
+
* Invoice type
|
31 |
+
*/
|
32 |
+
const QUEUE_TYPE_INVOICE = 'Invoice';
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Credit memo type
|
36 |
+
*/
|
37 |
+
const QUEUE_TYPE_CREDITMEMEO = 'Credit memo';
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Pending status
|
41 |
+
*/
|
42 |
+
const QUEUE_STATUS_PENDING = 'Pending';
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Retry status
|
46 |
+
*/
|
47 |
+
const QUEUE_STATUS_RETRY = 'Retry pending';
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Failed status
|
51 |
+
*/
|
52 |
+
const QUEUE_STATUS_FAILED = 'Failed';
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Complete status
|
56 |
+
*/
|
57 |
+
const QUEUE_STATUS_COMPLETE = 'Complete';
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Unbalanced status
|
61 |
+
*/
|
62 |
+
const QUEUE_STATUS_UNBALANCED = 'Unbalanced';
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Internal constructor
|
66 |
+
*/
|
67 |
+
protected function _construct()
|
68 |
+
{
|
69 |
+
parent::_construct();
|
70 |
+
$this->_init('avatax_records/queue');
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Set entity
|
75 |
+
*
|
76 |
+
* @param Mage_Sales_Model_Order_Invoice|Mage_Sales_Model_Order_Creditmemo $object
|
77 |
+
* @return $this
|
78 |
+
*/
|
79 |
+
public function setEntity($object)
|
80 |
+
{
|
81 |
+
$this->setEntityId($object->getId());
|
82 |
+
$this->setEntityIncrementId($object->getIncrementId());
|
83 |
+
$this->setStoreId($object->getStoreId());
|
84 |
+
return $this;
|
85 |
+
}
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Get type options
|
89 |
+
*
|
90 |
+
* @return array
|
91 |
+
*/
|
92 |
+
public function getTypeOptions()
|
93 |
+
{
|
94 |
+
return array(
|
95 |
+
self::QUEUE_TYPE_INVOICE => self::QUEUE_TYPE_INVOICE,
|
96 |
+
self::QUEUE_TYPE_CREDITMEMEO => self::QUEUE_TYPE_CREDITMEMEO
|
97 |
+
);
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Get status options
|
102 |
+
*
|
103 |
+
* @return array
|
104 |
+
*/
|
105 |
+
public function getStatusOptions()
|
106 |
+
{
|
107 |
+
return array(
|
108 |
+
self::QUEUE_STATUS_PENDING => self::QUEUE_STATUS_PENDING,
|
109 |
+
self::QUEUE_STATUS_RETRY => self::QUEUE_STATUS_RETRY,
|
110 |
+
self::QUEUE_STATUS_FAILED => self::QUEUE_STATUS_FAILED,
|
111 |
+
self::QUEUE_STATUS_COMPLETE => self::QUEUE_STATUS_COMPLETE,
|
112 |
+
self::QUEUE_STATUS_UNBALANCED => self::QUEUE_STATUS_UNBALANCED
|
113 |
+
);
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Load invoice by increment id
|
118 |
+
*
|
119 |
+
* @param int $incrementId
|
120 |
+
* @return $this
|
121 |
+
*/
|
122 |
+
public function loadInvoiceByIncrementId($incrementId)
|
123 |
+
{
|
124 |
+
$this->_getResource()->loadInvoiceByIncrementId($this, $incrementId);
|
125 |
+
$this->_afterLoad();
|
126 |
+
$this->setOrigData();
|
127 |
+
|
128 |
+
return $this;
|
129 |
+
}
|
130 |
+
}
|
app/code/community/OnePica/AvaTax/Model/Records/Queue/Process.php
CHANGED
@@ -1,143 +1,210 @@
|
|
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 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
*
|
71 |
-
*
|
72 |
-
*
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* Queue process model
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Model_Records_Queue_Process extends OnePica_AvaTax_Model_Abstract
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Remove the Failed process
|
29 |
+
*
|
30 |
+
* @return $this
|
31 |
+
*/
|
32 |
+
public function clear()
|
33 |
+
{
|
34 |
+
/** @var OnePica_AvaTax_Model_Records_Mysql4_Queue_Collection $queue */
|
35 |
+
$queue = Mage::getModel('avatax_records/queue')->getCollection()
|
36 |
+
->addFieldToFilter('status', array(
|
37 |
+
'in' => array(
|
38 |
+
OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_FAILED,
|
39 |
+
OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_UNBALANCED,
|
40 |
+
OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_COMPLETE
|
41 |
+
)
|
42 |
+
)
|
43 |
+
);
|
44 |
+
|
45 |
+
/** @var OnePica_AvaTax_Model_Records_Queue $item */
|
46 |
+
foreach ($queue as $item) {
|
47 |
+
$item->delete();
|
48 |
+
}
|
49 |
+
|
50 |
+
return $this;
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Run the complete process
|
55 |
+
*
|
56 |
+
* @throws \Exception
|
57 |
+
* @return $this
|
58 |
+
*/
|
59 |
+
public function run()
|
60 |
+
{
|
61 |
+
$this->_cleanCompleted()
|
62 |
+
->_cleanFailed()
|
63 |
+
->_cleanUnbalanced()
|
64 |
+
->_parseInvoices()
|
65 |
+
->_parseCreditMemos();
|
66 |
+
return $this;
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Delete any queue items that have been completed. Items stay in queue for some
|
71 |
+
* transparency into the process.
|
72 |
+
*
|
73 |
+
* @return $this
|
74 |
+
*/
|
75 |
+
protected function _cleanCompleted()
|
76 |
+
{
|
77 |
+
$days = intval(Mage::getStoreConfig('tax/avatax/queue_success_lifetime'));
|
78 |
+
/** @var OnePica_AvaTax_Model_Records_Mysql4_Queue_Collection $queue */
|
79 |
+
$queue = Mage::getModel('avatax_records/queue')->getCollection()
|
80 |
+
->addFieldToFilter('status', OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_COMPLETE)
|
81 |
+
->addFieldToFilter('updated_at', array('lt' => gmdate('Y-m-d H:i:s', strtotime('-' . $days . ' days'))));
|
82 |
+
|
83 |
+
foreach ($queue as $item) {
|
84 |
+
$item->delete();
|
85 |
+
}
|
86 |
+
|
87 |
+
return $this;
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Delete any queue items that have failed. Items stay in queue for some
|
92 |
+
* transparency into the process.
|
93 |
+
*
|
94 |
+
* @return $this
|
95 |
+
*/
|
96 |
+
protected function _cleanFailed()
|
97 |
+
{
|
98 |
+
$days = intval(Mage::getStoreConfig('tax/avatax/queue_failed_lifetime'));
|
99 |
+
/** @var OnePica_AvaTax_Model_Records_Mysql4_Queue_Collection $queue */
|
100 |
+
$queue = Mage::getModel('avatax_records/queue')->getCollection()
|
101 |
+
->addFieldToFilter('status', OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_FAILED)
|
102 |
+
->addFieldToFilter('updated_at', array('lt' => gmdate('Y-m-d H:i:s', strtotime('-' . $days . ' days'))));
|
103 |
+
|
104 |
+
foreach ($queue as $item) {
|
105 |
+
$item->delete();
|
106 |
+
}
|
107 |
+
|
108 |
+
return $this;
|
109 |
+
}
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Delete any queue items that have unbalanced status
|
113 |
+
*
|
114 |
+
* @return $this
|
115 |
+
* @throws \Exception
|
116 |
+
*/
|
117 |
+
protected function _cleanUnbalanced()
|
118 |
+
{
|
119 |
+
$days = (int)Mage::getStoreConfig('tax/avatax/queue_failed_lifetime');
|
120 |
+
/** @var OnePica_AvaTax_Model_Records_Mysql4_Queue_Collection $queue */
|
121 |
+
$queue = Mage::getModel('avatax_records/queue')->getCollection()
|
122 |
+
->addFieldToFilter('status', OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_UNBALANCED)
|
123 |
+
->addFieldToFilter('updated_at', array('lt' => gmdate('Y-m-d H:i:s', strtotime('-' . $days . ' days'))));
|
124 |
+
|
125 |
+
/** @var OnePica_AvaTax_Model_Records_Queue $item */
|
126 |
+
foreach ($queue as $item) {
|
127 |
+
$item->delete();
|
128 |
+
}
|
129 |
+
|
130 |
+
return $this;
|
131 |
+
}
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Attempt to send any pending invoices to Avalara
|
135 |
+
*
|
136 |
+
* @return $this
|
137 |
+
*/
|
138 |
+
protected function _parseInvoices()
|
139 |
+
{
|
140 |
+
/** @var OnePica_AvaTax_Model_Records_Mysql4_Queue_Collection $queue */
|
141 |
+
$queue = Mage::getModel('avatax_records/queue')->getCollection()
|
142 |
+
->addFieldToFilter('type', OnePica_AvaTax_Model_Records_Queue::QUEUE_TYPE_INVOICE)
|
143 |
+
->addFieldToFilter('status', array('neq' => OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_FAILED))
|
144 |
+
->addFieldToFilter('status', array('neq' => OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_COMPLETE))
|
145 |
+
->addFieldToFilter('status', array('neq' => OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_UNBALANCED));
|
146 |
+
foreach ($queue as $item) {
|
147 |
+
$item->setAttempt($item->getAttempt() + 1);
|
148 |
+
try {
|
149 |
+
$invoice = Mage::getModel('sales/order_invoice')->load($item->getEntityId());
|
150 |
+
if ($invoice->getId()) {
|
151 |
+
Mage::getModel('avatax/avatax_invoice')->invoice($invoice, $item);
|
152 |
+
}
|
153 |
+
$item->setStatus(OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_COMPLETE)->setMessage(null)->save();
|
154 |
+
} catch (OnePica_AvaTax_Model_Avatax_Exception_Unbalanced $e) {
|
155 |
+
$item->setStatus(OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_UNBALANCED)
|
156 |
+
->setMessage($e->getMessage())
|
157 |
+
->save();
|
158 |
+
} catch (Exception $e) {
|
159 |
+
$status = ($item->getAttempt() >= OnePica_AvaTax_Model_Config::QUEUE_ATTEMPT_MAX) ?
|
160 |
+
OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_FAILED :
|
161 |
+
OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_RETRY;
|
162 |
+
$item->setStatus($status)
|
163 |
+
->setMessage($e->getMessage())
|
164 |
+
->save();
|
165 |
+
}
|
166 |
+
}
|
167 |
+
|
168 |
+
return $this;
|
169 |
+
}
|
170 |
+
|
171 |
+
/**
|
172 |
+
* Attempt to send any pending credit memos to Avalara
|
173 |
+
*
|
174 |
+
* @return $this
|
175 |
+
*/
|
176 |
+
protected function _parseCreditMemos()
|
177 |
+
{
|
178 |
+
/** @var OnePica_AvaTax_Model_Records_Mysql4_Queue_Collection $queue */
|
179 |
+
$queue = Mage::getModel('avatax_records/queue')->getCollection()
|
180 |
+
->addFieldToFilter('type', OnePica_AvaTax_Model_Records_Queue::QUEUE_TYPE_CREDITMEMEO)
|
181 |
+
->addFieldToFilter('status', array('neq' => OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_FAILED))
|
182 |
+
->addFieldToFilter('status', array('neq' => OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_COMPLETE))
|
183 |
+
->addFieldToFilter('status', array('neq' => OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_UNBALANCED));
|
184 |
+
foreach ($queue as $item) {
|
185 |
+
$item->setAttempt($item->getAttempt() + 1);
|
186 |
+
try {
|
187 |
+
$creditmemo = Mage::getModel('sales/order_creditmemo')->load($item->getEntityId());
|
188 |
+
if ($creditmemo->getId()) {
|
189 |
+
Mage::getModel('avatax/avatax_invoice')->creditmemo($creditmemo, $item);
|
190 |
+
}
|
191 |
+
$item->setStatus(OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_COMPLETE)
|
192 |
+
->setMessage(null)
|
193 |
+
->save();
|
194 |
+
} catch (OnePica_AvaTax_Model_Avatax_Exception_Unbalanced $e) {
|
195 |
+
$item->setStatus(OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_UNBALANCED)
|
196 |
+
->setMessage($e->getMessage())
|
197 |
+
->save();
|
198 |
+
} catch (Exception $e) {
|
199 |
+
$status = ($item->getAttempt() >= OnePica_AvaTax_Model_Config::QUEUE_ATTEMPT_MAX) ?
|
200 |
+
OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_FAILED :
|
201 |
+
OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_RETRY;
|
202 |
+
$item->setStatus($status)
|
203 |
+
->setMessage($e->getMessage())
|
204 |
+
->save();
|
205 |
+
}
|
206 |
+
}
|
207 |
+
|
208 |
+
return $this;
|
209 |
+
}
|
210 |
+
}
|
app/code/community/OnePica/AvaTax/Model/Sales/Quote/Address.php
CHANGED
@@ -1,203 +1,221 @@
|
|
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 |
-
* The Sales Quote Address model
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
if (
|
85 |
-
return
|
86 |
-
}
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
*
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
*
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
*
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
$this->
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
*
|
162 |
-
*
|
163 |
-
* @param
|
164 |
-
* @
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
*
|
179 |
-
*
|
180 |
-
* @
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* The Sales Quote Address 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 extends Mage_Sales_Model_Quote_Address
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Avatax address validator instance
|
29 |
+
*
|
30 |
+
* @var OnePica_AvaTax_Model_Avatax_Address
|
31 |
+
*/
|
32 |
+
protected $_avataxValidator = null;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Validation results array (to avoid double valiadation of same address)
|
36 |
+
*
|
37 |
+
* @var array
|
38 |
+
*/
|
39 |
+
static protected $_validationResult = array();
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Avatax address validator accessor method
|
43 |
+
*
|
44 |
+
* @return OnePica_AvaTax_Model_Avatax_Address
|
45 |
+
*/
|
46 |
+
public function getAvataxValidator()
|
47 |
+
{
|
48 |
+
return $this->_avataxValidator;
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Avatax address validator mutator method
|
53 |
+
*
|
54 |
+
* @param OnePica_AvaTax_Model_Avatax_Address $object
|
55 |
+
* @return $this
|
56 |
+
*/
|
57 |
+
public function setAvataxValidator(OnePica_AvaTax_Model_Avatax_Address $object)
|
58 |
+
{
|
59 |
+
$this->_avataxValidator = $object;
|
60 |
+
return $this;
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Creates a hash key based on only address data for caching
|
65 |
+
*
|
66 |
+
* @return string
|
67 |
+
*/
|
68 |
+
public function getCacheHashKey()
|
69 |
+
{
|
70 |
+
if (!$this->getData('cache_hash_key')) {
|
71 |
+
$this->setData('cache_hash_key', hash('md4', $this->format('text')));
|
72 |
+
}
|
73 |
+
return $this->getData('cache_hash_key');
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Validates the address. AvaTax validation is invoked if the this is a ship-to address.
|
78 |
+
* Returns true on success and an array with an error on failure.
|
79 |
+
*
|
80 |
+
* @return true|array
|
81 |
+
*/
|
82 |
+
public function validate()
|
83 |
+
{
|
84 |
+
if (!Mage::helper('avatax')->fullStopOnError()) {
|
85 |
+
return true;
|
86 |
+
}
|
87 |
+
|
88 |
+
$result = parent::validate();
|
89 |
+
|
90 |
+
//if base validation fails, don't bother with additional validation
|
91 |
+
if ($result !== true) {
|
92 |
+
return $result;
|
93 |
+
}
|
94 |
+
|
95 |
+
//if ship-to address, do AvaTax validation
|
96 |
+
$data = Mage::app()->getRequest()->getPost('billing', array());
|
97 |
+
$useForShipping = isset($data['use_for_shipping']) ? (int)$data['use_for_shipping'] : 0;
|
98 |
+
|
99 |
+
if ($this->getAddressType() == self::TYPE_SHIPPING
|
100 |
+
|| $this->getUseForShipping()/* <1.9 */ || $useForShipping/* >=1.9 */) {
|
101 |
+
if (!isset(self::$_validationResult[$this->getAddressId()])) {
|
102 |
+
if (!$this->getAvataxValidator()) {
|
103 |
+
$validator = Mage::getModel('avatax/avatax_address')->setAddress($this);
|
104 |
+
$this->setAvataxValidator($validator);
|
105 |
+
}
|
106 |
+
|
107 |
+
self::$_validationResult[$this->getAddressId()] = $this->getAvataxValidator()->validate();
|
108 |
+
}
|
109 |
+
|
110 |
+
return self::$_validationResult[$this->getAddressId()];
|
111 |
+
}
|
112 |
+
|
113 |
+
return $result;
|
114 |
+
}
|
115 |
+
|
116 |
+
/* BELOW ARE MAGE CORE PROPERTIES AND METHODS ADDED FOR OLDER VERSION COMPATABILITY */
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Total amount
|
120 |
+
*
|
121 |
+
* @var array
|
122 |
+
*/
|
123 |
+
protected $_totalAmounts = array();
|
124 |
+
|
125 |
+
/**
|
126 |
+
* Base total amount
|
127 |
+
*
|
128 |
+
* @var array
|
129 |
+
*/
|
130 |
+
protected $_baseTotalAmounts = array();
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Add amount total amount value
|
134 |
+
*
|
135 |
+
* @param string $code
|
136 |
+
* @param float $amount
|
137 |
+
* @return Mage_Sales_Model_Quote_Address
|
138 |
+
*/
|
139 |
+
public function addTotalAmount($code, $amount)
|
140 |
+
{
|
141 |
+
$amount = $this->getTotalAmount($code)+$amount;
|
142 |
+
$this->setTotalAmount($code, $amount);
|
143 |
+
return $this;
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Add amount total amount value in base store currency
|
148 |
+
*
|
149 |
+
* @param string $code
|
150 |
+
* @param float $amount
|
151 |
+
* @return Mage_Sales_Model_Quote_Address
|
152 |
+
*/
|
153 |
+
public function addBaseTotalAmount($code, $amount)
|
154 |
+
{
|
155 |
+
$amount = $this->getBaseTotalAmount($code)+$amount;
|
156 |
+
$this->setBaseTotalAmount($code, $amount);
|
157 |
+
return $this;
|
158 |
+
}
|
159 |
+
|
160 |
+
/**
|
161 |
+
* Set total amount value
|
162 |
+
*
|
163 |
+
* @param string $code
|
164 |
+
* @param float $amount
|
165 |
+
* @return Mage_Sales_Model_Quote_Address
|
166 |
+
*/
|
167 |
+
public function setTotalAmount($code, $amount)
|
168 |
+
{
|
169 |
+
$this->_totalAmounts[$code] = $amount;
|
170 |
+
if ($code != 'subtotal') {
|
171 |
+
$code = $code.'_amount';
|
172 |
+
}
|
173 |
+
$this->setData($code, $amount);
|
174 |
+
return $this;
|
175 |
+
}
|
176 |
+
|
177 |
+
/**
|
178 |
+
* Set total amount value in base store currency
|
179 |
+
*
|
180 |
+
* @param string $code
|
181 |
+
* @param float $amount
|
182 |
+
* @return Mage_Sales_Model_Quote_Address
|
183 |
+
*/
|
184 |
+
public function setBaseTotalAmount($code, $amount)
|
185 |
+
{
|
186 |
+
$this->_baseTotalAmounts[$code] = $amount;
|
187 |
+
if ($code != 'subtotal') {
|
188 |
+
$code = $code.'_amount';
|
189 |
+
}
|
190 |
+
$this->setData('base_'.$code, $amount);
|
191 |
+
return $this;
|
192 |
+
}
|
193 |
+
|
194 |
+
/**
|
195 |
+
* Get total amount value by code
|
196 |
+
*
|
197 |
+
* @param string $code
|
198 |
+
* @return float
|
199 |
+
*/
|
200 |
+
public function getTotalAmount($code)
|
201 |
+
{
|
202 |
+
if (isset($this->_totalAmounts[$code])) {
|
203 |
+
return $this->_totalAmounts[$code];
|
204 |
+
}
|
205 |
+
return 0;
|
206 |
+
}
|
207 |
+
|
208 |
+
/**
|
209 |
+
* Get total amount value by code in base store curncy
|
210 |
+
*
|
211 |
+
* @param string $code
|
212 |
+
* @return float
|
213 |
+
*/
|
214 |
+
public function getBaseTotalAmount($code)
|
215 |
+
{
|
216 |
+
if (isset($this->_baseTotalAmounts[$code])) {
|
217 |
+
return $this->_baseTotalAmounts[$code];
|
218 |
+
}
|
219 |
+
return 0;
|
220 |
+
}
|
221 |
+
}
|
app/code/community/OnePica/AvaTax/Model/Sales/Quote/Address/Total/Grand.php
CHANGED
@@ -17,28 +17,44 @@
|
|
17 |
|
18 |
/**
|
19 |
* Grand totals calculation model
|
|
|
|
|
|
|
|
|
20 |
*/
|
21 |
class OnePica_AvaTax_Model_Sales_Quote_Address_Total_Grand extends Mage_Sales_Model_Quote_Address_Total_Grand
|
22 |
{
|
23 |
-
|
24 |
/**
|
25 |
* Collect grand total address amount
|
26 |
*
|
27 |
-
* @param
|
28 |
-
* @return
|
29 |
*/
|
30 |
-
public function collect(Mage_Sales_Model_Quote_Address $address)
|
31 |
-
|
|
|
32 |
parent::collect($address);
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
}
|
39 |
}
|
40 |
-
|
41 |
return $this;
|
42 |
}
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
}
|
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_Data $helper */
|
56 |
+
$helper = Mage::helper('avatax');
|
57 |
+
$storeId = $address->getQuote()->getStoreId();
|
58 |
+
return $helper->isAddressActionable($address, $storeId, OnePica_AvaTax_Model_Config::REGIONFILTER_TAX);
|
59 |
+
}
|
60 |
}
|
app/code/community/OnePica/AvaTax/Model/Sales/Quote/Address/Total/Tax.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* OnePica_AvaTax
|
5 |
*
|
@@ -18,147 +17,169 @@
|
|
18 |
|
19 |
/**
|
20 |
* Tax totals calculation model
|
|
|
|
|
|
|
|
|
21 |
*/
|
22 |
-
class OnePica_AvaTax_Model_Sales_Quote_Address_Total_Tax extends Mage_Sales_Model_Quote_Address_Total_Abstract
|
23 |
-
|
24 |
/**
|
25 |
* Class constructor
|
26 |
*/
|
27 |
-
public function __construct()
|
|
|
28 |
$this->setCode('tax');
|
29 |
}
|
30 |
|
31 |
/**
|
32 |
* Collect tax totals for quote address. If quote address doesn't have a
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
*
|
37 |
* @param Mage_Sales_Model_Quote_Address $address
|
38 |
* @return Mage_Tax_Model_Sales_Total_Quote
|
39 |
*/
|
40 |
-
public function collect(Mage_Sales_Model_Quote_Address $address)
|
|
|
41 |
$this->_setAddress($address);
|
42 |
parent::collect($address);
|
43 |
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
|
|
152 |
return $this;
|
153 |
}
|
154 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
/**
|
156 |
* Add tax totals information to address object
|
157 |
*
|
158 |
* @param Mage_Sales_Model_Quote_Address $address
|
159 |
* @return Mage_Tax_Model_Sales_Total_Quote
|
160 |
*/
|
161 |
-
public function fetch(Mage_Sales_Model_Quote_Address $address)
|
|
|
162 |
$config = Mage::getSingleton('tax/config');
|
163 |
$quote = $address->getQuote();
|
164 |
$store = $quote->getStore();
|
@@ -171,12 +192,12 @@ class OnePica_AvaTax_Model_Sales_Quote_Address_Total_Tax extends Mage_Sales_Mode
|
|
171 |
$id = 'avatax-' . $key;
|
172 |
$fullInfo[$id] = array(
|
173 |
'rates' => array(array(
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
)),
|
181 |
'percent' => $row['rate'],
|
182 |
'id' => $id,
|
@@ -199,8 +220,8 @@ class OnePica_AvaTax_Model_Sales_Quote_Address_Total_Tax extends Mage_Sales_Mode
|
|
199 |
/**
|
200 |
* Modify subtotal
|
201 |
*/
|
202 |
-
if (
|
203 |
-
|
204 |
$subtotalInclTax = $address->getSubtotal() + $address->getTaxAmount() - $address->getShippingTaxAmount();
|
205 |
$address->setSubtotalInclTax($subtotalInclTax);
|
206 |
|
@@ -224,15 +245,22 @@ class OnePica_AvaTax_Model_Sales_Quote_Address_Total_Tax extends Mage_Sales_Mode
|
|
224 |
* @var string
|
225 |
*/
|
226 |
protected $_code;
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
protected $_address = null;
|
228 |
|
229 |
/**
|
230 |
* Add total model amount value to address
|
231 |
*
|
232 |
-
* @param
|
233 |
-
* @return
|
234 |
*/
|
235 |
-
protected function _addAmount($amount)
|
|
|
236 |
$this->_getAddress()->addTotalAmount($this->getCode(), $amount);
|
237 |
return $this;
|
238 |
}
|
@@ -240,21 +268,23 @@ class OnePica_AvaTax_Model_Sales_Quote_Address_Total_Tax extends Mage_Sales_Mode
|
|
240 |
/**
|
241 |
* Add total model base amount value to address
|
242 |
*
|
243 |
-
* @param
|
244 |
-
* @return
|
245 |
*/
|
246 |
-
protected function _addBaseAmount($baseAmount)
|
|
|
247 |
$this->_getAddress()->addBaseTotalAmount($this->getCode(), $baseAmount);
|
248 |
return $this;
|
249 |
}
|
250 |
|
251 |
/**
|
252 |
-
* Set address
|
253 |
*
|
254 |
* @param Mage_Sales_Model_Quote_Address $address
|
255 |
* @return Mage_Sales_Model_Quote_Address_Total_Abstract
|
256 |
*/
|
257 |
-
protected function _setAddress(Mage_Sales_Model_Quote_Address $address)
|
|
|
258 |
$this->_address = $address;
|
259 |
return $this;
|
260 |
}
|
@@ -262,16 +292,14 @@ class OnePica_AvaTax_Model_Sales_Quote_Address_Total_Tax extends Mage_Sales_Mode
|
|
262 |
/**
|
263 |
* Get quote address object
|
264 |
*
|
265 |
-
* @
|
266 |
-
* @
|
267 |
*/
|
268 |
-
protected function _getAddress()
|
|
|
269 |
if ($this->_address === null) {
|
270 |
-
Mage::
|
271 |
-
Mage::helper('sales')->__('Address model is not defined')
|
272 |
-
);
|
273 |
}
|
274 |
return $this->_address;
|
275 |
}
|
276 |
-
|
277 |
}
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* OnePica_AvaTax
|
4 |
*
|
17 |
|
18 |
/**
|
19 |
* Tax 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_Tax extends Mage_Sales_Model_Quote_Address_Total_Abstract
|
26 |
+
{
|
27 |
/**
|
28 |
* Class constructor
|
29 |
*/
|
30 |
+
public function __construct()
|
31 |
+
{
|
32 |
$this->setCode('tax');
|
33 |
}
|
34 |
|
35 |
/**
|
36 |
* Collect tax totals for quote address. If quote address doesn't have a
|
37 |
+
* postal code or postal code is "-" (OneStepCheckout), no tax is requested
|
38 |
+
* from Avatax. When selling to a country that doesn't require postal code
|
39 |
+
* this could be a problem, but Avatax doesn't support those locations yet.
|
40 |
*
|
41 |
* @param Mage_Sales_Model_Quote_Address $address
|
42 |
* @return Mage_Tax_Model_Sales_Total_Quote
|
43 |
*/
|
44 |
+
public function collect(Mage_Sales_Model_Quote_Address $address)
|
45 |
+
{
|
46 |
$this->_setAddress($address);
|
47 |
parent::collect($address);
|
48 |
|
49 |
+
if ($address->getPostcode() && $address->getPostcode() != '-') {
|
50 |
+
$store = $address->getQuote()->getStore();
|
51 |
+
/** @var OnePica_AvaTax_Model_Avatax_Estimate $calculator */
|
52 |
+
$calculator = Mage::getModel('avatax/avatax_estimate');
|
53 |
+
|
54 |
+
$address->setTotalAmount($this->getCode(), 0);
|
55 |
+
$address->setBaseTotalAmount($this->getCode(), 0);
|
56 |
+
|
57 |
+
$address->setTaxAmount(0);
|
58 |
+
$address->setBaseTaxAmount(0);
|
59 |
+
$address->setShippingTaxAmount(0);
|
60 |
+
$address->setBaseShippingTaxAmount(0);
|
61 |
+
|
62 |
+
//Added check for calculating tax for regions filtered in the admin
|
63 |
+
if ($this->_isAddressActionable($address)) {
|
64 |
+
foreach ($address->getAllItems() as $item) {
|
65 |
+
$item->setAddress($address);
|
66 |
+
$baseAmount = $calculator->getItemTax($item);
|
67 |
+
$amount = Mage::app()->getStore()->convertPrice($baseAmount);
|
68 |
+
$percent = $calculator->getItemRate($item);
|
69 |
+
|
70 |
+
$item->setTaxAmount($amount);
|
71 |
+
$item->setBaseTaxAmount($baseAmount);
|
72 |
+
$item->setTaxPercent($percent);
|
73 |
+
|
74 |
+
$item->setPriceInclTax($item->getPrice() + ($amount / $item->getQty()));
|
75 |
+
$item->setBasePriceInclTax($item->getBasePrice() + ($baseAmount / $item->getQty()));
|
76 |
+
$item->setRowTotalInclTax($item->getRowTotal() + $amount);
|
77 |
+
$item->setBaseRowTotalInclTax($item->getBaseRowTotal() + $baseAmount);
|
78 |
+
|
79 |
+
if (!$calculator->isProductCalculated($item)) {
|
80 |
+
$this->_addAmount($amount);
|
81 |
+
$this->_addBaseAmount($baseAmount);
|
82 |
+
}
|
83 |
+
}
|
84 |
+
|
85 |
+
if ($address->getAddressType() == Mage_Sales_Model_Quote_Address::TYPE_SHIPPING
|
86 |
+
|| $address->getUseForShipping()) {
|
87 |
+
$shippingItem = new Varien_Object();
|
88 |
+
$shippingItem->setId(Mage::helper('avatax')->getShippingSku($store->getId()));
|
89 |
+
$shippingItem->setProductId(Mage::helper('avatax')->getShippingSku($store->getId()));
|
90 |
+
$shippingItem->setAddress($address);
|
91 |
+
$baseShippingTax = $calculator->getItemTax($shippingItem);
|
92 |
+
$shippingTax = Mage::app()->getStore()->convertPrice($baseShippingTax);
|
93 |
+
|
94 |
+
$shippingAmt = $address->getTotalAmount('shipping');
|
95 |
+
$baseShippingAmt = $address->getBaseTotalAmount('shipping');
|
96 |
+
|
97 |
+
$address->setShippingTaxAmount($shippingTax);
|
98 |
+
$address->setBaseShippingTaxAmount($baseShippingTax);
|
99 |
+
$address->setShippingInclTax($shippingAmt + $shippingTax);
|
100 |
+
$address->setBaseShippingInclTax($baseShippingAmt + $baseShippingTax);
|
101 |
+
$address->setShippingTaxable($shippingTax ? $shippingAmt : 0);
|
102 |
+
$address->setBaseShippingTaxable($baseShippingTax ? $baseShippingAmt : 0);
|
103 |
+
$address->setIsShippingInclTax(false);
|
104 |
+
|
105 |
+
$this->_addAmount($shippingTax);
|
106 |
+
$this->_addBaseAmount($baseShippingTax);
|
107 |
+
}
|
108 |
+
|
109 |
+
if ($address->getGwPrice() > 0) {
|
110 |
+
$gwOrderItem = new Varien_Object();
|
111 |
+
$gwOrderItem->setId(Mage::helper('avatax')->getGwOrderSku($store->getId()));
|
112 |
+
$gwOrderItem->setProductId(Mage::helper('avatax')->getGwOrderSku($store->getId()));
|
113 |
+
$gwOrderItem->setAddress($address);
|
114 |
+
$baseGwOrderTax = $calculator->getItemTax($gwOrderItem);
|
115 |
+
$gwOrderTax = Mage::app()->getStore()->convertPrice($baseGwOrderTax);
|
116 |
+
|
117 |
+
$address->setGwBaseTaxAmount($address->getGwBasePrice() + $baseGwOrderTax);
|
118 |
+
$address->setGwTaxAmount($address->getGwPrice() + $gwOrderTax);
|
119 |
+
|
120 |
+
$this->_addAmount($gwOrderTax);
|
121 |
+
$this->_addBaseAmount($baseGwOrderTax);
|
122 |
+
}
|
123 |
+
|
124 |
+
if ($address->getGwItemsPrice() > 0) {
|
125 |
+
$gwIndividualItem = new Varien_Object();
|
126 |
+
$gwIndividualItem->setId(Mage::helper('avatax')->getGwItemsSku($store->getId()));
|
127 |
+
$gwIndividualItem->setProductId(Mage::helper('avatax')->getGwItemsSku($store->getId()));
|
128 |
+
$gwIndividualItem->setAddress($address);
|
129 |
+
$baseGwItemsTax = $calculator->getItemTax($gwIndividualItem);
|
130 |
+
$gwItemsTax = Mage::app()->getStore()->convertPrice($baseGwItemsTax);
|
131 |
+
|
132 |
+
$address->setGwItemsBaseTaxAmount($address->getGwItemsBasePrice() + $baseGwItemsTax);
|
133 |
+
$address->setGwItemsTaxAmount($address->getGwItemsPrice() + $gwItemsTax);
|
134 |
+
|
135 |
+
$this->_addAmount($gwItemsTax);
|
136 |
+
$this->_addBaseAmount($baseGwItemsTax);
|
137 |
+
}
|
138 |
+
|
139 |
+
if ($address->getGwAddPrintedCard()) {
|
140 |
+
$gwPrintedCardItem = new Varien_Object();
|
141 |
+
$gwPrintedCardItem->setId(Mage::helper('avatax')->getGwPrintedCardSku($store->getId()));
|
142 |
+
$gwPrintedCardItem->setProductId(Mage::helper('avatax')->getGwPrintedCardSku($store->getId()));
|
143 |
+
$gwPrintedCardItem->setAddress($address);
|
144 |
+
$baseGwPrintedCardTax = $calculator->getItemTax($gwPrintedCardItem);
|
145 |
+
$gwPrintedCardTax = Mage::app()->getStore()->convertPrice($baseGwPrintedCardTax);
|
146 |
+
|
147 |
+
$address->setGwPrintedCardBaseTaxAmount(
|
148 |
+
$address->getGwPrintedCardBasePrice() + $baseGwPrintedCardTax
|
149 |
+
);
|
150 |
+
$address->setGwPrintedCardTaxAmount($address->getGwPrintedCardPrice() + $gwPrintedCardTax);
|
151 |
+
|
152 |
+
$this->_addAmount($gwPrintedCardTax);
|
153 |
+
$this->_addBaseAmount($baseGwPrintedCardTax);
|
154 |
+
}
|
155 |
+
}
|
156 |
+
}
|
157 |
+
|
158 |
return $this;
|
159 |
}
|
160 |
|
161 |
+
/**
|
162 |
+
* Check if address actionable to calculate tax
|
163 |
+
*
|
164 |
+
* @param Mage_Sales_Model_Quote_Address $address
|
165 |
+
* @return bool
|
166 |
+
*/
|
167 |
+
protected function _isAddressActionable($address)
|
168 |
+
{
|
169 |
+
/** @var OnePica_AvaTax_Helper_Data $helper */
|
170 |
+
$helper = Mage::helper('avatax');
|
171 |
+
$storeId = $address->getQuote()->getStoreId();
|
172 |
+
return $helper->isAddressActionable($address, $storeId, OnePica_AvaTax_Model_Config::REGIONFILTER_TAX);
|
173 |
+
}
|
174 |
+
|
175 |
/**
|
176 |
* Add tax totals information to address object
|
177 |
*
|
178 |
* @param Mage_Sales_Model_Quote_Address $address
|
179 |
* @return Mage_Tax_Model_Sales_Total_Quote
|
180 |
*/
|
181 |
+
public function fetch(Mage_Sales_Model_Quote_Address $address)
|
182 |
+
{
|
183 |
$config = Mage::getSingleton('tax/config');
|
184 |
$quote = $address->getQuote();
|
185 |
$store = $quote->getStore();
|
192 |
$id = 'avatax-' . $key;
|
193 |
$fullInfo[$id] = array(
|
194 |
'rates' => array(array(
|
195 |
+
'code' => $row['name'],
|
196 |
+
'title' => $row['name'],
|
197 |
+
'percent' => $row['rate'],
|
198 |
+
'position' => $key,
|
199 |
+
'priority' => $key,
|
200 |
+
'rule_id' => 0
|
201 |
)),
|
202 |
'percent' => $row['rate'],
|
203 |
'id' => $id,
|
220 |
/**
|
221 |
* Modify subtotal
|
222 |
*/
|
223 |
+
if (method_exists($config, "displayCartSubtotalBoth") && method_exists($config, "displayCartSubtotalInclTax")
|
224 |
+
&& ($config->displayCartSubtotalBoth($store) || $config->displayCartSubtotalInclTax($store))) {
|
225 |
$subtotalInclTax = $address->getSubtotal() + $address->getTaxAmount() - $address->getShippingTaxAmount();
|
226 |
$address->setSubtotalInclTax($subtotalInclTax);
|
227 |
|
245 |
* @var string
|
246 |
*/
|
247 |
protected $_code;
|
248 |
+
|
249 |
+
/**
|
250 |
+
* Quote address
|
251 |
+
*
|
252 |
+
* @var Mage_Sales_Model_Quote_Address|null
|
253 |
+
*/
|
254 |
protected $_address = null;
|
255 |
|
256 |
/**
|
257 |
* Add total model amount value to address
|
258 |
*
|
259 |
+
* @param float $amount
|
260 |
+
* @return Mage_Sales_Model_Quote_Address_Total_Abstract
|
261 |
*/
|
262 |
+
protected function _addAmount($amount)
|
263 |
+
{
|
264 |
$this->_getAddress()->addTotalAmount($this->getCode(), $amount);
|
265 |
return $this;
|
266 |
}
|
268 |
/**
|
269 |
* Add total model base amount value to address
|
270 |
*
|
271 |
+
* @param float $baseAmount
|
272 |
+
* @return Mage_Sales_Model_Quote_Address_Total_Abstract
|
273 |
*/
|
274 |
+
protected function _addBaseAmount($baseAmount)
|
275 |
+
{
|
276 |
$this->_getAddress()->addBaseTotalAmount($this->getCode(), $baseAmount);
|
277 |
return $this;
|
278 |
}
|
279 |
|
280 |
/**
|
281 |
+
* Set address which can be used inside totals calculation
|
282 |
*
|
283 |
* @param Mage_Sales_Model_Quote_Address $address
|
284 |
* @return Mage_Sales_Model_Quote_Address_Total_Abstract
|
285 |
*/
|
286 |
+
protected function _setAddress(Mage_Sales_Model_Quote_Address $address)
|
287 |
+
{
|
288 |
$this->_address = $address;
|
289 |
return $this;
|
290 |
}
|
292 |
/**
|
293 |
* Get quote address object
|
294 |
*
|
295 |
+
* @return Mage_Sales_Model_Quote_Address
|
296 |
+
* @throws Mage_Core_Exception
|
297 |
*/
|
298 |
+
protected function _getAddress()
|
299 |
+
{
|
300 |
if ($this->_address === null) {
|
301 |
+
throw new Mage_Core_Exception(Mage::helper('sales')->__('Address model is not defined'));
|
|
|
|
|
302 |
}
|
303 |
return $this->_address;
|
304 |
}
|
|
|
305 |
}
|
app/code/community/OnePica/AvaTax/Model/Session.php
CHANGED
@@ -1,27 +1,36 @@
|
|
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 |
-
* The AvaTax Session model
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* The AvaTax Session model
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Model_Session extends Mage_Core_Model_Session_Abstract
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Construct
|
29 |
+
*
|
30 |
+
* @param array $data
|
31 |
+
*/
|
32 |
+
public function __construct($data = array())
|
33 |
+
{
|
34 |
+
$this->init('avatax');
|
35 |
+
}
|
36 |
+
}
|
app/code/community/OnePica/AvaTax/Model/Source/Actions.php
CHANGED
@@ -1,43 +1,53 @@
|
|
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 |
class OnePica_AvaTax_Model_Source_Actions
|
20 |
{
|
21 |
/**
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
public function toOptionArray()
|
27 |
{
|
28 |
return array(
|
29 |
array(
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
|
|
|
|
35 |
array(
|
36 |
-
|
37 |
-
|
|
|
38 |
array(
|
39 |
-
|
40 |
-
|
|
|
41 |
);
|
42 |
}
|
43 |
}
|
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 |
+
* Actions source model
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
class OnePica_AvaTax_Model_Source_Actions
|
26 |
{
|
27 |
/**
|
28 |
+
* Gets the list of cache methods for the admin config dropdown
|
29 |
+
*
|
30 |
+
* @return array
|
31 |
+
*/
|
32 |
public function toOptionArray()
|
33 |
{
|
34 |
return array(
|
35 |
array(
|
36 |
+
'value' => OnePica_AvaTax_Model_Config::ACTION_DISABLE,
|
37 |
+
'label' => Mage::helper('avatax')->__('Disable')
|
38 |
+
),
|
39 |
+
array(
|
40 |
+
'value' => OnePica_AvaTax_Model_Config::ACTION_CALC,
|
41 |
+
'label' => Mage::helper('avatax')->__('Enable: calculate tax')
|
42 |
+
),
|
43 |
array(
|
44 |
+
'value' => OnePica_AvaTax_Model_Config::ACTION_CALC_SUBMIT,
|
45 |
+
'label' => Mage::helper('avatax')->__('Enable: calculate tax, submit data')
|
46 |
+
),
|
47 |
array(
|
48 |
+
'value' => OnePica_AvaTax_Model_Config::ACTION_CALC_SUBMIT_COMMIT,
|
49 |
+
'label' => Mage::helper('avatax')->__('Enable: calculate tax, submit data, and commit')
|
50 |
+
)
|
51 |
);
|
52 |
}
|
53 |
}
|
app/code/community/OnePica/AvaTax/Model/Source/Addressvalidation.php
CHANGED
@@ -15,30 +15,50 @@
|
|
15 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
*/
|
17 |
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
class OnePica_AvaTax_Model_Source_Addressvalidation
|
20 |
{
|
21 |
-
const DISABLED = 0;
|
22 |
-
const ENABLED_PREVENT_ORDER = 1;
|
23 |
-
const ENABLED_ALLOW_ORDER = 2;
|
24 |
-
|
25 |
/**
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
public function toOptionArray()
|
31 |
{
|
32 |
return array(
|
33 |
array(
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
|
|
|
|
|
|
42 |
);
|
43 |
}
|
44 |
}
|
15 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
*/
|
17 |
|
18 |
+
/**
|
19 |
+
* Address validation source model
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
class OnePica_AvaTax_Model_Source_Addressvalidation
|
26 |
{
|
|
|
|
|
|
|
|
|
27 |
/**
|
28 |
+
* Disabled
|
29 |
+
*/
|
30 |
+
const DISABLED = 0;
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Enabled + Prevent order
|
34 |
+
*/
|
35 |
+
const ENABLED_PREVENT_ORDER = 1;
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Enabled + Allow order
|
39 |
+
*/
|
40 |
+
const ENABLED_ALLOW_ORDER = 2;
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Gets the list of address validation for the admin config dropdown
|
44 |
+
*
|
45 |
+
* @return array
|
46 |
+
*/
|
47 |
public function toOptionArray()
|
48 |
{
|
49 |
return array(
|
50 |
array(
|
51 |
+
'value' => self::DISABLED,
|
52 |
+
'label' => Mage::helper('avatax')->__('Disabled')
|
53 |
+
),
|
54 |
+
array(
|
55 |
+
'value' => self::ENABLED_PREVENT_ORDER,
|
56 |
+
'label' => Mage::helper('avatax')->__('Enabled + Prevent Order')
|
57 |
+
),
|
58 |
+
array(
|
59 |
+
'value' => self::ENABLED_ALLOW_ORDER,
|
60 |
+
'label' => Mage::helper('avatax')->__('Enabled + Allow Order')
|
61 |
+
)
|
62 |
);
|
63 |
}
|
64 |
}
|
app/code/community/OnePica/AvaTax/Model/Source/Customercodeformat.php
CHANGED
@@ -1,44 +1,64 @@
|
|
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 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* Customer code format source model
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Model_Source_Customercodeformat
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Legacy format
|
29 |
+
*/
|
30 |
+
const LEGACY = 0; //depricated, included for stores who are upgrading so the code format doesn't change unexpectedly
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Customer id format
|
34 |
+
*/
|
35 |
+
const CUST_ID = 1; //recommended
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Customer email format
|
39 |
+
*/
|
40 |
+
const CUST_EMAIL = 2;
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Gets the list of cache methods for the admin config dropdown
|
44 |
+
*
|
45 |
+
* @return array
|
46 |
+
*/
|
47 |
+
public function toOptionArray()
|
48 |
+
{
|
49 |
+
return array(
|
50 |
+
array(
|
51 |
+
'value' => self::CUST_ID,
|
52 |
+
'label' => 'customer_id'
|
53 |
+
),
|
54 |
+
array(
|
55 |
+
'value' => self::CUST_EMAIL,
|
56 |
+
'label' => 'customer_email'
|
57 |
+
),
|
58 |
+
array(
|
59 |
+
'value' => self::LEGACY,
|
60 |
+
'label' => 'customer_name (customer_id)'
|
61 |
+
)
|
62 |
+
);
|
63 |
+
}
|
64 |
+
}
|
app/code/community/OnePica/AvaTax/Model/Source/Error.php
CHANGED
@@ -1,37 +1,45 @@
|
|
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 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* Error mode source model
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Model_Source_Error
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Gets the list of cache methods for the admin config dropdown
|
29 |
+
*
|
30 |
+
* @return array
|
31 |
+
*/
|
32 |
+
public function toOptionArray()
|
33 |
+
{
|
34 |
+
return array(
|
35 |
+
array(
|
36 |
+
'value' => 1,
|
37 |
+
'label' => Mage::helper('avatax')->__('Disable checkout & show error message')
|
38 |
+
),
|
39 |
+
array(
|
40 |
+
'value' => 0,
|
41 |
+
'label' => Mage::helper('avatax')->__('Allow checkout without charging tax (no error message)')
|
42 |
+
)
|
43 |
+
);
|
44 |
+
}
|
45 |
+
}
|
app/code/community/OnePica/AvaTax/Model/Source/Fieldlist.php
CHANGED
@@ -15,31 +15,35 @@
|
|
15 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
*/
|
17 |
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
class OnePica_AvaTax_Model_Source_Fieldlist
|
20 |
{
|
21 |
/**
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
public function toOptionArray()
|
27 |
{
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
return $arr;
|
43 |
}
|
44 |
}
|
45 |
-
|
15 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
*/
|
17 |
|
18 |
+
/**
|
19 |
+
* Field list source model
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
class OnePica_AvaTax_Model_Source_Fieldlist
|
26 |
{
|
27 |
/**
|
28 |
+
* Gets the list of required fileds for the admin config dropdown
|
29 |
+
*
|
30 |
+
* @return array
|
31 |
+
*/
|
32 |
public function toOptionArray()
|
33 |
{
|
34 |
+
$obj = Mage::getConfig()->getNode('admin/fieldsets/customer_dataflow');
|
35 |
+
|
36 |
+
foreach ($obj as $key => $obj2) {
|
37 |
+
foreach ($obj2 as $key2 => $obj3) {
|
38 |
+
if ($obj3->shipping) {
|
39 |
+
$arr[] = array(
|
40 |
+
'value' => $key2,
|
41 |
+
'label' => Mage::helper('avatax')->__($key2),
|
42 |
+
);
|
43 |
+
}
|
44 |
+
}
|
45 |
+
}
|
46 |
+
|
47 |
+
return $arr;
|
|
|
48 |
}
|
49 |
}
|
|
app/code/community/OnePica/AvaTax/Model/Source/Logmode.php
CHANGED
@@ -1,44 +1,64 @@
|
|
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 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* Log mode source model
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Model_Source_Logmode
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Only errors mode
|
29 |
+
*/
|
30 |
+
const ERRORS = 0;
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Normal mode
|
34 |
+
*/
|
35 |
+
const NORMAL = 1;
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Debug mode
|
39 |
+
*/
|
40 |
+
const DEBUG = 2;
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Gets the list of cache methods for the admin config dropdown
|
44 |
+
*
|
45 |
+
* @return array
|
46 |
+
*/
|
47 |
+
public function toOptionArray()
|
48 |
+
{
|
49 |
+
return array(
|
50 |
+
array(
|
51 |
+
'value' => self::ERRORS,
|
52 |
+
'label' => Mage::helper('avatax')->__('Log only errors')
|
53 |
+
),
|
54 |
+
array(
|
55 |
+
'value' => self::NORMAL,
|
56 |
+
'label' => Mage::helper('avatax')->__('Log all actions (recommended)')
|
57 |
+
),
|
58 |
+
array(
|
59 |
+
'value' => self::DEBUG,
|
60 |
+
'label' => Mage::helper('avatax')->__('Log all actions with trace (debug mode)')
|
61 |
+
)
|
62 |
+
);
|
63 |
+
}
|
64 |
+
}
|
app/code/community/OnePica/AvaTax/Model/Source/Logtype.php
CHANGED
@@ -15,40 +15,68 @@
|
|
15 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
*/
|
17 |
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
class OnePica_AvaTax_Model_Source_Logtype
|
20 |
{
|
21 |
-
const PING = 'Ping';
|
22 |
-
const GET_TAX = 'GetTax';
|
23 |
-
const FILTER = 'Filter';
|
24 |
-
const VALIDATE = 'Validate';
|
25 |
-
const QUEUE = 'Queue';
|
26 |
-
|
27 |
/**
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
public function toOptionArray()
|
33 |
{
|
34 |
return array(
|
35 |
array(
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
|
|
|
|
|
|
52 |
);
|
53 |
}
|
54 |
}
|
15 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
*/
|
17 |
|
18 |
+
/**
|
19 |
+
* Log type source model
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
class OnePica_AvaTax_Model_Source_Logtype
|
26 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
/**
|
28 |
+
* Ping type
|
29 |
+
*/
|
30 |
+
const PING = 'Ping';
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Get tax type
|
34 |
+
*/
|
35 |
+
const GET_TAX = 'GetTax';
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Filter type
|
39 |
+
*/
|
40 |
+
const FILTER = 'Filter';
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Validate type
|
44 |
+
*/
|
45 |
+
const VALIDATE = 'Validate';
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Queue type
|
49 |
+
*/
|
50 |
+
const QUEUE = 'Queue';
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Gets the list of type for the admin config dropdown
|
54 |
+
*
|
55 |
+
* @return array
|
56 |
+
*/
|
57 |
public function toOptionArray()
|
58 |
{
|
59 |
return array(
|
60 |
array(
|
61 |
+
'value' => self::PING,
|
62 |
+
'label' => Mage::helper('avatax')->__('Ping')
|
63 |
+
),
|
64 |
+
array(
|
65 |
+
'value' => self::GET_TAX,
|
66 |
+
'label' => Mage::helper('avatax')->__('Get Tax')
|
67 |
+
),
|
68 |
+
array(
|
69 |
+
'value' => self::FILTER,
|
70 |
+
'label' => Mage::helper('avatax')->__('Filter')
|
71 |
+
),
|
72 |
+
array(
|
73 |
+
'value' => self::VALIDATE,
|
74 |
+
'label' => Mage::helper('avatax')->__('Validate')
|
75 |
+
),
|
76 |
+
array(
|
77 |
+
'value' => self::QUEUE,
|
78 |
+
'label' => Mage::helper('avatax')->__('Queue')
|
79 |
+
)
|
80 |
);
|
81 |
}
|
82 |
}
|
app/code/community/OnePica/AvaTax/Model/Source/Onerrorfrontend.php
CHANGED
@@ -1,34 +1,49 @@
|
|
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 |
class OnePica_AvaTax_Model_Source_Onerrorfrontend
|
20 |
{
|
21 |
/**
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
public function toOptionArray()
|
27 |
{
|
28 |
return array(
|
29 |
-
array(
|
30 |
-
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
);
|
33 |
}
|
34 |
}
|
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 |
+
* On error frontend action source model
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
class OnePica_AvaTax_Model_Source_Onerrorfrontend
|
26 |
{
|
27 |
/**
|
28 |
+
* Gets the list of cache methods for the admin config dropdown
|
29 |
+
*
|
30 |
+
* @return array
|
31 |
+
*/
|
32 |
public function toOptionArray()
|
33 |
{
|
34 |
return array(
|
35 |
+
array(
|
36 |
+
'value' => 1,
|
37 |
+
'label' => Mage::helper('avatax')->__('Always show no tax')
|
38 |
+
),
|
39 |
+
array(
|
40 |
+
'value' => 2,
|
41 |
+
'label' => Mage::helper('avatax')->__('Always show no tax and warn user')
|
42 |
+
),
|
43 |
+
array(
|
44 |
+
'value' => 3,
|
45 |
+
'label' => Mage::helper('avatax')->__('Stop orders from completing and warn user')
|
46 |
+
)
|
47 |
);
|
48 |
}
|
49 |
}
|
app/code/community/OnePica/AvaTax/Model/Source/Regionfilter/List.php
CHANGED
@@ -24,36 +24,52 @@
|
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
class OnePica_AvaTax_Model_Source_Regionfilter_List
|
29 |
{
|
|
|
|
|
|
|
|
|
|
|
30 |
protected $_options;
|
31 |
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
33 |
{
|
34 |
if (!$this->_options) {
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
}
|
56 |
-
|
57 |
return $this->_options;
|
58 |
}
|
59 |
}
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
27 |
+
/**
|
28 |
+
* Regionfilter source model
|
29 |
+
*
|
30 |
+
* @category OnePica
|
31 |
+
* @package OnePica_AvaTax
|
32 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
33 |
+
*/
|
34 |
class OnePica_AvaTax_Model_Source_Regionfilter_List
|
35 |
{
|
36 |
+
/**
|
37 |
+
* Options
|
38 |
+
*
|
39 |
+
* @var array
|
40 |
+
*/
|
41 |
protected $_options;
|
42 |
|
43 |
+
/**
|
44 |
+
* Get option array
|
45 |
+
*
|
46 |
+
* @return array
|
47 |
+
*/
|
48 |
+
public function toOptionArray()
|
49 |
{
|
50 |
if (!$this->_options) {
|
51 |
+
$countries = array('US', 'CA');
|
52 |
+
$this->_options = array();
|
53 |
+
|
54 |
+
$this->_options[] = array(
|
55 |
+
'label' => '',
|
56 |
+
'value' => ''
|
57 |
+
);
|
58 |
+
|
59 |
+
foreach ($countries as $country) {
|
60 |
+
$regions = Mage::getResourceModel('directory/region_collection')
|
61 |
+
->addCountryFilter($country)
|
62 |
+
->loadData()
|
63 |
+
->toOptionArray();
|
64 |
+
array_shift($regions);
|
65 |
+
|
66 |
+
$this->_options[] = array(
|
67 |
+
'label' => Mage::app()->getLocale()->getCountryTranslation($country),
|
68 |
+
'value' => $regions
|
69 |
+
);
|
70 |
+
}
|
71 |
}
|
72 |
+
|
73 |
return $this->_options;
|
74 |
}
|
75 |
}
|
app/code/community/OnePica/AvaTax/Model/Source/Regionfilter/Mode.php
CHANGED
@@ -1,40 +1,49 @@
|
|
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 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
array(
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* Regionfilter mode source model
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Model_Source_Regionfilter_Mode
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Gets the list of cache methods for the admin config dropdown
|
29 |
+
*
|
30 |
+
* @return array
|
31 |
+
*/
|
32 |
+
public function toOptionArray()
|
33 |
+
{
|
34 |
+
return array(
|
35 |
+
array(
|
36 |
+
'value' => OnePica_AvaTax_Model_Config::REGIONFILTER_OFF,
|
37 |
+
'label' => Mage::helper('avatax')->__('None')
|
38 |
+
),
|
39 |
+
array(
|
40 |
+
'value' => OnePica_AvaTax_Model_Config::REGIONFILTER_TAX,
|
41 |
+
'label' => Mage::helper('avatax')->__('Filter tax calculations')
|
42 |
+
),
|
43 |
+
array(
|
44 |
+
'value' => OnePica_AvaTax_Model_Config::REGIONFILTER_ALL,
|
45 |
+
'label' => Mage::helper('avatax')->__('Filter tax calculations & address options')
|
46 |
+
)
|
47 |
+
);
|
48 |
+
}
|
49 |
+
}
|
app/code/community/OnePica/AvaTax/Model/Tax/Config.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* Configuration paths storage
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
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
|
30 |
+
*
|
31 |
+
* @param null|int $store
|
32 |
+
* @return bool
|
33 |
+
*/
|
34 |
+
public function discountTax($store = null)
|
35 |
+
{
|
36 |
+
if (Mage::helper('avatax')->isAvataxEnabled($store)) {
|
37 |
+
return false;
|
38 |
+
}
|
39 |
+
|
40 |
+
return parent::discountTax($store);
|
41 |
+
}
|
42 |
+
}
|
app/code/community/OnePica/AvaTax/controllers/.DS_Store
DELETED
Binary file
|
app/code/community/OnePica/AvaTax/controllers/Adminhtml/ExportController.php
CHANGED
@@ -1,52 +1,90 @@
|
|
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 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
}
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
$
|
44 |
-
$
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
$
|
49 |
-
|
50 |
-
}
|
51 |
-
|
52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* Admin export controller
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Adminhtml_ExportController extends Mage_Adminhtml_Controller_Action
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Check if is allowed
|
29 |
+
*
|
30 |
+
* @return bool
|
31 |
+
*/
|
32 |
+
protected function _isAllowed()
|
33 |
+
{
|
34 |
+
return Mage::getSingleton('admin/session')->isAllowed('avatax');
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Log action
|
39 |
+
*
|
40 |
+
* @return $this
|
41 |
+
*/
|
42 |
+
public function logAction() {
|
43 |
+
$fileName = 'avatax-log-' . gmdate('U') . '.sql';
|
44 |
+
$content = Mage::getModel('avatax/export')
|
45 |
+
->setAdapter(Mage::getModel('avatax/export_adapter_sql'))
|
46 |
+
->setEntity(Mage::getModel('avatax/export_entity_log'))
|
47 |
+
->getContent();
|
48 |
+
$this->_sendResponse($fileName, $content);
|
49 |
+
return $this;
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Queue action
|
54 |
+
*
|
55 |
+
* @return $this
|
56 |
+
*/
|
57 |
+
public function queueAction()
|
58 |
+
{
|
59 |
+
$fileName = 'avatax-queue-' . gmdate('U') . '.sql';
|
60 |
+
$content = Mage::getModel('avatax/export')
|
61 |
+
->setAdapter(Mage::getModel('avatax/export_adapter_sql'))
|
62 |
+
->setEntity(Mage::getModel('avatax/export_entity_queue'))
|
63 |
+
->getContent();
|
64 |
+
$this->_sendResponse($fileName, $content);
|
65 |
+
return $this;
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Send response
|
70 |
+
*
|
71 |
+
* @param string $fileName
|
72 |
+
* @param string $content
|
73 |
+
* @param string $contentType
|
74 |
+
* @return $this
|
75 |
+
*/
|
76 |
+
protected function _sendResponse($fileName, $content, $contentType = 'application/octet-stream')
|
77 |
+
{
|
78 |
+
$response = $this->getResponse();
|
79 |
+
$response->setHeader('HTTP/1.1 200 OK', '');
|
80 |
+
$response->setHeader('Pragma', 'public', true);
|
81 |
+
$response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
|
82 |
+
$response->setHeader('Content-Disposition', 'attachment; filename=' . $fileName);
|
83 |
+
$response->setHeader('Last-Modified', date('r'));
|
84 |
+
$response->setHeader('Accept-Ranges', 'bytes');
|
85 |
+
$response->setHeader('Content-Length', strlen($content));
|
86 |
+
$response->setHeader('Content-type', $contentType);
|
87 |
+
$response->setBody($content);
|
88 |
+
return $this;
|
89 |
+
}
|
90 |
+
}
|
app/code/community/OnePica/AvaTax/controllers/Adminhtml/GridController.php
CHANGED
@@ -1,93 +1,137 @@
|
|
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 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
Mage::getModel('
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* Admin grid controller
|
20 |
+
*
|
21 |
+
* @category OnePica
|
22 |
+
* @package OnePica_AvaTax
|
23 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
24 |
+
*/
|
25 |
+
class OnePica_AvaTax_Adminhtml_GridController extends Mage_Adminhtml_Controller_Action
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Additional initialization
|
29 |
+
*/
|
30 |
+
protected function _construct()
|
31 |
+
{
|
32 |
+
$this->setUsedModuleName('OnePica_AvaTax');
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Clear queue action
|
37 |
+
*
|
38 |
+
* @return $this
|
39 |
+
*/
|
40 |
+
public function clearQueueAction()
|
41 |
+
{
|
42 |
+
Mage::getModel('avatax_records/queue_process')->clear();
|
43 |
+
$this->_redirect('*/*/queue');
|
44 |
+
return $this;
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Log action
|
49 |
+
*
|
50 |
+
* @return $this
|
51 |
+
*/
|
52 |
+
public function logAction()
|
53 |
+
{
|
54 |
+
$this->_setTitle($this->__('Sales'))->_setTitle($this->__('Tax'))->_setTitle($this->__('AvaTax Log'));
|
55 |
+
|
56 |
+
$this->loadLayout()
|
57 |
+
->_setActiveMenu('sales/tax/avatax_log')
|
58 |
+
->renderLayout();
|
59 |
+
return $this;
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Log view action
|
64 |
+
*
|
65 |
+
* @return $this
|
66 |
+
*/
|
67 |
+
public function logViewAction()
|
68 |
+
{
|
69 |
+
$this->_setTitle($this->__('Sales'))->_setTitle($this->__('Tax'))->_setTitle($this->__('AvaTax Log'));
|
70 |
+
|
71 |
+
$logId = $this->getRequest()->getParam('id');
|
72 |
+
$model = Mage::getModel('avatax/records_log')->load($logId);
|
73 |
+
|
74 |
+
if (!$model->getId()) {
|
75 |
+
$this->_redirect('*/*/log');
|
76 |
+
return $this;
|
77 |
+
}
|
78 |
+
|
79 |
+
Mage::register('current_event', $model);
|
80 |
+
|
81 |
+
$this->loadLayout()
|
82 |
+
->_setActiveMenu('sales/tax/avatax_log')
|
83 |
+
->renderLayout();
|
84 |
+
return $this;
|
85 |
+
}
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Queue action
|
89 |
+
*
|
90 |
+
* @return $this
|
91 |
+
*/
|
92 |
+
public function queueAction()
|
93 |
+
{
|
94 |
+
$this->_setTitle($this->__('Sales'))->_setTitle($this->__('Tax'))->_setTitle($this->__('AvaTax Queue'));
|
95 |
+
|
96 |
+
$this->loadLayout()
|
97 |
+
->_setActiveMenu('sales/tax/avatax_queue')
|
98 |
+
->renderLayout();
|
99 |
+
return $this;
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Process queue action
|
104 |
+
*
|
105 |
+
* @return $this
|
106 |
+
*/
|
107 |
+
public function processQueueAction()
|
108 |
+
{
|
109 |
+
Mage::getModel('avatax_records/queue_process')->run();
|
110 |
+
$this->_redirect('*/*/queue');
|
111 |
+
return $this;
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Check if is allowed
|
116 |
+
*
|
117 |
+
* @return bool
|
118 |
+
*/
|
119 |
+
protected function _isAllowed()
|
120 |
+
{
|
121 |
+
return Mage::getSingleton('admin/session')->isAllowed('avatax');
|
122 |
+
}
|
123 |
+
|
124 |
+
/**
|
125 |
+
* Magento <1.4 does not let the title be set
|
126 |
+
*
|
127 |
+
* @param string $title
|
128 |
+
* @return $this
|
129 |
+
*/
|
130 |
+
protected function _setTitle($title)
|
131 |
+
{
|
132 |
+
if (method_exists($this, '_title')) {
|
133 |
+
$this->_title($title);
|
134 |
+
}
|
135 |
+
return $this;
|
136 |
+
}
|
137 |
+
}
|
app/code/community/OnePica/AvaTax/controllers/CartController.php
DELETED
@@ -1,35 +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 |
-
* Shopping cart controller
|
20 |
-
*/
|
21 |
-
|
22 |
-
require_once 'Mage/Checkout/controllers/CartController.php';
|
23 |
-
|
24 |
-
class OnePica_AvaTax_CartController extends Mage_Checkout_CartController
|
25 |
-
{
|
26 |
-
/**
|
27 |
-
* Initialize shipping information
|
28 |
-
*/
|
29 |
-
public function estimatePostAction()
|
30 |
-
{
|
31 |
-
$session = Mage::getSingleton('checkout/session');
|
32 |
-
$session->setPostType('estimate');
|
33 |
-
parent::estimatePostAction();
|
34 |
-
}
|
35 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/OnePica/AvaTax/{controllers/OnepageController.php → data/avatax_records_setup/data-upgrade-2.2.0-2.2.1.php}
RENAMED
@@ -14,19 +14,18 @@
|
|
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 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
}
|
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 |
+
$installer = $this;
|
18 |
+
$this->startSetup();
|
19 |
+
/* @var $this Mage_Core_Model_Resource_Setup */
|
20 |
+
$adapter = $this->getConnection();
|
21 |
+
$adapter->update(
|
22 |
+
$this->getTable('tax/tax_class'),
|
23 |
+
array(
|
24 |
+
'class_name' => 'Shipping (not used by AvaTax)'
|
25 |
+
),
|
26 |
+
array(
|
27 |
+
'class_name = ?' => 'Shipping',
|
28 |
+
'class_type = ?' => Mage_Tax_Model_Class::TAX_CLASS_TYPE_PRODUCT
|
29 |
+
)
|
30 |
+
);
|
31 |
+
$this->endSetup();
|
|
app/code/community/OnePica/AvaTax/etc/adminhtml.xml
CHANGED
@@ -1,69 +1,68 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<!--
|
3 |
-
/**
|
4 |
-
* OnePica_AvaTax
|
5 |
-
*
|
6 |
-
* NOTICE OF LICENSE
|
7 |
-
*
|
8 |
-
* This source file is subject to the Open Software License (OSL 3.0), a
|
9 |
-
* copy of which is available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
*
|
12 |
-
* @category OnePica
|
13 |
-
* @package OnePica_AvaTax
|
14 |
-
* @author OnePica Codemaster <codemaster@onepica.com>
|
15 |
-
* @copyright Copyright (c) 2009 One Pica, Inc.
|
16 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
-
*/
|
18 |
-
-->
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
<
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
<
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* OnePica_AvaTax
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0), a
|
9 |
+
* copy of which is available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category OnePica
|
13 |
+
* @package OnePica_AvaTax
|
14 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
15 |
+
* @copyright Copyright (c) 2009 One Pica, Inc.
|
16 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
+
-->
|
19 |
+
<config>
|
20 |
+
<!-- the adminhtml section is repeated in config.xml & adminhtml.xml for backwards compatibility -->
|
21 |
+
<!-- @see http://www.magentocommerce.com/bug-tracking/issue?issue=8496 -->
|
22 |
+
<layout>
|
23 |
+
<updates>
|
24 |
+
<avatax>
|
25 |
+
<file>onepica/avatax.xml</file>
|
26 |
+
</avatax>
|
27 |
+
</updates>
|
28 |
+
</layout>
|
29 |
+
<menu>
|
30 |
+
<sales>
|
31 |
+
<children>
|
32 |
+
<tax>
|
33 |
+
<children>
|
34 |
+
<rules>
|
35 |
+
<!-- enabled/disabled in OnePica_AvaTax_Model_Admin_Session -->
|
36 |
+
</rules>
|
37 |
+
<rates>
|
38 |
+
<!-- enabled/disabled in OnePica_AvaTax_Model_Admin_Session -->
|
39 |
+
</rates>
|
40 |
+
<import_export>
|
41 |
+
<!-- enabled/disabled in OnePica_AvaTax_Model_Admin_Session -->
|
42 |
+
</import_export>
|
43 |
+
<avatax_queue translate="title" module="avatax">
|
44 |
+
<title>AvaTax Order Sync Queue</title>
|
45 |
+
<action>avatax/adminhtml_grid/queue</action>
|
46 |
+
</avatax_queue>
|
47 |
+
<avatax_log translate="title" module="avatax">
|
48 |
+
<title>AvaTax Log</title>
|
49 |
+
<action>avatax/adminhtml_grid/log</action>
|
50 |
+
</avatax_log>
|
51 |
+
</children>
|
52 |
+
</tax>
|
53 |
+
</children>
|
54 |
+
</sales>
|
55 |
+
</menu>
|
56 |
+
<acl>
|
57 |
+
<resources>
|
58 |
+
<admin>
|
59 |
+
<children>
|
60 |
+
<avatax translate="title">
|
61 |
+
<title>AvaTax Module</title>
|
62 |
+
<sort_order>100</sort_order>
|
63 |
+
</avatax>
|
64 |
+
</children>
|
65 |
+
</admin>
|
66 |
+
</resources>
|
67 |
+
</acl>
|
68 |
+
</config>
|
|
app/code/community/OnePica/AvaTax/etc/config.xml
CHANGED
@@ -1,324 +1,336 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<!--
|
3 |
-
/**
|
4 |
-
* OnePica_AvaTax
|
5 |
-
*
|
6 |
-
* NOTICE OF LICENSE
|
7 |
-
*
|
8 |
-
* This source file is subject to the Open Software License (OSL 3.0), a
|
9 |
-
* copy of which is available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
*
|
12 |
-
* @category OnePica
|
13 |
-
* @package OnePica_AvaTax
|
14 |
-
* @author OnePica Codemaster <codemaster@onepica.com>
|
15 |
-
* @copyright Copyright (c) 2009 One Pica, Inc.
|
16 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
-
*/
|
18 |
-
-->
|
19 |
-
|
20 |
-
<
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
<
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
<
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
<
|
159 |
-
<
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
<
|
179 |
-
</
|
180 |
-
</
|
181 |
-
</
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
<
|
194 |
-
<
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
<
|
312 |
-
<
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* OnePica_AvaTax
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0), a
|
9 |
+
* copy of which is available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category OnePica
|
13 |
+
* @package OnePica_AvaTax
|
14 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
15 |
+
* @copyright Copyright (c) 2009 One Pica, Inc.
|
16 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
+
-->
|
19 |
+
<config>
|
20 |
+
<modules>
|
21 |
+
<OnePica_AvaTax>
|
22 |
+
<version>2.5.0.2</version>
|
23 |
+
</OnePica_AvaTax>
|
24 |
+
</modules>
|
25 |
+
<global>
|
26 |
+
<models>
|
27 |
+
<avatax>
|
28 |
+
<class>OnePica_AvaTax_Model</class>
|
29 |
+
</avatax>
|
30 |
+
<avatax_records>
|
31 |
+
<class>OnePica_AvaTax_Model_Records</class>
|
32 |
+
<resourceModel>avatax_records_mysql4</resourceModel>
|
33 |
+
</avatax_records>
|
34 |
+
<avatax_records_mysql4>
|
35 |
+
<class>OnePica_AvaTax_Model_Records_Mysql4</class>
|
36 |
+
<entities>
|
37 |
+
<log>
|
38 |
+
<table>op_avatax_log</table>
|
39 |
+
</log>
|
40 |
+
<queue>
|
41 |
+
<table>op_avatax_queue</table>
|
42 |
+
</queue>
|
43 |
+
</entities>
|
44 |
+
</avatax_records_mysql4>
|
45 |
+
<adminhtml>
|
46 |
+
<rewrite>
|
47 |
+
<config>OnePica_AvaTax_Model_Adminhtml_Config</config>
|
48 |
+
<sales_order_create>OnePica_AvaTax_Model_Adminhtml_Sales_Order_Create</sales_order_create>
|
49 |
+
</rewrite>
|
50 |
+
</adminhtml>
|
51 |
+
<admin>
|
52 |
+
<rewrite>
|
53 |
+
<session>OnePica_AvaTax_Model_Admin_Session</session>
|
54 |
+
</rewrite>
|
55 |
+
</admin>
|
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 |
+
</models>
|
68 |
+
<helpers>
|
69 |
+
<avatax>
|
70 |
+
<class>OnePica_AvaTax_Helper</class>
|
71 |
+
</avatax>
|
72 |
+
<tax>
|
73 |
+
<rewrite>
|
74 |
+
<data>OnePica_AvaTax_Helper_Tax_Data</data>
|
75 |
+
</rewrite>
|
76 |
+
</tax>
|
77 |
+
</helpers>
|
78 |
+
<blocks>
|
79 |
+
<avatax>
|
80 |
+
<class>OnePica_AvaTax_Block</class>
|
81 |
+
</avatax>
|
82 |
+
<adminhtml>
|
83 |
+
<rewrite>
|
84 |
+
<tax_class_grid>OnePica_AvaTax_Block_Adminhtml_Tax_Class_Grid</tax_class_grid>
|
85 |
+
<tax_class_edit_form>OnePica_AvaTax_Block_Adminhtml_Tax_Class_Edit_Form</tax_class_edit_form>
|
86 |
+
</rewrite>
|
87 |
+
</adminhtml>
|
88 |
+
</blocks>
|
89 |
+
<resources>
|
90 |
+
<avatax_records_setup>
|
91 |
+
<setup>
|
92 |
+
<module>OnePica_AvaTax</module>
|
93 |
+
</setup>
|
94 |
+
<connection>
|
95 |
+
<use>core_setup</use>
|
96 |
+
</connection>
|
97 |
+
</avatax_records_setup>
|
98 |
+
<avatax_records_write>
|
99 |
+
<connection>
|
100 |
+
<use>core_write</use>
|
101 |
+
</connection>
|
102 |
+
</avatax_records_write>
|
103 |
+
<avatax_records_read>
|
104 |
+
<connection>
|
105 |
+
<use>core_read</use>
|
106 |
+
</connection>
|
107 |
+
</avatax_records_read>
|
108 |
+
</resources>
|
109 |
+
<events>
|
110 |
+
<sales_quote_collect_totals_before>
|
111 |
+
<observers>
|
112 |
+
<avatax>
|
113 |
+
<type>singleton</type>
|
114 |
+
<class>avatax/observer</class>
|
115 |
+
<method>salesQuoteCollectTotalsBefore</method>
|
116 |
+
</avatax>
|
117 |
+
</observers>
|
118 |
+
</sales_quote_collect_totals_before>
|
119 |
+
<sales_order_invoice_save_after>
|
120 |
+
<observers>
|
121 |
+
<avatax>
|
122 |
+
<type>singleton</type>
|
123 |
+
<class>avatax/observer</class>
|
124 |
+
<method>salesOrderInvoiceSaveAfter</method>
|
125 |
+
</avatax>
|
126 |
+
</observers>
|
127 |
+
</sales_order_invoice_save_after>
|
128 |
+
<sales_order_creditmemo_save_after>
|
129 |
+
<observers>
|
130 |
+
<avatax>
|
131 |
+
<type>singleton</type>
|
132 |
+
<class>avatax/observer</class>
|
133 |
+
<method>salesOrderCreditmemoSaveAfter</method>
|
134 |
+
</avatax>
|
135 |
+
</observers>
|
136 |
+
</sales_order_creditmemo_save_after>
|
137 |
+
<admin_system_config_changed_section_tax>
|
138 |
+
<observers>
|
139 |
+
<avatax>
|
140 |
+
<type>singleton</type>
|
141 |
+
<class>avatax/observer</class>
|
142 |
+
<method>adminSystemConfigChangedSectionTax</method>
|
143 |
+
</avatax>
|
144 |
+
</observers>
|
145 |
+
</admin_system_config_changed_section_tax>
|
146 |
+
<checkout_type_multishipping_set_shipping_items>
|
147 |
+
<observers>
|
148 |
+
<avatax>
|
149 |
+
<type>singleton</type>
|
150 |
+
<class>avatax/observer</class>
|
151 |
+
<method>multishippingSetShippingItems</method>
|
152 |
+
</avatax>
|
153 |
+
</observers>
|
154 |
+
</checkout_type_multishipping_set_shipping_items>
|
155 |
+
<controller_front_init_before>
|
156 |
+
<observers>
|
157 |
+
<avatax>
|
158 |
+
<type>singleton</type>
|
159 |
+
<class>avatax/observer</class>
|
160 |
+
<method>loadAvaTaxExternalLib</method>
|
161 |
+
</avatax>
|
162 |
+
</observers>
|
163 |
+
</controller_front_init_before>
|
164 |
+
<default>
|
165 |
+
<observers>
|
166 |
+
<avatax>
|
167 |
+
<type>singleton</type>
|
168 |
+
<class>avatax/observer</class>
|
169 |
+
<method>loadAvaTaxExternalLib</method>
|
170 |
+
</avatax>
|
171 |
+
</observers>
|
172 |
+
</default>
|
173 |
+
<controller_action_predispatch_checkout_cart_estimatePost>
|
174 |
+
<observers>
|
175 |
+
<avatax>
|
176 |
+
<type>singleton</type>
|
177 |
+
<class>avatax/observer</class>
|
178 |
+
<method>controllerActionPredispatchCheckoutCartEstimatePost</method>
|
179 |
+
</avatax>
|
180 |
+
</observers>
|
181 |
+
</controller_action_predispatch_checkout_cart_estimatePost>
|
182 |
+
<controller_action_predispatch_checkout_onepage_index>
|
183 |
+
<observers>
|
184 |
+
<avatax>
|
185 |
+
<type>singleton</type>
|
186 |
+
<class>avatax/observer</class>
|
187 |
+
<method>controllerActionPredispatchCheckoutOnepageIndex</method>
|
188 |
+
</avatax>
|
189 |
+
</observers>
|
190 |
+
</controller_action_predispatch_checkout_onepage_index>
|
191 |
+
</events>
|
192 |
+
</global>
|
193 |
+
<frontend>
|
194 |
+
<layout>
|
195 |
+
<updates>
|
196 |
+
<avatax>
|
197 |
+
<file>onepica/avatax.xml</file>
|
198 |
+
</avatax>
|
199 |
+
</updates>
|
200 |
+
</layout>
|
201 |
+
<translate>
|
202 |
+
<modules>
|
203 |
+
<OnePica_AvaTax>
|
204 |
+
<files>
|
205 |
+
<default>OnePica_AvaTax.csv</default>
|
206 |
+
</files>
|
207 |
+
</OnePica_AvaTax>
|
208 |
+
</modules>
|
209 |
+
</translate>
|
210 |
+
</frontend>
|
211 |
+
<admin>
|
212 |
+
<routers>
|
213 |
+
<avatax>
|
214 |
+
<use>admin</use>
|
215 |
+
<args>
|
216 |
+
<module>OnePica_AvaTax</module>
|
217 |
+
<frontName>avatax</frontName>
|
218 |
+
</args>
|
219 |
+
</avatax>
|
220 |
+
</routers>
|
221 |
+
</admin>
|
222 |
+
<!-- the adminhtml section is repeated in config.xml & adminhtml.xml for backwards compatibility -->
|
223 |
+
<!-- @see http://www.magentocommerce.com/bug-tracking/issue?issue=8496 -->
|
224 |
+
<adminhtml>
|
225 |
+
<layout>
|
226 |
+
<updates>
|
227 |
+
<avatax>
|
228 |
+
<file>onepica/avatax.xml</file>
|
229 |
+
</avatax>
|
230 |
+
</updates>
|
231 |
+
</layout>
|
232 |
+
<translate>
|
233 |
+
<modules>
|
234 |
+
<OnePica_AvaTax>
|
235 |
+
<files>
|
236 |
+
<default>OnePica_AvaTax.csv</default>
|
237 |
+
</files>
|
238 |
+
</OnePica_AvaTax>
|
239 |
+
</modules>
|
240 |
+
</translate>
|
241 |
+
<menu>
|
242 |
+
<sales>
|
243 |
+
<children>
|
244 |
+
<tax>
|
245 |
+
<children>
|
246 |
+
<rules>
|
247 |
+
<!-- enabled/disabled in OnePica_AvaTax_Model_Admin_Session -->
|
248 |
+
</rules>
|
249 |
+
<rates>
|
250 |
+
<!-- enabled/disabled in OnePica_AvaTax_Model_Admin_Session -->
|
251 |
+
</rates>
|
252 |
+
<import_export>
|
253 |
+
<!-- enabled/disabled in OnePica_AvaTax_Model_Admin_Session -->
|
254 |
+
</import_export>
|
255 |
+
<avatax_queue translate="title" module="avatax">
|
256 |
+
<title>AvaTax Order Sync Queue</title>
|
257 |
+
<action>avatax/adminhtml_grid/queue</action>
|
258 |
+
</avatax_queue>
|
259 |
+
</children>
|
260 |
+
</tax>
|
261 |
+
</children>
|
262 |
+
</sales>
|
263 |
+
</menu>
|
264 |
+
<acl>
|
265 |
+
<resources>
|
266 |
+
<admin>
|
267 |
+
<children>
|
268 |
+
<avatax translate="title">
|
269 |
+
<title>AvaTax Module</title>
|
270 |
+
<sort_order>100</sort_order>
|
271 |
+
</avatax>
|
272 |
+
</children>
|
273 |
+
</admin>
|
274 |
+
</resources>
|
275 |
+
</acl>
|
276 |
+
</adminhtml>
|
277 |
+
<default>
|
278 |
+
<tax>
|
279 |
+
<avatax>
|
280 |
+
<action>0</action>
|
281 |
+
<url>https://avatax.avalara.net/</url>
|
282 |
+
<region_filter_mode>0</region_filter_mode>
|
283 |
+
<country_filter_list>CA,US</country_filter_list>
|
284 |
+
<log_status>1</log_status>
|
285 |
+
<log_lifetime>3</log_lifetime>
|
286 |
+
<queue_success_lifetime>7</queue_success_lifetime>
|
287 |
+
<queue_failed_lifetime>60</queue_failed_lifetime>
|
288 |
+
<log_type_list>Ping,Get Tax,Filter,Validate,Queue</log_type_list>
|
289 |
+
<cust_code_format>0</cust_code_format>
|
290 |
+
<shipping_sku>Shipping</shipping_sku>
|
291 |
+
<gw_order_sku>GwOrder</gw_order_sku>
|
292 |
+
<gw_items_sku>GwItems</gw_items_sku>
|
293 |
+
<gw_printed_card_sku>GwPrintedCard</gw_printed_card_sku>
|
294 |
+
<adjustment_positive_sku>Adjustment</adjustment_positive_sku>
|
295 |
+
<adjustment_negative_sku>Adjustment</adjustment_negative_sku>
|
296 |
+
<sales_person_code>Magento</sales_person_code>
|
297 |
+
<error_full_stop>1</error_full_stop>
|
298 |
+
<error_frontend_action>2</error_frontend_action>
|
299 |
+
<error_frontend_message>Unfortunately, we could not calculate tax for your order. Please try again with a different address or contact us to complete your order.</error_frontend_message>
|
300 |
+
<error_backend_message>There was an error getting tax rates from Avalara. Please see the error log for details.</error_backend_message>
|
301 |
+
<error_notification_toolbar>1</error_notification_toolbar>
|
302 |
+
<onepage_normalize_message>Your shipping address has been modified during our validation process. Please confirm the address to the right is accurate.</onepage_normalize_message>
|
303 |
+
<multiaddress_normalize_message>Your shipping addresses have been modified during our validation process. Please confirm they are still correct.</multiaddress_normalize_message>
|
304 |
+
<validate_address_message>The address '%s' appears invalid. Please correct it or select another address.</validate_address_message>
|
305 |
+
</avatax>
|
306 |
+
<calculation>
|
307 |
+
<based_on>shipping</based_on>
|
308 |
+
<price_includes_tax>0</price_includes_tax>
|
309 |
+
<shipping_includes_tax>0</shipping_includes_tax>
|
310 |
+
<apply_after_discount>1</apply_after_discount>
|
311 |
+
<discount_tax>0</discount_tax>
|
312 |
+
<apply_tax_on>0</apply_tax_on>
|
313 |
+
</calculation>
|
314 |
+
<defaults>
|
315 |
+
<region>0</region>
|
316 |
+
<postcode>*</postcode>
|
317 |
+
</defaults>
|
318 |
+
</tax>
|
319 |
+
</default>
|
320 |
+
<crontab>
|
321 |
+
<jobs>
|
322 |
+
<avatax_processqueue>
|
323 |
+
<schedule><cron_expr>0 * * * *</cron_expr></schedule>
|
324 |
+
<run>
|
325 |
+
<model>avatax/observer::processQueue</model>
|
326 |
+
</run>
|
327 |
+
</avatax_processqueue>
|
328 |
+
<avatax_cleanlog>
|
329 |
+
<schedule><cron_expr>0 0 * * *</cron_expr></schedule>
|
330 |
+
<run>
|
331 |
+
<model>avatax/observer::cleanLog</model>
|
332 |
+
</run>
|
333 |
+
</avatax_cleanlog>
|
334 |
+
</jobs>
|
335 |
+
</crontab>
|
336 |
+
</config>
|
app/code/community/OnePica/AvaTax/etc/system-disabled.xml
CHANGED
@@ -1,91 +1,90 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<!--
|
3 |
-
/**
|
4 |
-
* OnePica_AvaTax
|
5 |
-
*
|
6 |
-
* NOTICE OF LICENSE
|
7 |
-
*
|
8 |
-
* This source file is subject to the Open Software License (OSL 3.0), a
|
9 |
-
* copy of which is available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
*
|
12 |
-
* @category OnePica
|
13 |
-
* @package OnePica_AvaTax
|
14 |
-
* @author OnePica Codemaster <codemaster@onepica.com>
|
15 |
-
* @copyright Copyright (c) 2009 One Pica, Inc.
|
16 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
-
*/
|
18 |
-
-->
|
19 |
-
|
20 |
-
<
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
<
|
82 |
-
<
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* OnePica_AvaTax
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0), a
|
9 |
+
* copy of which is available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category OnePica
|
13 |
+
* @package OnePica_AvaTax
|
14 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
15 |
+
* @copyright Copyright (c) 2009 One Pica, Inc.
|
16 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
+
-->
|
19 |
+
<config>
|
20 |
+
<sections>
|
21 |
+
<tax>
|
22 |
+
<groups>
|
23 |
+
<classes>
|
24 |
+
<fields>
|
25 |
+
<shipping_tax_class>
|
26 |
+
<show_in_default>1</show_in_default>
|
27 |
+
<show_in_website>1</show_in_website>
|
28 |
+
<show_in_store>1</show_in_store>
|
29 |
+
</shipping_tax_class>
|
30 |
+
</fields>
|
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>1</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>1</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>1</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>1</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>
|
57 |
+
<show_in_store>1</show_in_store>
|
58 |
+
</discount_tax>
|
59 |
+
<apply_tax_on>
|
60 |
+
<show_in_default>1</show_in_default>
|
61 |
+
<show_in_website>1</show_in_website>
|
62 |
+
<show_in_store>1</show_in_store>
|
63 |
+
</apply_tax_on>
|
64 |
+
</fields>
|
65 |
+
</calculation>
|
66 |
+
<defaults>
|
67 |
+
<fields>
|
68 |
+
<region>
|
69 |
+
<comment></comment>
|
70 |
+
</region>
|
71 |
+
<postcode>
|
72 |
+
<comment></comment>
|
73 |
+
</postcode>
|
74 |
+
</fields>
|
75 |
+
</defaults>
|
76 |
+
<sales_display>
|
77 |
+
<display>
|
78 |
+
<fields>
|
79 |
+
<full_summary>
|
80 |
+
<show_in_default>1</show_in_default>
|
81 |
+
<show_in_website>1</show_in_website>
|
82 |
+
<show_in_store>1</show_in_store>
|
83 |
+
</full_summary>
|
84 |
+
</fields>
|
85 |
+
</display>
|
86 |
+
</sales_display>
|
87 |
+
</groups>
|
88 |
+
</tax>
|
89 |
+
</sections>
|
90 |
+
</config>
|
|
app/code/community/OnePica/AvaTax/etc/system.xml
CHANGED
@@ -1,523 +1,522 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<!--
|
3 |
-
/**
|
4 |
-
* OnePica_AvaTax
|
5 |
-
*
|
6 |
-
* NOTICE OF LICENSE
|
7 |
-
*
|
8 |
-
* This source file is subject to the Open Software License (OSL 3.0), a
|
9 |
-
* copy of which is available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
*
|
12 |
-
* @category OnePica
|
13 |
-
* @package OnePica_AvaTax
|
14 |
-
* @author OnePica Codemaster <codemaster@onepica.com>
|
15 |
-
* @copyright Copyright (c) 2009 One Pica, Inc.
|
16 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
-
*/
|
18 |
-
-->
|
19 |
-
|
20 |
-
<
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
<label
|
38 |
-
<
|
39 |
-
<
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
<
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
<
|
97 |
-
|
98 |
-
<
|
99 |
-
<
|
100 |
-
<
|
101 |
-
<
|
102 |
-
<
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
<
|
108 |
-
<
|
109 |
-
<
|
110 |
-
<
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
<label
|
116 |
-
<
|
117 |
-
<
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
<label
|
180 |
-
<
|
181 |
-
<
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
<label
|
288 |
-
<
|
289 |
-
<
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
<
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
<
|
354 |
-
<
|
355 |
-
<
|
356 |
-
<
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
<label
|
371 |
-
<
|
372 |
-
<
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* OnePica_AvaTax
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0), a
|
9 |
+
* copy of which is available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category OnePica
|
13 |
+
* @package OnePica_AvaTax
|
14 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
15 |
+
* @copyright Copyright (c) 2009 One Pica, Inc.
|
16 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
+
-->
|
19 |
+
<config>
|
20 |
+
<sections>
|
21 |
+
<tax>
|
22 |
+
<tab>sales</tab>
|
23 |
+
<groups>
|
24 |
+
<avatax translate="label comment">
|
25 |
+
<label>AvaTax</label>
|
26 |
+
<comment><![CDATA[
|
27 |
+
<style type="text/css"> #tax_avatax textarea { height:65px; } #tax_avatax .multiselect { height:155px; } </style>
|
28 |
+
<p class="switcher">For complete and up-to-date documentation, please visit <a href="http://www.onepica.com/magento-extensions/avatax/" target="_blank">http://www.onepica.com/magento-extensions/avatax</a>.</p>
|
29 |
+
]]></comment>
|
30 |
+
<sort_order>0</sort_order>
|
31 |
+
<show_in_default>1</show_in_default>
|
32 |
+
<show_in_website>1</show_in_website>
|
33 |
+
<show_in_store>1</show_in_store>
|
34 |
+
<fields>
|
35 |
+
<title_connection_settings translate="label">
|
36 |
+
<label><![CDATA[<strong>Connection Settings</strong>]]></label>
|
37 |
+
<frontend_type>label</frontend_type>
|
38 |
+
<sort_order>0</sort_order>
|
39 |
+
<show_in_default>1</show_in_default>
|
40 |
+
<show_in_website>1</show_in_website>
|
41 |
+
<show_in_store>1</show_in_store>
|
42 |
+
</title_connection_settings>
|
43 |
+
<action translate="label">
|
44 |
+
<label>Action</label>
|
45 |
+
<frontend_type>select</frontend_type>
|
46 |
+
<source_model>avatax/source_actions</source_model>
|
47 |
+
<sort_order>10</sort_order>
|
48 |
+
<show_in_default>1</show_in_default>
|
49 |
+
<show_in_website>1</show_in_website>
|
50 |
+
<show_in_store>1</show_in_store>
|
51 |
+
</action>
|
52 |
+
<url translate="label">
|
53 |
+
<label>URL</label>
|
54 |
+
<frontend_type>text</frontend_type>
|
55 |
+
<sort_order>20</sort_order>
|
56 |
+
<show_in_default>1</show_in_default>
|
57 |
+
<show_in_website>1</show_in_website>
|
58 |
+
<show_in_store>1</show_in_store>
|
59 |
+
</url>
|
60 |
+
<account translate="label">
|
61 |
+
<label>Account Number</label>
|
62 |
+
<frontend_type>text</frontend_type>
|
63 |
+
<sort_order>30</sort_order>
|
64 |
+
<show_in_default>1</show_in_default>
|
65 |
+
<show_in_website>1</show_in_website>
|
66 |
+
<show_in_store>1</show_in_store>
|
67 |
+
</account>
|
68 |
+
<license translate="label">
|
69 |
+
<label>License Key</label>
|
70 |
+
<frontend_type>text</frontend_type>
|
71 |
+
<sort_order>40</sort_order>
|
72 |
+
<show_in_default>1</show_in_default>
|
73 |
+
<show_in_website>1</show_in_website>
|
74 |
+
<show_in_store>1</show_in_store>
|
75 |
+
</license>
|
76 |
+
<company_code translate="label comment">
|
77 |
+
<label>Company Code</label>
|
78 |
+
<comment>Required. Your company code from the dashboard.</comment>
|
79 |
+
<frontend_type>text</frontend_type>
|
80 |
+
<sort_order>50</sort_order>
|
81 |
+
<show_in_default>1</show_in_default>
|
82 |
+
<show_in_website>1</show_in_website>
|
83 |
+
<show_in_store>1</show_in_store>
|
84 |
+
</company_code>
|
85 |
+
<region_filter_mode translate="label">
|
86 |
+
<label>Filter Requests by Region</label>
|
87 |
+
<frontend_type>select</frontend_type>
|
88 |
+
<source_model>avatax/source_regionfilter_mode</source_model>
|
89 |
+
<sort_order>60</sort_order>
|
90 |
+
<show_in_default>1</show_in_default>
|
91 |
+
<show_in_website>1</show_in_website>
|
92 |
+
<show_in_store>1</show_in_store>
|
93 |
+
</region_filter_mode>
|
94 |
+
<region_filter_list translate="label comment">
|
95 |
+
<label></label>
|
96 |
+
<comment><![CDATA[Select regions to use AvaTax services. Ignored if <em>Filter Requests by Region</em> is set to <em>None</em>.]]></comment>
|
97 |
+
<frontend_type>multiselect</frontend_type>
|
98 |
+
<source_model>avatax/source_regionfilter_list</source_model>
|
99 |
+
<sort_order>70</sort_order>
|
100 |
+
<show_in_default>1</show_in_default>
|
101 |
+
<show_in_website>1</show_in_website>
|
102 |
+
<show_in_store>1</show_in_store>
|
103 |
+
</region_filter_list>
|
104 |
+
<country_filter_list>
|
105 |
+
<frontend_type>multiselect</frontend_type>
|
106 |
+
<source_model>adminhtml/system_config_source_country</source_model>
|
107 |
+
<sort_order>80</sort_order>
|
108 |
+
<show_in_default>0</show_in_default>
|
109 |
+
<show_in_website>0</show_in_website>
|
110 |
+
<show_in_store>0</show_in_store>
|
111 |
+
</country_filter_list>
|
112 |
+
|
113 |
+
<title_debug_settings translate="label">
|
114 |
+
<label><![CDATA[<strong>Log & Queue Settings</strong>]]></label>
|
115 |
+
<frontend_type>label</frontend_type>
|
116 |
+
<sort_order>100</sort_order>
|
117 |
+
<show_in_default>1</show_in_default>
|
118 |
+
<show_in_website>1</show_in_website>
|
119 |
+
<show_in_store>1</show_in_store>
|
120 |
+
</title_debug_settings>
|
121 |
+
<log_status translate="label">
|
122 |
+
<label>Log Mode</label>
|
123 |
+
<frontend_type>select</frontend_type>
|
124 |
+
<source_model>avatax/source_logmode</source_model>
|
125 |
+
<sort_order>110</sort_order>
|
126 |
+
<show_in_default>1</show_in_default>
|
127 |
+
<show_in_website>1</show_in_website>
|
128 |
+
<show_in_store>1</show_in_store>
|
129 |
+
</log_status>
|
130 |
+
<log_lifetime translate="label comment">
|
131 |
+
<label>Log Entry Lifetime</label>
|
132 |
+
<comment>Required. Days before entries are auto-purged.</comment>
|
133 |
+
<frontend_type>text</frontend_type>
|
134 |
+
<sort_order>120</sort_order>
|
135 |
+
<show_in_default>1</show_in_default>
|
136 |
+
<show_in_website>0</show_in_website>
|
137 |
+
<show_in_store>0</show_in_store>
|
138 |
+
</log_lifetime>
|
139 |
+
<queue_success_lifetime translate="label comment">
|
140 |
+
<label>Successful Queue Lifetime</label>
|
141 |
+
<comment>Required. Days before entries are auto-purged.</comment>
|
142 |
+
<frontend_type>text</frontend_type>
|
143 |
+
<sort_order>122</sort_order>
|
144 |
+
<show_in_default>1</show_in_default>
|
145 |
+
<show_in_website>0</show_in_website>
|
146 |
+
<show_in_store>0</show_in_store>
|
147 |
+
</queue_success_lifetime>
|
148 |
+
<queue_failed_lifetime translate="label comment">
|
149 |
+
<label>Failed Queue Lifetime</label>
|
150 |
+
<comment>Required. Days before entries are auto-purged.</comment>
|
151 |
+
<frontend_type>text</frontend_type>
|
152 |
+
<sort_order>124</sort_order>
|
153 |
+
<show_in_default>1</show_in_default>
|
154 |
+
<show_in_website>0</show_in_website>
|
155 |
+
<show_in_store>0</show_in_store>
|
156 |
+
</queue_failed_lifetime>
|
157 |
+
|
158 |
+
<log_type_list>
|
159 |
+
<label>Log Type</label>
|
160 |
+
<frontend_type>multiselect</frontend_type>
|
161 |
+
<source_model>avatax/source_logtype</source_model>
|
162 |
+
<sort_order>125</sort_order>
|
163 |
+
<show_in_default>1</show_in_default>
|
164 |
+
<show_in_website>0</show_in_website>
|
165 |
+
<show_in_store>0</show_in_store>
|
166 |
+
</log_type_list>
|
167 |
+
|
168 |
+
<log_export>
|
169 |
+
<label></label>
|
170 |
+
<frontend_model>avatax/adminhtml_system_config_form_field_export</frontend_model>
|
171 |
+
<sort_order>130</sort_order>
|
172 |
+
<show_in_default>1</show_in_default>
|
173 |
+
<show_in_website>0</show_in_website>
|
174 |
+
<show_in_store>0</show_in_store>
|
175 |
+
</log_export>
|
176 |
+
|
177 |
+
<title_data_mapping translate="label">
|
178 |
+
<label><![CDATA[<strong>Data Mapping</strong>]]></label>
|
179 |
+
<frontend_type>label</frontend_type>
|
180 |
+
<sort_order>200</sort_order>
|
181 |
+
<show_in_default>1</show_in_default>
|
182 |
+
<show_in_website>1</show_in_website>
|
183 |
+
<show_in_store>1</show_in_store>
|
184 |
+
</title_data_mapping>
|
185 |
+
<cust_code_format translate="label comment">
|
186 |
+
<label>Customer Code Format</label>
|
187 |
+
<comment><![CDATA[Recommended: <code>customer_id</code>]]></comment>
|
188 |
+
<frontend_type>select</frontend_type>
|
189 |
+
<source_model>avatax/source_customercodeformat</source_model>
|
190 |
+
<sort_order>205</sort_order>
|
191 |
+
<show_in_default>1</show_in_default>
|
192 |
+
<show_in_website>1</show_in_website>
|
193 |
+
<show_in_store>1</show_in_store>
|
194 |
+
</cust_code_format>
|
195 |
+
<shipping_sku translate="label comment">
|
196 |
+
<label>Shipping Sku</label>
|
197 |
+
<comment>Required. The sku sent to denote shipping costs.</comment>
|
198 |
+
<frontend_type>text</frontend_type>
|
199 |
+
<sort_order>210</sort_order>
|
200 |
+
<show_in_default>1</show_in_default>
|
201 |
+
<show_in_website>1</show_in_website>
|
202 |
+
<show_in_store>1</show_in_store>
|
203 |
+
</shipping_sku>
|
204 |
+
<gw_order_sku translate="label comment">
|
205 |
+
<label>Gift Wrap Order Sku</label>
|
206 |
+
<comment>Required. The sku sent to denote gift wrap order costs.</comment>
|
207 |
+
<frontend_type>text</frontend_type>
|
208 |
+
<sort_order>215</sort_order>
|
209 |
+
<show_in_default>1</show_in_default>
|
210 |
+
<show_in_website>1</show_in_website>
|
211 |
+
<show_in_store>1</show_in_store>
|
212 |
+
</gw_order_sku>
|
213 |
+
<gw_items_sku translate="label comment">
|
214 |
+
<label>Gift Wrap Items Sku</label>
|
215 |
+
<comment>Required. The sku sent to denote gift wrap items costs.</comment>
|
216 |
+
<frontend_type>text</frontend_type>
|
217 |
+
<sort_order>216</sort_order>
|
218 |
+
<show_in_default>1</show_in_default>
|
219 |
+
<show_in_website>1</show_in_website>
|
220 |
+
<show_in_store>1</show_in_store>
|
221 |
+
</gw_items_sku>
|
222 |
+
<gw_printed_card_sku translate="label comment">
|
223 |
+
<label>Gift Wrap Printed Card Sku</label>
|
224 |
+
<comment>Required. The sku sent to denote gift wrap printed card costs.</comment>
|
225 |
+
<frontend_type>text</frontend_type>
|
226 |
+
<sort_order>217</sort_order>
|
227 |
+
<show_in_default>1</show_in_default>
|
228 |
+
<show_in_website>1</show_in_website>
|
229 |
+
<show_in_store>1</show_in_store>
|
230 |
+
</gw_printed_card_sku>
|
231 |
+
<adjustment_positive_sku translate="label comment">
|
232 |
+
<label>Adjustment Refund Sku</label>
|
233 |
+
<comment>Required. The sku sent to denote positive ajustments.</comment>
|
234 |
+
<frontend_type>text</frontend_type>
|
235 |
+
<sort_order>220</sort_order>
|
236 |
+
<show_in_default>1</show_in_default>
|
237 |
+
<show_in_website>1</show_in_website>
|
238 |
+
<show_in_store>1</show_in_store>
|
239 |
+
</adjustment_positive_sku>
|
240 |
+
<adjustment_negative_sku translate="label comment">
|
241 |
+
<label>Adjustment Fee Sku</label>
|
242 |
+
<comment>Required. The sku sent to denote negative ajustments.</comment>
|
243 |
+
<frontend_type>text</frontend_type>
|
244 |
+
<sort_order>230</sort_order>
|
245 |
+
<show_in_default>1</show_in_default>
|
246 |
+
<show_in_website>1</show_in_website>
|
247 |
+
<show_in_store>1</show_in_store>
|
248 |
+
</adjustment_negative_sku>
|
249 |
+
<sales_person_code translate="label comment">
|
250 |
+
<label>Sales Person Code</label>
|
251 |
+
<comment>Optional. The sales person code for orders.</comment>
|
252 |
+
<frontend_type>text</frontend_type>
|
253 |
+
<sort_order>240</sort_order>
|
254 |
+
<show_in_default>1</show_in_default>
|
255 |
+
<show_in_website>1</show_in_website>
|
256 |
+
<show_in_store>1</show_in_store>
|
257 |
+
</sales_person_code>
|
258 |
+
<location_code translate="label comment">
|
259 |
+
<label>Location Code</label>
|
260 |
+
<comment>Optional. The location code for orders.</comment>
|
261 |
+
<frontend_type>text</frontend_type>
|
262 |
+
<sort_order>250</sort_order>
|
263 |
+
<show_in_default>1</show_in_default>
|
264 |
+
<show_in_website>1</show_in_website>
|
265 |
+
<show_in_store>1</show_in_store>
|
266 |
+
</location_code>
|
267 |
+
<line_ref1_code translate="label">
|
268 |
+
<label>Reference Code 1</label>
|
269 |
+
<frontend_type>text</frontend_type>
|
270 |
+
<sort_order>260</sort_order>
|
271 |
+
<show_in_default>1</show_in_default>
|
272 |
+
<show_in_website>1</show_in_website>
|
273 |
+
<show_in_store>1</show_in_store>
|
274 |
+
</line_ref1_code>
|
275 |
+
<line_ref2_code translate="label comment">
|
276 |
+
<label>Reference Code 2</label>
|
277 |
+
<comment>Optional. An attribute code to pass with each product. See product attributes in catalog > attributes.</comment>
|
278 |
+
<frontend_type>text</frontend_type>
|
279 |
+
<sort_order>270</sort_order>
|
280 |
+
<show_in_default>1</show_in_default>
|
281 |
+
<show_in_website>1</show_in_website>
|
282 |
+
<show_in_store>1</show_in_store>
|
283 |
+
</line_ref2_code>
|
284 |
+
|
285 |
+
<title_address_validation translate="label">
|
286 |
+
<label><![CDATA[<strong>Shipping Address Options</strong>]]></label>
|
287 |
+
<frontend_type>label</frontend_type>
|
288 |
+
<sort_order>300</sort_order>
|
289 |
+
<show_in_default>1</show_in_default>
|
290 |
+
<show_in_website>1</show_in_website>
|
291 |
+
<show_in_store>1</show_in_store>
|
292 |
+
</title_address_validation>
|
293 |
+
<validate_address translate="label comment">
|
294 |
+
<label>Address Validation</label>
|
295 |
+
<frontend_type>select</frontend_type>
|
296 |
+
<source_model>avatax/source_addressvalidation</source_model>
|
297 |
+
<comment>Require a validated address from AvaTax to checkout</comment>
|
298 |
+
<sort_order>301</sort_order>
|
299 |
+
<show_in_default>1</show_in_default>
|
300 |
+
<show_in_website>1</show_in_website>
|
301 |
+
<show_in_store>1</show_in_store>
|
302 |
+
</validate_address>
|
303 |
+
<validate_address_message translate="label comment">
|
304 |
+
<label>Multi-Address Address Validation Error</label>
|
305 |
+
<comment>Only applies if address validation is enabled and shows ONLY for the multi-address checkout</comment>
|
306 |
+
<frontend_type>textarea</frontend_type>
|
307 |
+
<sort_order>331</sort_order>
|
308 |
+
<show_in_default>1</show_in_default>
|
309 |
+
<show_in_website>1</show_in_website>
|
310 |
+
<show_in_store>1</show_in_store>
|
311 |
+
</validate_address_message>
|
312 |
+
<normalize_address translate="label comment">
|
313 |
+
<label>Address Normalization</label>
|
314 |
+
<frontend_type>select</frontend_type>
|
315 |
+
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
316 |
+
<comment>Replace address with well-formed one from AvaTax</comment>
|
317 |
+
<sort_order>320</sort_order>
|
318 |
+
<show_in_default>1</show_in_default>
|
319 |
+
<show_in_website>1</show_in_website>
|
320 |
+
<show_in_store>1</show_in_store>
|
321 |
+
</normalize_address>
|
322 |
+
<onepage_normalize_message translate="label comment">
|
323 |
+
<label>Onepage Checkout Address Normalized Notice</label>
|
324 |
+
<comment>Only applies if address normalization is enabled</comment>
|
325 |
+
<frontend_type>textarea</frontend_type>
|
326 |
+
<sort_order>330</sort_order>
|
327 |
+
<show_in_default>1</show_in_default>
|
328 |
+
<show_in_website>1</show_in_website>
|
329 |
+
<show_in_store>1</show_in_store>
|
330 |
+
</onepage_normalize_message>
|
331 |
+
<multiaddress_normalize_message translate="label comment">
|
332 |
+
<label>Multi-Address Checkout Address Normalized Notice</label>
|
333 |
+
<comment>Only applies if address normalization is enabled</comment>
|
334 |
+
<frontend_type>textarea</frontend_type>
|
335 |
+
<sort_order>330</sort_order>
|
336 |
+
<show_in_default>1</show_in_default>
|
337 |
+
<show_in_website>1</show_in_website>
|
338 |
+
<show_in_store>1</show_in_store>
|
339 |
+
</multiaddress_normalize_message>
|
340 |
+
|
341 |
+
<title_request_settings translate="label">
|
342 |
+
<label><![CDATA[<strong>Request Settings</strong>]]></label>
|
343 |
+
<frontend_type>label</frontend_type>
|
344 |
+
<sort_order>340</sort_order>
|
345 |
+
<show_in_default>1</show_in_default>
|
346 |
+
<show_in_website>1</show_in_website>
|
347 |
+
<show_in_store>1</show_in_store>
|
348 |
+
</title_request_settings>
|
349 |
+
<field_required_list>
|
350 |
+
<label>Required Fileds</label>
|
351 |
+
<frontend_type>multiselect</frontend_type>
|
352 |
+
<source_model>avatax/source_fieldlist</source_model>
|
353 |
+
<sort_order>350</sort_order>
|
354 |
+
<show_in_default>1</show_in_default>
|
355 |
+
<show_in_website>1</show_in_website>
|
356 |
+
<show_in_store>1</show_in_store>
|
357 |
+
</field_required_list>
|
358 |
+
<field_rule>
|
359 |
+
<label>Field Rule</label>
|
360 |
+
<comment>Example: ' ,-,_'</comment>
|
361 |
+
<frontend_type>text</frontend_type>
|
362 |
+
<sort_order>360</sort_order>
|
363 |
+
<show_in_default>1</show_in_default>
|
364 |
+
<show_in_website>1</show_in_website>
|
365 |
+
<show_in_store>1</show_in_store>
|
366 |
+
</field_rule>
|
367 |
+
|
368 |
+
<title_error_handling translate="label">
|
369 |
+
<label><![CDATA[<strong>Error Handling</strong>]]></label>
|
370 |
+
<frontend_type>label</frontend_type>
|
371 |
+
<sort_order>400</sort_order>
|
372 |
+
<show_in_default>1</show_in_default>
|
373 |
+
<show_in_website>1</show_in_website>
|
374 |
+
<show_in_store>1</show_in_store>
|
375 |
+
</title_error_handling>
|
376 |
+
<error_full_stop translate="label">
|
377 |
+
<label>Action on Error</label>
|
378 |
+
<frontend_type>select</frontend_type>
|
379 |
+
<source_model>avatax/source_error</source_model>
|
380 |
+
<sort_order>410</sort_order>
|
381 |
+
<show_in_default>1</show_in_default>
|
382 |
+
<show_in_website>1</show_in_website>
|
383 |
+
<show_in_store>1</show_in_store>
|
384 |
+
</error_full_stop>
|
385 |
+
<error_frontend_message translate="label">
|
386 |
+
<label>Frontend Error Message</label>
|
387 |
+
<frontend_type>textarea</frontend_type>
|
388 |
+
<sort_order>420</sort_order>
|
389 |
+
<show_in_default>1</show_in_default>
|
390 |
+
<show_in_website>1</show_in_website>
|
391 |
+
<show_in_store>1</show_in_store>
|
392 |
+
</error_frontend_message>
|
393 |
+
<error_backend_message translate="label">
|
394 |
+
<label>Backend Error Message</label>
|
395 |
+
<frontend_type>textarea</frontend_type>
|
396 |
+
<sort_order>430</sort_order>
|
397 |
+
<show_in_default>1</show_in_default>
|
398 |
+
<show_in_website>1</show_in_website>
|
399 |
+
<show_in_store>1</show_in_store>
|
400 |
+
</error_backend_message>
|
401 |
+
<error_notification_toolbar translate="label comment">
|
402 |
+
<label>Notification Toolbar</label>
|
403 |
+
<frontend_type>select</frontend_type>
|
404 |
+
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
405 |
+
<comment>If there are issues syncing invoice or credit memo data, show warning in admin notification toolbar.</comment>
|
406 |
+
<sort_order>440</sort_order>
|
407 |
+
<show_in_default>1</show_in_default>
|
408 |
+
<show_in_website>0</show_in_website>
|
409 |
+
<show_in_store>0</show_in_store>
|
410 |
+
</error_notification_toolbar>
|
411 |
+
</fields>
|
412 |
+
</avatax>
|
413 |
+
<classes>
|
414 |
+
<fields>
|
415 |
+
<shipping_tax_class>
|
416 |
+
<!-- Will always be FR020100. It is hardcoded in OnePica_AvaTax_Helper_Tax_Data. -->
|
417 |
+
<show_in_default>0</show_in_default>
|
418 |
+
<show_in_website>0</show_in_website>
|
419 |
+
<show_in_store>0</show_in_store>
|
420 |
+
</shipping_tax_class>
|
421 |
+
</fields>
|
422 |
+
</classes>
|
423 |
+
<calculation>
|
424 |
+
<fields>
|
425 |
+
<based_on>
|
426 |
+
<!-- AvaTax always computes tax based on ship from and ship to addresses. -->
|
427 |
+
<show_in_default>0</show_in_default>
|
428 |
+
<show_in_website>0</show_in_website>
|
429 |
+
<show_in_store>0</show_in_store>
|
430 |
+
</based_on>
|
431 |
+
<price_includes_tax>
|
432 |
+
<!-- Items should not include tax so that AvaTax can calculate it. -->
|
433 |
+
<show_in_default>0</show_in_default>
|
434 |
+
<show_in_website>0</show_in_website>
|
435 |
+
<show_in_store>0</show_in_store>
|
436 |
+
</price_includes_tax>
|
437 |
+
<shipping_includes_tax>
|
438 |
+
<!-- Shipping should not include tax so that AvaTax can calculate it. -->
|
439 |
+
<show_in_default>0</show_in_default>
|
440 |
+
<show_in_website>0</show_in_website>
|
441 |
+
<show_in_store>0</show_in_store>
|
442 |
+
</shipping_includes_tax>
|
443 |
+
<apply_after_discount>
|
444 |
+
<!-- Always apply discount first since AvaTax doesn't support line-level item discount amounts -->
|
445 |
+
<show_in_default>0</show_in_default>
|
446 |
+
<show_in_website>0</show_in_website>
|
447 |
+
<show_in_store>0</show_in_store>
|
448 |
+
</apply_after_discount>
|
449 |
+
<discount_tax>
|
450 |
+
<!-- Always apply discount first since AvaTax doesn't support line-level item discount amounts -->
|
451 |
+
<show_in_default>0</show_in_default>
|
452 |
+
<show_in_website>0</show_in_website>
|
453 |
+
<show_in_store>0</show_in_store>
|
454 |
+
</discount_tax>
|
455 |
+
<apply_tax_on>
|
456 |
+
<!-- Always apply tax to custom price if available -->
|
457 |
+
<show_in_default>0</show_in_default>
|
458 |
+
<show_in_website>0</show_in_website>
|
459 |
+
<show_in_store>0</show_in_store>
|
460 |
+
</apply_tax_on>
|
461 |
+
<algorithm>
|
462 |
+
<!-- Always based on row (actually determined by Avalara) -->
|
463 |
+
<show_in_default>0</show_in_default>
|
464 |
+
<show_in_website>0</show_in_website>
|
465 |
+
<show_in_store>0</show_in_store>
|
466 |
+
</algorithm>
|
467 |
+
</fields>
|
468 |
+
</calculation>
|
469 |
+
<defaults>
|
470 |
+
<fields>
|
471 |
+
<region translate="comment">
|
472 |
+
<comment>Set this to "*" (asterisk) to stop unneeded requests to Avalara and to help speed up page loads</comment>
|
473 |
+
</region>
|
474 |
+
<postcode translate="comment">
|
475 |
+
<comment>Set this to "*" (asterisk) to stop unneeded requests to Avalara and to help speed up page loads</comment>
|
476 |
+
</postcode>
|
477 |
+
</fields>
|
478 |
+
</defaults>
|
479 |
+
<display>
|
480 |
+
<fields>
|
481 |
+
<type>
|
482 |
+
<show_in_default>0</show_in_default>
|
483 |
+
<show_in_website>0</show_in_website>
|
484 |
+
<show_in_store>0</show_in_store>
|
485 |
+
</type>
|
486 |
+
<shipping>
|
487 |
+
<show_in_default>0</show_in_default>
|
488 |
+
<show_in_website>0</show_in_website>
|
489 |
+
<show_in_store>0</show_in_store>
|
490 |
+
</shipping>
|
491 |
+
</fields>
|
492 |
+
</display>
|
493 |
+
<sales_display>
|
494 |
+
<fields>
|
495 |
+
<full_summary>
|
496 |
+
<!-- Jurisdiction data is not kept in Magento at this time after the quote -->
|
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 |
+
</full_summary>
|
501 |
+
</fields>
|
502 |
+
</sales_display>
|
503 |
+
</groups>
|
504 |
+
</tax>
|
505 |
+
<shipping>
|
506 |
+
<groups>
|
507 |
+
<origin>
|
508 |
+
<fields>
|
509 |
+
<street translate="label">
|
510 |
+
<label><![CDATA[Number & Street]]></label>
|
511 |
+
<frontend_type>text</frontend_type>
|
512 |
+
<sort_order>99</sort_order>
|
513 |
+
<show_in_default>1</show_in_default>
|
514 |
+
<show_in_website>1</show_in_website>
|
515 |
+
<show_in_store>1</show_in_store>
|
516 |
+
</street>
|
517 |
+
</fields>
|
518 |
+
</origin>
|
519 |
+
</groups>
|
520 |
+
</shipping>
|
521 |
+
</sections>
|
522 |
+
</config>
|
|
app/code/community/OnePica/AvaTax/lib/AvaTax.php
CHANGED
@@ -93,9 +93,4 @@ function getCurrentDate()
|
|
93 |
{
|
94 |
$dateTime=new DateTime();
|
95 |
return $dateTime->format("Y-m-d");
|
96 |
-
}
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
?>
|
93 |
{
|
94 |
$dateTime=new DateTime();
|
95 |
return $dateTime->format("Y-m-d");
|
96 |
+
}
|
|
|
|
|
|
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/ATConfig.class.php
CHANGED
@@ -65,7 +65,3 @@ new ATConfig('Default', array(
|
|
65 |
'name' => 'PHPAdapter',
|
66 |
'trace' => true) // change to false for production
|
67 |
);
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
?>
|
65 |
'name' => 'PHPAdapter',
|
66 |
'trace' => true) // change to false for production
|
67 |
);
|
|
|
|
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/ATObject.class.php
CHANGED
@@ -50,6 +50,4 @@ class ATObject
|
|
50 |
}
|
51 |
}
|
52 |
public function ivars() { return $this->_ivars; }
|
53 |
-
}
|
54 |
-
|
55 |
-
?>
|
50 |
}
|
51 |
}
|
52 |
public function ivars() { return $this->_ivars; }
|
53 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/AVObject.class.php
CHANGED
File without changes
|
app/code/community/OnePica/AvaTax/lib/classes/Address.class.php
CHANGED
@@ -224,6 +224,4 @@ class Address
|
|
224 |
$this->TaxRegionId === $other->TaxRegionId
|
225 |
);
|
226 |
}
|
227 |
-
}
|
228 |
-
|
229 |
-
?>
|
224 |
$this->TaxRegionId === $other->TaxRegionId
|
225 |
);
|
226 |
}
|
227 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/AddressServiceSoap.class.php
CHANGED
@@ -151,7 +151,3 @@ class AddressServiceSoap extends AvalaraSoapClient
|
|
151 |
|
152 |
|
153 |
}
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
?>
|
151 |
|
152 |
|
153 |
}
|
|
|
|
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/AddressType.class.php
CHANGED
@@ -36,5 +36,3 @@ class AddressType extends Enum
|
|
36 |
// Unfortunate boiler plate due to polymorphism issues on static functions
|
37 |
public static function Validate($value) { self::__Validate($value,self::Values(),__CLASS__); }
|
38 |
}
|
39 |
-
|
40 |
-
?>
|
36 |
// Unfortunate boiler plate due to polymorphism issues on static functions
|
37 |
public static function Validate($value) { self::__Validate($value,self::Values(),__CLASS__); }
|
38 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/AdjustTaxRequest.class.php
CHANGED
@@ -72,6 +72,4 @@ class AdjustTaxRequest
|
|
72 |
|
73 |
|
74 |
|
75 |
-
}
|
76 |
-
|
77 |
-
?>
|
72 |
|
73 |
|
74 |
|
75 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/AdjustTaxResult.class.php
CHANGED
@@ -258,6 +258,4 @@ class AdjustTaxResult //extends GetTaxResult
|
|
258 |
|
259 |
|
260 |
|
261 |
-
}
|
262 |
-
|
263 |
-
?>
|
258 |
|
259 |
|
260 |
|
261 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/ApplyPaymentRequest.class.php
CHANGED
@@ -74,6 +74,4 @@ class ApplyPaymentRequest
|
|
74 |
*/
|
75 |
public function getPaymentDate(){ return $this->PaymentDate;} //date
|
76 |
|
77 |
-
}
|
78 |
-
|
79 |
-
?>
|
74 |
*/
|
75 |
public function getPaymentDate(){ return $this->PaymentDate;} //date
|
76 |
|
77 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/ApplyPaymentResult.class.php
CHANGED
@@ -10,6 +10,4 @@ class ApplyPaymentResult extends BaseResult
|
|
10 |
|
11 |
|
12 |
|
13 |
-
}
|
14 |
-
|
15 |
-
?>
|
10 |
|
11 |
|
12 |
|
13 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/AvalaraSoapClient.class.php
CHANGED
@@ -30,7 +30,3 @@ class AvalaraSoapClient
|
|
30 |
public function __getLastResponseHeaders() { return $this->client->__getLastResponseHeaders(); }
|
31 |
|
32 |
}
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
?>
|
30 |
public function __getLastResponseHeaders() { return $this->client->__getLastResponseHeaders(); }
|
31 |
|
32 |
}
|
|
|
|
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BaseResult.class.php
CHANGED
@@ -34,6 +34,4 @@ class BaseResult
|
|
34 |
*/
|
35 |
public function getMessages() { return EnsureIsArray($this->Messages->Message); }
|
36 |
|
37 |
-
}
|
38 |
-
|
39 |
-
?>
|
34 |
*/
|
35 |
public function getMessages() { return EnsureIsArray($this->Messages->Message); }
|
36 |
|
37 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/AuditMessage.class.php
CHANGED
@@ -11,5 +11,3 @@ class AuditMessage {
|
|
11 |
public function getMessage(){return $this->Message;} // string
|
12 |
|
13 |
}
|
14 |
-
|
15 |
-
?>
|
11 |
public function getMessage(){return $this->Message;} // string
|
12 |
|
13 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/AvaTaxBatchSvc.php
CHANGED
@@ -68,7 +68,4 @@ function xml_pretty_printer($xml, $html_output=FALSE)
|
|
68 |
|
69 |
$xml = join("n", $new_xml_lines);
|
70 |
return ($html_output) ? '<pre>' . htmlentities($xml) . '</pre>' : $xml;
|
71 |
-
}
|
72 |
-
|
73 |
-
|
74 |
-
?>
|
68 |
|
69 |
$xml = join("n", $new_xml_lines);
|
70 |
return ($html_output) ? '<pre>' . htmlentities($xml) . '</pre>' : $xml;
|
71 |
+
}
|
|
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BaseResult.class.php
CHANGED
@@ -18,6 +18,4 @@ class BaseResult {
|
|
18 |
public function setMessages($value){$this->Messages=$value;} // ArrayOfMessage
|
19 |
public function getMessages(){return $this->Messages;} // ArrayOfMessage
|
20 |
|
21 |
-
}
|
22 |
-
|
23 |
-
?>
|
18 |
public function setMessages($value){$this->Messages=$value;} // ArrayOfMessage
|
19 |
public function getMessages(){return $this->Messages;} // ArrayOfMessage
|
20 |
|
21 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/Batch.class.php
CHANGED
@@ -84,5 +84,3 @@ class Batch {
|
|
84 |
public function getCurrentRecord(){return $this->CurrentRecord;} // int
|
85 |
|
86 |
}
|
87 |
-
|
88 |
-
?>
|
84 |
public function getCurrentRecord(){return $this->CurrentRecord;} // int
|
85 |
|
86 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchDelete.class.php
CHANGED
@@ -10,6 +10,4 @@ class BatchDelete {
|
|
10 |
public function setDeleteRequest($value){$this->DeleteRequest=$value;} // DeleteRequest
|
11 |
public function getDeleteRequest(){return $this->DeleteRequest;} // DeleteRequest
|
12 |
|
13 |
-
}
|
14 |
-
|
15 |
-
?>
|
10 |
public function setDeleteRequest($value){$this->DeleteRequest=$value;} // DeleteRequest
|
11 |
public function getDeleteRequest(){return $this->DeleteRequest;} // DeleteRequest
|
12 |
|
13 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchDeleteResponse.class.php
CHANGED
@@ -11,5 +11,3 @@ class BatchDeleteResponse {
|
|
11 |
public function getBatchDeleteResult(){return $this->BatchDeleteResult;} // DeleteResult
|
12 |
|
13 |
}
|
14 |
-
|
15 |
-
?>
|
11 |
public function getBatchDeleteResult(){return $this->BatchDeleteResult;} // DeleteResult
|
12 |
|
13 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchFetch.class.php
CHANGED
@@ -11,5 +11,3 @@ class BatchFetch {
|
|
11 |
public function getFetchRequest(){return $this->FetchRequest;} // FetchRequest
|
12 |
|
13 |
}
|
14 |
-
|
15 |
-
?>
|
11 |
public function getFetchRequest(){return $this->FetchRequest;} // FetchRequest
|
12 |
|
13 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchFetchResponse.class.php
CHANGED
@@ -11,5 +11,3 @@ class BatchFetchResponse {
|
|
11 |
public function getBatchFetchResult(){return $this->BatchFetchResult;} // BatchFetchResult
|
12 |
|
13 |
}
|
14 |
-
|
15 |
-
?>
|
11 |
public function getBatchFetchResult(){return $this->BatchFetchResult;} // BatchFetchResult
|
12 |
|
13 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchFetchResult.class.php
CHANGED
@@ -15,5 +15,3 @@ class BatchFetchResult extends BaseResult {
|
|
15 |
public function getRecordCount(){return $this->RecordCount;} // int
|
16 |
|
17 |
}
|
18 |
-
|
19 |
-
?>
|
15 |
public function getRecordCount(){return $this->RecordCount;} // int
|
16 |
|
17 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchFile.class.php
CHANGED
@@ -50,5 +50,3 @@ class BatchFile {
|
|
50 |
public function getErrorCount(){return $this->ErrorCount;} // int
|
51 |
|
52 |
}
|
53 |
-
|
54 |
-
?>
|
50 |
public function getErrorCount(){return $this->ErrorCount;} // int
|
51 |
|
52 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchFileDelete.class.php
CHANGED
@@ -11,5 +11,3 @@ class BatchFileDelete {
|
|
11 |
public function getDeleteRequest(){return $this->DeleteRequest;} // DeleteRequest
|
12 |
|
13 |
}
|
14 |
-
|
15 |
-
?>
|
11 |
public function getDeleteRequest(){return $this->DeleteRequest;} // DeleteRequest
|
12 |
|
13 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchFileDeleteResponse.class.php
CHANGED
@@ -10,6 +10,4 @@ class BatchFileDeleteResponse {
|
|
10 |
public function setBatchFileDeleteResult($value){$this->BatchFileDeleteResult=$value;} // DeleteResult
|
11 |
public function getBatchFileDeleteResult(){return $this->BatchFileDeleteResult;} // DeleteResult
|
12 |
|
13 |
-
}
|
14 |
-
|
15 |
-
?>
|
10 |
public function setBatchFileDeleteResult($value){$this->BatchFileDeleteResult=$value;} // DeleteResult
|
11 |
public function getBatchFileDeleteResult(){return $this->BatchFileDeleteResult;} // DeleteResult
|
12 |
|
13 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchFileFetch.class.php
CHANGED
@@ -11,5 +11,3 @@ class BatchFileFetch {
|
|
11 |
public function getFetchRequest(){return $this->FetchRequest;} // FetchRequest
|
12 |
|
13 |
}
|
14 |
-
|
15 |
-
?>
|
11 |
public function getFetchRequest(){return $this->FetchRequest;} // FetchRequest
|
12 |
|
13 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchFileFetchResponse.class.php
CHANGED
@@ -11,5 +11,3 @@ class BatchFileFetchResponse {
|
|
11 |
public function getBatchFileFetchResult(){return $this->BatchFileFetchResult;} // BatchFileFetchResult
|
12 |
|
13 |
}
|
14 |
-
|
15 |
-
?>
|
11 |
public function getBatchFileFetchResult(){return $this->BatchFileFetchResult;} // BatchFileFetchResult
|
12 |
|
13 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchFileFetchResult.class.php
CHANGED
@@ -15,5 +15,3 @@ class BatchFileFetchResult extends BaseResult {
|
|
15 |
public function getRecordCount(){return $this->RecordCount;} // int
|
16 |
|
17 |
}
|
18 |
-
|
19 |
-
?>
|
15 |
public function getRecordCount(){return $this->RecordCount;} // int
|
16 |
|
17 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchFileSave.class.php
CHANGED
@@ -10,6 +10,4 @@ class BatchFileSave {
|
|
10 |
public function setBatchFile($value){$this->BatchFile=$value;} // BatchFile
|
11 |
public function getBatchFile(){return $this->BatchFile;} // BatchFile
|
12 |
|
13 |
-
}
|
14 |
-
|
15 |
-
?>
|
10 |
public function setBatchFile($value){$this->BatchFile=$value;} // BatchFile
|
11 |
public function getBatchFile(){return $this->BatchFile;} // BatchFile
|
12 |
|
13 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchFileSaveResponse.class.php
CHANGED
@@ -10,6 +10,4 @@ class BatchFileSaveResponse {
|
|
10 |
public function setBatchFileSaveResult($value){$this->BatchFileSaveResult=$value;} // BatchFileSaveResult
|
11 |
public function getBatchFileSaveResult(){return $this->BatchFileSaveResult;} // BatchFileSaveResult
|
12 |
|
13 |
-
}
|
14 |
-
|
15 |
-
?>
|
10 |
public function setBatchFileSaveResult($value){$this->BatchFileSaveResult=$value;} // BatchFileSaveResult
|
11 |
public function getBatchFileSaveResult(){return $this->BatchFileSaveResult;} // BatchFileSaveResult
|
12 |
|
13 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchFileSaveResult.class.php
CHANGED
@@ -11,5 +11,3 @@ class BatchFileSaveResult extends BaseResult {
|
|
11 |
public function getBatchFileId(){return $this->BatchFileId;} // int
|
12 |
|
13 |
}
|
14 |
-
|
15 |
-
?>
|
11 |
public function getBatchFileId(){return $this->BatchFileId;} // int
|
12 |
|
13 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchProcess.class.php
CHANGED
@@ -11,5 +11,3 @@ class BatchProcess {
|
|
11 |
public function getBatchProcessRequest(){return $this->BatchProcessRequest;} // BatchProcessRequest
|
12 |
|
13 |
}
|
14 |
-
|
15 |
-
?>
|
11 |
public function getBatchProcessRequest(){return $this->BatchProcessRequest;} // BatchProcessRequest
|
12 |
|
13 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchProcessRequest.class.php
CHANGED
@@ -22,5 +22,3 @@ class BatchProcessRequest //extends FilterRequest
|
|
22 |
public function getMaxCount(){return $this->MaxCount;} // int
|
23 |
|
24 |
}
|
25 |
-
|
26 |
-
?>
|
22 |
public function getMaxCount(){return $this->MaxCount;} // int
|
23 |
|
24 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchProcessResponse.class.php
CHANGED
@@ -11,5 +11,3 @@ class BatchProcessResponse {
|
|
11 |
public function getBatchProcessResult(){return $this->BatchProcessResult;} // BatchProcessResult
|
12 |
|
13 |
}
|
14 |
-
|
15 |
-
?>
|
11 |
public function getBatchProcessResult(){return $this->BatchProcessResult;} // BatchProcessResult
|
12 |
|
13 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchProcessResult.class.php
CHANGED
@@ -7,5 +7,3 @@
|
|
7 |
class BatchProcessResult extends BaseResult {
|
8 |
|
9 |
}
|
10 |
-
|
11 |
-
?>
|
7 |
class BatchProcessResult extends BaseResult {
|
8 |
|
9 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchSave.class.php
CHANGED
@@ -11,5 +11,3 @@ class BatchSave {
|
|
11 |
public function getBatch(){return $this->Batch;} // Batch
|
12 |
|
13 |
}
|
14 |
-
|
15 |
-
?>
|
11 |
public function getBatch(){return $this->Batch;} // Batch
|
12 |
|
13 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchSaveResponse.class.php
CHANGED
@@ -11,5 +11,3 @@ class BatchSaveResponse {
|
|
11 |
public function getBatchSaveResult(){return $this->BatchSaveResult;} // BatchSaveResult
|
12 |
|
13 |
}
|
14 |
-
|
15 |
-
?>
|
11 |
public function getBatchSaveResult(){return $this->BatchSaveResult;} // BatchSaveResult
|
12 |
|
13 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchSaveResult.class.php
CHANGED
@@ -15,5 +15,3 @@ class BatchSaveResult extends BaseResult {
|
|
15 |
public function getEstimatedCompletion(){return $this->EstimatedCompletion;} // dateTime
|
16 |
|
17 |
}
|
18 |
-
|
19 |
-
?>
|
15 |
public function getEstimatedCompletion(){return $this->EstimatedCompletion;} // dateTime
|
16 |
|
17 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/BatchSvc.class.php
CHANGED
@@ -171,5 +171,3 @@ public function IsAuthorized($operations)
|
|
171 |
}
|
172 |
|
173 |
}
|
174 |
-
|
175 |
-
?>
|
171 |
}
|
172 |
|
173 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/DeleteRequest.class.php
CHANGED
@@ -22,5 +22,3 @@ class DeleteRequest //extends FilterRequest
|
|
22 |
public function getMaxCount(){return $this->MaxCount;} // int
|
23 |
|
24 |
}
|
25 |
-
|
26 |
-
?>
|
22 |
public function getMaxCount(){return $this->MaxCount;} // int
|
23 |
|
24 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/DeleteResult.class.php
CHANGED
@@ -6,6 +6,4 @@
|
|
6 |
*/
|
7 |
class DeleteResult extends BaseResult {
|
8 |
|
9 |
-
}
|
10 |
-
|
11 |
-
?>
|
6 |
*/
|
7 |
class DeleteResult extends BaseResult {
|
8 |
|
9 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/FetchRequest.class.php
CHANGED
@@ -43,5 +43,3 @@ class FetchRequest {
|
|
43 |
public function getRecordCount(){return $this->RecordCount;} // int
|
44 |
|
45 |
}
|
46 |
-
|
47 |
-
?>
|
43 |
public function getRecordCount(){return $this->RecordCount;} // int
|
44 |
|
45 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/FilterRequest.class.php
CHANGED
@@ -20,6 +20,4 @@ class FilterRequest {
|
|
20 |
public function setMaxCount($value){$this->MaxCount=$value;} // int
|
21 |
public function getMaxCount(){return $this->MaxCount;} // int
|
22 |
|
23 |
-
}
|
24 |
-
|
25 |
-
?>
|
20 |
public function setMaxCount($value){$this->MaxCount=$value;} // int
|
21 |
public function getMaxCount(){return $this->MaxCount;} // int
|
22 |
|
23 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/FilterResult.class.php
CHANGED
@@ -10,6 +10,4 @@ class FilterResult {
|
|
10 |
public function setCount($value){$this->Count=$value;} // int
|
11 |
public function getCount(){return $this->Count;} // int
|
12 |
|
13 |
-
}
|
14 |
-
|
15 |
-
?>
|
10 |
public function setCount($value){$this->Count=$value;} // int
|
11 |
public function getCount(){return $this->Count;} // int
|
12 |
|
13 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/IsAuthorized.class.php
CHANGED
@@ -11,5 +11,3 @@ class IsAuthorized {
|
|
11 |
public function getOperations(){return $this->Operations;} // string
|
12 |
|
13 |
}
|
14 |
-
|
15 |
-
?>
|
11 |
public function getOperations(){return $this->Operations;} // string
|
12 |
|
13 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/IsAuthorizedResponse.class.php
CHANGED
@@ -10,6 +10,4 @@ class IsAuthorizedResponse {
|
|
10 |
public function setIsAuthorizedResult($value){$this->IsAuthorizedResult=$value;} // IsAuthorizedResult
|
11 |
public function getIsAuthorizedResult(){return $this->IsAuthorizedResult;} // IsAuthorizedResult
|
12 |
|
13 |
-
}
|
14 |
-
|
15 |
-
?>
|
10 |
public function setIsAuthorizedResult($value){$this->IsAuthorizedResult=$value;} // IsAuthorizedResult
|
11 |
public function getIsAuthorizedResult(){return $this->IsAuthorizedResult;} // IsAuthorizedResult
|
12 |
|
13 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/IsAuthorizedResult.class.php
CHANGED
@@ -15,5 +15,3 @@ class IsAuthorizedResult {
|
|
15 |
public function getExpires(){return $this->Expires;} // dateTime
|
16 |
|
17 |
}
|
18 |
-
|
19 |
-
?>
|
15 |
public function getExpires(){return $this->Expires;} // dateTime
|
16 |
|
17 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/Message.class.php
CHANGED
@@ -35,5 +35,3 @@ class Message {
|
|
35 |
public function getName(){return $this->Name;} // string
|
36 |
|
37 |
}
|
38 |
-
|
39 |
-
?>
|
35 |
public function getName(){return $this->Name;} // string
|
36 |
|
37 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/Ping.class.php
CHANGED
@@ -11,5 +11,3 @@ class Ping {
|
|
11 |
public function getMessage(){return $this->Message;} // string
|
12 |
|
13 |
}
|
14 |
-
|
15 |
-
?>
|
11 |
public function getMessage(){return $this->Message;} // string
|
12 |
|
13 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/PingResponse.class.php
CHANGED
@@ -11,5 +11,3 @@ class PingResponse {
|
|
11 |
public function getPingResult(){return $this->PingResult;} // PingResult
|
12 |
|
13 |
}
|
14 |
-
|
15 |
-
?>
|
11 |
public function getPingResult(){return $this->PingResult;} // PingResult
|
12 |
|
13 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/PingResult.class.php
CHANGED
@@ -24,5 +24,3 @@ class PingResult extends BaseResult
|
|
24 |
//public function getMessages() { return EnsureIsArray($this->Messages->Message);}
|
25 |
|
26 |
}
|
27 |
-
|
28 |
-
?>
|
24 |
//public function getMessages() { return EnsureIsArray($this->Messages->Message);}
|
25 |
|
26 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/Profile.class.php
CHANGED
@@ -22,6 +22,4 @@ class Profile {
|
|
22 |
public function setMachine($value){$this->Machine=$value;} // string
|
23 |
public function getMachine(){return $this->Machine;} // string
|
24 |
|
25 |
-
}
|
26 |
-
|
27 |
-
?>
|
22 |
public function setMachine($value){$this->Machine=$value;} // string
|
23 |
public function getMachine(){return $this->Machine;} // string
|
24 |
|
25 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BatchSvc/SeverityLevel.class.php
CHANGED
@@ -10,6 +10,4 @@ class SeverityLevel {
|
|
10 |
const Error = 'Error';
|
11 |
const Exception = 'Exception';
|
12 |
|
13 |
-
}
|
14 |
-
|
15 |
-
?>
|
10 |
const Error = 'Error';
|
11 |
const Exception = 'Exception';
|
12 |
|
13 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/BoundaryLevel.class.php
CHANGED
@@ -54,7 +54,4 @@ class BoundaryLevel extends Enum
|
|
54 |
|
55 |
// Unfortunate boiler plate due to polymorphism issues on static functions
|
56 |
public static function Validate($value) { self::__Validate($value,self::Values(),__CLASS__); }
|
57 |
-
}
|
58 |
-
|
59 |
-
|
60 |
-
?>
|
54 |
|
55 |
// Unfortunate boiler plate due to polymorphism issues on static functions
|
56 |
public static function Validate($value) { self::__Validate($value,self::Values(),__CLASS__); }
|
57 |
+
}
|
|
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/CancelCode.class.php
CHANGED
@@ -69,6 +69,4 @@ class CancelCode extends Enum
|
|
69 |
// Unfortunate boiler plate due to polymorphism issues on static functions
|
70 |
public static function Validate($value) { self::__Validate($value,self::Values(),__CLASS__); }
|
71 |
|
72 |
-
}
|
73 |
-
|
74 |
-
?>
|
69 |
// Unfortunate boiler plate due to polymorphism issues on static functions
|
70 |
public static function Validate($value) { self::__Validate($value,self::Values(),__CLASS__); }
|
71 |
|
72 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/CancelTaxRequest.class.php
CHANGED
@@ -52,10 +52,4 @@ class CancelTaxRequest extends TaxRequest
|
|
52 |
|
53 |
public function setCancelCode($value) { CancelCode::Validate($value); $this->CancelCode = $value; return $this; }
|
54 |
|
55 |
-
}
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
?>
|
52 |
|
53 |
public function setCancelCode($value) { CancelCode::Validate($value); $this->CancelCode = $value; return $this; }
|
54 |
|
55 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/CancelTaxResult.class.php
CHANGED
@@ -53,6 +53,4 @@ class CancelTaxResult // extends BaseResult
|
|
53 |
|
54 |
|
55 |
|
56 |
-
}
|
57 |
-
|
58 |
-
?>
|
53 |
|
54 |
|
55 |
|
56 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/CommitTaxRequest.class.php
CHANGED
@@ -40,7 +40,4 @@ class CommitTaxRequest extends TaxRequest
|
|
40 |
|
41 |
|
42 |
|
43 |
-
}
|
44 |
-
|
45 |
-
|
46 |
-
?>
|
40 |
|
41 |
|
42 |
|
43 |
+
}
|
|
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/CommitTaxResult.class.php
CHANGED
@@ -49,6 +49,4 @@ class CommitTaxResult //extends BaseResult
|
|
49 |
public function getMessages() { return EnsureIsArray($this->Messages->Message); }
|
50 |
|
51 |
|
52 |
-
}
|
53 |
-
|
54 |
-
?>
|
49 |
public function getMessages() { return EnsureIsArray($this->Messages->Message); }
|
50 |
|
51 |
|
52 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/DetailLevel.class.php
CHANGED
@@ -52,6 +52,4 @@ class DetailLevel extends Enum
|
|
52 |
|
53 |
// Unfortunate boiler plate due to polymorphism issues on static functions
|
54 |
public static function Validate($value) { self::__Validate($value,self::Values(),__CLASS__); }
|
55 |
-
}
|
56 |
-
|
57 |
-
?>
|
52 |
|
53 |
// Unfortunate boiler plate due to polymorphism issues on static functions
|
54 |
public static function Validate($value) { self::__Validate($value,self::Values(),__CLASS__); }
|
55 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/DocStatus.class.php
CHANGED
@@ -82,6 +82,4 @@ class DocStatus extends Enum
|
|
82 |
// Unfortunate boiler plate due to polymorphism issues on static functions
|
83 |
public static function Validate($value) { self::__Validate($value,self::Values(),__CLASS__); }
|
84 |
|
85 |
-
}
|
86 |
-
|
87 |
-
?>
|
82 |
// Unfortunate boiler plate due to polymorphism issues on static functions
|
83 |
public static function Validate($value) { self::__Validate($value,self::Values(),__CLASS__); }
|
84 |
|
85 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/DocumentType.class.php
CHANGED
@@ -85,6 +85,4 @@ class DocumentType extends Enum
|
|
85 |
|
86 |
|
87 |
|
88 |
-
}
|
89 |
-
|
90 |
-
?>
|
85 |
|
86 |
|
87 |
|
88 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/DynamicSoapClient.class.php
CHANGED
@@ -59,5 +59,3 @@ class DynamicSoapClient extends SoapClient
|
|
59 |
}
|
60 |
|
61 |
}
|
62 |
-
|
63 |
-
?>
|
59 |
}
|
60 |
|
61 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/Enum.class.php
CHANGED
@@ -27,6 +27,4 @@ class Enum
|
|
27 |
|
28 |
throw new Exception('Invalid '.$class.' "'.$value.'" - must be one of "'.implode('"|"',$values).'"');
|
29 |
}
|
30 |
-
}
|
31 |
-
|
32 |
-
?>
|
27 |
|
28 |
throw new Exception('Invalid '.$class.' "'.$value.'" - must be one of "'.implode('"|"',$values).'"');
|
29 |
}
|
30 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/GetTaxHistoryRequest.class.php
CHANGED
@@ -49,6 +49,4 @@ class GetTaxHistoryRequest extends TaxRequest
|
|
49 |
|
50 |
public function setDetailLevel($value) { DetailLevel::Validate($value); $this->DetailLevel = $value; return $this; } //Summary or Document or Line or Tax or Diagnostic - enum
|
51 |
|
52 |
-
}
|
53 |
-
|
54 |
-
?>
|
49 |
|
50 |
public function setDetailLevel($value) { DetailLevel::Validate($value); $this->DetailLevel = $value; return $this; } //Summary or Document or Line or Tax or Diagnostic - enum
|
51 |
|
52 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/GetTaxHistoryResult.class.php
CHANGED
@@ -67,6 +67,4 @@ class GetTaxHistoryResult //extends BaseResult
|
|
67 |
public function getMessages() { return EnsureIsArray($this->Messages->Message); }
|
68 |
|
69 |
|
70 |
-
}
|
71 |
-
|
72 |
-
?>
|
67 |
public function getMessages() { return EnsureIsArray($this->Messages->Message); }
|
68 |
|
69 |
|
70 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/GetTaxRequest.class.php
CHANGED
@@ -258,17 +258,17 @@ class GetTaxRequest
|
|
258 |
* </p>
|
259 |
* <p>
|
260 |
* The standard values for the CustomerUsageType (A-L).<br/>
|
261 |
-
A � Federal Government<br/>
|
262 |
-
B � State/Local Govt.<br/>
|
263 |
-
C � Tribal Government<br/>
|
264 |
-
D � Foreign Diplomat<br/>
|
265 |
-
E � Charitable Organization<br/>
|
266 |
-
F � Religious/Education<br/>
|
267 |
-
G � Resale<br/>
|
268 |
-
H � Agricultural Production<br/>
|
269 |
-
I � Industrial Prod/Mfg.<br/>
|
270 |
-
J � Direct Pay Permit<br/>
|
271 |
-
K � Direct Mail<br/>
|
272 |
L - Other<br/>
|
273 |
* </p>
|
274 |
* @param customerUsageType
|
@@ -526,6 +526,4 @@ class GetTaxRequest
|
|
526 |
|
527 |
|
528 |
|
529 |
-
}
|
530 |
-
|
531 |
-
?>
|
258 |
* </p>
|
259 |
* <p>
|
260 |
* The standard values for the CustomerUsageType (A-L).<br/>
|
261 |
+
A � Federal Government<br/>
|
262 |
+
B � State/Local Govt.<br/>
|
263 |
+
C � Tribal Government<br/>
|
264 |
+
D � Foreign Diplomat<br/>
|
265 |
+
E � Charitable Organization<br/>
|
266 |
+
F � Religious/Education<br/>
|
267 |
+
G � Resale<br/>
|
268 |
+
H � Agricultural Production<br/>
|
269 |
+
I � Industrial Prod/Mfg.<br/>
|
270 |
+
J � Direct Pay Permit<br/>
|
271 |
+
K � Direct Mail<br/>
|
272 |
L - Other<br/>
|
273 |
* </p>
|
274 |
* @param customerUsageType
|
526 |
|
527 |
|
528 |
|
529 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/GetTaxResult.class.php
CHANGED
@@ -258,6 +258,4 @@ class GetTaxResult // extends BaseResult
|
|
258 |
|
259 |
|
260 |
|
261 |
-
}
|
262 |
-
|
263 |
-
?>
|
258 |
|
259 |
|
260 |
|
261 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/IsAuthorizedResult.class.php
CHANGED
@@ -76,6 +76,4 @@ class IsAuthorizedResult //extends BaseResult
|
|
76 |
public function getMessages() { return EnsureIsArray($this->Messages->Message); }
|
77 |
|
78 |
|
79 |
-
}
|
80 |
-
|
81 |
-
?>
|
76 |
public function getMessages() { return EnsureIsArray($this->Messages->Message); }
|
77 |
|
78 |
|
79 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/JurisdictionType.class.php
CHANGED
@@ -70,6 +70,4 @@ class JurisdictionType
|
|
70 |
|
71 |
*/
|
72 |
|
73 |
-
}
|
74 |
-
|
75 |
-
?>
|
70 |
|
71 |
*/
|
72 |
|
73 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/Line.class.php
CHANGED
@@ -122,17 +122,17 @@ class Line
|
|
122 |
* </p>
|
123 |
* <p>
|
124 |
* The standard values for the CustomerUsageType (A-L).<br/>
|
125 |
-
A � Federal Government<br/>
|
126 |
-
B � State/Local Govt.<br/>
|
127 |
-
C � Tribal Government<br/>
|
128 |
-
D � Foreign Diplomat<br/>
|
129 |
-
E � Charitable Organization<br/>
|
130 |
-
F � Religious/Education<br/>
|
131 |
-
G � Resale<br/>
|
132 |
-
H � Agricultural Production<br/>
|
133 |
-
I � Industrial Prod/Mfg.<br/>
|
134 |
-
J � Direct Pay Permit<br/>
|
135 |
-
K � Direct Mail<br/>
|
136 |
L - Other<br/>
|
137 |
* </p>
|
138 |
* @param string $value
|
@@ -261,7 +261,4 @@ class Line
|
|
261 |
|
262 |
/**#@-*/
|
263 |
|
264 |
-
}
|
265 |
-
|
266 |
-
|
267 |
-
?>
|
122 |
* </p>
|
123 |
* <p>
|
124 |
* The standard values for the CustomerUsageType (A-L).<br/>
|
125 |
+
A � Federal Government<br/>
|
126 |
+
B � State/Local Govt.<br/>
|
127 |
+
C � Tribal Government<br/>
|
128 |
+
D � Foreign Diplomat<br/>
|
129 |
+
E � Charitable Organization<br/>
|
130 |
+
F � Religious/Education<br/>
|
131 |
+
G � Resale<br/>
|
132 |
+
H � Agricultural Production<br/>
|
133 |
+
I � Industrial Prod/Mfg.<br/>
|
134 |
+
J � Direct Pay Permit<br/>
|
135 |
+
K � Direct Mail<br/>
|
136 |
L - Other<br/>
|
137 |
* </p>
|
138 |
* @param string $value
|
261 |
|
262 |
/**#@-*/
|
263 |
|
264 |
+
}
|
|
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/Message.class.php
CHANGED
@@ -83,6 +83,4 @@ class Message
|
|
83 |
public function setSource($value) { $this->Source = $value; return $this; }
|
84 |
public function setName($value) { $this->Name = $value; return $this; }
|
85 |
|
86 |
-
}
|
87 |
-
|
88 |
-
?>
|
83 |
public function setSource($value) { $this->Source = $value; return $this; }
|
84 |
public function setName($value) { $this->Name = $value; return $this; }
|
85 |
|
86 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/PingResult.class.php
CHANGED
@@ -71,6 +71,4 @@ class PingResult //extends BaseResult
|
|
71 |
|
72 |
|
73 |
|
74 |
-
}
|
75 |
-
|
76 |
-
?>
|
71 |
|
72 |
|
73 |
|
74 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/PostTaxRequest.class.php
CHANGED
@@ -76,9 +76,4 @@ class PostTaxRequest extends TaxRequest
|
|
76 |
*/
|
77 |
public function setNewDocCode($value) { $this->NewDocCode = $value; }
|
78 |
|
79 |
-
}
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
?>
|
76 |
*/
|
77 |
public function setNewDocCode($value) { $this->NewDocCode = $value; }
|
78 |
|
79 |
+
}
|
|
|
|
|
|
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/PostTaxResult.class.php
CHANGED
@@ -49,6 +49,4 @@ class PostTaxResult //extends BaseResult
|
|
49 |
public function getMessages() { return EnsureIsArray($this->Messages->Message); }
|
50 |
|
51 |
|
52 |
-
}
|
53 |
-
|
54 |
-
?>
|
49 |
public function getMessages() { return EnsureIsArray($this->Messages->Message); }
|
50 |
|
51 |
|
52 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/ReconcileTaxHistoryRequest.class.php
CHANGED
@@ -86,6 +86,4 @@ class ReconcileTaxHistoryRequest// extends TaxRequest
|
|
86 |
public function getPageSize(){return $this->PageSize;} // int
|
87 |
|
88 |
|
89 |
-
}
|
90 |
-
|
91 |
-
?>
|
86 |
public function getPageSize(){return $this->PageSize;} // int
|
87 |
|
88 |
|
89 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/ReconcileTaxHistoryResult.class.php
CHANGED
@@ -106,7 +106,5 @@ class ReconcileTaxHistoryResult //extends SearchTaxHistoryResult
|
|
106 |
public function getMessages() { return EnsureIsArray($this->Messages->Message); }
|
107 |
|
108 |
|
109 |
-
|
110 |
-
}
|
111 |
|
112 |
-
|
106 |
public function getMessages() { return EnsureIsArray($this->Messages->Message); }
|
107 |
|
108 |
|
|
|
|
|
109 |
|
110 |
+
}
|
app/code/community/OnePica/AvaTax/lib/classes/SearchTaxHistoryResult.class.php
CHANGED
@@ -97,6 +97,4 @@ class SearchTaxHistoryResult //extends BaseResult
|
|
97 |
|
98 |
|
99 |
|
100 |
-
}
|
101 |
-
|
102 |
-
?>
|
97 |
|
98 |
|
99 |
|
100 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/ServiceMode.class.php
CHANGED
@@ -43,5 +43,4 @@ class ServiceMode extends Enum
|
|
43 |
|
44 |
// Unfortunate boiler plate due to polymorphism issues on static functions
|
45 |
public static function Validate($value) { self::__Validate($value,self::Values(),__CLASS__); }
|
46 |
-
}
|
47 |
-
?>
|
43 |
|
44 |
// Unfortunate boiler plate due to polymorphism issues on static functions
|
45 |
public static function Validate($value) { self::__Validate($value,self::Values(),__CLASS__); }
|
46 |
+
}
|
|
app/code/community/OnePica/AvaTax/lib/classes/SeverityLevel.class.php
CHANGED
@@ -35,6 +35,4 @@ class SeverityLevel extends Enum
|
|
35 |
|
36 |
// Unfortunate boiler plate due to polymorphism issues on static functions
|
37 |
public static function Validate($value) { self::__Validate($value,self::Values(),__CLASS__); }
|
38 |
-
}
|
39 |
-
|
40 |
-
?>
|
35 |
|
36 |
// Unfortunate boiler plate due to polymorphism issues on static functions
|
37 |
public static function Validate($value) { self::__Validate($value,self::Values(),__CLASS__); }
|
38 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/TaxDetail.class.php
CHANGED
@@ -187,10 +187,4 @@ class TaxDetail
|
|
187 |
public function getTaxGroup(){ return $this->TaxGroup;}
|
188 |
|
189 |
|
190 |
-
}
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
?>
|
187 |
public function getTaxGroup(){ return $this->TaxGroup;}
|
188 |
|
189 |
|
190 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/TaxLine.class.php
CHANGED
@@ -130,5 +130,4 @@ class TaxLine
|
|
130 |
|
131 |
|
132 |
|
133 |
-
}
|
134 |
-
?>
|
130 |
|
131 |
|
132 |
|
133 |
+
}
|
|
app/code/community/OnePica/AvaTax/lib/classes/TaxOverride.class.php
CHANGED
@@ -37,6 +37,4 @@ class TaxOverride
|
|
37 |
public function getReason(){return $this->Reason;} //string
|
38 |
|
39 |
|
40 |
-
}
|
41 |
-
|
42 |
-
?>
|
37 |
public function getReason(){return $this->Reason;} //string
|
38 |
|
39 |
|
40 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/TaxOverrideType.class.php
CHANGED
@@ -11,6 +11,4 @@ class TaxOverrideType
|
|
11 |
public static $Exemption = "Exemption";
|
12 |
public static $TaxDate = "TaxDate";
|
13 |
|
14 |
-
}
|
15 |
-
|
16 |
-
?>
|
11 |
public static $Exemption = "Exemption";
|
12 |
public static $TaxDate = "TaxDate";
|
13 |
|
14 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/TaxRequest.class.php
CHANGED
@@ -158,6 +158,4 @@ class TaxRequest
|
|
158 |
|
159 |
}
|
160 |
|
161 |
-
}
|
162 |
-
|
163 |
-
?>
|
158 |
|
159 |
}
|
160 |
|
161 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/TaxServiceSoap.class.php
CHANGED
@@ -304,5 +304,3 @@ public function __construct($configurationName = 'Default')
|
|
304 |
}
|
305 |
|
306 |
}
|
307 |
-
|
308 |
-
?>
|
304 |
}
|
305 |
|
306 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/TaxType.class.php
CHANGED
@@ -32,8 +32,4 @@ class TaxType// extends Enum
|
|
32 |
|
33 |
*/
|
34 |
|
35 |
-
}
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
?>
|
32 |
|
33 |
*/
|
34 |
|
35 |
+
}
|
|
|
|
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/TextCase.class.php
CHANGED
@@ -29,6 +29,4 @@ class TextCase extends Enum
|
|
29 |
|
30 |
// Unfortunate boiler plate due to polymorphism issues on static functions
|
31 |
public static function Validate($value) { self::__Validate($value,self::Values(),__CLASS__); }
|
32 |
-
}
|
33 |
-
|
34 |
-
?>
|
29 |
|
30 |
// Unfortunate boiler plate due to polymorphism issues on static functions
|
31 |
public static function Validate($value) { self::__Validate($value,self::Values(),__CLASS__); }
|
32 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/ValidAddress.class.php
CHANGED
@@ -473,6 +473,4 @@ class ValidAddress //extends Address - or it should - SoapClient has issues mapp
|
|
473 |
|
474 |
|
475 |
|
476 |
-
}
|
477 |
-
|
478 |
-
?>
|
473 |
|
474 |
|
475 |
|
476 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/ValidateRequest.class.php
CHANGED
@@ -188,5 +188,3 @@ class ValidateRequest
|
|
188 |
|
189 |
public function getCoordinates() { return $this->Coordinates; }
|
190 |
}
|
191 |
-
|
192 |
-
?>
|
188 |
|
189 |
public function getCoordinates() { return $this->Coordinates; }
|
190 |
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/ValidateResult.class.php
CHANGED
@@ -84,6 +84,4 @@ class ValidateResult// extends BaseResult
|
|
84 |
return $this->Taxable;
|
85 |
}
|
86 |
|
87 |
-
}
|
88 |
-
|
89 |
-
?>
|
84 |
return $this->Taxable;
|
85 |
}
|
86 |
|
87 |
+
}
|
|
|
|
app/code/community/OnePica/AvaTax/lib/classes/wsdl/Address.wsdl
CHANGED
File without changes
|
app/code/community/OnePica/AvaTax/lib/classes/wsdl/BatchSvc.wsdl
CHANGED
File without changes
|
app/code/community/OnePica/AvaTax/lib/classes/wsdl/Tax.wsdl
CHANGED
File without changes
|
app/code/community/OnePica/AvaTax/lib/functions.php
CHANGED
File without changes
|
app/code/community/OnePica/AvaTax/sql/avatax_records_setup/mysql4-install-0.1.0.php
CHANGED
@@ -1,33 +1,37 @@
|
|
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 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
|
|
|
|
|
|
|
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 |
+
$installer = $this;
|
18 |
+
$installer->startSetup();
|
19 |
+
/* @var $this Mage_Core_Model_Resource_Setup */
|
20 |
+
$adapter = $this->getConnection();
|
21 |
+
try {
|
22 |
+
$adapter->addColumn(
|
23 |
+
$this->getTable('tax/tax_class'),
|
24 |
+
'op_avatax_code',
|
25 |
+
array(
|
26 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
27 |
+
'length' => 255,
|
28 |
+
'default' => '',
|
29 |
+
'nullable' => false,
|
30 |
+
'comment' => 'Used by One Pica AvaTax extension',
|
31 |
+
'after' => 'class_name'
|
32 |
+
)
|
33 |
+
);
|
34 |
+
} catch (Exception $e) {
|
35 |
+
Mage::logException($e);
|
36 |
+
}
|
37 |
+
$installer->endSetup();
|
app/code/community/OnePica/AvaTax/sql/avatax_records_setup/mysql4-upgrade-0.1.4-0.1.5.php
CHANGED
@@ -1,34 +1,81 @@
|
|
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 |
-
$
|
20 |
-
|
21 |
-
$this->
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
$installer = $this;
|
19 |
+
$this->startSetup();
|
20 |
+
/* @var $this Mage_Core_Model_Resource_Setup */
|
21 |
+
$adapter = $this->getConnection();
|
22 |
+
$table = $adapter->newTable($this->getTable('avatax_records/log'))
|
23 |
+
->addColumn('log_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
24 |
+
'identity' => true,
|
25 |
+
'nullable' => false,
|
26 |
+
'primary' => true,
|
27 |
+
'unsigned' => true
|
28 |
+
))
|
29 |
+
->addColumn('store_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
|
30 |
+
'unsigned' => true
|
31 |
+
))
|
32 |
+
->addColumn('level', Varien_Db_Ddl_Table::TYPE_VARCHAR, 50)
|
33 |
+
->addColumn('type', Varien_Db_Ddl_Table::TYPE_VARCHAR, 50)
|
34 |
+
->addColumn('request', Varien_Db_Ddl_Table::TYPE_TEXT, null)
|
35 |
+
->addColumn('result', Varien_Db_Ddl_Table::TYPE_TEXT, null)
|
36 |
+
->addColumn('additional', Varien_Db_Ddl_Table::TYPE_TEXT, null)
|
37 |
+
->addColumn('created_at', Varien_Db_Ddl_Table::TYPE_DATETIME, null)
|
38 |
+
->addForeignKey(
|
39 |
+
$this->getFkName(
|
40 |
+
$this->getTable('avatax_records/log'),
|
41 |
+
'store_id',
|
42 |
+
$this->getTable('core/store'),
|
43 |
+
'store_id'
|
44 |
+
),
|
45 |
+
'store_id',
|
46 |
+
$this->getTable('core/store'),
|
47 |
+
'store_id',
|
48 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE,
|
49 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE
|
50 |
+
)
|
51 |
+
->addIndex(
|
52 |
+
$this->getIdxName(
|
53 |
+
$this->getTable('avatax_records/log'),
|
54 |
+
array('level'),
|
55 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
56 |
+
),
|
57 |
+
array('level'),
|
58 |
+
array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX)
|
59 |
+
)
|
60 |
+
->addIndex(
|
61 |
+
$this->getIdxName(
|
62 |
+
$this->getTable('avatax_records/log'),
|
63 |
+
array('type'),
|
64 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
65 |
+
),
|
66 |
+
array('type'),
|
67 |
+
array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX)
|
68 |
+
)
|
69 |
+
->addIndex(
|
70 |
+
$this->getIdxName(
|
71 |
+
$this->getTable('avatax_records/log'),
|
72 |
+
array('created_at'),
|
73 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
74 |
+
),
|
75 |
+
array('created_at'),
|
76 |
+
array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX)
|
77 |
+
)
|
78 |
+
->setComment('Used by One Pica AvaTax extension');
|
79 |
+
|
80 |
+
$adapter->createTable($table);
|
81 |
+
$this->endSetup();
|
app/code/community/OnePica/AvaTax/sql/avatax_records_setup/mysql4-upgrade-1.0.1-2.0.0.php
CHANGED
@@ -1,37 +1,122 @@
|
|
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 |
-
|
20 |
-
|
21 |
-
$this->
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
$installer = $this;
|
18 |
+
$this->startSetup();
|
19 |
+
/* @var $this Mage_Core_Model_Resource_Setup */
|
20 |
+
$adapter = $this->getConnection();
|
21 |
+
$table = $adapter->newTable($this->getTable('avatax_records/queue'))
|
22 |
+
->addColumn('queue_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
23 |
+
'identity' => true,
|
24 |
+
'nullable' => false,
|
25 |
+
'primary' => true,
|
26 |
+
'unsigned' => true
|
27 |
+
))
|
28 |
+
->addColumn('store_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
|
29 |
+
'unsigned' => true
|
30 |
+
))
|
31 |
+
->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
|
32 |
+
'unsigned' => true
|
33 |
+
))
|
34 |
+
->addColumn('entity_increment_id', Varien_Db_Ddl_Table::TYPE_VARCHAR, 50)
|
35 |
+
->addColumn('type', Varien_Db_Ddl_Table::TYPE_VARCHAR, 50)
|
36 |
+
->addColumn('status', Varien_Db_Ddl_Table::TYPE_VARCHAR, 50)
|
37 |
+
->addColumn('attempt', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
|
38 |
+
'unsigned' => true,
|
39 |
+
'default' => 0
|
40 |
+
))
|
41 |
+
->addColumn('message', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255)
|
42 |
+
->addColumn('created_at', Varien_Db_Ddl_Table::TYPE_DATETIME, null)
|
43 |
+
->addColumn('updated_at', Varien_Db_Ddl_Table::TYPE_DATETIME, null)
|
44 |
+
->addForeignKey(
|
45 |
+
$this->getFkName(
|
46 |
+
$this->getTable('avatax_records/queue'),
|
47 |
+
'store_id',
|
48 |
+
$this->getTable('core/store'),
|
49 |
+
'store_id'
|
50 |
+
),
|
51 |
+
'store_id',
|
52 |
+
$this->getTable('core/store'),
|
53 |
+
'store_id',
|
54 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE,
|
55 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE
|
56 |
+
)
|
57 |
+
->addIndex(
|
58 |
+
$this->getIdxName(
|
59 |
+
$this->getTable('avatax_records/queue'),
|
60 |
+
array('entity_id'),
|
61 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
62 |
+
),
|
63 |
+
array('entity_id'),
|
64 |
+
array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX)
|
65 |
+
)
|
66 |
+
->addIndex(
|
67 |
+
$this->getIdxName(
|
68 |
+
$this->getTable('avatax_records/queue'),
|
69 |
+
array('entity_increment_id'),
|
70 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
71 |
+
),
|
72 |
+
array('entity_increment_id'),
|
73 |
+
array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX)
|
74 |
+
)
|
75 |
+
->addIndex(
|
76 |
+
$this->getIdxName(
|
77 |
+
$this->getTable('avatax_records/queue'),
|
78 |
+
array('type'),
|
79 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
80 |
+
),
|
81 |
+
array('type'),
|
82 |
+
array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX)
|
83 |
+
)
|
84 |
+
->addIndex(
|
85 |
+
$this->getIdxName(
|
86 |
+
$this->getTable('avatax_records/queue'),
|
87 |
+
array('status'),
|
88 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
89 |
+
),
|
90 |
+
array('status'),
|
91 |
+
array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX)
|
92 |
+
)
|
93 |
+
->addIndex(
|
94 |
+
$this->getIdxName(
|
95 |
+
$this->getTable('avatax_records/queue'),
|
96 |
+
array('attempt'),
|
97 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
98 |
+
),
|
99 |
+
array('attempt'),
|
100 |
+
array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX)
|
101 |
+
)
|
102 |
+
->addIndex(
|
103 |
+
$this->getIdxName(
|
104 |
+
$this->getTable('avatax_records/queue'),
|
105 |
+
array('created_at'),
|
106 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
107 |
+
),
|
108 |
+
array('created_at'),
|
109 |
+
array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX)
|
110 |
+
)
|
111 |
+
->addIndex(
|
112 |
+
$this->getIdxName(
|
113 |
+
$this->getTable('avatax_records/queue'),
|
114 |
+
array('updated_at'),
|
115 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
116 |
+
),
|
117 |
+
array('updated_at'),
|
118 |
+
array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX)
|
119 |
+
)
|
120 |
+
->setComment('Used by One Pica AvaTax extension');
|
121 |
+
$adapter->createTable($table);
|
122 |
+
$this->endSetup();
|
app/code/community/OnePica/AvaTax/sql/avatax_records_setup/mysql4-upgrade-2.5.0.0-2.5.0.1.php
ADDED
@@ -0,0 +1,306 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
$installer = $this;
|
18 |
+
$this->startSetup();
|
19 |
+
/* @var $this Mage_Core_Model_Resource_Setup */
|
20 |
+
$adapter = $this->getConnection();
|
21 |
+
|
22 |
+
// check if current process is install from scratch or update from 2.4.3.3-stable
|
23 |
+
$queueColumns = array_keys($adapter->describeTable($this->getTable('avatax_records/queue')));
|
24 |
+
if (!in_array('queue_id', $queueColumns)) {
|
25 |
+
$adapter
|
26 |
+
->modifyColumn(
|
27 |
+
$this->getTable('avatax_records/log'),
|
28 |
+
'log_id',
|
29 |
+
array(
|
30 |
+
'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
|
31 |
+
'identity' => true,
|
32 |
+
'nullable' => false,
|
33 |
+
'primary' => true,
|
34 |
+
'unsigned' => true
|
35 |
+
)
|
36 |
+
)
|
37 |
+
->modifyColumn(
|
38 |
+
$this->getTable('avatax_records/log'),
|
39 |
+
'store_id',
|
40 |
+
array(
|
41 |
+
'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
|
42 |
+
'unsigned' => true
|
43 |
+
)
|
44 |
+
)
|
45 |
+
->modifyColumn(
|
46 |
+
$this->getTable('avatax_records/log'),
|
47 |
+
'level',
|
48 |
+
array(
|
49 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
50 |
+
'length' => 50
|
51 |
+
)
|
52 |
+
)
|
53 |
+
->modifyColumn(
|
54 |
+
$this->getTable('avatax_records/log'),
|
55 |
+
'type',
|
56 |
+
array(
|
57 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
58 |
+
'length' => 50
|
59 |
+
)
|
60 |
+
)
|
61 |
+
->modifyColumn(
|
62 |
+
$this->getTable('avatax_records/log'),
|
63 |
+
'request',
|
64 |
+
array(
|
65 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
66 |
+
)
|
67 |
+
)
|
68 |
+
->modifyColumn(
|
69 |
+
$this->getTable('avatax_records/log'),
|
70 |
+
'result',
|
71 |
+
array(
|
72 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
73 |
+
)
|
74 |
+
)
|
75 |
+
->modifyColumn(
|
76 |
+
$this->getTable('avatax_records/log'),
|
77 |
+
'additional',
|
78 |
+
array(
|
79 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
80 |
+
)
|
81 |
+
)
|
82 |
+
->modifyColumn(
|
83 |
+
$this->getTable('avatax_records/log'),
|
84 |
+
'created_at',
|
85 |
+
array(
|
86 |
+
'type' => Varien_Db_Ddl_Table::TYPE_DATETIME,
|
87 |
+
)
|
88 |
+
);
|
89 |
+
$adapter
|
90 |
+
->addForeignKey(
|
91 |
+
$this->getFkName(
|
92 |
+
$this->getTable('avatax_records/log'),
|
93 |
+
'store_id',
|
94 |
+
$this->getTable('core/store'),
|
95 |
+
'store_id'
|
96 |
+
),
|
97 |
+
$this->getTable('avatax_records/log'),
|
98 |
+
'store_id',
|
99 |
+
$this->getTable('core/store'),
|
100 |
+
'store_id',
|
101 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE,
|
102 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE
|
103 |
+
);
|
104 |
+
$adapter->addIndex(
|
105 |
+
$this->getTable('avatax_records/log'),
|
106 |
+
$this->getIdxName(
|
107 |
+
$this->getTable('avatax_records/log'),
|
108 |
+
array('level'),
|
109 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
110 |
+
),
|
111 |
+
array('level'),
|
112 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
113 |
+
);
|
114 |
+
$adapter->addIndex(
|
115 |
+
$this->getTable('avatax_records/log'),
|
116 |
+
$this->getIdxName(
|
117 |
+
$this->getTable('avatax_records/log'),
|
118 |
+
array('type'),
|
119 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
120 |
+
),
|
121 |
+
array('type'),
|
122 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
123 |
+
);
|
124 |
+
$adapter->addIndex(
|
125 |
+
$this->getTable('avatax_records/log'),
|
126 |
+
$this->getIdxName(
|
127 |
+
$this->getTable('avatax_records/log'),
|
128 |
+
array('created_at'),
|
129 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
130 |
+
),
|
131 |
+
array('created_at'),
|
132 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
133 |
+
);
|
134 |
+
|
135 |
+
$result = $adapter->changeColumn(
|
136 |
+
$this->getTable('avatax_records/queue'),
|
137 |
+
'id',
|
138 |
+
'queue_id',
|
139 |
+
array(
|
140 |
+
'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
|
141 |
+
'identity' => true,
|
142 |
+
'nullable' => false,
|
143 |
+
'primary' => true,
|
144 |
+
'unsigned' => true
|
145 |
+
)
|
146 |
+
);
|
147 |
+
|
148 |
+
$adapter
|
149 |
+
->modifyColumn(
|
150 |
+
$this->getTable('avatax_records/queue'),
|
151 |
+
'store_id',
|
152 |
+
array(
|
153 |
+
'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
|
154 |
+
'unsigned' => true
|
155 |
+
)
|
156 |
+
)
|
157 |
+
->modifyColumn(
|
158 |
+
$this->getTable('avatax_records/queue'),
|
159 |
+
'entity_id',
|
160 |
+
array(
|
161 |
+
'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
|
162 |
+
'unsigned' => true
|
163 |
+
)
|
164 |
+
)
|
165 |
+
->modifyColumn(
|
166 |
+
$this->getTable('avatax_records/queue'),
|
167 |
+
'entity_increment_id',
|
168 |
+
array(
|
169 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
170 |
+
'length' => 50
|
171 |
+
)
|
172 |
+
)
|
173 |
+
->modifyColumn(
|
174 |
+
$this->getTable('avatax_records/queue'),
|
175 |
+
'type',
|
176 |
+
array(
|
177 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
178 |
+
'length' => 50
|
179 |
+
)
|
180 |
+
)
|
181 |
+
->modifyColumn(
|
182 |
+
$this->getTable('avatax_records/queue'),
|
183 |
+
'status',
|
184 |
+
array(
|
185 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
186 |
+
'length' => 50
|
187 |
+
)
|
188 |
+
)
|
189 |
+
->modifyColumn(
|
190 |
+
$this->getTable('avatax_records/queue'),
|
191 |
+
'attempt',
|
192 |
+
array(
|
193 |
+
'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
|
194 |
+
'unsigned' => true,
|
195 |
+
'default' => 0
|
196 |
+
)
|
197 |
+
)
|
198 |
+
->modifyColumn(
|
199 |
+
$this->getTable('avatax_records/queue'),
|
200 |
+
'message',
|
201 |
+
array(
|
202 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
203 |
+
'length' => 255
|
204 |
+
)
|
205 |
+
)
|
206 |
+
->modifyColumn(
|
207 |
+
$this->getTable('avatax_records/queue'),
|
208 |
+
'created_at',
|
209 |
+
array(
|
210 |
+
'type' => Varien_Db_Ddl_Table::TYPE_DATETIME,
|
211 |
+
)
|
212 |
+
)
|
213 |
+
->modifyColumn(
|
214 |
+
$this->getTable('avatax_records/queue'),
|
215 |
+
'updated_at',
|
216 |
+
array(
|
217 |
+
'type' => Varien_Db_Ddl_Table::TYPE_DATETIME,
|
218 |
+
)
|
219 |
+
);
|
220 |
+
$adapter->addForeignKey(
|
221 |
+
$this->getFkName(
|
222 |
+
$this->getTable('avatax_records/queue'),
|
223 |
+
'store_id',
|
224 |
+
$this->getTable('core/store'),
|
225 |
+
'store_id'
|
226 |
+
),
|
227 |
+
$this->getTable('avatax_records/queue'),
|
228 |
+
'store_id',
|
229 |
+
$this->getTable('core/store'),
|
230 |
+
'store_id',
|
231 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE,
|
232 |
+
Varien_Db_Ddl_Table::ACTION_CASCADE
|
233 |
+
);
|
234 |
+
$adapter->addIndex(
|
235 |
+
$this->getTable('avatax_records/queue'),
|
236 |
+
$this->getIdxName(
|
237 |
+
$this->getTable('avatax_records/queue'),
|
238 |
+
array('entity_id'),
|
239 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
240 |
+
),
|
241 |
+
array('entity_id'),
|
242 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
243 |
+
);
|
244 |
+
$adapter->addIndex(
|
245 |
+
$this->getTable('avatax_records/queue'),
|
246 |
+
$this->getIdxName(
|
247 |
+
$this->getTable('avatax_records/queue'),
|
248 |
+
array('entity_increment_id'),
|
249 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
250 |
+
),
|
251 |
+
array('entity_increment_id'),
|
252 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
253 |
+
);
|
254 |
+
$adapter->addIndex(
|
255 |
+
$this->getTable('avatax_records/queue'),
|
256 |
+
$this->getIdxName(
|
257 |
+
$this->getTable('avatax_records/queue'),
|
258 |
+
array('type'),
|
259 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
260 |
+
),
|
261 |
+
array('type'),
|
262 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
263 |
+
);
|
264 |
+
$adapter->addIndex(
|
265 |
+
$this->getTable('avatax_records/queue'),
|
266 |
+
$this->getIdxName(
|
267 |
+
$this->getTable('avatax_records/queue'),
|
268 |
+
array('status'),
|
269 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
270 |
+
),
|
271 |
+
array('status'),
|
272 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
273 |
+
);
|
274 |
+
$adapter->addIndex(
|
275 |
+
$this->getTable('avatax_records/queue'),
|
276 |
+
$this->getIdxName(
|
277 |
+
$this->getTable('avatax_records/queue'),
|
278 |
+
array('attempt'),
|
279 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
280 |
+
),
|
281 |
+
array('attempt'),
|
282 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
283 |
+
);
|
284 |
+
$adapter->addIndex(
|
285 |
+
$this->getTable('avatax_records/queue'),
|
286 |
+
$this->getIdxName(
|
287 |
+
$this->getTable('avatax_records/queue'),
|
288 |
+
array('created_at'),
|
289 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
290 |
+
),
|
291 |
+
array('created_at'),
|
292 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
293 |
+
);
|
294 |
+
$adapter->addIndex(
|
295 |
+
$this->getTable('avatax_records/queue'),
|
296 |
+
$this->getIdxName(
|
297 |
+
$this->getTable('avatax_records/queue'),
|
298 |
+
array('updated_at'),
|
299 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
300 |
+
),
|
301 |
+
array('updated_at'),
|
302 |
+
Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
|
303 |
+
);
|
304 |
+
}
|
305 |
+
|
306 |
+
$this->endSetup();
|
app/design/adminhtml/default/default/layout/avatax.xml
DELETED
@@ -1,14 +0,0 @@
|
|
1 |
-
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
-
<layout>
|
3 |
-
<default>
|
4 |
-
<reference name="notifications">
|
5 |
-
<block type="avatax/adminhtml_notification_toolbar" name="avatax_notifications"></block>
|
6 |
-
</reference>
|
7 |
-
</default>
|
8 |
-
|
9 |
-
<avatax_adminhtml_grid_logview>
|
10 |
-
<reference name="content">
|
11 |
-
<block type="avatax/adminhtml_export_log_view" name ="avatax_log_view" template="avatax/log/view.phtml"></block>
|
12 |
-
</reference>
|
13 |
-
</avatax_adminhtml_grid_logview>
|
14 |
-
</layout>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/layout/onepica/avatax.xml
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* OnePica_AvaTax
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0), a
|
9 |
+
* copy of which is available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category OnePica
|
13 |
+
* @package OnePica_AvaTax
|
14 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
15 |
+
* @copyright Copyright (c) 2009 One Pica, Inc.
|
16 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
+
-->
|
19 |
+
<layout>
|
20 |
+
<default>
|
21 |
+
<reference name="notifications">
|
22 |
+
<block type="avatax/adminhtml_notification_toolbar" name="avatax.notifications" template="onepica/avatax/notification/toolbar.phtml" />
|
23 |
+
</reference>
|
24 |
+
</default>
|
25 |
+
|
26 |
+
<avatax_adminhtml_grid_log>
|
27 |
+
<reference name="content">
|
28 |
+
<block type="avatax/adminhtml_export_log_grid" name="avatax.log.grid" />
|
29 |
+
</reference>
|
30 |
+
</avatax_adminhtml_grid_log>
|
31 |
+
|
32 |
+
<avatax_adminhtml_grid_queue>
|
33 |
+
<reference name="content">
|
34 |
+
<block type="avatax/adminhtml_export_queue_grid" name="avatax.queue.grid" />
|
35 |
+
</reference>
|
36 |
+
</avatax_adminhtml_grid_queue>
|
37 |
+
|
38 |
+
<avatax_adminhtml_grid_logview>
|
39 |
+
<reference name="content">
|
40 |
+
<block type="avatax/adminhtml_export_log_view" name ="avatax.log.view" template="onepica/avatax/log/view.phtml" />
|
41 |
+
</reference>
|
42 |
+
</avatax_adminhtml_grid_logview>
|
43 |
+
</layout>
|
app/design/adminhtml/default/default/template/{avatax → onepica/avatax}/log/view.phtml
RENAMED
@@ -19,34 +19,32 @@
|
|
19 |
<div class="content-header">
|
20 |
<table cellspacing="0">
|
21 |
<tr>
|
22 |
-
<td style="<?php echo $this->getHeaderWidth() ?>"><?php echo $this->getHeaderHtml() ?></td>
|
23 |
-
<td class="form-buttons"><?php echo $this->getButtonsHtml() ?></td>
|
24 |
</tr>
|
25 |
</table>
|
26 |
</div>
|
27 |
|
28 |
-
<?php
|
29 |
-
$event = $this->getCurrentEvent();
|
30 |
-
?>
|
31 |
<div class="entry-edit">
|
32 |
<div class="entry-edit">
|
33 |
<div class="entry-edit-head">
|
34 |
<h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Request'); ?></h4>
|
35 |
</div>
|
36 |
<div id="log_details_fieldset" class="log-details">
|
37 |
-
|
38 |
</div>
|
39 |
<div class="entry-edit-head">
|
40 |
<h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Response'); ?></h4>
|
41 |
</div>
|
42 |
<div id="log_details_fieldset" class="log-details">
|
43 |
-
|
44 |
</div>
|
45 |
<div class="entry-edit-head">
|
46 |
<h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Additional'); ?></h4>
|
47 |
</div>
|
48 |
<div id="log_details_fieldset" class="log-details">
|
49 |
-
|
50 |
</div>
|
51 |
</div>
|
52 |
</div>
|
19 |
<div class="content-header">
|
20 |
<table cellspacing="0">
|
21 |
<tr>
|
22 |
+
<td style="<?php echo $this->getHeaderWidth() ?>"><?php echo $this->getHeaderHtml(); ?></td>
|
23 |
+
<td class="form-buttons"><?php echo $this->getButtonsHtml(); ?></td>
|
24 |
</tr>
|
25 |
</table>
|
26 |
</div>
|
27 |
|
28 |
+
<?php $event = $this->getCurrentEvent();?>
|
|
|
|
|
29 |
<div class="entry-edit">
|
30 |
<div class="entry-edit">
|
31 |
<div class="entry-edit-head">
|
32 |
<h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Request'); ?></h4>
|
33 |
</div>
|
34 |
<div id="log_details_fieldset" class="log-details">
|
35 |
+
<textarea readonly style="width:100%; height:300px"><?php echo $this->escapeHtml($event->getRequest()); ?></textarea>
|
36 |
</div>
|
37 |
<div class="entry-edit-head">
|
38 |
<h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Response'); ?></h4>
|
39 |
</div>
|
40 |
<div id="log_details_fieldset" class="log-details">
|
41 |
+
<textarea readonly style="width:100%; height:300px"><?php echo $this->escapeHtml($event->getResult()); ?></textarea>
|
42 |
</div>
|
43 |
<div class="entry-edit-head">
|
44 |
<h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Additional'); ?></h4>
|
45 |
</div>
|
46 |
<div id="log_details_fieldset" class="log-details">
|
47 |
+
<textarea readonly style="width:100%; height:300px"><?php echo $this->escapeHtml($event->getAdditional()); ?></textarea>
|
48 |
</div>
|
49 |
</div>
|
50 |
</div>
|
app/design/adminhtml/default/default/template/onepica/avatax/notification/toolbar.phtml
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
<?php /** @var OnePica_AvaTax_Block_Adminhtml_Notification_Toolbar $this */?>
|
19 |
+
<?php if ($this->isEnabled()):?>
|
20 |
+
<?php $count = $this->getQueuePendingRetryCount();?>
|
21 |
+
<?php if ($count):?>
|
22 |
+
<div class="notification-global">
|
23 |
+
<?php if ($this->isAllowed()):?>
|
24 |
+
<span class="f-right"><?php echo $this->__('Go to the <a href="%s">AvaTax Order Sync Queue</a>', $this->getQueueGridUrl());?></span>
|
25 |
+
<?php endif;?>
|
26 |
+
<strong class="label"><?php echo $this->__('AvaTax:');?></strong>
|
27 |
+
<?php if ($count == 1):?>
|
28 |
+
<?php echo $this->__('There is <strong>%s</strong> entry in the AvaTax Order Sync Queue that has errored. Syncing is attemped %s times before permanently failing.', $count, $this->getQueueAttemptMaxValue());?>
|
29 |
+
<?php else:?>
|
30 |
+
<?php echo $this->__('There are <strong>%s</strong> entries in the AvaTax Order Sync Queue that have errored. Syncing is attemped %s times before permanently failing.', $count, $this->getQueueAttemptMaxValue());?>
|
31 |
+
<?php endif;?>
|
32 |
+
</div>
|
33 |
+
<?php endif;?>
|
34 |
+
<?php endif;?>
|
app/design/frontend/base/default/layout/avatax.xml
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
-
<layout>
|
3 |
-
<checkout_onepage_index>
|
4 |
-
<reference name="checkout.onepage.shipping_method">
|
5 |
-
<block type="avatax/checkout_onepage_shipping_method_available" name="checkout.onepage.shipping_method.availableAvatax" before="-" output="toHtml" />
|
6 |
-
</reference>
|
7 |
-
</checkout_onepage_index>
|
8 |
-
|
9 |
-
<checkout_onepage_shippingmethod>
|
10 |
-
<block type="avatax/checkout_onepage_shipping_method_available" name="checkout.onepage.shipping_method.availableAvatax" before="-" output="toHtml" />
|
11 |
-
</checkout_onepage_shippingmethod>
|
12 |
-
</layout>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/layout/onepica/avatax.xml
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* OnePica_AvaTax
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0), a
|
9 |
+
* copy of which is available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category OnePica
|
13 |
+
* @package OnePica_AvaTax
|
14 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
15 |
+
* @copyright Copyright (c) 2009 One Pica, Inc.
|
16 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
+
-->
|
19 |
+
<layout>
|
20 |
+
<checkout_onepage_index>
|
21 |
+
<reference name="checkout.onepage.shipping_method">
|
22 |
+
<block type="avatax/checkout_onepage_shipping_method_available" name="checkout.onepage.shipping_method.availableAvatax" before="-" output="toHtml" />
|
23 |
+
</reference>
|
24 |
+
</checkout_onepage_index>
|
25 |
+
|
26 |
+
<checkout_onepage_shippingmethod>
|
27 |
+
<block type="avatax/checkout_onepage_shipping_method_available" name="checkout.onepage.shipping_method.availableAvatax" before="-" output="toHtml" />
|
28 |
+
</checkout_onepage_shippingmethod>
|
29 |
+
</layout>
|
app/etc/modules/OnePica_AvaTax.xml
CHANGED
@@ -1,9 +1,26 @@
|
|
1 |
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
<config>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
</config>
|
1 |
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* OnePica_AvaTax
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0), a
|
9 |
+
* copy of which is available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category OnePica
|
13 |
+
* @package OnePica_AvaTax
|
14 |
+
* @author OnePica Codemaster <codemaster@onepica.com>
|
15 |
+
* @copyright Copyright (c) 2009 One Pica, Inc.
|
16 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
+
-->
|
19 |
<config>
|
20 |
+
<modules>
|
21 |
+
<OnePica_AvaTax>
|
22 |
+
<active>true</active>
|
23 |
+
<codePool>community</codePool>
|
24 |
+
</OnePica_AvaTax>
|
25 |
+
</modules>
|
26 |
</config>
|
app/locale/de_DE/OnePica_AvaTax.csv
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"firstname", "First Name"
|
2 |
+
"middlename", "Middle Name"
|
3 |
+
"lastname", "Last Name"
|
4 |
+
"street_full", "Full Address"
|
5 |
+
"street", "Address"
|
6 |
+
"street1", "Address"
|
7 |
+
"city", "City"
|
8 |
+
"region", "State/Province"
|
9 |
+
"country", "Country"
|
10 |
+
"postcode", "Zip/Postal Code"
|
11 |
+
"telephone", "Telephone"
|
12 |
+
"company", "Company"
|
13 |
+
"fax", "Fax"
|
app/locale/en_US/OnePica_AvaTax.csv
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"firstname", "First Name"
|
2 |
+
"middlename", "Middle Name"
|
3 |
+
"lastname", "Last Name"
|
4 |
+
"street_full", "Full Address"
|
5 |
+
"street", "Address"
|
6 |
+
"street1", "Address"
|
7 |
+
"city", "City"
|
8 |
+
"region", "State/Province"
|
9 |
+
"country", "Country"
|
10 |
+
"postcode", "Zip/Postal Code"
|
11 |
+
"telephone", "Telephone"
|
12 |
+
"company", "Company"
|
13 |
+
"fax", "Fax"
|
app/locale/es_ES/OnePica_AvaTax.csv
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"firstname", "First Name"
|
2 |
+
"middlename", "Middle Name"
|
3 |
+
"lastname", "Last Name"
|
4 |
+
"street_full", "Full Address"
|
5 |
+
"street", "Address"
|
6 |
+
"street1", "Address"
|
7 |
+
"city", "City"
|
8 |
+
"region", "State/Province"
|
9 |
+
"country", "Country"
|
10 |
+
"postcode", "Zip/Postal Code"
|
11 |
+
"telephone", "Telephone"
|
12 |
+
"company", "Company"
|
13 |
+
"fax", "Fax"
|
app/locale/fr_FR/OnePica_AvaTax.csv
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"firstname", "First Name"
|
2 |
+
"middlename", "Middle Name"
|
3 |
+
"lastname", "Last Name"
|
4 |
+
"street_full", "Full Address"
|
5 |
+
"street", "Address"
|
6 |
+
"street1", "Address"
|
7 |
+
"city", "City"
|
8 |
+
"region", "State/Province"
|
9 |
+
"country", "Country"
|
10 |
+
"postcode", "Zip/Postal Code"
|
11 |
+
"telephone", "Telephone"
|
12 |
+
"company", "Company"
|
13 |
+
"fax", "Fax"
|
app/locale/nl_NL/OnePica_AvaTax.csv
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"firstname", "First Name"
|
2 |
+
"middlename", "Middle Name"
|
3 |
+
"lastname", "Last Name"
|
4 |
+
"street_full", "Full Address"
|
5 |
+
"street", "Address"
|
6 |
+
"street1", "Address"
|
7 |
+
"city", "City"
|
8 |
+
"region", "State/Province"
|
9 |
+
"country", "Country"
|
10 |
+
"postcode", "Zip/Postal Code"
|
11 |
+
"telephone", "Telephone"
|
12 |
+
"company", "Company"
|
13 |
+
"fax", "Fax"
|
app/locale/pt_BR/OnePica_AvaTax.csv
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"firstname", "First Name"
|
2 |
+
"middlename", "Middle Name"
|
3 |
+
"lastname", "Last Name"
|
4 |
+
"street_full", "Full Address"
|
5 |
+
"street", "Address"
|
6 |
+
"street1", "Address"
|
7 |
+
"city", "City"
|
8 |
+
"region", "State/Province"
|
9 |
+
"country", "Country"
|
10 |
+
"postcode", "Zip/Postal Code"
|
11 |
+
"telephone", "Telephone"
|
12 |
+
"company", "Company"
|
13 |
+
"fax", "Fax"
|
app/locale/zh_CN/OnePica_AvaTax.csv
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"firstname", "First Name"
|
2 |
+
"middlename", "Middle Name"
|
3 |
+
"lastname", "Last Name"
|
4 |
+
"street_full", "Full Address"
|
5 |
+
"street", "Address"
|
6 |
+
"street1", "Address"
|
7 |
+
"city", "City"
|
8 |
+
"region", "State/Province"
|
9 |
+
"country", "Country"
|
10 |
+
"postcode", "Zip/Postal Code"
|
11 |
+
"telephone", "Telephone"
|
12 |
+
"company", "Company"
|
13 |
+
"fax", "Fax"
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>OnePica_AvaTax</name>
|
4 |
-
<version>2.
|
5 |
<stability>stable</stability>
|
6 |
<license>Open Software License (OSL 3.0)</license>
|
7 |
<channel>community</channel>
|
@@ -18,20 +18,27 @@ Released as a commercial extension, this software will not work unless you have
|
|
18 |

|
19 |

|
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>
|
22 |

|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |

|
25 |
-
Fixed checkout for invalid addresses.
|
26 |

|
27 |
-
Fixed destination address (missing street lines).
|
28 |

|
29 |
-
Added avoiding shipping address validation logic for virtual orders.
|
30 |
</notes>
|
31 |
-
<authors><author><name>
|
32 |
-
<date>
|
33 |
-
<time>
|
34 |
-
<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="b5db0baa25adca61990553cdfae054f8"/></dir><dir name="Log"><file name="Grid.php" hash="3d36d791700f8a747bb492732ff86077"/><file name="View.php" hash="99f17c532b545e34fb6ca207c2beeb37"/></dir><dir name="Queue"><file name="Grid.php" hash="52efc8e013002639cc2f0f88010c91ec"/></dir></dir><dir name="Notification"><file name="Toolbar.php" hash="a0cb132e6fb73412879a5b0b7f85871c"/></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Export.php" hash="a834887971b517d7141cb2c8868d68b1"/></dir></dir></dir></dir><dir name="Tax"><dir name="Class"><dir name="Edit"><file name="Form.php" hash="a34316cf45867eb83de49243f0fdf4c6"/></dir><file name="Grid.php" hash="a7222bf20619ea8104e4d3d0066f27fd"/></dir></dir></dir><dir name="Checkout"><dir name="Onepage"><dir name="Shipping"><dir name="Method"><file name="Available.php" hash="32d846b8b509e62206ab5de2ff3680dd"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="c210d52ae758be31baf225f9926029bc"/><dir name="Tax"><file name="Data.php" hash="81edee6048e5e9487f5c0a3e985d1b15"/></dir></dir><dir name="Model"><file name="Abstract.php" hash="96dcb00145bbc1a28859bd5c0f2c380d"/><dir name="Admin"><file name="Session.php" hash="e19ebf06208e3d2edef45683401fe7a8"/></dir><dir name="Adminhtml"><file name="Config.php" hash="518933b279d0bbf7f13651a9b33e2edb"/><dir name="Sales"><dir name="Order"><file name="Create.php" hash="f2202ae68958e359d294a221c95ffde9"/></dir></dir></dir><dir name="Avatax"><file name="Abstract.php" hash="4a3cc074e955055d9ae1ba7e32dac400"/><file name="Address.php" hash="21dadef76f7df29d65da454dfdc262e7"/><file name="Estimate.php" hash="331ee6dd5ec37954ec54aa9f64606d85"/><dir name="Exception"><file name="Address.php" hash="9052a48d9c3b46811c3db4090dc610d4"/><file name="Commitfailure.php" hash="23559a21d37fd14904f088e8c2357992"/><file name="Unbalanced.php" hash="3ee206bb1cfb87cceae006a2c1b6b5e7"/></dir><file name="Invoice.php" hash="08764c536526d8c54e09c9d2a831fae4"/><file name="Ping.php" hash="61fc25b14e144ffbae8629e497cd5305"/></dir><file name="Config.php" hash="7f202ecb12a601971369714f1281d5ba"/><file name="Observer.php" hash="4fa7733a4ca40a99f5d837f2653d24df"/><dir name="Records"><file name="Log.php" hash="14d58227e9c6b96b46b6a00cd7952586"/><dir name="Mysql4"><dir name="Log"><file name="Collection.php" hash="14344f43b12f84d745f522589b83e271"/></dir><file name="Log.php" hash="dd367bc03d936fab12d93b5a950ec102"/><dir name="Queue"><file name="Collection.php" hash="faac004ece9a1e413f870dedfc925e38"/></dir><file name="Queue.php" hash="fc68b22eec10cc208ae8d4f8b33c2a46"/></dir><dir name="Queue"><file name="Process.php" hash="8e650e32f1208867441d041716adc098"/></dir><file name="Queue.php" hash="4bd9ba90dbb6a81f9f01acb8ed8e3082"/><file name=".DS_Store" hash="48d5c220a3fad09c37de12b9e5e448f8"/></dir><dir name="Sales"><dir name="Quote"><dir name="Address"><dir name="Total"><file name="Grand.php" hash="ce472ac13ac610db29175afc735c5701"/><file name="Tax.php" hash="065a94e81758d52f8ebfd816f71e4756"/></dir></dir><file name="Address.php" hash="94c10d2fb4e2830ad6faee3c878122bc"/></dir></dir><file name="Session.php" hash="72849341ba81db155cc8d998b7dfef69"/><dir name="Source"><file name="Actions.php" hash="55cde933437761b778ebea15075568ab"/><file name="Addressvalidation.php" hash="50910e35a4413b03e2089b2b7877e98e"/><file name="Customercodeformat.php" hash="1478c6fcba951ae497e7621d6cf808e0"/><file name="Error.php" hash="467b37421490cfe5eba060fc5e1af240"/><file name="Fieldlist.php" hash="78e6a255435b2e48ebe912424108c606"/><file name="Logmode.php" hash="63ab9699d71f2a6031a37d249c816b10"/><file name="Logtype.php" hash="cd46d9baf9ef70d24e1240a891a6b7be"/><file name="Onerrorfrontend.php" hash="9ecd5015d95925adfe1626634d91820e"/><dir name="Regionfilter"><file name="List.php" hash="3b86c8f2a69aeeb9eb0c1988393f10ac"/><file name="Mode.php" hash="1a1bc328674db870d0cf4ef69a05de17"/></dir></dir><file name=".DS_Store" hash="65255944ee79d37cac5700e36e70eaf0"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ExportController.php" hash="3d770db9c1dbc8199c305e69387b679f"/><file name="GridController.php" hash="d40ba09889406dffd747788e1c244dee"/></dir><file name="CartController.php" hash="1dd07701a719717381b52da7b0e235e2"/><file name="OnepageController.php" hash="491c3547e25aca5632356e678109f105"/><file name=".DS_Store" hash="8b6cbc252371183dd3ee7f9c2a75b282"/></dir><dir name="etc"><file name="adminhtml.xml" hash="65419d8a1aed1cdb2e3bd1af076af732"/><file name="config.xml" hash="546770423cab2123490fb5a9328bcf30"/><file name="system-disabled.xml" hash="851329d6173bca6f2a2f074880c8289a"/><file name="system.xml" hash="b25373b964002d8be9bd9cd671e55ba2"/></dir><dir name="lib"><file name="AvaTax.php" hash="d9d2ac44a3a7a4d5ca34752df3d70afb"/><dir name="classes"><file name="ATConfig.class.php" hash="9ccc6722b520cf4068235ecea5d9cade"/><file name="ATObject.class.php" hash="b9b910adcb86703cff3a59f38665a003"/><file name="AVObject.class.php" hash="b65c5532b01074a57a20703513148301"/><file name="Address.class.php" hash="06f5487c223132005a65d633930f5b72"/><file name="AddressServiceSoap.class.php" hash="776cbf348c32a7dc20cc47f90b2cc806"/><file name="AddressType.class.php" hash="1458d719ab0c4d1ff93244527b8c75cf"/><file name="AdjustTaxRequest.class.php" hash="a67ce5082335bcd553ac7ead85a7a36c"/><file name="AdjustTaxResult.class.php" hash="0fb71e82a0aa38ff792fb45d3b19c664"/><file name="ApplyPaymentRequest.class.php" hash="65fab85ca47b7c9ad84e861d6e2e9a01"/><file name="ApplyPaymentResult.class.php" hash="ddf7a332575f7c972f11f95430179b01"/><file name="AvalaraSoapClient.class.php" hash="e3561a81c82ac293767271195c8cf2e5"/><file name="BaseResult.class.php" hash="8dc91ad90e7b9fb12dbea3d5e3279892"/><dir name="BatchSvc"><file name="AuditMessage.class.php" hash="b2cf0248904656cd10b3d28f3cfa25a1"/><file name="AvaTaxBatchSvc.php" hash="2c6ecf16cec6926ca0438772c08e4f70"/><file name="BaseResult.class.php" hash="911a199f0fd54e00ccab6fad53f89ba3"/><file name="Batch.class.php" hash="ded2b8509c4223732b91608fffea43a5"/><file name="BatchDelete.class.php" hash="27b5510c8199a6e348e7c983a1b68778"/><file name="BatchDeleteResponse.class.php" hash="a181bdf63032b6f292f32a3c2d8dc008"/><file name="BatchFetch.class.php" hash="efeee6d7bcc181c1a4d4a5d165169ca8"/><file name="BatchFetchResponse.class.php" hash="e5c8f28218e1240cf360a61456baeeb5"/><file name="BatchFetchResult.class.php" hash="10549cd50bc803814381bea5e62d951e"/><file name="BatchFile.class.php" hash="0ef50e2a8147f2f57d3072128f6561ee"/><file name="BatchFileDelete.class.php" hash="b937b21facf90fb1db1f1ee70a0fefdd"/><file name="BatchFileDeleteResponse.class.php" hash="8753ed5b4aa5ed2b8f790b5d529698d2"/><file name="BatchFileFetch.class.php" hash="3a374c13d668707e004d779ee6377880"/><file name="BatchFileFetchResponse.class.php" hash="09fe9b8cc3a426b3ab13b4eb9a462914"/><file name="BatchFileFetchResult.class.php" hash="49e84f4dd96483229649539e4bcea9bd"/><file name="BatchFileSave.class.php" hash="72589688feea7a1d6afd1c27794b2585"/><file name="BatchFileSaveResponse.class.php" hash="1850184ea711a501f61ad3cbd7284069"/><file name="BatchFileSaveResult.class.php" hash="1266eefddc041b850b58616935300187"/><file name="BatchProcess.class.php" hash="60912e77dd6e6a0f6629b2e86ce0df09"/><file name="BatchProcessRequest.class.php" hash="a01a7987cc0dc962ee1499f0ab92f346"/><file name="BatchProcessResponse.class.php" hash="db13565dc7b3b1544ef5ada36c32a568"/><file name="BatchProcessResult.class.php" hash="7a4d631658c89539ea07a0236b17cf13"/><file name="BatchSave.class.php" hash="616295413418b16410cd008e3f20b28b"/><file name="BatchSaveResponse.class.php" hash="2cb0ada61c6501877c08da49bbb4a946"/><file name="BatchSaveResult.class.php" hash="bced01bdbfbdd476bca9c9d0176bd785"/><file name="BatchSvc.class.php" hash="a42b48303d7ffa8074821d738ec5b37e"/><file name="DeleteRequest.class.php" hash="259dd71651fbc6307e3ba39ba37b0982"/><file name="DeleteResult.class.php" hash="8c39215b0e317f7834a147869ca7fb17"/><file name="FetchRequest.class.php" hash="3b2cea507374b08bd6b6ea23c9487494"/><file name="FilterRequest.class.php" hash="14d910ba0d03a2179263a03404a85194"/><file name="FilterResult.class.php" hash="0608a53670e6e156628451303d11ace3"/><file name="IsAuthorized.class.php" hash="589c1aff4109cc480312675f2e04aa0e"/><file name="IsAuthorizedResponse.class.php" hash="64db8c37e7946c2902ea9e46ae86cb78"/><file name="IsAuthorizedResult.class.php" hash="5b177cc88d91c63ee998fe5712b44bcc"/><file name="Message.class.php" hash="034c2276b6de0eb234f63d9cb5c1dae0"/><file name="Ping.class.php" hash="119c38ad0e7cd85eb1b550d51a6e2425"/><file name="PingResponse.class.php" hash="f92a631e8c09cfa884acd6b820232e83"/><file name="PingResult.class.php" hash="f818d99e05c0d3c014dbf3e5986ec599"/><file name="Profile.class.php" hash="7fda4e5d8db696d854cd7d1cec25f799"/><file name="SeverityLevel.class.php" hash="043ecef6038f2e95fe282f4c979af425"/></dir><file name="BoundaryLevel.class.php" hash="9a27f3e00bbe8dde729e7e54fb323d62"/><file name="CancelCode.class.php" hash="ef3f56a04d1aade150cb08c3a9134c9b"/><file name="CancelTaxRequest.class.php" hash="19d5af5d81c6e125766c927e76971e4e"/><file name="CancelTaxResult.class.php" hash="07228ddee4ab305bc9b1512b996105f7"/><file name="CommitTaxRequest.class.php" hash="b066a6d15874be72549053f66826c9e1"/><file name="CommitTaxResult.class.php" hash="30372831394d6bdeb705b93af413b71f"/><file name="DetailLevel.class.php" hash="82c39ae81735c84cf42e45f08d2a09a9"/><file name="DocStatus.class.php" hash="bbdb6cc343319bb996f5780d90d3a5a0"/><file name="DocumentType.class.php" hash="d27a4700fefed81cb9f8c701c3939982"/><file name="DynamicSoapClient.class.php" hash="0ab14d845214d6a4c4d1dbe32666bf2f"/><file name="Enum.class.php" hash="0d16eadf4c991e7f52ef41de5cbc92e7"/><file name="GetTaxHistoryRequest.class.php" hash="b598dcee1bcaa13e4c123e558bc5d545"/><file name="GetTaxHistoryResult.class.php" hash="4c85747ef17f770ae4ec94d9e27f681f"/><file name="GetTaxRequest.class.php" hash="9da97ed2bfaa71ae47900ee2c5e2aee2"/><file name="GetTaxResult.class.php" hash="e2cf17e68126a6b0e4f5440a072dc581"/><file name="IsAuthorizedResult.class.php" hash="c570782cd50745810995c787048c8864"/><file name="JurisdictionType.class.php" hash="68b8022228fbc22d60fd74914f2a2749"/><file name="Line.class.php" hash="9afc25c9ce2581b929173d92af8b801d"/><file name="Message.class.php" hash="06a099c0f099e4e6a10c3be887b07b30"/><file name="PingResult.class.php" hash="22d83358dd7c4f8ffe3e720da3c1b565"/><file name="PostTaxRequest.class.php" hash="3301991ededc9fbad1dd45c6aa80dc51"/><file name="PostTaxResult.class.php" hash="36f02467db90d6beb33681e4f1c0a26e"/><file name="ReconcileTaxHistoryRequest.class.php" hash="ce0164310a18a7d464217ce69d7b4fc2"/><file name="ReconcileTaxHistoryResult.class.php" hash="baab8d603255b246731bcb7bca149596"/><file name="SearchTaxHistoryResult.class.php" hash="6a86da07d80fff3518a2be6e74694662"/><file name="ServiceMode.class.php" hash="9a4e633e225d4cdc62b28a041ca4d739"/><file name="SeverityLevel.class.php" hash="72d3fe39e2ced741aa8917b8e8be7c6f"/><file name="TaxDetail.class.php" hash="b6be13edfa217119a5c82c3a291ba340"/><file name="TaxLine.class.php" hash="be67b350e74efc326d1d6dcf5a21978c"/><file name="TaxOverride.class.php" hash="b0f99ad5bfe71e06bfcb60312032fdb3"/><file name="TaxOverrideType.class.php" hash="f5d2434c2a369605f82d2a182ddbea74"/><file name="TaxRequest.class.php" hash="7a6a1dbf317aedb18b225efa7c90da88"/><file name="TaxServiceSoap.class.php" hash="9deec191eb6a90239eaed2537d06ffe1"/><file name="TaxType.class.php" hash="a8a6fe2ed98440606f50190e3f5aa914"/><file name="TextCase.class.php" hash="dd265892e4733ef7f2e6d5cd53daa087"/><file name="ValidAddress.class.php" hash="9aef14ddcda74827f288bce6cf5e18e0"/><file name="ValidateRequest.class.php" hash="df76ee0d0acef422e1640796f627bd4f"/><file name="ValidateResult.class.php" hash="cd7fff7ffa3fbc9d04d3fe15b9d877e9"/><dir name="wsdl"><file name="Address.wsdl" hash="2ca743760c961db0ae03e4c6900667cb"/><file name="BatchSvc.wsdl" hash="eae666b959c1889d586919da4ebccefd"/><file name="Tax.wsdl" hash="da6b3da89c3e4f3f7db6d0ed9d4d33de"/></dir></dir><file name="functions.php" hash="b94adf9f4887ff8f023fdaff5c64d974"/></dir><dir name="sql"><dir name="avatax_records_setup"><file name="mysql4-install-0.1.0.php" hash="cae21cd6e672cb07b606b5ab58fc5fd7"/><file name="mysql4-upgrade-0.1.4-0.1.5.php" hash="3bde3555bafe3f4dbb6b620b75abfa02"/><file name="mysql4-upgrade-1.0.1-2.0.0.php" hash="1b6d23e38621253e76c12a48e5494c64"/><file name="mysql4-upgrade-2.2.0-2.2.1.php" hash="82c4fc41cf9a235072c585028c23fecd"/></dir></dir><file name=".DS_Store" hash="47cfb3e4aa7a816c6eb4f04a99079f50"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="OnePica_AvaTax.xml" hash="9a548b57f519da49acf5fe116d2aeabe"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="avatax.xml" hash="e9ba43333bdc89b3de01845797d74c52"/></dir><dir name="template"><dir name="avatax"><dir name="log"><file name="view.phtml" hash="285bcc5ffb36140d010970e030b141ab"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="avatax.xml" hash="b47bd34f2df8092cdcbc973be8356777"/></dir></dir></dir></dir></target></contents>
|
35 |
<compatible/>
|
36 |
-
<dependencies><required><php><min>5.2.3</min><max>6.0.0</max></php><extension><name>curl</name><min
|
37 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>OnePica_AvaTax</name>
|
4 |
+
<version>2.5.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>Open Software License (OSL 3.0)</license>
|
7 |
<channel>community</channel>
|
18 |

|
19 |

|
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
|
22 |

|
23 |
+
Improved logging
|
24 |
+

|
25 |
+
Fixed tax calculation for configurable products
|
26 |
+

|
27 |
+
Fixed tax calculation when coupon is applied
|
28 |
+

|
29 |
+
Fixed tax calculation with gift wrapping
|
30 |
+

|
31 |
+
Fixed filter tax calculation option
|
32 |
+

|
33 |
+
Fixed queue clean up process
|
34 |

|
|
|
35 |

|
|
|
36 |

|
|
|
37 |
</notes>
|
38 |
+
<authors><author><name>Rostyslav Redko</name><user>marketing</user><email>avalara@onepica.com</email></author></authors>
|
39 |
+
<date>2015-07-09</date>
|
40 |
+
<time>16:26:17</time>
|
41 |
+
<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="85f9e21148f0bcb16d2bba85379b620c"/></dir><dir name="Log"><file name="Grid.php" hash="9fc68393de0fc3ebdbcd943e39a59a9d"/><file name="View.php" hash="b04fc9f60d4acbb07051f7391b878a92"/></dir><dir name="Queue"><file name="Grid.php" hash="5f32911ee544353d05b093a20c6fac4c"/></dir></dir><dir name="Notification"><file name="Toolbar.php" hash="ce0f6022846b565184147dc50d1792b8"/></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Export.php" hash="9a34cc10bf2e179725517be980d8ef17"/></dir></dir></dir></dir><dir name="Tax"><dir name="Class"><dir name="Edit"><file name="Form.php" hash="80d7048a100539d0957cc2d1e433d3fa"/></dir><file name="Grid.php" hash="130503c2d1b2e2efe84c0a658aa0f7a8"/></dir></dir></dir><dir name="Checkout"><dir name="Onepage"><dir name="Shipping"><dir name="Method"><file name="Available.php" hash="c8ad904b71f344cfd1e01ceea7556dd1"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="3e629ac46ddeefeac5370bcdd6af2476"/><dir name="Tax"><file name="Data.php" hash="2d267503f130a97db1786ea403564016"/></dir></dir><dir name="Model"><file name="Abstract.php" hash="dffa336069582428f490b85567dddb69"/><dir name="Admin"><file name="Session.php" hash="90dd2d8b332f813515889a454ee3c80b"/></dir><dir name="Adminhtml"><file name="Config.php" hash="b0232a66e3deb89a51c870ec9cc815ee"/><dir name="Sales"><dir name="Order"><file name="Create.php" hash="a83d3ac1d0dec5cd70d473dbfba7fc85"/></dir></dir></dir><dir name="Avatax"><file name="Abstract.php" hash="ad54fec335b71a6acc3887a68b347dc7"/><file name="Address.php" hash="365f7ac72aea4296cc5bfdee867a0f08"/><file name="Estimate.php" hash="76da48316e897fe0bdafa5dcc6c00237"/><dir name="Exception"><file name="Address.php" hash="689d9b351489c9101477b8f068bc48cd"/><file name="Commitfailure.php" hash="68e9c96eefed652e54a807bca1019f54"/><file name="Unbalanced.php" hash="778eb77593cb4787d6a00a5da0559ddc"/></dir><file name="Invoice.php" hash="0133aa19a1f4a4aea9d81a7f68d5d9bf"/><file name="Ping.php" hash="57b77948291fda5c6fe15733fd96a3c0"/></dir><file name="Config.php" hash="b4c80dbcd4d476f42f36d2a5dd666c15"/><file name="Exception.php" hash="78b46e431b3d8e1d31a3544c9a037e30"/><dir name="Export"><dir name="Adapter"><file name="Abstract.php" hash="840c8b87acd97646572bba9bb3b8f5ea"/><file name="Sql.php" hash="d4e76c823e5dd575279274debff69e4f"/></dir><dir name="Entity"><file name="Abstract.php" hash="a6e649456073395dc6f0d382e9abded8"/><file name="Log.php" hash="a1dd28eee3e72d1a4ef7bddd865ddbae"/><file name="Queue.php" hash="14a97c283aa74f97982ab71160017aa3"/></dir></dir><file name="Export.php" hash="479265899b15f58c1659c61f31c7470a"/><file name="Observer.php" hash="90932cf4977b4fed97e86746d8850ba7"/><dir name="Records"><file name="Log.php" hash="a15c22cf219e7750a37cde75ba3f22a9"/><dir name="Mysql4"><dir name="Log"><file name="Collection.php" hash="29db8163f4dda862ff822ddffd04554d"/></dir><file name="Log.php" hash="f9c213eef54837c95ebef0bb9403d610"/><dir name="Queue"><file name="Collection.php" hash="11bba1561c81f39695f091b94bd81560"/></dir><file name="Queue.php" hash="735132bae49948300cac00658a68cf74"/></dir><dir name="Queue"><file name="Process.php" hash="dda2ef9fa0571db1cb16292b7b93db54"/></dir><file name="Queue.php" hash="17e369325bcac42042676bb61a2248c5"/></dir><dir name="Sales"><dir name="Quote"><dir name="Address"><dir name="Total"><file name="Grand.php" hash="63fb5a808ad3c16d2ed15f1dafad7937"/><file name="Tax.php" hash="e309b0c41e91e714268c02a79d5e8e5f"/></dir></dir><file name="Address.php" hash="3191bbdf4e2227d35cf588dde798731b"/></dir></dir><file name="Session.php" hash="6a858f6395d248178c28160a29530bf1"/><dir name="Source"><file name="Actions.php" hash="879b80f92f735402f57e316546b16984"/><file name="Addressvalidation.php" hash="9f2315018910f7336ad894156d49d9b9"/><file name="Customercodeformat.php" hash="cfcfcbaa27ed29add072324816da0c9d"/><file name="Error.php" hash="7f5495a2f295ded2d0a30f2f7108d009"/><file name="Fieldlist.php" hash="b25835b23df6045777be1c891bd3dd05"/><file name="Logmode.php" hash="24d61da578a3b4adb896fea7d4d4d8ec"/><file name="Logtype.php" hash="4079ebbf7ef44593e631b8cc9f0fc2a5"/><file name="Onerrorfrontend.php" hash="ef4154ae563d8157c1083f20e0adf563"/><dir name="Regionfilter"><file name="List.php" hash="169d0a776823439984fbdf27e631f62e"/><file name="Mode.php" hash="27fdc94c6f162100d55005285b5170df"/></dir></dir><dir name="Tax"><file name="Config.php" hash="6168c0d674a44291b7dbfe358305a04b"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="ExportController.php" hash="306f2f688aaa85e4dbf2bda94bc7d353"/><file name="GridController.php" hash="91f38761378ff91d1f9c396b1cb3c150"/></dir></dir><dir name="data"><dir name="avatax_records_setup"><file name="data-upgrade-2.2.0-2.2.1.php" hash="260d1c57754ebadba00d8ccdbb0ec996"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="92c529d045fa34fd0822b6ccb40bd4ed"/><file name="config.xml" hash="cf523de8daa4d2e4c289f3cafa30826b"/><file name="system-disabled.xml" hash="937460e7271eb45d25f424d7da2baa72"/><file name="system.xml" hash="a1aa4cb07bce94406110cc9c1628460e"/></dir><dir name="lib"><file name="AvaTax.php" hash="ee495f13f7b31af8837839f8fd571102"/><dir name="classes"><file name="ATConfig.class.php" hash="88559205ad296264e9d363e95b7a3e98"/><file name="ATObject.class.php" hash="5447af3f2e2fec7bbf66589539b09e9f"/><file name="AVObject.class.php" hash="b65c5532b01074a57a20703513148301"/><file name="Address.class.php" hash="4f027c9ddbe7449397f1fe6218738ddd"/><file name="AddressServiceSoap.class.php" hash="d61560d0b4f03b6ca2823d2250c9a55e"/><file name="AddressType.class.php" hash="f778cdd8c767edd49e69815e8bd74643"/><file name="AdjustTaxRequest.class.php" hash="868b9eaed8f91ffec23ea2a688d04775"/><file name="AdjustTaxResult.class.php" hash="af37112818b9542e75bded41243a55c8"/><file name="ApplyPaymentRequest.class.php" hash="3b3877a6dc9504b090b6f4feede52b9f"/><file name="ApplyPaymentResult.class.php" hash="a38a544cff1698c59e0da9cd059b8c79"/><file name="AvalaraSoapClient.class.php" hash="1b3209110dbdc4293fbdbc6490ba7fc2"/><file name="BaseResult.class.php" hash="8b85d243d1ad85b6336de60aea38e529"/><dir name="BatchSvc"><file name="AuditMessage.class.php" hash="f3366c62f07ae94366744a18f573a2f1"/><file name="AvaTaxBatchSvc.php" hash="d6d59c824afb9357289e28f5b9ad051e"/><file name="BaseResult.class.php" hash="3d4fb18a13cb2521bdcebbb4828499a5"/><file name="Batch.class.php" hash="345e1566373ff0114fab9faba63b3bb9"/><file name="BatchDelete.class.php" hash="f6c87e688ea9a74b271af1416a5c2d3e"/><file name="BatchDeleteResponse.class.php" hash="281a7f9f48212f37f4a8dd59a8cbef05"/><file name="BatchFetch.class.php" hash="f1bd03669588ce597fb8c9e2ddf1a0c3"/><file name="BatchFetchResponse.class.php" hash="3c348fe3bd7447d1de2b3a7079ef1cb2"/><file name="BatchFetchResult.class.php" hash="8834954a075a890f5408c0fa3f68f359"/><file name="BatchFile.class.php" hash="6c2832889ecfd643bbddd8da92806d17"/><file name="BatchFileDelete.class.php" hash="d026a2536b7062ae435450b53fe81472"/><file name="BatchFileDeleteResponse.class.php" hash="87aa29c139e0f2370d3f32834a3b93d0"/><file name="BatchFileFetch.class.php" hash="8c71726d14294fb18663ba310b76e874"/><file name="BatchFileFetchResponse.class.php" hash="40c3e51f350dd6ce0a84f37e44d0d00c"/><file name="BatchFileFetchResult.class.php" hash="bcf86f8303b40b3304dc8cbf11f9a386"/><file name="BatchFileSave.class.php" hash="e06ef0079955ea1bb79c1e6385761efd"/><file name="BatchFileSaveResponse.class.php" hash="843501f0a13d018d1c48b55750f6e61f"/><file name="BatchFileSaveResult.class.php" hash="620e54c1f0c5d9a461dd9bb7a2de67ce"/><file name="BatchProcess.class.php" hash="5812c04ab18e5c65f598f9fcdfdc428a"/><file name="BatchProcessRequest.class.php" hash="c0b6c76103141b5d07bb62a37a2a7412"/><file name="BatchProcessResponse.class.php" hash="74b46fdcfd39561fed0ba85476d0aafd"/><file name="BatchProcessResult.class.php" hash="274cabe36df7e72f581fa243a2fb8b31"/><file name="BatchSave.class.php" hash="6af9af77f6d3545db34446b1cb25fffd"/><file name="BatchSaveResponse.class.php" hash="98f349e087b1caf602f5f6079a71a146"/><file name="BatchSaveResult.class.php" hash="96b2cfa552d832b75d8561312809216b"/><file name="BatchSvc.class.php" hash="8095b3bba337fe5f83ce6e2ad9ca8623"/><file name="DeleteRequest.class.php" hash="b3f449312c8c302ad919c37282a65857"/><file name="DeleteResult.class.php" hash="6101765b716fb1f3d22d95e5cff59c59"/><file name="FetchRequest.class.php" hash="51f934530a594ecc5b6602e95a90e911"/><file name="FilterRequest.class.php" hash="14fffca5fd500759a41a5072a6731d12"/><file name="FilterResult.class.php" hash="2a2a01693393144a2b9084fc036e7b2c"/><file name="IsAuthorized.class.php" hash="daf2e4fadadfcfc7c1daa5f4083ca4fa"/><file name="IsAuthorizedResponse.class.php" hash="e42a678c7b7f9a31129f87b5aeb1b694"/><file name="IsAuthorizedResult.class.php" hash="55e13f429b08d78b2be811206d4d96a9"/><file name="Message.class.php" hash="21cc40706c1b1bf550f8c84f855960d0"/><file name="Ping.class.php" hash="92358ab5f79862ff0c5e789f64cab8a0"/><file name="PingResponse.class.php" hash="ab87b30bb8204facce97bcf71b589300"/><file name="PingResult.class.php" hash="e22e864065ae905db9c8ef23b69929e7"/><file name="Profile.class.php" hash="655af918d59e879670825e89e43a1fcf"/><file name="SeverityLevel.class.php" hash="2ad4f7c3a19eff71b3459bd261182e50"/></dir><file name="BoundaryLevel.class.php" hash="602a600d04db4d74c7836ee51fafe452"/><file name="CancelCode.class.php" hash="a790b5976535a954f8d6b54e11e305df"/><file name="CancelTaxRequest.class.php" hash="27e2f1313b553ada9af5c6e2c36bbd1d"/><file name="CancelTaxResult.class.php" hash="134c8bc90db0f46a864008c15edf7206"/><file name="CommitTaxRequest.class.php" hash="0ae85335dd2e771760f5cedfeca86f34"/><file name="CommitTaxResult.class.php" hash="f9903f0b8db5a1132e409194147571aa"/><file name="DetailLevel.class.php" hash="b8bbfebb185894572a99a9acd5e53f5d"/><file name="DocStatus.class.php" hash="325c369f1db10b2039d85825a997494f"/><file name="DocumentType.class.php" hash="6ced7e430cf0019d71a83f200de6d086"/><file name="DynamicSoapClient.class.php" hash="3dd165e8cc700b2482a6b5a30568ba7e"/><file name="Enum.class.php" hash="9a131750a6c0bfcef90402721050b27d"/><file name="GetTaxHistoryRequest.class.php" hash="969209d7fc39ed4399d7a0b1fcdd1b60"/><file name="GetTaxHistoryResult.class.php" hash="83b741ace8abca31c0ab6d5c4b8b5c88"/><file name="GetTaxRequest.class.php" hash="2e4a37cb06433880803c679ff0126710"/><file name="GetTaxResult.class.php" hash="d75f0d5fe5b5d351bf92073396c2f951"/><file name="IsAuthorizedResult.class.php" hash="4eb11ff3bdf628cc4e2fc80e35d65de6"/><file name="JurisdictionType.class.php" hash="602d25befdd973b8843bad8202ecfeb7"/><file name="Line.class.php" hash="eacfe73ed6c64325036f9f82c8bca939"/><file name="Message.class.php" hash="07e308557bd2eb7552c15f91e3c85402"/><file name="PingResult.class.php" hash="e3df2dfde0f47ce50c7d95ed61b091da"/><file name="PostTaxRequest.class.php" hash="53acee39c416530b84608660d70ad013"/><file name="PostTaxResult.class.php" hash="a5c918b585ba19331ddfc731d950d9c5"/><file name="ReconcileTaxHistoryRequest.class.php" hash="c5a1d1f0bafa784f33ead69d8adb2bdf"/><file name="ReconcileTaxHistoryResult.class.php" hash="123c536c7f0706139d8f2733d387b4c2"/><file name="SearchTaxHistoryResult.class.php" hash="06175321ad401f59ad2cacd5235c29f2"/><file name="ServiceMode.class.php" hash="f42500790eb598cf28ed0e5a4151ff9c"/><file name="SeverityLevel.class.php" hash="e986ede05ca42f3bb8f1cc41614d9dfc"/><file name="TaxDetail.class.php" hash="c44906a9fd7f2b66050c07b68c9d30b4"/><file name="TaxLine.class.php" hash="481c08a933c0a4530712d405e2ea73b3"/><file name="TaxOverride.class.php" hash="911f2dd4fd707e13e1ce04026cd84b1e"/><file name="TaxOverrideType.class.php" hash="b9b1739cfac7b5523a307a19a705bbb4"/><file name="TaxRequest.class.php" hash="03ba7cc4f0ffa6b4c2fb8eef80b31219"/><file name="TaxServiceSoap.class.php" hash="5f9b9f18e43807cf54f5b0ec915255b4"/><file name="TaxType.class.php" hash="9b51208efe71386135db17fd719160a9"/><file name="TextCase.class.php" hash="9459eeef84909b2a3e7c4fc0855684c9"/><file name="ValidAddress.class.php" hash="0eb72c8763869689f434ac90d568b323"/><file name="ValidateRequest.class.php" hash="444616330d73d1e8bfe4535057a2ce59"/><file name="ValidateResult.class.php" hash="7667161c044dd77f29a0a1863bf2a5f3"/><dir name="wsdl"><file name="Address.wsdl" hash="2ca743760c961db0ae03e4c6900667cb"/><file name="BatchSvc.wsdl" hash="eae666b959c1889d586919da4ebccefd"/><file name="Tax.wsdl" hash="da6b3da89c3e4f3f7db6d0ed9d4d33de"/></dir></dir><file name="functions.php" hash="b94adf9f4887ff8f023fdaff5c64d974"/></dir><dir name="sql"><dir name="avatax_records_setup"><file name="mysql4-install-0.1.0.php" hash="4b83a0755b3d1cfa095649d6d342c9ca"/><file name="mysql4-upgrade-0.1.4-0.1.5.php" hash="75a7ad390a41c2c1f3287ebbf14ab0bd"/><file name="mysql4-upgrade-1.0.1-2.0.0.php" hash="cdd11a55f102b50cf6e522efdb30dadd"/><file name="mysql4-upgrade-2.5.0.0-2.5.0.1.php" hash="5a425755b6aa9f0296ec9aad975653dc"/></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="a2514046fa0428d24a25f82d17627843"/></dir></dir><dir name="template"><dir name="onepica"><dir name="avatax"><dir name="log"><file name="view.phtml" hash="176cc0e9b7842837be8350de143bc29f"/></dir><dir name="notification"><file name="toolbar.phtml" hash="3fe57e7f43f5995ac69b2c74744bfbd3"/></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></contents>
|
42 |
<compatible/>
|
43 |
+
<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>
|
44 |
</package>
|