Version Notes
Initial Public Release
Download this release
Release Info
Developer | Vonnda Development |
Extension | Taxify_Sales_Tax_Rates_and_Filing |
Version | 0.1.7 |
Comparing to | |
See all releases |
Code changes from version 0.1.6 to 0.1.7
- app/code/local/Vonnda/Taxify/Block/Adminhtml/Tax/Class/Edit/Form.php +25 -10
- app/code/local/Vonnda/Taxify/Helper/Data.php +20 -0
- app/code/local/Vonnda/Taxify/Model/Client.php +3 -0
- app/code/local/Vonnda/Taxify/Model/Request/Calculate.php +1 -1
- app/code/local/Vonnda/Taxify/Model/Request/Codes.php +6 -2
- app/code/local/Vonnda/Taxify/etc/config.xml +1 -1
- app/code/local/Vonnda/Taxify/sql/taxify_setup/mysql4-upgrade-0.1.6-0.1.7.php +17 -0
- app/code/local/Vonnda/Taxify/tests/Helper/DataTest.php +5 -7
- app/code/local/Vonnda/Taxify/tests/Request/CodesTest.php +14 -1
- package.xml +4 -4
app/code/local/Vonnda/Taxify/Block/Adminhtml/Tax/Class/Edit/Form.php
CHANGED
@@ -1,22 +1,37 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class Vonnda_Taxify_Block_Adminhtml_Tax_Class_Edit_Form
|
|
|
4 |
{
|
5 |
|
6 |
protected function _prepareForm()
|
7 |
{
|
8 |
parent::_prepareForm();
|
9 |
-
$fieldset = $this->getForm()->getElement('base_fieldset');
|
10 |
|
11 |
-
$
|
12 |
-
$
|
13 |
-
|
14 |
-
|
15 |
-
'
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
18 |
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
return $this;
|
22 |
}
|
1 |
<?php
|
2 |
|
3 |
+
class Vonnda_Taxify_Block_Adminhtml_Tax_Class_Edit_Form
|
4 |
+
extends Mage_Adminhtml_Block_Tax_Class_Edit_Form
|
5 |
{
|
6 |
|
7 |
protected function _prepareForm()
|
8 |
{
|
9 |
parent::_prepareForm();
|
|
|
10 |
|
11 |
+
$classType = $this->getClassType();
|
12 |
+
if ($classType == Mage_Tax_Model_Class::TAX_CLASS_TYPE_CUSTOMER) {
|
13 |
+
$fieldset = $this->getForm()->getElement('base_fieldset');
|
14 |
+
$model = Mage::registry('tax_class');
|
15 |
+
$fieldset->addField('taxify_code', 'select', array(
|
16 |
+
'name' => 'taxify_customer_taxability',
|
17 |
+
'label' => Mage::helper('taxify')->__('Taxify Tax Class'),
|
18 |
+
'required' => true,
|
19 |
+
'values' => Mage::helper('taxify')->getCustomerTaxabilityOptions(),
|
20 |
+
'value' => $model->getTaxifyCustomerTaxability(),
|
21 |
|
22 |
+
));
|
23 |
+
} else {
|
24 |
+
$fieldset = $this->getForm()->getElement('base_fieldset');
|
25 |
+
$model = Mage::registry('tax_class');
|
26 |
+
$fieldset->addField('taxify_code', 'select', array(
|
27 |
+
'name' => 'taxify_product_taxability',
|
28 |
+
'label' => Mage::helper('taxify')->__('Taxify Tax Class'),
|
29 |
+
'required' => true,
|
30 |
+
'values' => Mage::helper('taxify')->getProductTaxabilityOptions(),
|
31 |
+
'value' => $model->getTaxifyProductTaxability(),
|
32 |
+
|
33 |
+
));
|
34 |
+
}
|
35 |
|
36 |
return $this;
|
37 |
}
|
app/code/local/Vonnda/Taxify/Helper/Data.php
CHANGED
@@ -3,6 +3,15 @@
|
|
3 |
class Vonnda_Taxify_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
{
|
5 |
public function getCustomerTaxabilityOptions()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
{
|
7 |
$codReq = Mage::getModel('taxify/request_codes');
|
8 |
$codReq->send();
|
@@ -34,4 +43,15 @@ class Vonnda_Taxify_Helper_Data extends Mage_Core_Helper_Abstract
|
|
34 |
|
35 |
return $tax->getTaxifyCustomerTaxability();
|
36 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
}
|
3 |
class Vonnda_Taxify_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
{
|
5 |
public function getCustomerTaxabilityOptions()
|
6 |
+
{
|
7 |
+
$codReq = Mage::getModel('taxify/request_codes');
|
8 |
+
$codReq->codeType = 'Customer';
|
9 |
+
$codReq->send();
|
10 |
+
|
11 |
+
return $codReq->getCodesWithLabels();
|
12 |
+
}
|
13 |
+
|
14 |
+
public function getProductTaxabilityOptions()
|
15 |
{
|
16 |
$codReq = Mage::getModel('taxify/request_codes');
|
17 |
$codReq->send();
|
43 |
|
44 |
return $tax->getTaxifyCustomerTaxability();
|
45 |
}
|
46 |
+
|
47 |
+
public function getProductTaxClassMap()
|
48 |
+
{
|
49 |
+
$map = array();
|
50 |
+
foreach (Mage::getModel('tax/class')->getCollection() as $taxClass) {
|
51 |
+
$map[$taxClass->getClassId()] =
|
52 |
+
$taxClass->getTaxifyProductTaxability();
|
53 |
+
}
|
54 |
+
|
55 |
+
return $map;
|
56 |
+
}
|
57 |
}
|
app/code/local/Vonnda/Taxify/Model/Client.php
CHANGED
@@ -42,6 +42,7 @@ class Vonnda_Taxify_Model_Client extends Mage_Core_Model_Abstract
|
|
42 |
// Because GetCodes doesn't have the "Request" node.
|
43 |
if (array_key_exists('GetCodes', $req)) {
|
44 |
$this->requestNodeName = 'GetCodes';
|
|
|
45 |
}
|
46 |
|
47 |
$this->request[$this->requestNodeName] = $req;
|
@@ -52,8 +53,10 @@ class Vonnda_Taxify_Model_Client extends Mage_Core_Model_Abstract
|
|
52 |
{
|
53 |
$this->log('URL:'. $this->url);
|
54 |
$this->log('REQUEST:');
|
|
|
55 |
$this->log($this->request);
|
56 |
$this->log('RESPONSE:');
|
|
|
57 |
$this->log($this->response);
|
58 |
}
|
59 |
|
42 |
// Because GetCodes doesn't have the "Request" node.
|
43 |
if (array_key_exists('GetCodes', $req)) {
|
44 |
$this->requestNodeName = 'GetCodes';
|
45 |
+
$req = $req['GetCodes'];
|
46 |
}
|
47 |
|
48 |
$this->request[$this->requestNodeName] = $req;
|
53 |
{
|
54 |
$this->log('URL:'. $this->url);
|
55 |
$this->log('REQUEST:');
|
56 |
+
$this->log($this->soapClient->__getLastRequest());
|
57 |
$this->log($this->request);
|
58 |
$this->log('RESPONSE:');
|
59 |
+
$this->log($this->soapClient->__getLastResponse());
|
60 |
$this->log($this->response);
|
61 |
}
|
62 |
|
app/code/local/Vonnda/Taxify/Model/Request/Calculate.php
CHANGED
@@ -46,7 +46,7 @@ class Vonnda_Taxify_Model_Request_Calculate extends Vonnda_Taxify_Model_Request_
|
|
46 |
{
|
47 |
$taxClassId = $item->getProduct()->getTaxClassId();
|
48 |
|
49 |
-
$map =
|
50 |
|
51 |
if (isset($map[$taxClassId])) {
|
52 |
return $map[$taxClassId];
|
46 |
{
|
47 |
$taxClassId = $item->getProduct()->getTaxClassId();
|
48 |
|
49 |
+
$map = Mage::helper('taxify')->getProductTaxClassMap();
|
50 |
|
51 |
if (isset($map[$taxClassId])) {
|
52 |
return $map[$taxClassId];
|
app/code/local/Vonnda/Taxify/Model/Request/Codes.php
CHANGED
@@ -3,6 +3,7 @@
|
|
3 |
class Vonnda_Taxify_Model_Request_Codes extends Vonnda_Taxify_Model_Request_Request
|
4 |
{
|
5 |
public $apiMethod = 'GetCodes';
|
|
|
6 |
public $defaultCodes = array(
|
7 |
'',
|
8 |
'CLOTHING',
|
@@ -14,7 +15,7 @@ class Vonnda_Taxify_Model_Request_Codes extends Vonnda_Taxify_Model_Request_Requ
|
|
14 |
|
15 |
public function build()
|
16 |
{
|
17 |
-
$this->request['GetCodes'] = array('CodeType' =>
|
18 |
}
|
19 |
|
20 |
public function getCodes()
|
@@ -47,9 +48,12 @@ class Vonnda_Taxify_Model_Request_Codes extends Vonnda_Taxify_Model_Request_Requ
|
|
47 |
|
48 |
public function getLabelFromCode($code)
|
49 |
{
|
50 |
-
if ($code == '') {
|
51 |
return 'Default';
|
52 |
}
|
|
|
|
|
|
|
53 |
|
54 |
return ucwords(strtolower($code));
|
55 |
}
|
3 |
class Vonnda_Taxify_Model_Request_Codes extends Vonnda_Taxify_Model_Request_Request
|
4 |
{
|
5 |
public $apiMethod = 'GetCodes';
|
6 |
+
public $codeType = 'Item';
|
7 |
public $defaultCodes = array(
|
8 |
'',
|
9 |
'CLOTHING',
|
15 |
|
16 |
public function build()
|
17 |
{
|
18 |
+
$this->request['GetCodes'] = array('CodeType' => $this->codeType);
|
19 |
}
|
20 |
|
21 |
public function getCodes()
|
48 |
|
49 |
public function getLabelFromCode($code)
|
50 |
{
|
51 |
+
if ($code == '' && $this->codeType == 'Item') {
|
52 |
return 'Default';
|
53 |
}
|
54 |
+
if ($code == '' && $this->codeType == 'Customer') {
|
55 |
+
return 'None';
|
56 |
+
}
|
57 |
|
58 |
return ucwords(strtolower($code));
|
59 |
}
|
app/code/local/Vonnda/Taxify/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Vonnda_Taxify>
|
5 |
-
<version>0.1.
|
6 |
</Vonnda_Taxify>
|
7 |
</modules>
|
8 |
<global>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Vonnda_Taxify>
|
5 |
+
<version>0.1.7</version>
|
6 |
</Vonnda_Taxify>
|
7 |
</modules>
|
8 |
<global>
|
app/code/local/Vonnda/Taxify/sql/taxify_setup/mysql4-upgrade-0.1.6-0.1.7.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
$installer->startSetup();
|
5 |
+
try {
|
6 |
+
$installer->run("
|
7 |
+
|
8 |
+
ALTER TABLE `" . $this->getTable('tax/tax_class') . "`
|
9 |
+
ADD `taxify_product_taxability` VARCHAR(255) DEFAULT '' NOT NULL COMMENT 'Used by Vonnda Taxify extension'
|
10 |
+
AFTER `taxify_customer_taxability`;
|
11 |
+
|
12 |
+
");
|
13 |
+
} catch(Exception $e) {
|
14 |
+
Mage::log($e->getMessage());
|
15 |
+
}
|
16 |
+
|
17 |
+
$installer->endSetup();
|
app/code/local/Vonnda/Taxify/tests/Helper/DataTest.php
CHANGED
@@ -7,14 +7,12 @@ class HelperDataTest extends PHPUnit_Framework_TestCase
|
|
7 |
$helper = Mage::helper('taxify');
|
8 |
$options = $helper->getCustomerTaxabilityOptions();
|
9 |
$expected = array(
|
10 |
-
'' => '
|
11 |
-
'
|
12 |
-
'
|
13 |
-
'
|
14 |
-
'NONTAX' => 'Nontax',
|
15 |
-
'TAXABLE' => 'Taxable',
|
16 |
-
'WINE' => 'Wine',
|
17 |
);
|
18 |
$this->assertEquals($expected, $options);
|
19 |
}
|
|
|
20 |
}
|
7 |
$helper = Mage::helper('taxify');
|
8 |
$options = $helper->getCustomerTaxabilityOptions();
|
9 |
$expected = array(
|
10 |
+
'' => 'None',
|
11 |
+
'RESALE' => 'Resale',
|
12 |
+
'RETAIL' => 'Retail',
|
13 |
+
'USETAX' => 'Usetax',
|
|
|
|
|
|
|
14 |
);
|
15 |
$this->assertEquals($expected, $options);
|
16 |
}
|
17 |
+
|
18 |
}
|
app/code/local/Vonnda/Taxify/tests/Request/CodesTest.php
CHANGED
@@ -6,7 +6,10 @@ class CodesTest extends PHPUnit_Framework_TestCase
|
|
6 |
public function testCodesModelExists()
|
7 |
{
|
8 |
$client = Mage::getModel('taxify/request_codes');
|
9 |
-
$this->assertTrue(
|
|
|
|
|
|
|
10 |
}
|
11 |
|
12 |
public function testBuildRequest()
|
@@ -46,6 +49,16 @@ class CodesTest extends PHPUnit_Framework_TestCase
|
|
46 |
$client->getCodesWithLabels();
|
47 |
|
48 |
$this->assertEquals($expected, $client->getCodesWithLabels());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
|
|
|
50 |
}
|
51 |
}
|
6 |
public function testCodesModelExists()
|
7 |
{
|
8 |
$client = Mage::getModel('taxify/request_codes');
|
9 |
+
$this->assertTrue(
|
10 |
+
is_object($client),
|
11 |
+
'The model taxify/request_codes should exist'
|
12 |
+
);
|
13 |
}
|
14 |
|
15 |
public function testBuildRequest()
|
49 |
$client->getCodesWithLabels();
|
50 |
|
51 |
$this->assertEquals($expected, $client->getCodesWithLabels());
|
52 |
+
}
|
53 |
+
|
54 |
+
public function testGetCustomerCodes()
|
55 |
+
{
|
56 |
+
$client = Mage::getModel('taxify/request_codes');
|
57 |
+
$client->codeType = 'Customer';
|
58 |
+
$expected = array('GetCodes' => array('CodeType' => 'Customer'));
|
59 |
+
|
60 |
+
$client->build();
|
61 |
|
62 |
+
$this->assertEquals($expected, $client->request);
|
63 |
}
|
64 |
}
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Taxify_Sales_Tax_Rates_and_Filing</name>
|
4 |
-
<version>0.1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU General Public License V2</license>
|
7 |
<channel>community</channel>
|
@@ -10,9 +10,9 @@
|
|
10 |
<description>Taxify ensures that your Magento store collects, reports and remits accurate sales taxes for all Federal, state, and local jurisdictions throughout the United States</description>
|
11 |
<notes>Initial Public Release</notes>
|
12 |
<authors><author><name>Vonnda Development</name><user>Vonnda</user><email>info@vonnda.com</email></author></authors>
|
13 |
-
<date>2015-10-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magelocal"><dir name="Vonnda"><dir name="Taxify"><dir name="Block"><dir name="Adminhtml"><dir name="Tax"><dir name="Class"><dir name="Edit"><file name="Form.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.3.0</min><max>5.6.2</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Taxify_Sales_Tax_Rates_and_Filing</name>
|
4 |
+
<version>0.1.7</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU General Public License V2</license>
|
7 |
<channel>community</channel>
|
10 |
<description>Taxify ensures that your Magento store collects, reports and remits accurate sales taxes for all Federal, state, and local jurisdictions throughout the United States</description>
|
11 |
<notes>Initial Public Release</notes>
|
12 |
<authors><author><name>Vonnda Development</name><user>Vonnda</user><email>info@vonnda.com</email></author></authors>
|
13 |
+
<date>2015-10-29</date>
|
14 |
+
<time>21:27:10</time>
|
15 |
+
<contents><target name="magelocal"><dir name="Vonnda"><dir name="Taxify"><dir name="Block"><dir name="Adminhtml"><dir name="Tax"><dir name="Class"><dir name="Edit"><file name="Form.php" hash="4c8f337cb03db39cc74bb5df9d94850d"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="df447d3734709072c2176093e785e008"/></dir><dir name="Model"><file name="Client.php" hash="87d2fc2b68acbe9f624e00afca87f9d8"/><file name="Config.php" hash="2db3425ee59a162dedf5ef8a4fa655e3"/><dir name="Export"><file name="Row.php" hash="7c1ba01053c94524fa5bca031e310747"/></dir><file name="Export.php" hash="a7c54832cb11773f1598aa3a4778a59e"/><file name="Feed.php" hash="04f391cc7357d47184c243e81d068bf7"/><file name="Observer.php" hash="52d7d7e74b2a0676b58ad4262e26fc49"/><dir name="Request"><file name="Calculate.php" hash="75fa6340fbcfd7bc95a55b67c054bb82"/><file name="Cancel.php" hash="2d1eadf52123f4db8151832502d8ba01"/><file name="Codes.php" hash="43336ee3c7839b9746493c3f5860b8e0"/><file name="Commit.php" hash="3ec21b8860ab14f3eadc7bb9e53c02c1"/><file name="Request.php" hash="0047d6dc437b007e7923b70082aead6c"/><file name="Verifyaddress.php" hash="fff9f9d0ac574ac185916afaf7bdde0c"/><file name="Version.php" hash="ff41825cbc827abed4e0a2597e67ee67"/></dir><dir name="Resource"><dir name="Mysql4"><file name="Setup.php" hash="326120cd05749e9b48e7dd966a3b2c19"/></dir></dir><dir name="Sales"><dir name="Quote"><dir name="Address"><dir name="Total"><file name="Tax.php" hash="e41ac495324df63351c07f7772df7e9b"/></dir><file name=".DS_Store" hash="d6c424b95f6c304aa0e0c861c9a01073"/></dir><file name=".DS_Store" hash="e3088067e0aac643641350be6bd5da89"/></dir><file name=".DS_Store" hash="d8aa3112ea4a1c59b473e14dcddf7d1f"/></dir><file name=".DS_Store" hash="89503324a3148078dbd8a9ac140ae571"/></dir><dir name="controllers"><file name="ExportController.php" hash="b3d01205020d5cf3809bdfc5625abb72"/></dir><dir name="etc"><file name="adminhtml.xml" hash="438da0a4ed05ca800233f73fef1c65a8"/><file name="config.xml" hash="d5b99ed1a0e9951f03d5de355d630898"/><file name="system.xml" hash="f99743421bbf8bf7c4d19dca7a4b0d53"/></dir><dir name="sql"><dir name="taxify_setup"><file name="mysql4-install-0.1.1.php" hash="523629216cc236efa1e3a08dc40b9291"/><file name="mysql4-upgrade-0.1.6-0.1.7.php" hash="f63715adff31a85fb43aa1aecfc42c2d"/></dir></dir><dir name="tests"><dir name="Helper"><file name="DataTest.php" hash="3156f91fb3fdc07c3e7e9b06670ab049"/></dir><dir name="Model"><dir name="Export"><file name="RowTest.php" hash="370afb16507950dcbf2ac27090c8452c"/></dir><file name="ExportTest.php" hash="04ec5d1e4a71bf840881b2cb55be5528"/></dir><dir name="Request"><file name="CalculateTest.php" hash="7bd6291be8d42329a211fd6f73161cd8"/><file name="CancelTest.php" hash="b8ba6f0004d493f72ce22c66375ffdac"/><file name="CodesTest.php" hash="34101e57f496b40b817496fa78abad3a"/><file name="CommitTest.php" hash="59c4473ba919047dd821e05b335dbc38"/></dir><file name="SampleTest.php" hash="32606c8d8b84d95aec73bdeb1c03ca1e"/><dir name="fixtures"><file name="calculateMultiSimpleProductSuccess.txt" hash="6d7426310bebbcb0b758697035a4e8f7"/><file name="calculateSuccess.txt" hash="892ebdae0cd70bcf36cc34be2d21da76"/><file name="exportQueryResult.txt" hash="d07fec0de05420e89536fadb822baa84"/></dir></dir><file name=".DS_Store" hash="1f5579cf877cc451179cc658a1117441"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Vonnda_Taxify.xml" hash="b3120a86b364f80ee8daf825412a1318"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="template"><dir name="taxify"><file name="export.phtml" hash="25487d4b0664dd7cfbea135ad50bf948"/></dir></dir></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.3.0</min><max>5.6.2</max></php></required></dependencies>
|
18 |
</package>
|