Grinet_TurkeyTaxes - Version 0.1.0

Version Notes

No notes at this time

Download this release

Release Info

Developer Magento Core Team
Extension Grinet_TurkeyTaxes
Version 0.1.0
Comparing to
See all releases


Version 0.1.0

app/code/community/Grinet/TurkeyTaxes/etc/config.xml ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category GriNet
23
+ * @package GriNet turkeytaxes
24
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+ -->
28
+ <config>
29
+ <modules>
30
+ <Grinet_TurkeyTaxes>
31
+ <version>0.1.0</version>
32
+ </Grinet_TurkeyTaxes>
33
+ </modules>
34
+ <global>
35
+ <resources>
36
+ <turkeytaxes_setup>
37
+ <setup>
38
+ <module>Grinet_TurkeyTaxes</module>
39
+ </setup>
40
+ <connection>
41
+ <use>core_setup</use>
42
+ </connection>
43
+ </turkeytaxes_setup>
44
+ <turkeytaxes_write>
45
+ <connection>
46
+ <use>core_write</use>
47
+ </connection>
48
+ </turkeytaxes_write>
49
+ <turkeytaxes_read>
50
+ <connection>
51
+ <use>core_read</use>
52
+ </connection>
53
+ </turkeytaxes_read>
54
+ </resources>
55
+ </global>
56
+ </config>
app/code/community/Grinet/TurkeyTaxes/sql/turkeytaxes_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category GriNet
22
+ * @package GriNet TurkeyCities
23
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+ $installer = $this;
27
+
28
+ $installer->startSetup();
29
+
30
+ $db = Mage::getSingleton('core/resource')->getConnection('core_write');
31
+
32
+ $sql="INSERT INTO `".$installer->getTable('tax_class')."` (`class_id`,`class_name`,`class_type`) VALUES (NULL,'Perakende Müşteri','CUSTOMER');"; $db->query($sql); $ta1 = $db->lastInsertId();
33
+ $sql="INSERT INTO `".$installer->getTable('tax_class')."` (`class_id`,`class_name`,`class_type`) VALUES (NULL,'KDV %18','PRODUCT'); "; $db->query($sql); $ta2 = $db->lastInsertId();
34
+ $sql="INSERT INTO `".$installer->getTable('tax_class')."` (`class_id`,`class_name`,`class_type`) VALUES (NULL,'KDV %8','PRODUCT'); "; $db->query($sql); $ta3 = $db->lastInsertId();
35
+ $sql="INSERT INTO `".$installer->getTable('tax_class')."` (`class_id`,`class_name`,`class_type`) VALUES (NULL,'KDV %1','PRODUCT'); "; $db->query($sql); $ta4 = $db->lastInsertId();
36
+ $sql="INSERT INTO `".$installer->getTable('tax_class')."` (`class_id`,`class_name`,`class_type`) VALUES (NULL,'KDV %0','PRODUCT'); "; $db->query($sql); $ta5 = $db->lastInsertId();
37
+ //
38
+ $sql="INSERT INTO `".$installer->getTable('tax_calculation_rule')."` (`tax_calculation_rule_id`,`code`,`priority`,`position`) VALUES (NULL,'KDV %18',0,10);"; $db->query($sql); $tb1 = $db->lastInsertId();
39
+ $sql="INSERT INTO `".$installer->getTable('tax_calculation_rule')."` (`tax_calculation_rule_id`,`code`,`priority`,`position`) VALUES (NULL,'KDV %8',0,20); "; $db->query($sql); $tb2 = $db->lastInsertId();
40
+ $sql="INSERT INTO `".$installer->getTable('tax_calculation_rule')."` (`tax_calculation_rule_id`,`code`,`priority`,`position`) VALUES (NULL,'KDV %1',0,30); "; $db->query($sql); $tb3 = $db->lastInsertId();
41
+ $sql="INSERT INTO `".$installer->getTable('tax_calculation_rule')."` (`tax_calculation_rule_id`,`code`,`priority`,`position`) VALUES (NULL,'KDV %0',0,40); "; $db->query($sql); $tb4 = $db->lastInsertId();
42
+ //
43
+ $sql="INSERT INTO `".$installer->getTable('tax_calculation_rate')."` (`tax_calculation_rate_id`,`tax_country_id`,`tax_region_id`,`tax_postcode`,`code`,`rate`,`zip_is_range`,`zip_from`,`zip_to`) VALUES (NULL,'TR',0,'*','KDV %18','18.0000',NULL,NULL,NULL); "; $db->query($sql); $tc1 = $db->lastInsertId();
44
+ $sql="INSERT INTO `".$installer->getTable('tax_calculation_rate')."` (`tax_calculation_rate_id`,`tax_country_id`,`tax_region_id`,`tax_postcode`,`code`,`rate`,`zip_is_range`,`zip_from`,`zip_to`) VALUES (NULL,'TR',0,'*','KDV %8','8.0000',NULL,NULL,NULL); "; $db->query($sql); $tc2 = $db->lastInsertId();
45
+ $sql="INSERT INTO `".$installer->getTable('tax_calculation_rate')."` (`tax_calculation_rate_id`,`tax_country_id`,`tax_region_id`,`tax_postcode`,`code`,`rate`,`zip_is_range`,`zip_from`,`zip_to`) VALUES (NULL,'TR',0,'*','KDV %1','1.0000',NULL,NULL,NULL); "; $db->query($sql); $tc3 = $db->lastInsertId();
46
+ $sql="INSERT INTO `".$installer->getTable('tax_calculation_rate')."` (`tax_calculation_rate_id`,`tax_country_id`,`tax_region_id`,`tax_postcode`,`code`,`rate`,`zip_is_range`,`zip_from`,`zip_to`) VALUES (NULL,'TR',0,'*','KDV %0','0.0000',NULL,NULL,NULL); "; $db->query($sql); $tc4 = $db->lastInsertId();
47
+
48
+ $sql="SELECT * FROM `".$installer->getTable('tax_calculation')."` LIMIT 1;"; $cols=$db->query($sql)->fetch();
49
+
50
+ Mage::getSingleton('checkout/session')->addSuccess(var_export($cols,true));
51
+
52
+ if (isset($cols["tax_calculation_id"]))
53
+ {
54
+ $sql="INSERT INTO `".$installer->getTable('tax_calculation')."` (`tax_calculation_id`,`tax_calculation_rate_id`,`tax_calculation_rule_id`,`customer_tax_class_id`,`product_tax_class_id`) VALUES (NULL,$tc1,$tb1,$ta1,$ta2);"; $db->query($sql);
55
+ $sql="INSERT INTO `".$installer->getTable('tax_calculation')."` (`tax_calculation_id`,`tax_calculation_rate_id`,`tax_calculation_rule_id`,`customer_tax_class_id`,`product_tax_class_id`) VALUES (NULL,$tc2,$tb2,$ta1,$ta3);"; $db->query($sql);
56
+ $sql="INSERT INTO `".$installer->getTable('tax_calculation')."` (`tax_calculation_id`,`tax_calculation_rate_id`,`tax_calculation_rule_id`,`customer_tax_class_id`,`product_tax_class_id`) VALUES (NULL,$tc3,$tb3,$ta1,$ta4);"; $db->query($sql);
57
+ $sql="INSERT INTO `".$installer->getTable('tax_calculation')."` (`tax_calculation_id`,`tax_calculation_rate_id`,`tax_calculation_rule_id`,`customer_tax_class_id`,`product_tax_class_id`) VALUES (NULL,$tc4,$tb4,$ta1,$ta5);"; $db->query($sql);
58
+ } // if sonu
59
+ else
60
+ {
61
+ $sql="INSERT INTO `".$installer->getTable('tax_calculation')."` (`tax_calculation_rate_id`,`tax_calculation_rule_id`,`customer_tax_class_id`,`product_tax_class_id`) VALUES ($tc1,$tb1,$ta1,$ta2);"; $db->query($sql);
62
+ $sql="INSERT INTO `".$installer->getTable('tax_calculation')."` (`tax_calculation_rate_id`,`tax_calculation_rule_id`,`customer_tax_class_id`,`product_tax_class_id`) VALUES ($tc2,$tb2,$ta1,$ta3);"; $db->query($sql);
63
+ $sql="INSERT INTO `".$installer->getTable('tax_calculation')."` (`tax_calculation_rate_id`,`tax_calculation_rule_id`,`customer_tax_class_id`,`product_tax_class_id`) VALUES ($tc3,$tb3,$ta1,$ta4);"; $db->query($sql);
64
+ $sql="INSERT INTO `".$installer->getTable('tax_calculation')."` (`tax_calculation_rate_id`,`tax_calculation_rule_id`,`customer_tax_class_id`,`product_tax_class_id`) VALUES ($tc4,$tb4,$ta1,$ta5);"; $db->query($sql);
65
+ } // else sonu
66
+
67
+ Mage::getSingleton('checkout/session')->addSuccess(__('Turkiye icin vergi ayarlari eklendi...'));
68
+
69
+ $installer->endSetup();
app/etc/modules/Grinet_TurkeyTaxes.xml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magentocommerce.com for more information.
21
+ *
22
+ * @category GriNet
23
+ * @package Grinet_TurkeyTaxes
24
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
25
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
+ */
27
+ -->
28
+ <config>
29
+ <modules>
30
+ <Grinet_TurkeyTaxes>
31
+ <active>true</active>
32
+ <codePool>community</codePool>
33
+ </Grinet_TurkeyTaxes>
34
+ </modules>
35
+ </config>
package.xml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Grinet_TurkeyTaxes</name>
4
+ <version>0.1.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.opensource.org/licenses/gpl-license.php">GNU General Public License (GPL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>- Adds Turkey Taxes to Magento
10
+ - T&#xFC;rkiye'de ge&#xE7;erli vergileri Magento'ya ekler</summary>
11
+ <description>- Adds Turkey Taxes to Magento
12
+ - T&#xFC;rkiye'de ge&#xE7;erli vergileri Magento'ya ekler</description>
13
+ <notes>No notes at this time</notes>
14
+ <authors><author><name>Hidayet Ok</name><user>auto-converted</user><email>hidonet@grinet.com.tr</email></author></authors>
15
+ <date>2011-09-02</date>
16
+ <time>13:48:47</time>
17
+ <contents><target name="magecommunity"><dir name="Grinet"><dir name="TurkeyTaxes"><dir name="etc"><file name="config.xml" hash="0631f8017edb2cc64a782c8c5a2a1ecd"/></dir><dir name="sql"><dir name="turkeytaxes_setup"><file name="mysql4-install-0.1.0.php" hash="582dc26c7a64429e5a8d8a308dd271fa"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Grinet_TurkeyTaxes.xml" hash="808c80d838f1cb56076ee2c3ce24c03e"/></dir></target></contents>
18
+ <compatible/>
19
+ <dependencies/>
20
+ </package>