EBoekhouden_Export - Version 4.1.6

Version Notes

Berekeningen verbeterd voor shops die hoofdzakelijk exclusief btw werken.

Download this release

Release Info

Developer Magento Core Team
Extension EBoekhouden_Export
Version 4.1.6
Comparing to
See all releases


Version 4.1.6

Files changed (41) hide show
  1. app/code/community/Eboekhouden/Export/Block/Sales/Creditmemo/Grid.php +97 -0
  2. app/code/community/Eboekhouden/Export/Block/Sales/Invoice/Grid.php +96 -0
  3. app/code/community/Eboekhouden/Export/Block/Sales/Order/Grid.php +59 -0
  4. app/code/community/Eboekhouden/Export/Block/Tax/Rate/Form.php +66 -0
  5. app/code/community/Eboekhouden/Export/Block/Tax/Rate/Grid.php +50 -0
  6. app/code/community/Eboekhouden/Export/Block/Tax/Rate/Grid/Renderer/Ebvatcode.php +52 -0
  7. app/code/community/Eboekhouden/Export/Helper/AccountNumber.php +45 -0
  8. app/code/community/Eboekhouden/Export/Helper/Data.php +94 -0
  9. app/code/community/Eboekhouden/Export/Model/Config/Costcenter.php +44 -0
  10. app/code/community/Eboekhouden/Export/Model/Config/Ledgeraccount.php +44 -0
  11. app/code/community/Eboekhouden/Export/Model/Config/Taxcalculationrate.php +61 -0
  12. app/code/community/Eboekhouden/Export/Model/Export/Sales.php +905 -0
  13. app/code/community/Eboekhouden/Export/Model/Import/Costcenter.php +67 -0
  14. app/code/community/Eboekhouden/Export/Model/Import/Ebcode.php +161 -0
  15. app/code/community/Eboekhouden/Export/Model/Import/Gbcodes.php +67 -0
  16. app/code/community/Eboekhouden/Export/Model/Info.php +52 -0
  17. app/code/community/Eboekhouden/Export/Model/Product/Attribute/Costcenter.php +26 -0
  18. app/code/community/Eboekhouden/Export/Model/Product/Attribute/Ledgeraccount.php +26 -0
  19. app/code/community/Eboekhouden/Export/Model/Tax/Attribute/Ebtaxcode.php +44 -0
  20. app/code/community/Eboekhouden/Export/controllers/Catalog/ProductController.php +66 -0
  21. app/code/community/Eboekhouden/Export/controllers/Export/SaleController.php +113 -0
  22. app/code/community/Eboekhouden/Export/controllers/MutatieController.php +58 -0
  23. app/code/community/Eboekhouden/Export/etc/config.xml +181 -0
  24. app/code/community/Eboekhouden/Export/etc/system.xml +118 -0
  25. app/code/community/Eboekhouden/Export/sql/HOWTO_UnInstall.sql +41 -0
  26. app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/includes/install-current.php +167 -0
  27. app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/mysql4-install-4.0.php +33 -0
  28. app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/mysql4-upgrade-1.0.2-4.0.php +33 -0
  29. app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/mysql4-upgrade-1.0.7-4.0.php +33 -0
  30. app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/mysql4-upgrade-1.1.5-4.0.php +33 -0
  31. app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/mysql4-upgrade-1.2.0-4.0.php +33 -0
  32. app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/mysql4-upgrade-1.2.2-4.0.php +51 -0
  33. app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/mysql4-upgrade-1.2.6-4.0.php +33 -0
  34. app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/mysql4-upgrade-1.3-4.0.php +33 -0
  35. app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/mysql4-upgrade-1.4-4.0.php +33 -0
  36. app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/mysql4-upgrade-1.5-4.0.php +33 -0
  37. app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/mysql4-upgrade-1.6-4.0.php +33 -0
  38. app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/mysql4-upgrade-2.0-4.0.php +33 -0
  39. app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/mysql4-upgrade-3.0-4.0.php +33 -0
  40. app/etc/modules/Eboekhouden_Export.xml +40 -0
  41. package.xml +41 -0
app/code/community/Eboekhouden/Export/Block/Sales/Creditmemo/Grid.php ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2012 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2012 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+ class Eboekhouden_Export_Block_Sales_Creditmemo_Grid extends Mage_Adminhtml_Block_Sales_Creditmemo_Grid
33
+ {
34
+
35
+ protected function _prepareMassaction()
36
+ {
37
+ parent::_prepareMassaction();
38
+ $this->getMassactionBlock()->addItem(
39
+ 'eboekhouden',
40
+ array('label' => Mage::helper('Eboekhouden_Export')->__('Export naar e-Boekhouden.nl'),
41
+ 'url' => $this->getUrl('eboekhouden/export_sale/creditmemoexport'))
42
+ );
43
+ }
44
+
45
+ protected function _prepareColumns()
46
+ {
47
+ $oResult = parent::_prepareColumns();
48
+ $this->addColumn('eboekhouden_mutatie', array(
49
+ 'header' => Mage::helper('Eboekhouden_Export')->__('Mutatienummer'),
50
+ 'width' => '108px',
51
+ 'type' => 'number',
52
+ 'index' => 'eboekhouden_mutatie',
53
+ ));
54
+ return $oResult;
55
+ }
56
+
57
+ protected function _prepareCollection()
58
+ {
59
+ $mResult = false;
60
+ if (method_exists($this, '_getCollectionClass'))
61
+ {
62
+ // Magento 1.4.1.0 and higher
63
+ $oCoreResource = Mage::getSingleton('core/resource');
64
+ /* @var $oCoreResource Mage_Core_Model_Resource */
65
+ $oConnection = $oCoreResource->getConnection('core_read');
66
+ /* @var $oConnection Varien_Db_Adapter_Pdo_Mysql */
67
+ $sGridTable = $oCoreResource->getTableName('sales/creditmemo_grid');
68
+ if (!$oConnection->tableColumnExists($sGridTable, 'eboekhouden_mutatie'))
69
+ {
70
+ // "eboekhouden_mutatie" column is not in grid table, we need to join the invoice table
71
+ $oCollection = Mage::getResourceModel($this->_getCollectionClass());
72
+ /* @var $oCollection Mage_Sales_Model_Mysql4_Order_Invoice_Grid_Collection */
73
+ $oCollection->join('creditmemo', 'main_table.entity_id = creditmemo.entity_id', 'eboekhouden_mutatie');
74
+ parent::setCollection($oCollection);
75
+ $mResult = Mage_Adminhtml_Block_Widget_Grid::_prepareCollection();
76
+ }
77
+ }
78
+ if (empty($mResult))
79
+ {
80
+ $mResult = parent::_prepareCollection();
81
+ }
82
+ return $mResult;
83
+ }
84
+
85
+ public function setCollection($oCollection)
86
+ {
87
+ if (!method_exists($this, '_getCollectionClass'))
88
+ {
89
+ # Magento 1.4.0.0 and older
90
+ $oCollection->addAttributeToSelect('eboekhouden_mutatie');
91
+ }
92
+ return parent::setCollection($oCollection);
93
+ }
94
+
95
+ }
96
+
97
+ ?>
app/code/community/Eboekhouden/Export/Block/Sales/Invoice/Grid.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2012 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2012 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+ class Eboekhouden_Export_Block_Sales_Invoice_Grid extends Mage_Adminhtml_Block_Sales_Invoice_Grid
33
+ {
34
+ protected function _prepareMassaction()
35
+ {
36
+ parent::_prepareMassaction();
37
+ $this->getMassactionBlock()->addItem(
38
+ 'eboekhouden',
39
+ array('label' => Mage::helper('Eboekhouden_Export')->__('Export naar e-Boekhouden.nl'),
40
+ 'url' => $this->getUrl('eboekhouden/export_sale/invoiceexport'))
41
+ );
42
+ }
43
+
44
+ protected function _prepareColumns()
45
+ {
46
+ $oResult = parent::_prepareColumns();
47
+ $this->addColumn('eboekhouden_mutatie', array(
48
+ 'header' => Mage::helper('Eboekhouden_Export')->__('Mutatienummer'),
49
+ 'width' => '108px',
50
+ 'type' => 'number',
51
+ 'index' => 'eboekhouden_mutatie',
52
+ ));
53
+ return $oResult;
54
+ }
55
+
56
+ protected function _prepareCollection()
57
+ {
58
+ $mResult = false;
59
+ if (method_exists($this, '_getCollectionClass'))
60
+ {
61
+ // Magento 1.4.1.0 and higher
62
+ $oCoreResource = Mage::getSingleton('core/resource');
63
+ /* @var $oCoreResource Mage_Core_Model_Resource */
64
+ $oConnection = $oCoreResource->getConnection('core_read');
65
+ /* @var $oConnection Varien_Db_Adapter_Pdo_Mysql */
66
+ $sGridTable = $oCoreResource->getTableName('sales/invoice_grid');
67
+ if (!$oConnection->tableColumnExists($sGridTable, 'eboekhouden_mutatie'))
68
+ {
69
+ // "eboekhouden_mutatie" column is not in grid table, we need to join the invoice table
70
+ $oCollection = Mage::getResourceModel($this->_getCollectionClass());
71
+ /* @var $oCollection Mage_Sales_Model_Mysql4_Order_Invoice_Grid_Collection */
72
+ $oCollection->join('invoice', 'main_table.entity_id = invoice.entity_id', 'eboekhouden_mutatie');
73
+ parent::setCollection($oCollection);
74
+ $mResult = Mage_Adminhtml_Block_Widget_Grid::_prepareCollection();
75
+ }
76
+ }
77
+ if (empty($mResult))
78
+ {
79
+ $mResult = parent::_prepareCollection();
80
+ }
81
+ return $mResult;
82
+ }
83
+
84
+ public function setCollection($oCollection)
85
+ {
86
+ if (!method_exists($this, '_getCollectionClass'))
87
+ {
88
+ # Magento 1.4.0.0 and older
89
+ $oCollection->addAttributeToSelect('eboekhouden_mutatie');
90
+ }
91
+ return parent::setCollection($oCollection);
92
+ }
93
+
94
+ }
95
+
96
+ ?>
app/code/community/Eboekhouden/Export/Block/Sales/Order/Grid.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2012 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2012 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+
33
+ class Eboekhouden_Export_Block_Sales_Order_Grid extends Mage_Adminhtml_Block_Sales_Order_Grid
34
+ {
35
+
36
+ protected function _prepareMassaction()
37
+ {
38
+ parent::_prepareMassaction();
39
+
40
+ $this->getMassactionBlock()->addItem(
41
+ 'eboekhouden',
42
+ array('label' => Mage::helper('Eboekhouden_Export')->__('Export naar e-Boekhouden.nl'),
43
+ 'url' => $this->getUrl('eboekhouden/export_sale/orderexport'))
44
+ );
45
+
46
+ $sExtensionFile = BP . DS . 'app' . DS . 'code' . DS . 'community' . DS . 'BoutikCircus' . DS . 'DeleteOrders' . DS . 'Block' . DS . 'Grid.php';
47
+ if (file_exists($sExtensionFile))
48
+ {
49
+ require_once $sExtensionFile;
50
+ $iPrevErrRep = error_reporting();
51
+ error_reporting($iPrevErrRep & ~E_STRICT); // prevent 'should not be called statically' error
52
+ BoutikCircus_DeleteOrders_Block_Grid::_prepareMassaction();
53
+ error_reporting($iPrevErrRep);
54
+ }
55
+ }
56
+
57
+ }
58
+
59
+ ?>
app/code/community/Eboekhouden/Export/Block/Tax/Rate/Form.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2012 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2012 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+
33
+ class Eboekhouden_Export_Block_Tax_Rate_Form extends Mage_Adminhtml_Block_Tax_Rate_Form
34
+ {
35
+
36
+ protected function _prepareForm()
37
+ {
38
+
39
+ $oResult = parent::_prepareForm();
40
+
41
+ $oForm = $this->getForm();
42
+ /* @var $oForm Varien_Data_Form */
43
+ $oModel = Mage::getSingleton('tax/calculation_rate');
44
+ /* @var $oModel Mage_Tax_Model_Calculation_Rate */
45
+
46
+ $aSettings = array('legend' => Mage::helper('Eboekhouden_Export')->__('Export naar e-Boekhouden.nl'));
47
+ $oFieldset = $oForm->addFieldset('eboekhouden_fieldset', $aSettings);
48
+ /* @var $oFieldset Varien_Data_Form_Element_Fieldset */
49
+
50
+ $oFieldset->addField('tax_ebvatcode', 'select',
51
+ array(
52
+ 'name' => 'tax_ebvatcode',
53
+ 'label' => Mage::helper('Eboekhouden_Export')->__('e-Boekhouden.nl BTW Code'),
54
+ 'required' => false,
55
+ 'values' => Mage::getModel('Eboekhouden_Export/tax_attribute_ebtaxcode')->getAllOptions(),
56
+ )
57
+ );
58
+
59
+ $oForm->addValues($oModel->getData());
60
+
61
+ return $oResult;
62
+ }
63
+
64
+ }
65
+
66
+ ?>
app/code/community/Eboekhouden/Export/Block/Tax/Rate/Grid.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2012 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2012 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+
33
+ class Eboekhouden_Export_Block_Tax_Rate_Grid extends Mage_Adminhtml_Block_Tax_Rate_Grid
34
+ {
35
+
36
+ protected function _prepareColumns()
37
+ {
38
+ $oResult = parent::_prepareColumns();
39
+ $this->addColumn('tax_ebvatcode', array(
40
+ 'header' => Mage::helper('Eboekhouden_Export')->__('e-Boekhouden.nl BTW Code'),
41
+ 'index' => 'tax_ebvatcode',
42
+ 'renderer' => 'Eboekhouden_Export/tax_rate_grid_renderer_ebvatcode',
43
+ 'width' => '208px',
44
+ ));
45
+ return $oResult;
46
+ }
47
+
48
+ }
49
+
50
+ ?>
app/code/community/Eboekhouden/Export/Block/Tax/Rate/Grid/Renderer/Ebvatcode.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2012 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2012 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+
33
+ class Eboekhouden_Export_Block_Tax_Rate_Grid_Renderer_Ebvatcode extends
34
+ Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
35
+ {
36
+ /**
37
+ * @param Varien_Object $row
38
+ * @return string
39
+ */
40
+ public function render(Varien_Object $row)
41
+ {
42
+ $sResult = null;
43
+ $aOptionArray = Mage::getModel('Eboekhouden_Export/tax_attribute_ebtaxcode')->getOptionArray();
44
+ if ($sData = $row->getData($this->getColumn()->getIndex()))
45
+ {
46
+ $sResult = (!empty($aOptionArray[$sData])) ? $aOptionArray[$sData] : $sData;
47
+ }
48
+ return $sResult;
49
+ }
50
+ }
51
+
52
+ ?>
app/code/community/Eboekhouden/Export/Helper/AccountNumber.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * The purpose of this class is to be overridden by specific shop implementations.
5
+ */
6
+
7
+ // Internal use in the Eboekhouden_Export extension:
8
+ // $oAccountNumberHelper = Mage::helper('Eboekhouden_Export/accountNumber'); /* @var Eboekhouden_Export_Helper_AccountNumber $oAccountNumberHelper */
9
+
10
+ class Eboekhouden_Export_Helper_AccountNumber extends Mage_Core_Helper_Abstract
11
+ {
12
+
13
+ /**
14
+ * @param int $iCurrentValue
15
+ * @param Mage_Sales_Model_Order_Invoice|Mage_Sales_Model_Order_Creditmemo $oContainer
16
+ * @return int
17
+ */
18
+ function getBalanceAccountNumber( $iCurrentValue, $oContainer )
19
+ {
20
+ return $iCurrentValue;
21
+ }
22
+
23
+ /**
24
+ * @param int $iCurrentValue
25
+ * @param Mage_Sales_Model_Order_Invoice|Mage_Sales_Model_Order_Creditmemo $oContainer
26
+ * @param Mage_Sales_Model_Order_Invoice_Item|Mage_Sales_Model_Order_Creditmemo_Item $oItem
27
+ * @return int
28
+ */
29
+ function getLedgerAccountNumber( $iCurrentValue, $oContainer, $oItem )
30
+ {
31
+ return $iCurrentValue;
32
+ }
33
+
34
+
35
+ /**
36
+ * @param int $iCurrentValue
37
+ * @param Mage_Sales_Model_Order_Invoice|Mage_Sales_Model_Order_Creditmemo $oContainer
38
+ * @param Mage_Sales_Model_Order_Invoice_Item|Mage_Sales_Model_Order_Creditmemo_Item $oItem
39
+ * @return int
40
+ */
41
+ function getCostCenterNumber( $iCurrentValue, $oContainer, $oItem )
42
+ {
43
+ return $iCurrentValue;
44
+ }
45
+ }
app/code/community/Eboekhouden/Export/Helper/Data.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2012 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2012 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+ class Eboekhouden_Export_Helper_Data extends Mage_Core_Helper_Abstract
33
+ {
34
+ public function getConnectorSettings($mStore = null)
35
+ {
36
+ $sErrorMsg = '';
37
+ $aSettings = array();
38
+
39
+ $aSettings['bConOK'] = 0;
40
+ $aSettings['sConUser'] = trim(Mage::getStoreConfig('eboekhouden/connector/username', $mStore));
41
+ $aSettings['sConWord'] = trim(Mage::getStoreConfig('eboekhouden/connector/securitycode1', $mStore));
42
+ $aSettings['sConGuid'] = trim(Mage::getStoreConfig('eboekhouden/connector/securitycode2', $mStore));
43
+ $aSettings['sShipLedgerAcc'] = intval( trim(Mage::getStoreConfig('eboekhouden/settings/shippingledgeraccount', $mStore)) );
44
+ $aSettings['sShipCostcenter'] = intval( trim(Mage::getStoreConfig('eboekhouden/settings/shippingcostcenter', $mStore)) );
45
+ if ( empty($aSettings['sShipLedgerAcc']) )
46
+ {
47
+ $aSettings['sShipLedgerAcc'] = 8000;
48
+ }
49
+ if ( empty($aSettings['sShipCostcenter']) )
50
+ {
51
+ $aSettings['sShipCostcenter'] = 0;
52
+ }
53
+
54
+ if (empty($aSettings['sConUser']) || empty($aSettings['sConWord']) || empty($aSettings['sConGuid']))
55
+ {
56
+ $sCurrentUrl = Mage::helper('core/url')->getCurrentUrl();
57
+ if ( !Mage::app()->getRequest()->getParam('eboekhouden_config_error', 0)
58
+ && !preg_match('|/system_config/|i',$sCurrentUrl)
59
+ )
60
+ {
61
+ $aSettings['bConOK'] = 0;
62
+ $sErrorMsg .= Mage::helper('Eboekhouden_Export')
63
+ ->__('Configuratie is niet volledig ingevuld, ga naar het menu "%s","%s" en kies "e-Boekhouden.nl" uit de zijbalk. Vul de gegevens in onder "Connector Login Gegevens"',
64
+ Mage::helper('adminhtml')->__('System'), Mage::helper('adminhtml')->__('Configuration'));
65
+ Mage::getSingleton('core/session')->addError($sErrorMsg);
66
+ Mage::app()->getRequest()->setParam('eboekhouden_config_error', 1);
67
+ }
68
+ }
69
+ else
70
+ {
71
+ $aSettings['bConOK'] = 1;
72
+ }
73
+
74
+ return $aSettings;
75
+ }
76
+
77
+ /**
78
+ * Prepare an output string for use in XML for e-Boekhouden.nl
79
+ *
80
+ * @param string $sValue
81
+ * @return string
82
+ */
83
+ public function xmlPrepare($sValue)
84
+ {
85
+ $sResult = $sValue;
86
+ $sResult = html_entity_decode($sResult); // remove previous HTML encoding
87
+ // No utf8_encode() needed, all data in Magento is UTF-8.
88
+ $sResult = htmlspecialchars($sResult, ENT_QUOTES, 'UTF-8'); // encode < > & ' "
89
+ return $sResult;
90
+ }
91
+
92
+ }
93
+
94
+ ?>
app/code/community/Eboekhouden/Export/Model/Config/Costcenter.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2012 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2012 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+
33
+ class Eboekhouden_Export_Model_Config_Costcenter
34
+ {
35
+
36
+ public function toOptionArray()
37
+ {
38
+ $oImportModel = Mage::getModel('Eboekhouden_Export/import_costcenter');
39
+ /* @var $oImportModel Eboekhouden_Export_Model_Import_Costcenter */
40
+ $aCodes = $oImportModel->importCodesForDropdown();
41
+ return $aCodes;
42
+ }
43
+
44
+ }
app/code/community/Eboekhouden/Export/Model/Config/Ledgeraccount.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2012 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2012 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+
33
+ class Eboekhouden_Export_Model_Config_Ledgeraccount
34
+ {
35
+
36
+ public function toOptionArray()
37
+ {
38
+ $oImportModel = Mage::getModel('Eboekhouden_Export/import_gbcodes');
39
+ /* @var $oImportModel Eboekhouden_Export_Model_Import_Gbcodes */
40
+ $aCodes = $oImportModel->importCodesForDropdown();
41
+ return $aCodes;
42
+ }
43
+
44
+ }
app/code/community/Eboekhouden/Export/Model/Config/Taxcalculationrate.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2012 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2012 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+
33
+ class Eboekhouden_Export_Model_Config_Taxcalculationrate
34
+ {
35
+
36
+ public function toOptionArray()
37
+ {
38
+ $aResult = array();
39
+
40
+ $aItem = array();
41
+ $aItem['value'] = '=NOT-USED=';
42
+ $aItem['label'] = '-- ' . Mage::helper('Eboekhouden_Export')->__('niet in gebruik') . ' --';
43
+ $aResult[] = $aItem;
44
+
45
+ $oTaxCollection = Mage::getModel('tax/calculation_rate')->getCollection()->load();
46
+ /* @var $oTaxCollection Mage_Tax_Model_Mysql4_Calculation_Rate_Collection */
47
+
48
+ $aTaxItems = $oTaxCollection->getItems();
49
+ foreach ($aTaxItems as $oTaxItem)
50
+ {
51
+ /* @var $oTaxItem Mage_Tax_Model_Calculation_Rate */
52
+ $aItem = array();
53
+ $aItem['value'] = $oTaxItem->getData('code');
54
+ $aItem['label'] = $oTaxItem->getData('code') . ' - ' . sprintf('%.02f', $oTaxItem->getData('rate')) . '%';
55
+ $aResult[] = $aItem;
56
+ }
57
+
58
+ return $aResult;
59
+ }
60
+
61
+ }
app/code/community/Eboekhouden/Export/Model/Export/Sales.php ADDED
@@ -0,0 +1,905 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2012 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2012 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+ class Eboekhouden_Export_Model_Export_Sales
33
+ {
34
+ /* @var $oTaxConfig Mage_Tax_Model_Config */
35
+ protected $_oTaxConfig;
36
+ /* @var $oWeeeHelper Mage_Weee_Helper_Data */
37
+ protected $_oWeeeHelper;
38
+
39
+ public function __construct()
40
+ {
41
+ $this->_oTaxConfig = Mage::getSingleton('tax/config');
42
+ $this->_oWeeeHelper = Mage::helper('weee');
43
+ }
44
+
45
+ public function errorHandler($errno, $errstr, $errfile, $errline)
46
+ {
47
+ switch ($errno)
48
+ {
49
+ case E_USER_ERROR:
50
+ echo "<b>My ERROR</b> [$errno] $errstr<br />\n";
51
+ echo " Fatal error on line $errline in file $errfile";
52
+ echo ", PHP " . PHP_VERSION . " (" . PHP_OS . ")<br />\n";
53
+ echo "Aborting...<br />\n";
54
+ exit(1);
55
+ break;
56
+
57
+ case E_USER_WARNING:
58
+ echo "<b>My WARNING</b> [$errno] $errstr<br />\n";
59
+ break;
60
+
61
+ case E_USER_NOTICE:
62
+ echo "<b>My NOTICE</b> [$errno] $errstr<br />\n";
63
+ break;
64
+
65
+ default:
66
+ echo "Unknown error type: [$errno] $errstr<br />\n";
67
+ break;
68
+ }
69
+
70
+ /* Don't execute PHP internal error handler */
71
+ return true;
72
+ }
73
+
74
+ /**
75
+ * Export invoices connected to given order ids to e-Boekhouden.nl.
76
+ *
77
+ * @param $aOrderIds List of order ids to export.
78
+ * @return array with values ($iCountAdded,$iCountExist,$sErrorMsg,$sInfoMsg)
79
+ */
80
+ public function exportOrders($aOrderIds)
81
+ {
82
+ // To enable printing warnings to Apache errorlog set in .htaccess: SetEnv EB_DEBUG 1
83
+ if (!empty($_SERVER["EB_DEBUG"]))
84
+ {
85
+ $iErrorOld = error_reporting();
86
+ $bErrorDisplayOld = ini_get('display_errors');
87
+ error_reporting(E_ALL | E_STRICT & ~E_DEPRECATED);
88
+ ini_set('display_errors', 0);
89
+ restore_error_handler();
90
+ }
91
+
92
+ $sErrorMsg = '';
93
+ $sInfoMsg = '';
94
+ $iCountAdded = 0;
95
+ $iCountExist = 0;
96
+
97
+ sort($aOrderIds);
98
+ foreach ($aOrderIds as $sOrderId)
99
+ {
100
+ $oOrder = Mage::getModel('sales/order')->load($sOrderId);
101
+ /* @var $oOrder Mage_Sales_Model_Order */
102
+ $oInvoiceColl = $oOrder->getInvoiceCollection();
103
+ /* @var $oInvoiceColl Mage_Sales_Model_Mysql4_Order_Invoice_Collection */
104
+ $aInvoiceIds = $oInvoiceColl->getAllIds();
105
+ list($iThisAdded, $iThisExist, $sThisErrorMsg, $sThisInfoMsg) = $this->exportInvoices($aInvoiceIds);
106
+ $iCountAdded += $iThisAdded;
107
+ $iCountExist += $iThisExist;
108
+ $sErrorMsg .= $sThisErrorMsg;
109
+ $sInfoMsg .= $sThisInfoMsg;
110
+ }
111
+
112
+ if (!empty($_SERVER["EB_DEBUG"]))
113
+ {
114
+ error_reporting($iErrorOld);
115
+ set_error_handler('mageCoreErrorHandler');
116
+ ini_set('display_errors', $bErrorDisplayOld);
117
+ }
118
+ return array($iCountAdded, $iCountExist, $sErrorMsg, $sInfoMsg);
119
+ }
120
+
121
+ /**
122
+ * Export given invoices ids to e-Boekhouden.nl.
123
+ * The creditmemo's connected to the orders of the invoices will also be exported
124
+ *
125
+ * @param $aInvoiceIds List of invoice ids to export.
126
+ * @return array with values ($iCountAdded,$iCountExist,$sErrorMsg,$sInfoMsg)
127
+ */
128
+ public function exportInvoices($aInvoiceIds)
129
+ {
130
+ $sErrorMsg = '';
131
+ $sInfoMsg = '';
132
+ $iCountAdded = 0;
133
+ $iCountExist = 0;
134
+
135
+ sort($aInvoiceIds);
136
+ foreach ($aInvoiceIds as $sInvoiceId)
137
+ {
138
+ $oInvoice = Mage::getModel('sales/order_invoice')->load($sInvoiceId);
139
+ /* @var $oInvoice Mage_Sales_Model_Order_Invoice */
140
+ list($iThisAdded, $iThisExist, $sThisErrorMsg, $sThisInfoMsg) = $this->_exportObject($oInvoice);
141
+ $iCountAdded += $iThisAdded;
142
+ $iCountExist += $iThisExist;
143
+ $sErrorMsg .= $sThisErrorMsg;
144
+ $sInfoMsg .= $sThisInfoMsg;
145
+ }
146
+ return array($iCountAdded, $iCountExist, $sErrorMsg, $sInfoMsg);
147
+ }
148
+
149
+
150
+ /**
151
+ * Export given creditmemo ids to e-Boekhouden.nl.
152
+ *
153
+ * @param $aCreditmemoIds List of creditmemo ids to export.
154
+ * @return array with values ($iCountAdded,$iCountExist,$sErrorMsg,$sInfoMsg)
155
+ */
156
+ public function exportCreditmemos($aCreditmemoIds)
157
+ {
158
+ $sErrorMsg = '';
159
+ $sInfoMsg = '';
160
+ $iCountAdded = 0;
161
+ $iCountExist = 0;
162
+
163
+ sort($aCreditmemoIds);
164
+ foreach ($aCreditmemoIds as $iCreditmemoId)
165
+ {
166
+ $oCreditMemo = Mage::getModel('sales/order_creditmemo')->load($iCreditmemoId);
167
+ /* @var $oInvoice Mage_Sales_Model_Order_Creditmemo */
168
+ list($iThisAdded, $iThisExist, $sThisErrorMsg, $sThisInfoMsg) = $this->_exportObject($oCreditMemo);
169
+ $iCountAdded += $iThisAdded;
170
+ $iCountExist += $iThisExist;
171
+ $sErrorMsg .= $sThisErrorMsg;
172
+ $sInfoMsg .= $sThisInfoMsg;
173
+ }
174
+ return array($iCountAdded, $iCountExist, $sErrorMsg, $sInfoMsg);
175
+ }
176
+
177
+ /**
178
+ * Export one Invoice or Creditmemo
179
+ *
180
+ * @param Mage_Sales_Model_Order_Invoice $oContainer
181
+ * @return array with values ($iOrdersAdded,$iOrdersExist,$sErrorMsg)
182
+ */
183
+ protected function _exportObject($oContainer)
184
+ {
185
+ $sXml = '';
186
+ $iCountAdded = 0;
187
+ $iCountExist = 0;
188
+ $sErrorMsg = '';
189
+ $sInfoMsg = '';
190
+
191
+ $oHelper = Mage::helper('Eboekhouden_Export');
192
+ /* @var $oHelper Eboekhouden_Export_Helper_Data */
193
+ $oAccountNumberHelper = Mage::helper('Eboekhouden_Export/accountNumber');
194
+ /* @var Eboekhouden_Export_Helper_AccountNumber $oAccountNumberHelper */
195
+
196
+ $iStoreId = $oContainer->getStoreId();
197
+ if (empty($iStoreId))
198
+ {
199
+ $iStoreId = 0;
200
+ }
201
+
202
+ $iOrderTime = strtotime($oContainer->getCreatedAt());
203
+
204
+ $oOrder = $oContainer->getOrder();
205
+ /* @var $oOrder Mage_Sales_Model_Order */
206
+ $sOrderNr = $oOrder->getIncrementId();
207
+ $sInvoiceNr = 'X' . $oContainer->getIncrementId();
208
+ $sExportType = Mage::helper('Eboekhouden_Export')->__('object');
209
+ if ($oContainer instanceof Mage_Sales_Model_Order_Invoice)
210
+ {
211
+ $sExportType = Mage::helper('Eboekhouden_Export')->__('factuur');
212
+ $sInvoiceNr = $oContainer->getIncrementId();
213
+ }
214
+ elseif ($oContainer instanceof Mage_Sales_Model_Order_Creditmemo)
215
+ {
216
+ $sExportType = Mage::helper('Eboekhouden_Export')->__('creditering');
217
+ $sInvoiceNr = 'C' . $oContainer->getIncrementId();
218
+ }
219
+
220
+ $aSettings = $oHelper->getConnectorSettings($oContainer->getStore());
221
+ $oBillingAddress = $oContainer->getBillingAddress();
222
+
223
+ if (empty($aSettings['bConOK']))
224
+ {
225
+ # Skip the rest
226
+ }
227
+ elseif (empty($oBillingAddress))
228
+ {
229
+ $sErrorMsg .= Mage::helper('Eboekhouden_Export')
230
+ ->__('Fout in %s %s: geen factuuradres gevonden. ' . "\n", $sExportType,
231
+ $oContainer->getIncrementId());
232
+ }
233
+ else
234
+ {
235
+ $sCompanyName = $oBillingAddress->getCompany();
236
+ if (empty($sCompanyName))
237
+ {
238
+ $sCompanyName = $oBillingAddress->getName();
239
+ }
240
+
241
+ $iExistingMutatieNr = $oContainer->getEboekhoudenMutatie();
242
+
243
+ $aTaxInfo = $oOrder->getFullTaxInfo();
244
+ $aValidTaxPerc = array();
245
+ foreach ( $aTaxInfo as $aTaxInfoItem )
246
+ {
247
+ foreach ( $aTaxInfoItem['rates'] as $aRateInfo )
248
+ {
249
+ $aValidTaxPerc[ $aRateInfo['percent'] ] = 1;
250
+ }
251
+ }
252
+
253
+ $sObjectDescription = Mage::helper('Eboekhouden_Export')->__('Magento %s %s, order %s'
254
+ , $sExportType
255
+ , $oContainer->getIncrementId()
256
+ , $sOrderNr);
257
+
258
+ $sXml .= '
259
+ <MUTATIE>';
260
+ if (!empty($iExistingMutatieNr))
261
+ {
262
+ $sXml .= '
263
+ <MUTNR>' . $oHelper->xmlPrepare($iExistingMutatieNr) . '</MUTNR>';
264
+ }
265
+ $sStreetFull = $oBillingAddress->getStreetFull();
266
+ $sStreetFull = str_replace("\n", ' ', $sStreetFull);
267
+ $sEmail = $oOrder->getCustomerEmail();
268
+ $sTaxvat = $oOrder->getCustomerTaxvat();
269
+ $sTaxvat = strtoupper(preg_replace('|\W|', '', $sTaxvat));
270
+
271
+ $iBalanceAccount = 1300;
272
+ $iBalanceAccount = $oAccountNumberHelper->getBalanceAccountNumber($iBalanceAccount,$oContainer);
273
+ if (empty($iBalanceAccount))
274
+ {
275
+ $iBalanceAccount = 1300;
276
+ }
277
+ $sXml .= '
278
+ <NAW>
279
+ <BEDRIJF>' . $oHelper->xmlPrepare($sCompanyName) . '</BEDRIJF>
280
+ <ADRES>' . $oHelper->xmlPrepare($sStreetFull) . '</ADRES>
281
+ <POSTCODE>' . $oHelper->xmlPrepare($oBillingAddress->getPostcode()) . '</POSTCODE>
282
+ <PLAATS>' . $oHelper->xmlPrepare($oBillingAddress->getCity()) . '</PLAATS>
283
+ <LAND>' . $oHelper->xmlPrepare($oBillingAddress->getCountryModel()->getName()) . '</LAND>
284
+ <LANDCODE>' . $oHelper->xmlPrepare($oBillingAddress->getCountry()) . '</LANDCODE>
285
+ <TELEFOON>' . $oHelper->xmlPrepare($oBillingAddress->getTelephone()) . '</TELEFOON>
286
+ <EMAIL>' . $oHelper->xmlPrepare($sEmail) . '</EMAIL>
287
+ <OBNUMMER>' . $oHelper->xmlPrepare($sTaxvat) . '</OBNUMMER>
288
+ </NAW>
289
+ <SOORT>' . $oHelper->xmlPrepare(2) . '</SOORT>
290
+ <REKENING>' . $oHelper->xmlPrepare($iBalanceAccount) . '</REKENING>
291
+ <OMSCHRIJVING>' . $oHelper->xmlPrepare($sObjectDescription) . '</OMSCHRIJVING>
292
+ <FACTUUR>' . $oHelper->xmlPrepare($sInvoiceNr) . '</FACTUUR>
293
+ <BETALINGSKENMERK>' . $oHelper->xmlPrepare($sOrderNr) . '</BETALINGSKENMERK>
294
+ <BETALINGSTERMIJN>' . $oHelper->xmlPrepare(30) . '</BETALINGSTERMIJN>
295
+ <DATUM>' . $oHelper->xmlPrepare(date('d-m-Y', $iOrderTime)) . '</DATUM>
296
+ <INEX>' . $oHelper->xmlPrepare('EX') . '</INEX>
297
+ <MUTATIEREGELS>';
298
+
299
+ $aOrderItems = $oContainer->getItemsCollection();
300
+
301
+ foreach ($aOrderItems as $oItem)
302
+ /* @var $oItem Mage_Sales_Model_Order_Invoice_Item */
303
+ {
304
+ $fDbProductTaxAmount = $oItem->getBaseTaxAmount();
305
+
306
+ $aWeeItems = $this->_oWeeeHelper->getApplied( $oItem );
307
+ foreach ( $aWeeItems as $aWeeData )
308
+ {
309
+ $oWeeeItem = new Mage_Sales_Model_Order_Item();
310
+ $oWeeeItem->setData( $aWeeData );
311
+ $oWeeeItem->setStoreId( $iStoreId );
312
+
313
+ ///// Bugfix for Magento not saving tax in serialezed weee data in order item
314
+ if ( 0 < $fDbProductTaxAmount // Tax used + prevent devide by zero
315
+ && $this->_oWeeeHelper->isTaxable($iStoreId)
316
+ && $oWeeeItem->getBaseRowTotal() == $oWeeeItem->getBaseRowTotalInclTax() // No tax calculated for WEEE
317
+ )
318
+ {
319
+ $fRowAllTotalEx = $oItem->getBaseRowTotal() - $oItem->getBaseDiscountAmount() + $oItem->getWeeeTaxAppliedRowAmount();
320
+ $fAllTaxPerc = 100 * $fDbProductTaxAmount / $fRowAllTotalEx;
321
+ $fAllTaxPerc = $this->_vatPercRound( $fAllTaxPerc );
322
+ if ( empty($aValidTaxPerc[$fAllTaxPerc]) ) // It is not a valid tax percentage yet
323
+ {
324
+ $fAllTaxPerc = $this->_getItemVatPerc( $oContainer, $oItem );
325
+ }
326
+ if ( !empty($aValidTaxPerc[$fAllTaxPerc]) ) // It is a valid tax percentage
327
+ {
328
+ $fVatFactor = (100+$fAllTaxPerc) / 100;
329
+ $oItem->setTaxPercent( $fAllTaxPerc );
330
+ $oItem->setBaseTaxAmount( $oItem->getBaseRowTotal() * $fAllTaxPerc / 100 );
331
+ $oItem->setBaseRowTotalInclTax( $oItem->getBaseRowTotal() + $oItem->getBaseTaxAmount() );
332
+
333
+ $oWeeeItem->setTaxPercent( $fAllTaxPerc );
334
+ if ( $this->_oTaxConfig->priceIncludesTax($iStoreId) )
335
+ {
336
+ $oWeeeItem->setBaseAmount( $oWeeeItem->getBaseAmountInclTax() / $fVatFactor );
337
+ $oWeeeItem->setBaseRowAmount( $oWeeeItem->getBaseRowAmountInclTax() / $fVatFactor );
338
+ }
339
+ else
340
+ {
341
+ $oWeeeItem->setBaseAmountInclTax( $oWeeeItem->getBaseAmount() * $fVatFactor );
342
+ $oWeeeItem->setBaseRowAmountInclTax( $oWeeeItem->getBaseRowAmount() * $fVatFactor );
343
+ }
344
+ $oWeeeItem->setBaseTaxAmount( $oWeeeItem->getBaseRowAmountInclTax() - $oWeeeItem->getBaseRowAmount() );
345
+
346
+ }
347
+ }
348
+ ///// /Bugfix for Magento not saving tax in serialezed weee data in order item
349
+
350
+ $oWeeeItem->setProductId( 'weee_'.$oItem->getProductId() );
351
+ $oWeeeItem->setBaseRowTotal( $oWeeeItem->getBaseRowAmount() );
352
+ $oWeeeItem->setBaseRowTotalInclTax( $oWeeeItem->getBaseRowAmountInclTax() );
353
+
354
+ $sXml .= $this->_getItemXml($oContainer, $oWeeeItem);
355
+ }
356
+
357
+ $sXml .= $this->_getItemXml($oContainer, $oItem);
358
+ }
359
+ if (0 < $oContainer->getBaseShippingAmount())
360
+ {
361
+ $fShipFactor = 1;
362
+ if ($oContainer instanceof Mage_Sales_Model_Order_Creditmemo)
363
+ {
364
+ // We need to find out which part of the shippingcost is refunded.
365
+ // Magento only updates the BaseShippingAmount for a CreditMemo.
366
+ $fBaseShippingAmount = $oOrder->getBaseShippingAmount();
367
+ if ( !empty($fBaseShippingAmount)
368
+ && is_numeric($fBaseShippingAmount)
369
+ && 0 != 1 * $fBaseShippingAmount
370
+ ) // prevent divivsion by zero
371
+ {
372
+ $fShipFactor = $oContainer->getBaseShippingAmount() / $fBaseShippingAmount;
373
+ }
374
+ }
375
+ // Shipping & Handling cost, create a virtual order_item
376
+ $oShippingItem = new Mage_Sales_Model_Order_Item();
377
+ $oShippingItem->setStoreId($iStoreId);
378
+ $oShippingItem->setProductId('shipping');
379
+ $oShippingItem->setBaseRowTotal($fShipFactor * $oContainer->getBaseShippingAmount());
380
+ $oShippingItem->setBaseRowTotalInclTax($fShipFactor * $oContainer->getBaseShippingInclTax());
381
+ $oShippingItem->setBaseTaxAmount($fShipFactor * $oContainer->getBaseShippingTaxAmount());
382
+ $oShippingItem->setBaseDiscountAmount($fShipFactor * $oContainer->getBaseShippingDiscountAmount());
383
+ $oShippingItem->setTaxClassId(Mage::getStoreConfig(Mage_Tax_Model_Config::CONFIG_XML_PATH_SHIPPING_TAX_CLASS,
384
+ $iStoreId));
385
+ $sXml .= $this->_getItemXml($oContainer, $oShippingItem);
386
+ }
387
+ $sXml .= '
388
+ </MUTATIEREGELS>
389
+ </MUTATIE>';
390
+
391
+ $sPostAction = (!empty($iExistingMutatieNr)) ? 'ALTER_MUTATIE' : 'ADD_MUTATIE';
392
+ list($sThisMutatieNr, $iThisExist, $sThisErrorMsg, $sThisInfoMsg) = $this->_postMutatieXml($sXml,
393
+ $aSettings,
394
+ $sPostAction);
395
+ $iCountExist += $iThisExist;
396
+ $sErrorMsg .= $sThisErrorMsg;
397
+ $sInfoMsg .= $sThisInfoMsg;
398
+ if (!empty($sThisMutatieNr)) # can be boolean or string
399
+ {
400
+ $iCountAdded++;
401
+ if (is_string($sThisMutatieNr))
402
+ {
403
+ // Do NOT save whole $oContainer, because the fixes to all items will be written to database!
404
+ $oContainer->setEboekhoudenMutatie($sThisMutatieNr);
405
+ $oContainer->getResource()->saveAttribute( $oContainer, 'eboekhouden_mutatie' );
406
+ }
407
+ }
408
+
409
+ if ($oContainer instanceof Mage_Sales_Model_Order_Invoice)
410
+ {
411
+ $oCreditMemoColl = $oOrder->getCreditmemosCollection();
412
+ /* @var $oCreditMemoColl Mage_Sales_Model_Mysql4_Order_Creditmemo_Collection */
413
+ if (!empty($oCreditMemoColl) && $oCreditMemoColl->count())
414
+ {
415
+ foreach ($oCreditMemoColl as $oCreditMemo)
416
+ /* @var $oCreditMemo Mage_Sales_Model_Order_Creditmemo */
417
+ {
418
+ list($sThisAdded, $iThisExist, $sThisErrorMsg, $sThisInfoMsg) = $this->_exportObject($oCreditMemo,
419
+ $aSettings);
420
+ $iCountAdded += $sThisAdded;
421
+ $iCountExist += $iThisExist;
422
+ $sErrorMsg .= $sThisErrorMsg;
423
+ $sInfoMsg .= $sThisInfoMsg;
424
+ }
425
+ }
426
+ }
427
+ }
428
+ return array($iCountAdded, $iCountExist, $sErrorMsg, $sInfoMsg);
429
+ }
430
+
431
+ /**
432
+ * Post the XML of one order or invoice to the e-Boekhouden API
433
+ *
434
+ * @param string $sXml the XML to post
435
+ * @return array with values ($iOrdersMutatie,$iOrdersExist,$sErrorMsg,$sInfoMsg)
436
+ */
437
+ protected function _postMutatieXml($sMutatieXml, $aSettings, $sAction = 'ADD_MUTATIE')
438
+ {
439
+ $sErrorMsg = '';
440
+ $sInfoMsg = '';
441
+ $sMutatieNr = false;
442
+ $iOrdersExist = 0;
443
+ $oHelper = Mage::helper('Eboekhouden_Export');
444
+ /* @var $oHelper Eboekhouden_Export_Helper_Data */
445
+
446
+ $sXml = '<?xml version="1.0" encoding="UTF-8" ?>';
447
+ $sXml .= '
448
+ <API>
449
+ <ACTION>' . $oHelper->xmlPrepare($sAction) . '</ACTION>
450
+ <VERSION>' . $oHelper->xmlPrepare('1.0') . '</VERSION>
451
+ <SOURCE>' . $oHelper->xmlPrepare('Magento') . '</SOURCE>
452
+ <AUTH>
453
+ <GEBRUIKERSNAAM>' . $oHelper->xmlPrepare($aSettings['sConUser']) . '</GEBRUIKERSNAAM>
454
+ <WACHTWOORD>' . $oHelper->xmlPrepare($aSettings['sConWord']) . '</WACHTWOORD>
455
+ <GUID>' . $oHelper->xmlPrepare($aSettings['sConGuid']) . '</GUID>
456
+ </AUTH>';
457
+ $sXml .= $sMutatieXml;
458
+ $sXml .= '
459
+ </API>';
460
+
461
+ if (Mage::getStoreConfig('eboekhouden/settings/showxml'))
462
+ {
463
+ $sInfoMsg .= 'posted xml:<BR>' . "\n";
464
+ $sInfoMsg .= '<xmp style="font-weight:normal">';
465
+ $sInfoMsg .= $sXml . "\n";
466
+ $sInfoMsg .= '</xmp><BR>' . "\n";
467
+ }
468
+
469
+ $oClient = new Zend_Http_Client();
470
+ $oClient->setUri('https://secure.e-boekhouden.nl/bh/api.asp');
471
+ $oClient->setParameterPost('xml', $sXml);
472
+ $oResponse = $oClient->request('POST');
473
+
474
+ if ($oResponse->isError())
475
+ {
476
+ $sErrorMsg .= Mage::helper('Eboekhouden_Export')->__('HTTP fout %s ontvangen van API: %s', $oResponse->getStatus(),
477
+ $oResponse->getMessage()) . "\n";
478
+ }
479
+ else
480
+ {
481
+ $sResponse = $oResponse->getBody();
482
+ if (empty($sResponse))
483
+ {
484
+ $sErrorMsg .= Mage::helper('Eboekhouden_Export')->__('Fout: Leeg antwoord ontvangen van API') . "\n";
485
+ }
486
+ else
487
+ {
488
+ if (Mage::getStoreConfig('eboekhouden/settings/showxml'))
489
+ {
490
+ $sInfoMsg .= 'response xml:<BR>' . "\n";
491
+ $sInfoMsg .= '<xmp style="font-weight:normal">';
492
+ $sInfoMsg .= $sResponse . "\n";
493
+ $sInfoMsg .= '</xmp><BR>' . "\n";
494
+ }
495
+
496
+ $oData = @simplexml_load_string($sResponse);
497
+ if (empty($oData))
498
+ {
499
+ $sShowResponse = htmlspecialchars(strip_tags($sResponse));
500
+ $sShowResponse = preg_replace('#\s*\n#', "\n", $sShowResponse);
501
+ $sErrorMsg .= Mage::helper('Eboekhouden_Export')
502
+ ->__('Fout in van API ontvangen XML: parsen mislukt') . "\n" . $sShowResponse . "\n";
503
+ }
504
+ elseif (empty($oData->RESULT))
505
+ {
506
+ $sErrorMsg .= Mage::helper('Eboekhouden_Export')
507
+ ->__('Fout in van API ontvangen XML: "RESULT" veld is leeg') . "\n";
508
+ }
509
+ elseif ('ERROR' == strval($oData->RESULT))
510
+ {
511
+ if ('M006' == strval($oData->ERROR->CODE))
512
+ {
513
+ $iOrdersExist++;
514
+ }
515
+ else
516
+ {
517
+ $sErrorMsg .= Mage::helper('Eboekhouden_Export')->__('Fout %s: %s', $oData->ERROR->CODE,
518
+ $oData->ERROR->DESCRIPTION) . "\n";
519
+ }
520
+ }
521
+ elseif ('OK' == strval($oData->RESULT))
522
+ {
523
+ # Inititiate sMutatieNr to true, for the situation that the mutatie exists in EB.nl, and the MutatieNr stays the same
524
+ $sMutatieNr = true;
525
+ }
526
+ else
527
+ {
528
+ $sErrorMsg .= Mage::helper('Eboekhouden_Export')
529
+ ->__('Onbekend resultaat van API ontvangen: %s' . $oData->RESULT) . "\n";
530
+ }
531
+ if (!empty($oData->MUTNR))
532
+ {
533
+ $sMutatieNr = strval($oData->MUTNR);
534
+ }
535
+ }
536
+ }
537
+ return array($sMutatieNr, $iOrdersExist, $sErrorMsg, $sInfoMsg);
538
+ }
539
+
540
+
541
+ /**
542
+ * Get the XML for one order item
543
+ *
544
+ * @param Mage_Sales_Model_Order_Invoice|Mage_Sales_Model_Order_Creditmemo $oContainer
545
+ * @param Mage_Sales_Model_Order_Invoice_Item|Mage_Sales_Model_Order_Creditmemo_Item $oItem
546
+ * @return string
547
+ */
548
+ protected function _getItemXml(&$oContainer, &$oItem)
549
+ {
550
+ $oHelper = Mage::helper('Eboekhouden_Export');
551
+ /* @var $oHelper Eboekhouden_Export_Helper_Data */
552
+ $oAccountNumberHelper = Mage::helper('Eboekhouden_Export/accountNumber');
553
+ /* @var Eboekhouden_Export_Helper_AccountNumber $oAccountNumberHelper */
554
+
555
+ $aSettings = $oHelper->getConnectorSettings($oContainer->getStore());
556
+
557
+ $sXml = '';
558
+ $sComment = '';
559
+
560
+ $oOrderItem = null; /* @var $oOrderItem Mage_Sales_Model_Order_Item */
561
+ if ( is_a($oItem, 'Mage_Sales_Model_Order_Item') )
562
+ {
563
+ $oOrderItem = $oItem;
564
+ }
565
+ else
566
+ {
567
+ $oOrderItem = $oItem->getOrderItem();
568
+ }
569
+
570
+ if ( ( !method_exists($oItem, 'isDummy') || !$oItem->isDummy() )
571
+ && ( empty($oOrderItem) || 'bundle' != $oOrderItem->getProductType() )
572
+ )
573
+ {
574
+ $iStoreId = $oContainer->getStoreId();
575
+ if (empty($iStoreId))
576
+ {
577
+ $iStoreId = Mage_Core_Model_App::ADMIN_STORE_ID;
578
+ }
579
+
580
+ $oOrder = $oContainer->getOrder();
581
+ /* @var $oOrder Mage_Sales_Model_Order */
582
+ $sProductId = $oItem->getProductId();
583
+
584
+ $fVatPercent = $this->_getItemVatPerc( $oContainer, $oItem );
585
+ $sComment .= ' [BTW '.$fVatPercent.'%] ';
586
+ $fVatFactor = (100 + $fVatPercent) / 100;
587
+ if (empty($fVatFactor)
588
+ || !is_numeric($fVatFactor)
589
+ || 0 == 1 * $fVatFactor
590
+ ) // prevent division by zero
591
+ {
592
+ $fVatFactor = 1;
593
+ }
594
+
595
+ // Due to bugs in Magento the row total incl. tax is the most reliable
596
+ $fPriceIn = $oItem->getBaseRowTotalInclTax();
597
+ if (empty($fPriceIn)) // Can be 0 and invalid in Magento 1.3.x
598
+ {
599
+ // Receiving TotalPriceInclTax failed, probably Magento 1.3.x or complicated one
600
+ // Use fallback calculation method.
601
+ $fPriceIn = $oItem->getBaseRowTotal() * $fVatFactor;
602
+ $sComment .= ' ['.$fPriceIn.' = '.$oItem->getBaseRowTotal().' * '.$fVatFactor.'] ';
603
+ }
604
+
605
+ $fDiscountAmount = $oItem->getBaseDiscountAmount();
606
+ if (!empty($fDiscountAmount) && 0 < $fDiscountAmount)
607
+ {
608
+ if ( $this->_oTaxConfig->applyTaxAfterDiscount() )
609
+ {
610
+ // Apply Tax after Discount
611
+ $fPriceIn = ( $oItem->getBaseRowTotal() - $fDiscountAmount ) * $fVatFactor;
612
+ $sComment .= ' ['.$fPriceIn.' = ('.$oItem->getBaseRowTotal().' - '.$fDiscountAmount.') * '.$fVatFactor.'] ';
613
+ }
614
+ else
615
+ {
616
+ // Apply Tax before Discount
617
+ $fPriceInOld = $fPriceIn;
618
+ $fPriceIn = $fPriceInOld - $fDiscountAmount;
619
+ $sComment .= ' ['.$fPriceIn.' = '.$fPriceInOld.' - '.$fDiscountAmount.'] ';
620
+ }
621
+ }
622
+
623
+ $fPriceEx = $fPriceIn / $fVatFactor;
624
+
625
+ $fTaxAmount = $fPriceIn - $fPriceEx;
626
+ if (empty($fTaxAmount))
627
+ {
628
+ $fTaxAmount = 0;
629
+ }
630
+
631
+ $iProductTaxClassId = false;
632
+ $iGbRekening = false;
633
+ $iCostcenter = false;
634
+
635
+ if (!empty($sProductId))
636
+ {
637
+ if ( preg_match( '|^weee_(.+)$|', $sProductId, $aMatch ) )
638
+ {
639
+ $sProductId = $aMatch[1];
640
+ $sComment .= 'WEEE/FPT: ';
641
+ }
642
+ if ( $oItem->getTitle() )
643
+ {
644
+ $sComment .= $oItem->getTitle().': ';
645
+ }
646
+
647
+ if ('shipping' == $sProductId)
648
+ {
649
+ $iGbRekening = $aSettings['sShipLedgerAcc'];
650
+ $iCostcenter = $aSettings['sShipCostcenter'];
651
+ $iProductTaxClassId = $oItem->getTaxClassId();
652
+ $sComment .= 'Shipping';
653
+ }
654
+ else
655
+ {
656
+ $sProductCode = 'ID: ' . $sProductId;
657
+ $oProduct = Mage::getModel('catalog/product');
658
+ /* @var $oProduct Mage_Catalog_Model_Product */
659
+ $oProduct->setStoreId($iStoreId);
660
+ $oProduct->load($sProductId);
661
+ if (!empty($oProduct) && $oProduct->hasData('sku'))
662
+ {
663
+ $sProductCode = $oProduct->getSku();
664
+ $iGbRekening = $oProduct->getEboekhoudenGrootboekrekening();
665
+ $iCostcenter = $oProduct->getEboekhoudenCostcenter();
666
+ $iProductTaxClassId = $oProduct->getTaxClassId();
667
+ }
668
+ $sComment .= 'Product ' . $sProductCode;
669
+ }
670
+ }
671
+
672
+ $iGbRekening = $oAccountNumberHelper->getLedgerAccountNumber($iGbRekening,$oContainer,$oItem);
673
+ if (empty($iGbRekening))
674
+ {
675
+ $iGbRekening = 8000;
676
+ }
677
+ $iCostcenter = $oAccountNumberHelper->getCostCenterNumber($iCostcenter,$oContainer,$oItem);
678
+ if (empty($iCostcenter))
679
+ {
680
+ $iCostcenter = 0;
681
+ }
682
+
683
+ $sVatCode = $this->_Find_Ebvatcode($fVatPercent, $oOrder, $iProductTaxClassId);
684
+
685
+ if ($oContainer instanceof Mage_Sales_Model_Order_Creditmemo)
686
+ {
687
+ $sComment = 'Refund: ' . $sComment;
688
+ $fPriceIn = -1 * $fPriceIn;
689
+ $fPriceEx = -1 * $fPriceEx;
690
+ $fTaxAmount = -1 * $fTaxAmount;
691
+ }
692
+ // Leading numbers for e-Boekhouden: BEDRAGEXCL and BTWPERC
693
+ $sXml .= '
694
+ <MUTATIEREGEL>
695
+ <!-- ' . $oHelper->xmlPrepare($sComment) . ' -->
696
+ <BEDRAGINCL>' . $this->_xmlAmountPrepare($fPriceIn) . '</BEDRAGINCL>
697
+ <BEDRAGEXCL>' . $this->_xmlAmountPrepare($fPriceEx) . '</BEDRAGEXCL>
698
+ <BTWBEDRAG>' . $this->_xmlAmountPrepare($fTaxAmount) . '</BTWBEDRAG>
699
+ <BTWPERC>' . $oHelper->xmlPrepare($sVatCode) . '</BTWPERC>
700
+ <TEGENREKENING>' . $oHelper->xmlPrepare($iGbRekening) . '</TEGENREKENING>
701
+ <KOSTENPLAATS>' . $oHelper->xmlPrepare($iCostcenter) . '</KOSTENPLAATS>
702
+ </MUTATIEREGEL>';
703
+ }
704
+ return $sXml;
705
+ }
706
+
707
+ private function _xmlAmountPrepare($fValue)
708
+ {
709
+ $oHelper = Mage::helper('Eboekhouden_Export');
710
+ /* @var $oHelper Eboekhouden_Export_Helper_Data */
711
+ $fRoundVal = round(floatval($fValue), 2);
712
+ return $oHelper->xmlPrepare($fRoundVal);
713
+ }
714
+
715
+ private function _Find_CustomerTaxClassId($oOrder)
716
+ {
717
+ $iResult = false;
718
+ $iStoreId = $oOrder->getStoreId();
719
+ $iCustomerId = $oOrder->getCustomerId();
720
+ // Set default group id first
721
+ $iCustomerGroupId = Mage::getStoreConfig('customer/create_account/default_group', $iStoreId);
722
+ if (!empty($iCustomerId))
723
+ {
724
+ $oCustomer = Mage::getModel('customer/customer')->load($iCustomerId);
725
+ /* @var $oCustomer Mage_Customer_Model_Customer */
726
+ $iCustomerGroupId = $oCustomer->getGroupId();
727
+ }
728
+ $oCustomerGroup = Mage::getModel('customer/group')->load($iCustomerGroupId);
729
+ /* @var $oCustomerGroup Mage_Customer_Model_Group */
730
+ $iResult = $oCustomerGroup->getTaxClassId();
731
+ return $iResult;
732
+ }
733
+
734
+ /**
735
+ * @param Mage_Sales_Model_Order_Invoice|Mage_Sales_Model_Order_Creditmemo $oContainer
736
+ * @param Mage_Sales_Model_Order_Invoice_Item|Mage_Sales_Model_Order_Creditmemo_Item $oItem
737
+ * @return float
738
+ */
739
+ private function _getItemVatPerc($oContainer,$oItem)
740
+ {
741
+ $fVatPercent = $oItem->getTaxPercent();
742
+ if (!isset($fVatPercent))
743
+ {
744
+ // Getting Vat Perc failed, we need to calculate
745
+ $fTempTaxAmount = $oItem->getBaseTaxAmount();
746
+ $fTempPriceEx = $oItem->getBaseRowTotal();
747
+
748
+ $fDiscountAmount = $oItem->getBaseDiscountAmount();
749
+ if ( !empty($fDiscountAmount) && $this->_oTaxConfig->applyTaxAfterDiscount() )
750
+ {
751
+ $fTempPriceEx = $fTempPriceEx - $fDiscountAmount;
752
+ }
753
+
754
+ if ('shipping' == $oItem->getProductId() && empty($fTempTaxAmount))
755
+ {
756
+ $oOrder = $oContainer->getOrder();
757
+ // Magento 1.3.x is missing some shipping fields in the invoice,
758
+ // using shipping data from the order to calculate the vat perc.
759
+ $fTempTaxAmount = $oOrder->getBaseShippingTaxAmount();
760
+ $fTempPriceEx = $oOrder->getBaseShippingAmount();
761
+ }
762
+ $fVatPercent = 0;
763
+ if ( !empty($fTempPriceEx)
764
+ && is_numeric($fTempPriceEx)
765
+ && 0 != 1 * $fTempPriceEx
766
+ ) // prevent division by zero
767
+ {
768
+ $fVatPercent = 100 * $fTempTaxAmount / $fTempPriceEx;
769
+ }
770
+ }
771
+ $fVatPercent = floatval($fVatPercent);
772
+ $fVatPercent = $this->_vatPercRound($fVatPercent);
773
+ return $fVatPercent;
774
+ }
775
+
776
+ /**
777
+ * Look up the EB vat code
778
+ *
779
+ * @param string $sMagVatCode
780
+ * @param array $aVatPercToMagCode
781
+ * @param Mage_Sales_Model_Order $oOrder
782
+ * @return string
783
+ */
784
+ private function _Find_Ebvatcode($fVatPercent, $oOrder, $iProductTaxClassId)
785
+ {
786
+ $fVatPercent = $this->_vatPercRound($fVatPercent);
787
+ $sVatCode = false;
788
+ $sMagCode = false;
789
+
790
+ $iStoreId = $oOrder->getStoreId();
791
+ if (empty($iStoreId))
792
+ {
793
+ $iStoreId = 0;
794
+ }
795
+
796
+ if (empty($sVatCode) && empty($sMagCode))
797
+ {
798
+ // Try finding by percentage in the Order's Full Tax Info
799
+ $aVatPercToMagCode = array();
800
+ $aTaxInfo = $oOrder->getFullTaxInfo();
801
+ if (is_array($aTaxInfo))
802
+ {
803
+ foreach ($aTaxInfo as $aTaxRow)
804
+ {
805
+ foreach ($aTaxRow['rates'] as $aTaxRate)
806
+ {
807
+ if (!empty($aTaxRate['code']) && isset($aTaxRate['percent']))
808
+ {
809
+ $aVatPercToMagCode[$aTaxRate['percent']] = $aTaxRate['code'];
810
+ }
811
+ }
812
+ }
813
+ }
814
+ if (!empty($aVatPercToMagCode[$fVatPercent]))
815
+ {
816
+ $sMagCode = $aVatPercToMagCode[$fVatPercent];
817
+ }
818
+ }
819
+
820
+ if (empty($sVatCode) && empty($sMagCode))
821
+ {
822
+ // Try complete recalculation of tax
823
+ if (!empty($iProductTaxClassId))
824
+ {
825
+ $oStore = Mage::app()->getStore($iStoreId);
826
+ /* @var $oStore Mage_Core_Model_Store */
827
+ $iCustomerTaxClassId = $this->_Find_CustomerTaxClassId($oOrder);
828
+ $oTaxCalc = Mage::getSingleton('tax/calculation');
829
+ /* @var $oTaxCalc Mage_Tax_Model_Calculation */
830
+ $iCustomerId = $oOrder->getCustomerId();
831
+ if (!empty($iCustomerId))
832
+ {
833
+ $oCustomer = Mage::getModel('customer/customer')->load($iCustomerId);
834
+ /* @var $oCustomer Mage_Customer_Model_Customer */
835
+ if (!empty($oCustomer))
836
+ {
837
+ $oTaxCalc->setCustomer($oCustomer);
838
+ }
839
+ }
840
+ $oRequest = $oTaxCalc->getRateRequest($oOrder->getShippingAddress(), $oOrder->getBillingAddress(),
841
+ $iCustomerTaxClassId, $oStore);
842
+ /* @var $oRequest Varien_Object */
843
+ $oRequest->setProductClassId($iProductTaxClassId);
844
+ $oResourceTaxCalc = Mage::getResourceSingleton('tax/calculation');
845
+ /* @var $oResourceTaxCalc Mage_Tax_Model_Mysql4_Calculation */
846
+ if (!empty($oResourceTaxCalc) && method_exists($oResourceTaxCalc, 'getRateInfo'))
847
+ { // Mag 1.3 doesn't have getRateInfo
848
+ $rateInfo = $oResourceTaxCalc->getRateInfo($oRequest);
849
+ if (!empty($rateInfo['process'][0]['id']))
850
+ {
851
+ $sMagCode = $rateInfo['process'][0]['id'];
852
+ }
853
+ }
854
+ }
855
+ }
856
+
857
+ if (!empty($sMagCode))
858
+ {
859
+ $oRateModel = Mage::getModel('tax/calculation_rate');
860
+ /* @var $oRateModel Mage_Tax_Model_Calculation_Rate */
861
+ $oRateModel->setStoreId($iStoreId);
862
+ $oRateModel->load($sMagCode, 'code');
863
+ $sRateEbvatcode = $oRateModel->getTaxEbvatcode();
864
+ if (!empty($sRateEbvatcode))
865
+ {
866
+ $sVatCode = $sRateEbvatcode;
867
+ }
868
+ }
869
+
870
+ if (empty($sVatCode))
871
+ {
872
+ // Receiving vatcode failed, use fallback vat code choosing method
873
+ if (0 == $fVatPercent)
874
+ {
875
+ $sVatCode = 'GEEN';
876
+ }
877
+ elseif (6 == $fVatPercent)
878
+ {
879
+ $sVatCode = 'LAAG_VERK';
880
+ }
881
+ else
882
+ {
883
+ $sVatCode = 'HOOG_VERK';
884
+ }
885
+ }
886
+
887
+ return $sVatCode;
888
+ }
889
+
890
+ private function _vatPercRound($fVatPercent)
891
+ {
892
+ $aKnownRates = array(0, 6, 19); // TODO Fill this based on db data
893
+ foreach ($aKnownRates as $fKnownRate)
894
+ {
895
+ if (0.1 > abs($fVatPercent - $fKnownRate))
896
+ {
897
+ return $fKnownRate;
898
+ }
899
+ }
900
+ // http://en.wikipedia.org/wiki/Tax_rates_around_the_world
901
+ // Some countries have a vat perc with 3 digits
902
+ return round($fVatPercent, 3);
903
+ }
904
+
905
+ }
app/code/community/Eboekhouden/Export/Model/Import/Costcenter.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2012 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2012 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+
33
+ class Eboekhouden_Export_Model_Import_Costcenter extends Eboekhouden_Export_Model_Import_Ebcode
34
+ {
35
+ protected $iDefault = 0;
36
+
37
+ /**
38
+ * Import Cost center codes from e-Boekhouden.nl.
39
+ *
40
+ * @return array with ($aResult,$sErrorMsg). $aResult: key=code value=desc
41
+ */
42
+ public function importCodes()
43
+ {
44
+ $aResult = array();
45
+ $oData = $this->getCodes('LIST_KOSTENPLAATSEN');
46
+ if (!empty($oData))
47
+ {
48
+ if (!isset($oData->RESULT->KOSTENPLAATSEN))
49
+ {
50
+ $sErrorMsg = Mage::helper('Eboekhouden_Export')
51
+ ->__('Fout in van API ontvangen XML: RESULT.KOSTENPLAATSEN is niet gevonden') . "\n";
52
+ Mage::getSingleton('adminhtml/session')->addError(nl2br($sErrorMsg));
53
+ }
54
+ else
55
+ {
56
+ foreach ($oData->RESULT->KOSTENPLAATSEN->KOSTENPLAATS as $oCostCenter)
57
+ {
58
+ $iCode = intval($oCostCenter->KP_ID);
59
+ $sDesc = $iCode . ' - ' . strval($oCostCenter->OMSCHRIJVING);
60
+ $aResult[$iCode] = $sDesc;
61
+ }
62
+ }
63
+ }
64
+ return $aResult;
65
+ }
66
+
67
+ }
app/code/community/Eboekhouden/Export/Model/Import/Ebcode.php ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2012 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2012 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+
33
+ class Eboekhouden_Export_Model_Import_Ebcode
34
+ {
35
+ protected $iDefault = 0; // can be overridden in sub classes
36
+
37
+ public function importCodesForDropdown($bShowConfigIncompleteMsg = true)
38
+ {
39
+ $aResult = array();
40
+ $aCodes = $this->importCodes($bShowConfigIncompleteMsg);
41
+ if (!is_array($aCodes))
42
+ {
43
+ $aCodes = array();
44
+ }
45
+ $aDefaultOption = array();
46
+ $aDefaultOption['value'] = $this->iDefault;
47
+ if (!empty($aCodes[$aDefaultOption['value']]))
48
+ {
49
+ $aDefaultOption['label'] = $aCodes[$aDefaultOption['value']];
50
+ }
51
+ else
52
+ {
53
+ $aDefaultOption['label'] = $aDefaultOption['value'] . ' -';
54
+ }
55
+ $aDefaultOption['label'] .= ' ' . Mage::helper('Eboekhouden_Export')->__('(standaard)');
56
+ $aResult[] = $aDefaultOption;
57
+
58
+ if (is_array($aCodes))
59
+ {
60
+ foreach ($aCodes as $sKey => $sValue)
61
+ {
62
+ $aOption = array();
63
+ $aOption['value'] = trim($sKey);
64
+ $aOption['label'] = $sValue;
65
+ $aResult[] = $aOption;
66
+ }
67
+ }
68
+ return $aResult;
69
+ }
70
+
71
+ function getCodes($sAction)
72
+ {
73
+ $oResult = false;
74
+ if ( Mage::app()->getStore()->isAdmin() ) // Protection against unnecessary loading in frontend
75
+ {
76
+ $sErrorMsg = '';
77
+ $sInfoMsg = '';
78
+
79
+ $oClient = new Zend_Http_Client();
80
+ $oClient->setUri('https://secure.e-boekhouden.nl/bh/api.asp');
81
+
82
+ $oHelper = Mage::helper('Eboekhouden_Export');
83
+ /* @var $oHelper Eboekhouden_Export_Helper_Data */
84
+ $aSettings = $oHelper->getConnectorSettings();
85
+
86
+ if (!empty($aSettings['bConOK']))
87
+ {
88
+ $sXml = '<?xml version="1.0"?>' . "\n";
89
+ $sXml .= '
90
+ <API>
91
+ <ACTION>' . $oHelper->xmlPrepare($sAction) . '</ACTION>
92
+ <VERSION>1.0</VERSION>
93
+ <SOURCE>Magento</SOURCE>
94
+ <AUTH>
95
+ <GEBRUIKERSNAAM>' . $oHelper->xmlPrepare($aSettings['sConUser']) . '</GEBRUIKERSNAAM>
96
+ <WACHTWOORD>' . $oHelper->xmlPrepare($aSettings['sConWord']) . '</WACHTWOORD>
97
+ <GUID>' . $oHelper->xmlPrepare($aSettings['sConGuid']) . '</GUID>
98
+ </AUTH>
99
+ </API>';
100
+
101
+ if (Mage::getStoreConfig('eboekhouden/settings/showxml'))
102
+ {
103
+ $sInfoMsg .= 'posted xml:<BR>' . "\n";
104
+ $sInfoMsg .= '<xmp style="font-weight:normal">';
105
+ $sInfoMsg .= $sXml . "\n";
106
+ $sInfoMsg .= '</xmp><BR>' . "\n";
107
+ }
108
+
109
+ $oClient->setParameterPost('xml', $sXml);
110
+ $oResponse = $oClient->request('POST');
111
+
112
+ if ($oResponse->isError())
113
+ {
114
+ $sErrorMsg .= Mage::helper('Eboekhouden_Export')
115
+ ->__('HTTP fout %s ontvangen van API: %s', $oResponse->getStatus(),
116
+ $oResponse->getMessage()) . "\n";
117
+ }
118
+ else
119
+ {
120
+ $sResponse = $oResponse->getBody();
121
+
122
+ if (empty($sResponse))
123
+ {
124
+ $sErrorMsg .= Mage::helper('Eboekhouden_Export')->__('Fout: Leeg antwoord ontvangen van API') . "\n";
125
+ }
126
+ else
127
+ {
128
+ if (Mage::getStoreConfig('eboekhouden/settings/showxml'))
129
+ {
130
+ $sInfoMsg .= 'response xml:<BR>' . "\n";
131
+ $sInfoMsg .= '<xmp style="font-weight:normal">';
132
+ $sInfoMsg .= $sResponse . "\n";
133
+ $sInfoMsg .= '</xmp><BR>' . "\n";
134
+ }
135
+
136
+ $oResult = @simplexml_load_string($sResponse);
137
+ if (empty($oResult))
138
+ {
139
+ $oResult = false;
140
+ $sShowResponse = htmlspecialchars(strip_tags($sResponse));
141
+ $sShowResponse = preg_replace('#\s*\n#', "\n", $sShowResponse);
142
+ $sErrorMsg .= Mage::helper('Eboekhouden_Export')
143
+ ->__('Fout in van API ontvangen XML: parsen mislukt') . "\n" . $sShowResponse . "\n";
144
+ }
145
+ }
146
+ }
147
+
148
+ if ($sInfoMsg)
149
+ {
150
+ Mage::getSingleton('core/session')->addNotice($sInfoMsg);
151
+ }
152
+ if ($sErrorMsg)
153
+ {
154
+ Mage::getSingleton('core/session')->addError(nl2br($sErrorMsg));
155
+ }
156
+ } // if connection ok
157
+ } // if isAdmin
158
+ return $oResult;
159
+ }
160
+
161
+ }
app/code/community/Eboekhouden/Export/Model/Import/Gbcodes.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2012 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2012 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+
33
+ class Eboekhouden_Export_Model_Import_Gbcodes extends Eboekhouden_Export_Model_Import_Ebcode
34
+ {
35
+ protected $iDefault = 8000;
36
+
37
+ /**
38
+ * Import Grootboek rekening codes from e-Boekhouden.nl.
39
+ *
40
+ * @return array with ($aResult,$sErrorMsg). $aResult: key=code value=desc
41
+ */
42
+ public function importCodes()
43
+ {
44
+ $aResult = array();
45
+ $oData = $this->getCodes('LIST_GBCODE');
46
+ if (!empty($oData))
47
+ {
48
+ if (!isset($oData->RESULT->GBCODES))
49
+ {
50
+ $sErrorMsg = Mage::helper('Eboekhouden_Export')
51
+ ->__('Fout in van API ontvangen XML: RESULT.GBCODES is niet gevonden') . "\n";
52
+ Mage::getSingleton('adminhtml/session')->addError(nl2br($sErrorMsg));
53
+ }
54
+ else
55
+ {
56
+ foreach ($oData->RESULT->GBCODES->GBCODE as $oGbCode)
57
+ {
58
+ $iCode = intval($oGbCode->CODE);
59
+ $sDesc = $iCode . ' - ' . strval($oGbCode->OMSCHRIJVING);
60
+ $aResult[$iCode] = $sDesc;
61
+ }
62
+ }
63
+ }
64
+ return $aResult;
65
+ }
66
+
67
+ }
app/code/community/Eboekhouden/Export/Model/Info.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2012 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2012 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+ class Eboekhouden_Export_Model_Info
33
+ {
34
+
35
+ static function getExtensionVersion()
36
+ {
37
+ $oConfig = Eboekhouden_Export_Model_Info::getXmlConfigObj('config.xml');
38
+ $sResult = $oConfig->modules->Eboekhouden_Export->version;
39
+ return $sResult;
40
+ }
41
+
42
+ static function getXmlConfigObj($sConfigFile)
43
+ {
44
+ if (false === strpos($sConfigFile, '/'))
45
+ {
46
+ $sConfigFile = dirname(__FILE__) . '/../etc/' . $sConfigFile;
47
+ }
48
+ $oResult = simplexml_load_file($sConfigFile);
49
+ return $oResult;
50
+ }
51
+
52
+ }
app/code/community/Eboekhouden/Export/Model/Product/Attribute/Costcenter.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Eboekhouden_Export_Model_Product_Attribute_Costcenter extends Mage_Eav_Model_Entity_Attribute_Source_Abstract
4
+ {
5
+ /**
6
+ * Retrieve All options
7
+ *
8
+ * @return array
9
+ */
10
+ public function getAllOptions()
11
+ {
12
+ $aResult = array();
13
+ if ( Mage::app()->getStore()->isAdmin() ) // Protection against unnecessary loading in frontend
14
+ {
15
+ if (!$this->_options)
16
+ {
17
+ $oImportModel = Mage::getModel('Eboekhouden_Export/import_costcenter');
18
+ /* @var $oImportModel Eboekhouden_Export_Model_Import_Costcenter */
19
+ $this->_options = $oImportModel->importCodesForDropdown();
20
+ }
21
+ $aResult = $this->_options;
22
+ }
23
+ return $aResult;
24
+ }
25
+
26
+ }
app/code/community/Eboekhouden/Export/Model/Product/Attribute/Ledgeraccount.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Eboekhouden_Export_Model_Product_Attribute_Ledgeraccount extends Mage_Eav_Model_Entity_Attribute_Source_Abstract
4
+ {
5
+ /**
6
+ * Retrieve All options
7
+ *
8
+ * @return array
9
+ */
10
+ public function getAllOptions()
11
+ {
12
+ $aResult = array();
13
+ if ( Mage::app()->getStore()->isAdmin() ) // Protection against unnecessary loading in frontend
14
+ {
15
+ if (!$this->_options)
16
+ {
17
+ $oImportModel = Mage::getModel('Eboekhouden_Export/import_gbcodes');
18
+ /* @var $oImportModel Eboekhouden_Export_Model_Import_Gbcodes */
19
+ $this->_options = $oImportModel->importCodesForDropdown();
20
+ }
21
+ $aResult = $this->_options;
22
+ }
23
+ return $aResult;
24
+ }
25
+
26
+ }
app/code/community/Eboekhouden/Export/Model/Tax/Attribute/Ebtaxcode.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Eboekhouden_Export_Model_Tax_Attribute_Ebtaxcode extends Mage_Eav_Model_Entity_Attribute_Source_Abstract
4
+ {
5
+ public function getOptionArray()
6
+ {
7
+ $aOptions = array();
8
+ $aOptions['HOOG_VERK'] = 'BTW Hoog 19%';
9
+ $aOptions['LAAG_VERK'] = 'BTW Laag 6%';
10
+ $aOptions['VERL_VERK'] = 'BTW Verlegd';
11
+ $aOptions['BU_EU_VERK'] = 'Levering naar buiten de EU 0%';
12
+ $aOptions['BI_EU_VERK'] = 'Goederen naar binnen de EU 0%';
13
+ //$aOptions['BI_EU_VERK_D'] = 'Diensten naar binnen de EU 0%';
14
+ $aOptions['AFST_VERK'] = 'Afstandsverkopen binnen EU 0%';
15
+ $aOptions['GEEN'] = 'Geen BTW van toepassing';
16
+ return $aOptions;
17
+ }
18
+
19
+ /**
20
+ * Retrieve All options
21
+ *
22
+ * @return array
23
+ */
24
+ public function getAllOptions()
25
+ {
26
+ if (!$this->_options)
27
+ {
28
+ $aOptions = $this->getOptionArray();
29
+
30
+ $this->_options = array();
31
+ foreach ($aOptions as $sKey => $sValue)
32
+ {
33
+ $aOption = array();
34
+ $aOption['value'] = $sKey;
35
+ $aOption['label'] = $sValue; # . ' ---- '.$sKey;
36
+ $this->_options[] = $aOption;
37
+ }
38
+ }
39
+ return $this->_options;
40
+ }
41
+
42
+ }
43
+
44
+ ?>
app/code/community/Eboekhouden/Export/controllers/Catalog/ProductController.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2012 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2012 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+ require_once 'Mage/Adminhtml/controllers/Catalog/ProductController.php';
33
+
34
+ class Eboekhouden_Export_Catalog_ProductController extends Mage_Adminhtml_Catalog_ProductController
35
+ {
36
+
37
+ public function eboekhoudenAction()
38
+ {
39
+ $this->_initProduct();
40
+ $oBlock = $this->getLayout()->createBlock('Eboekhouden_Export/catalog_product_edit_tab_eboekhouden');
41
+ $oBlock->setData('aGbcodes', $this->getGbcodes());
42
+ $this->_outputBlocks($oBlock);
43
+ }
44
+
45
+ public function eboekhoudenattributeAction()
46
+ {
47
+ $this->_initProduct();
48
+ $oBlock = $this->getLayout()->createBlock('Eboekhouden_Export/catalog_product_edit_action_attribute_tab_eboekhouden');
49
+ $oBlock->setData('aGbcodes', $this->getGbcodes());
50
+ $this->_outputBlocks($oBlock);
51
+ }
52
+
53
+ protected function getGbcodes()
54
+ {
55
+ $oImportModel = Mage::getModel('Eboekhouden_Export/import_gbcodes');
56
+ list($aGbcodes, $sErrorMsg) = $oImportModel->importGbcodes();
57
+ if (!empty($sErrorMsg))
58
+ {
59
+ $this->_getSession()->addError(nl2br($sErrorMsg));
60
+ }
61
+ return $aGbcodes;
62
+ }
63
+
64
+ }
65
+
66
+ ?>
app/code/community/Eboekhouden/Export/controllers/Export/SaleController.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2012 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2012 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+ class Eboekhouden_Export_Export_SaleController extends Mage_Adminhtml_Controller_Action
33
+ {
34
+
35
+ public function orderExportAction()
36
+ {
37
+ $aOrderIds = $this->getRequest()->getPost('order_ids', array());
38
+ $oExportModel = Mage::getModel('Eboekhouden_Export/export_sales');
39
+ /* @var $oExportModel Eboekhouden_Export_Model_Export_Sales */
40
+ list($iAdded, $iExist, $sErrorMsg, $sInfoMsg) = $oExportModel->exportOrders($aOrderIds);
41
+ $this->_reportExportResult($iAdded, $iExist, $sErrorMsg, $sInfoMsg);
42
+ if (0 == $iAdded)
43
+ {
44
+ $this->_getSession()->addSuccess(Mage::helper('Eboekhouden_Export')
45
+ ->__('Alleen bestellingen waar een factuur van gemaakt is worden doorgegeven aan e-Boekhouden.nl.<br />'));
46
+ }
47
+ $this->_redirectReferer();
48
+ }
49
+
50
+ public function invoiceExportAction()
51
+ {
52
+ $aInvoiceIds = $this->getRequest()->getPost('invoice_ids', array());
53
+ $oExportModel = Mage::getModel('Eboekhouden_Export/export_sales');
54
+ /* @var $oExportModel Eboekhouden_Export_Model_Export_Sales */
55
+ list($iAdded, $iExist, $sErrorMsg, $sInfoMsg) = $oExportModel->exportInvoices($aInvoiceIds);
56
+ $this->_reportExportResult($iAdded, $iExist, $sErrorMsg, $sInfoMsg);
57
+ $this->_redirectReferer();
58
+ }
59
+
60
+ public function creditmemoExportAction()
61
+ {
62
+ $aCreditmemoIds = $this->getRequest()->getPost('creditmemo_ids', array());
63
+ $oExportModel = Mage::getModel('Eboekhouden_Export/export_sales');
64
+ /* @var $oExportModel Eboekhouden_Export_Model_Export_Sales */
65
+ list($iAdded, $iExist, $sErrorMsg, $sInfoMsg) = $oExportModel->exportCreditmemos($aCreditmemoIds);
66
+ $this->_reportExportResult($iAdded, $iExist, $sErrorMsg, $sInfoMsg);
67
+ $this->_redirectReferer();
68
+ }
69
+
70
+ protected function _reportExportResult($iOrdersAdded, $iOrdersExist, $sErrorMsg, $sInfoMsg)
71
+ {
72
+ if (!empty($sInfoMsg))
73
+ {
74
+ $this->_getSession()->addNotice($sInfoMsg);
75
+ }
76
+
77
+ $iOrdersTransferred = $iOrdersAdded + $iOrdersExist;
78
+
79
+ $sMessage = '<b>' . Mage::helper('Eboekhouden_Export')->__('Export naar e-Boekhouden') . '</b><br /><br />' . "\n";
80
+ if (1 == $iOrdersTransferred)
81
+ {
82
+ $sMessage .= Mage::helper('Eboekhouden_Export')->__('1 mutatie doorgegeven');
83
+ }
84
+ else
85
+ {
86
+ $sMessage .= Mage::helper('Eboekhouden_Export')->__('%s mutaties doorgegeven', $iOrdersTransferred);
87
+ }
88
+ if (1 == $iOrdersExist)
89
+ {
90
+ $sMessage .= Mage::helper('Eboekhouden_Export')->__(', waarvan er 1 al bestond');
91
+ }
92
+ elseif (1 < $iOrdersExist)
93
+ {
94
+ $sMessage .= Mage::helper('Eboekhouden_Export')->__(', waarvan er %s al bestonden', $iOrdersExist);
95
+ }
96
+ $sMessage .= '.<br />' . "\n";
97
+
98
+ if (empty($sErrorMsg))
99
+ {
100
+ $this->_getSession()->addSuccess($sMessage);
101
+ }
102
+ else
103
+ {
104
+ $sMessage .= '<br />' . "\n";
105
+ $sMessage .= nl2br($sErrorMsg) . "\n";
106
+ $this->_getSession()->addError($sMessage);
107
+ }
108
+ $this->_redirectReferer();
109
+ }
110
+
111
+ }
112
+
113
+ ?>
app/code/community/Eboekhouden/Export/controllers/MutatieController.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // index.php/eboekhouden/mutatie/reset_all/key/XXXXXXXXXX/
4
+ class Eboekhouden_Export_MutatieController extends Mage_Adminhtml_Controller_Action
5
+ {
6
+ public function indexAction()
7
+ {
8
+ $oSession = Mage::getSingleton('core/session');
9
+ /* @var $oSession Mage_Core_Model_Session */
10
+ $oSession->addNotice(Mage::helper('Eboekhouden_Export')->__('Ongeldige actie.'));
11
+ $this->_redirect('adminhtml/index');
12
+ }
13
+
14
+ public function reset_allAction()
15
+ {
16
+ $oSession = Mage::getSingleton('core/session');
17
+ /* @var $oSession Mage_Core_Model_Session */
18
+
19
+ $oCoreResource = Mage::getSingleton('core/resource');
20
+ /* @var $oCoreResource Mage_Core_Model_Resource */
21
+ $oConnection = $oCoreResource->getConnection('core_write');
22
+ /* @var $oConnection Varien_Db_Adapter_Pdo_Mysql */
23
+
24
+ $iUpdated = 0;
25
+
26
+ $aDbTables = $oConnection->listTables();
27
+ $aQueries = array();
28
+
29
+ # Magento 1.4.x + 1.5.x
30
+ $aQueries['sales_flat_invoice']['eboekhouden_mutatie'] = 'UPDATE `'.$oCoreResource->getTableName('sales_flat_invoice').'` SET `eboekhouden_mutatie`=NULL';
31
+ $aQueries['sales_flat_invoice_grid']['eboekhouden_mutatie'] = 'UPDATE `'.$oCoreResource->getTableName('sales_flat_invoice_grid').'` SET `eboekhouden_mutatie`=NULL';
32
+ $aQueries['sales_flat_creditmemo']['eboekhouden_mutatie'] = 'UPDATE `'.$oCoreResource->getTableName('sales_flat_creditmemo').'` SET `eboekhouden_mutatie`=NULL';
33
+ $aQueries['sales_flat_creditmemo_grid']['eboekhouden_mutatie'] = 'UPDATE `'.$oCoreResource->getTableName('sales_flat_creditmemo_grid').'` SET `eboekhouden_mutatie`=NULL';
34
+ # Magento 1.3.x
35
+ $aQueries['sales_order_entity_int']['attribute_id'] = 'DELETE FROM `'.$oCoreResource->getTableName('sales_order_entity_int').'` WHERE `attribute_id` IN (SELECT `attribute_id` FROM `'.$oCoreResource->getTableName('eav_attribute').'` WHERE `attribute_code` = "eboekhouden_mutatie")';
36
+
37
+ foreach ($aQueries as $sTable => $aFields)
38
+ {
39
+ if (in_array($sTable, $aDbTables))
40
+ {
41
+ foreach ($aFields as $sField => $sSQL)
42
+ {
43
+ if ($oConnection->tableColumnExists($sTable, $sField))
44
+ {
45
+ $oResult = $oConnection->query($sSQL);
46
+ /* @var $oResult Zend_Db_Statement_Pdo */
47
+ $iUpdated += $oResult->rowCount();
48
+ }
49
+ }
50
+ }
51
+ }
52
+
53
+ $oSession->addNotice(Mage::helper('Eboekhouden_Export')
54
+ ->__('Alle mutatie nummers zijn gereset, %d rijen aangepast.', $iUpdated));
55
+
56
+ $this->_redirect('adminhtml/sales_invoice/index');
57
+ }
58
+ }
app/code/community/Eboekhouden/Export/etc/config.xml ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * The MIT License
7
+ *
8
+ * Copyright (c) 2012 e-Boekhouden.nl
9
+ *
10
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ * of this software and associated documentation files (the "Software"), to deal
12
+ * in the Software without restriction, including without limitation the rights
13
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ * copies of the Software, and to permit persons to whom the Software is
15
+ * furnished to do so, subject to the following conditions:
16
+ *
17
+ * The above copyright notice and this permission notice shall be included in
18
+ * all copies or substantial portions of the Software.
19
+ *
20
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26
+ * THE SOFTWARE.
27
+ *
28
+ * @package Eboekhouden_Export
29
+ * @copyright Copyright (c) 2012 e-Boekhouden.nl
30
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
31
+ */
32
+ -->
33
+ <config>
34
+
35
+ <modules>
36
+ <Eboekhouden_Export>
37
+ <version>4.0</version>
38
+ </Eboekhouden_Export>
39
+ </modules>
40
+
41
+ <global>
42
+
43
+ <models>
44
+ <Eboekhouden_Export>
45
+ <class>Eboekhouden_Export_Model</class>
46
+ </Eboekhouden_Export>
47
+ <!--<eboekhouden>-->
48
+ <!--&lt;!&ndash; deprecated, needed for older installations. (resource < 4.0) &ndash;&gt;-->
49
+ <!--<class>Eboekhouden_Export_Model</class>-->
50
+ <!--</eboekhouden>-->
51
+ </models>
52
+
53
+ <helpers>
54
+ <Eboekhouden_Export>
55
+ <class>Eboekhouden_Export_Helper</class>
56
+ </Eboekhouden_Export>
57
+ </helpers>
58
+
59
+ <blocks>
60
+ <Eboekhouden_Export>
61
+ <class>Eboekhouden_Export_Block</class>
62
+ </Eboekhouden_Export>
63
+ <!--<eboekhouden>-->
64
+ <!--&lt;!&ndash; deprecated, needed for older installations (resource < 4.0) &ndash;&gt;-->
65
+ <!--<class>Eboekhouden_Export_Block</class>-->
66
+ <!--</eboekhouden>-->
67
+ <adminhtml>
68
+ <rewrite>
69
+ <sales_order_grid>Eboekhouden_Export_Block_Sales_Order_Grid</sales_order_grid>
70
+ <sales_invoice_grid>Eboekhouden_Export_Block_Sales_Invoice_Grid</sales_invoice_grid>
71
+ <sales_creditmemo_grid>Eboekhouden_Export_Block_Sales_Creditmemo_Grid</sales_creditmemo_grid>
72
+ <tax_rate_grid>Eboekhouden_Export_Block_Tax_Rate_Grid</tax_rate_grid>
73
+ <tax_rate_form>Eboekhouden_Export_Block_Tax_Rate_Form</tax_rate_form>
74
+ </rewrite>
75
+ </adminhtml>
76
+ </blocks>
77
+
78
+ <resources>
79
+ <eboekhouden_setup>
80
+ <setup>
81
+ <module>Eboekhouden_Export</module>
82
+ </setup>
83
+ <connection>
84
+ <use>core_setup</use>
85
+ </connection>
86
+ </eboekhouden_setup>
87
+
88
+ <eboekhouden_write>
89
+ <connection>
90
+ <use>core_write</use>
91
+ </connection>
92
+ </eboekhouden_write>
93
+ <eboekhouden_read>
94
+ <connection>
95
+ <use>core_read</use>
96
+ </connection>
97
+ </eboekhouden_read>
98
+ </resources>
99
+
100
+ </global>
101
+
102
+ <admin>
103
+ <routers>
104
+ <Eboekhouden_Export>
105
+ <use>admin</use>
106
+ <args>
107
+ <module>Eboekhouden_Export</module>
108
+ <frontName>eboekhouden</frontName>
109
+ </args>
110
+ </Eboekhouden_Export>
111
+ </routers>
112
+ </admin>
113
+
114
+ <adminhtml>
115
+ <menu>
116
+ <system>
117
+ <children>
118
+ <attributes translate="title" module="Eboekhouden_Export">
119
+ <title>e-Boekhouden.nl</title>
120
+ <sort_order>90</sort_order>
121
+ <children>
122
+ <eboekhouden_reset_mutatie_nummers translate="title" module="Eboekhouden_Export">
123
+ <title>Reset alle mutatie nummers</title>
124
+ <action>eboekhouden/mutatie/reset_all</action>
125
+ <sort_order>10</sort_order>
126
+ </eboekhouden_reset_mutatie_nummers>
127
+ <eboekhouden_config translate="title" module="Eboekhouden_Export">
128
+ <title>Configuratie</title>
129
+ <sort_order>100</sort_order>
130
+ <action>adminhtml/system_config/edit/section/eboekhouden</action>
131
+ </eboekhouden_config>
132
+ </children>
133
+ </attributes>
134
+ </children>
135
+ </system>
136
+ </menu>
137
+ <translate>
138
+ <modules>
139
+ <Eboekhouden_Export>
140
+ <files>
141
+ <default>Eboekhouden_Export.csv</default>
142
+ </files>
143
+ </Eboekhouden_Export>
144
+ </modules>
145
+ </translate>
146
+ <acl>
147
+ <resources>
148
+ <admin>
149
+ <children>
150
+ <system>
151
+ <children>
152
+ <config>
153
+ <children>
154
+ <eboekhouden translate="title" module="Eboekhouden_Export">
155
+ <title>e-Boekhouden.nl Instellingen</title>
156
+ </eboekhouden>
157
+ </children>
158
+ </config>
159
+ </children>
160
+ </system>
161
+ </children>
162
+ </admin>
163
+ </resources>
164
+ </acl>
165
+ </adminhtml>
166
+
167
+ <default>
168
+ <eboekhouden>
169
+ <settings>
170
+ <showxml>0</showxml>
171
+ <shippingledgeraccount>8000</shippingledgeraccount>
172
+ </settings>
173
+ <vatcodes>
174
+ <vatcode_HOOG_VERK>=NOT-USED=</vatcode_HOOG_VERK>
175
+ <vatcode_LAAG_VERK>=NOT-USED=</vatcode_LAAG_VERK>
176
+ <vatcode_GEEN>=NOT-USED=</vatcode_GEEN>
177
+ </vatcodes>
178
+ </eboekhouden>
179
+ </default>
180
+
181
+ </config>
app/code/community/Eboekhouden/Export/etc/system.xml ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * The MIT License
7
+ *
8
+ * Copyright (c) 2012 e-Boekhouden.nl
9
+ *
10
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ * of this software and associated documentation files (the "Software"), to deal
12
+ * in the Software without restriction, including without limitation the rights
13
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ * copies of the Software, and to permit persons to whom the Software is
15
+ * furnished to do so, subject to the following conditions:
16
+ *
17
+ * The above copyright notice and this permission notice shall be included in
18
+ * all copies or substantial portions of the Software.
19
+ *
20
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26
+ * THE SOFTWARE.
27
+ *
28
+ * @package Eboekhouden_Export
29
+ * @copyright Copyright (c) 2012 e-Boekhouden.nl
30
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
31
+ */
32
+ -->
33
+ <config>
34
+ <sections>
35
+ <eboekhouden module="Eboekhouden_Export">
36
+ <label>e-Boekhouden.nl</label>
37
+ <tab>sales</tab>
38
+ <frontend_type>text</frontend_type>
39
+ <sort_order>995</sort_order>
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
+ <groups>
44
+ <connector translate="label comment" module="Eboekhouden_Export">
45
+ <label>Connector logingegevens</label>
46
+ <comment>
47
+ <![CDATA[U vindt deze gegevens in e-Boekhouden.nl onder Beheer &gt; Instellingen &gt; Magento<br />&nbsp;]]></comment>
48
+ <sort_order>100</sort_order>
49
+ <show_in_default>1</show_in_default>
50
+ <show_in_website>1</show_in_website>
51
+ <show_in_store>1</show_in_store>
52
+ <fields>
53
+ <username translate="label">
54
+ <sort_order>110</sort_order>
55
+ <label>Gebruikersnaam</label>
56
+ <frontend_type>text</frontend_type>
57
+ <show_in_default>1</show_in_default>
58
+ <show_in_website>1</show_in_website>
59
+ <show_in_store>1</show_in_store>
60
+ </username>
61
+ <securitycode1 translate="label">
62
+ <sort_order>120</sort_order>
63
+ <label>Beveiligingscode 1</label>
64
+ <frontend_type>text</frontend_type>
65
+ <show_in_default>1</show_in_default>
66
+ <show_in_website>1</show_in_website>
67
+ <show_in_store>1</show_in_store>
68
+ </securitycode1>
69
+ <securitycode2 translate="label">
70
+ <sort_order>130</sort_order>
71
+ <label>Beveiligingscode 2</label>
72
+ <frontend_type>text</frontend_type>
73
+ <show_in_default>1</show_in_default>
74
+ <show_in_website>1</show_in_website>
75
+ <show_in_store>1</show_in_store>
76
+ </securitycode2>
77
+ </fields>
78
+ </connector>
79
+ <settings translate="label" module="Eboekhouden_Export">
80
+ <label>Instellingen</label>
81
+ <sort_order>200</sort_order>
82
+ <show_in_default>1</show_in_default>
83
+ <show_in_website>1</show_in_website>
84
+ <show_in_store>1</show_in_store>
85
+ <fields>
86
+ <showxml translate="label">
87
+ <sort_order>220</sort_order>
88
+ <label>Toon XML (voor ontwikkelaars)</label>
89
+ <frontend_type>select</frontend_type>
90
+ <source_model>adminhtml/system_config_source_yesno</source_model>
91
+ <show_in_default>1</show_in_default>
92
+ <show_in_website>1</show_in_website>
93
+ <show_in_store>1</show_in_store>
94
+ </showxml>
95
+ <shippingledgeraccount translate="label">
96
+ <sort_order>230</sort_order>
97
+ <label>Grootboekrek. voor verzendkosten</label>
98
+ <frontend_type>select</frontend_type>
99
+ <source_model>Eboekhouden_Export/config_ledgeraccount</source_model>
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
+ </shippingledgeraccount>
104
+ <shippingcostcenter translate="label">
105
+ <sort_order>240</sort_order>
106
+ <label>Kostenplaats voor verzendkosten</label>
107
+ <frontend_type>select</frontend_type>
108
+ <source_model>Eboekhouden_Export/config_costcenter</source_model>
109
+ <show_in_default>1</show_in_default>
110
+ <show_in_website>1</show_in_website>
111
+ <show_in_store>1</show_in_store>
112
+ </shippingcostcenter>
113
+ </fields>
114
+ </settings>
115
+ </groups>
116
+ </eboekhouden>
117
+ </sections>
118
+ </config>
app/code/community/Eboekhouden/Export/sql/HOWTO_UnInstall.sql ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ###
2
+ ### To undo the installation of the e-Boekhouden.nl extension for Magento:
3
+ ###
4
+ ### First uninstall the extension using the Magento Connect Manager.
5
+ ###
6
+ ### If that doesn't work, remove via SSH or FTP:
7
+ ### - the file: [magento_root]/app/etc/modules/Eboekhouden_Export.xml
8
+ ### - the dir with contents: [magento_root]/app/code/community/Eboekhouden
9
+ ###
10
+ ###
11
+ ### These are the SQL statements to undo the installation of the e-Boekhouden.nl extension for Magento.
12
+ ### The statements are based on the default table names.
13
+ ### If you use a prefix, or if you upgraded from an old Magento version, you may need to change the table names.
14
+ ###
15
+ ### Magento 1.4.x and higher:
16
+ ###
17
+ DELETE FROM `catalog_eav_attribute` WHERE `attribute_id` IN (SELECT `attribute_id` FROM `eav_attribute` WHERE `attribute_code` LIKE 'eboekhouden_%');
18
+ DELETE FROM `eav_entity_attribute` WHERE `attribute_id` IN (SELECT `attribute_id` FROM `eav_attribute` WHERE `attribute_code` LIKE 'eboekhouden_%');
19
+ DELETE FROM `eav_attribute` WHERE `attribute_code` LIKE 'eboekhouden_%';
20
+ DELETE FROM `eav_attribute_group` WHERE `attribute_group_name` = 'e-Boekhouden.nl';
21
+ DELETE FROM `core_resource` WHERE `code` LIKE 'eboekhouden_%';
22
+ DELETE FROM `core_config_data` WHERE `path` LIKE 'eboekhouden/%';
23
+ ALTER TABLE `sales_flat_invoice` DROP `eboekhouden_mutatie`;
24
+ ALTER TABLE `sales_flat_invoice_grid` DROP `eboekhouden_mutatie`;
25
+ ALTER TABLE `sales_flat_creditmemo` DROP `eboekhouden_mutatie`;
26
+ ALTER TABLE `sales_flat_creditmemo_grid` DROP `eboekhouden_mutatie`;
27
+ ALTER TABLE `tax_calculation_rate` DROP `tax_ebvatcode`;
28
+ ###
29
+ ### Magento 1.3.x:
30
+ ###
31
+ DELETE FROM `sales_order_int` WHERE `attribute_id` IN (SELECT `attribute_id` FROM `eav_attribute` WHERE `attribute_code` LIKE 'eboekhouden_%');
32
+ DELETE FROM `sales_order_entity_int` WHERE `attribute_id` IN (SELECT `attribute_id` FROM `eav_attribute` WHERE `attribute_code` LIKE 'eboekhouden_%');
33
+ DELETE FROM `catalog_product_entity_int` WHERE `attribute_id` IN (SELECT `attribute_id` FROM `eav_attribute` WHERE `attribute_code` LIKE 'eboekhouden_%');
34
+ DELETE FROM `eav_entity_attribute` WHERE `attribute_id` IN (SELECT `attribute_id` FROM `eav_attribute` WHERE `attribute_code` LIKE 'eboekhouden_%');
35
+ DELETE FROM `eav_attribute` WHERE `attribute_code` LIKE 'eboekhouden_%';
36
+ DELETE FROM `eav_attribute_group` WHERE `attribute_group_name` = 'e-Boekhouden.nl';
37
+ DELETE FROM `core_resource` WHERE `code` LIKE 'eboekhouden_%';
38
+ DELETE FROM `core_config_data` WHERE `path` LIKE 'eboekhouden/%';
39
+ ###
40
+ ### Now you need to flush the Magento cache.
41
+ ###
app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/includes/install-current.php ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2012 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2012 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+
33
+ $oInstaller = $this;
34
+ /* @var $oInstaller Mage_Core_Model_Resource_Setup */
35
+ $oCoreSetup = new Mage_Eav_Model_Entity_Setup('core_setup');
36
+ $oSalesSetup = new Mage_Sales_Model_Mysql4_Setup('sales_setup');
37
+ $oSession = Mage::getSingleton('core/session');
38
+ /* @var $oSession Mage_Core_Model_Session */
39
+ $oCoreResource = Mage::getSingleton('core/resource');
40
+ /* @var $oCoreResource Mage_Core_Model_Resource */
41
+
42
+ $iStoreId = 0;
43
+
44
+ $oInstaller->startSetup();
45
+
46
+ $oConnection = $oInstaller->getConnection(); /* @var $oConnection Varien_Db_Adapter_Pdo_Mysql */
47
+
48
+ $aProductGbrekSet = array('group' => 'e-Boekhouden.nl'
49
+ , 'label' => 'Grootboekrek. e-Boekhouden.nl'
50
+ , 'position' => 9990
51
+ , 'sort_order' => 9990
52
+ , 'type' => 'int'
53
+ , 'input' => 'select'
54
+ , 'default' => 8000
55
+ , 'source' => 'Eboekhouden_Export/product_attribute_ledgeraccount'
56
+ , 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE
57
+ , 'searchable' => true
58
+ , 'filterable' => true
59
+ );
60
+ $oCoreSetup->addAttribute('catalog_product', 'eboekhouden_grootboekrekening', $aProductGbrekSet);
61
+ $aProductCostCenterSet = array('group' => 'e-Boekhouden.nl'
62
+ , 'label' => 'Kostenplaats e-Boekhouden.nl'
63
+ , 'position' => 9995
64
+ , 'sort_order' => 9995
65
+ , 'type' => 'int'
66
+ , 'input' => 'select'
67
+ , 'default' => 0
68
+ , 'source' => 'Eboekhouden_Export/product_attribute_costcenter'
69
+ , 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE
70
+ , 'searchable' => true
71
+ , 'filterable' => true
72
+ );
73
+ $oCoreSetup->addAttribute('catalog_product', 'eboekhouden_costcenter', $aProductCostCenterSet);
74
+
75
+ $aOrderInvoiceSet = array('label' => 'Mutatie e-Boekhouden.nl'
76
+ , 'position' => 9999
77
+ , 'sort_order' => 9999
78
+ , 'type' => 'int'
79
+ , 'input' => 'text'
80
+ , 'default' => null
81
+ , 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE
82
+ , 'searchable' => true
83
+ , 'filterable' => true
84
+ , 'grid' => true
85
+ );
86
+ $oSalesSetup->addAttribute('invoice', 'eboekhouden_mutatie', $aOrderInvoiceSet);
87
+ $oSalesSetup->addAttribute('creditmemo', 'eboekhouden_mutatie', $aOrderInvoiceSet);
88
+
89
+ ### Clean up order attribute 'eboekhouden_grootboekrekening' from previous version of this module to prevent errors
90
+ $oEntitySelect = $oConnection->select('entity_type_id')->from($oCoreResource->getTableName('eav_entity_type'))->where('entity_type_code = "order"');
91
+ $iOrderEntityTypeId = $oConnection->fetchOne($oEntitySelect);
92
+ $oConnection->query('DELETE FROM `'.$oCoreResource->getTableName('eav_attribute').'` WHERE `entity_type_id`=? AND `attribute_code` = "eboekhouden_mutatie"',
93
+ $iOrderEntityTypeId);
94
+ ###
95
+
96
+ $sTaxCalcRateTable = $oInstaller->getTable('tax/tax_calculation_rate');
97
+ $sTaxCalcRateField = 'tax_ebvatcode';
98
+ if (!$oConnection->tableColumnExists($sTaxCalcRateTable, $sTaxCalcRateField))
99
+ {
100
+ $oConnection->addColumn($sTaxCalcRateTable, $sTaxCalcRateField, 'VARCHAR(20) NULL');
101
+ $oConnection->resetDdlCache($sTaxCalcRateTable);
102
+ }
103
+
104
+ // Try to convert old vat code settings from configuration to new settings via calculation_rate
105
+ $bVatUpdated = false;
106
+ $oTaxSelect = $oConnection->select();
107
+ /* @var $oTaxSelect Zend_Db_Select */
108
+ $oTaxSelect->from($this->getTable('core/config_data'), array('path', 'value'));
109
+ $oTaxSelect->where('path LIKE ?', '%eboekhouden/vatcodes/vatcode_%');
110
+ $aVatConfig = $oConnection->fetchAll($oTaxSelect);
111
+ if (!empty($aVatConfig))
112
+ {
113
+ foreach ($aVatConfig as $aConfigRow)
114
+ {
115
+ $sConfigKey = $aConfigRow['path'];
116
+ $sMagCode = $aConfigRow['value'];
117
+ $aMatch = array();
118
+ if (preg_match('/vatcode_(\w+)$/', $sConfigKey, $aMatch))
119
+ {
120
+ if (!empty($sMagCode))
121
+ {
122
+ $sEBVatCode = $aMatch[1];
123
+ $oRateModel = Mage::getModel('tax/calculation_rate')->load($sMagCode, 'code');
124
+ /* @var $oRateModel Mage_Tax_Model_Calculation_Rate */
125
+ if (!$oRateModel->isEmpty())
126
+ {
127
+ $sCurEBVatCode = $oRateModel->getData("tax_ebvatcode");
128
+ if (empty($sCurEBVatCode))
129
+ {
130
+ // no current EB vatcode set
131
+ $oRateModel->setData("tax_ebvatcode", $sEBVatCode);
132
+ $oRateModel->save();
133
+ $bVatUpdated = true;
134
+ $oInstaller->deleteConfigData('eboekhouden/vatcodes/vatcode_' . $sEBVatCode);
135
+ }
136
+ }
137
+ }
138
+ }
139
+ }
140
+ }
141
+ if ($bVatUpdated)
142
+ {
143
+ $oSession->addNotice(Mage::helper('Eboekhouden_Export')->__('e-Boekhouden.nl BTW-code instellingen zijn geconverteerd.'));
144
+ }
145
+
146
+
147
+ ////// Model names update: eboekhouden/xxx -> Eboekhouden_Export/xxx
148
+
149
+ $iUpdated = $oConnection->update( $oCoreResource->getTableName('eav_attribute')
150
+ , array( 'source_model' => new Zend_Db_Expr('REPLACE(`source_model`,"eboekhouden/","Eboekhouden_Export/")') )
151
+ , '`attribute_code` = "eboekhouden_%"'
152
+ , array()
153
+ );
154
+ if ($iUpdated)
155
+ {
156
+ $oSession->addNotice(Mage::helper('Eboekhouden_Export')->__('e-Boekhouden.nl database upgrade uitgevoerd (model names).'));
157
+ }
158
+ ///////
159
+
160
+ $oInstaller->endSetup();
161
+
162
+ Mage::app()->cleanCache();
163
+
164
+ $oSession->addNotice(Mage::helper('Eboekhouden_Export')->__('De installatie van de e-Boekhouden.nl extensie is voltooid.'
165
+ , Eboekhouden_Export_Model_Info::getExtensionVersion())
166
+ );
167
+ $oSession->addNotice(Mage::helper('Eboekhouden_Export')->__('Gelieve de Magento Cache te flushen en daarna opnieuw in te loggen.'));
app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/mysql4-install-4.0.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2010 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2010 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+
33
+ require_once dirname(__FILE__) . '/includes/install-current.php';
app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/mysql4-upgrade-1.0.2-4.0.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2010 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2010 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+
33
+ require_once dirname(__FILE__) . '/includes/install-current.php';
app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/mysql4-upgrade-1.0.7-4.0.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2010 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2010 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+
33
+ require_once dirname(__FILE__) . '/includes/install-current.php';
app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/mysql4-upgrade-1.1.5-4.0.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2010 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2010 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+
33
+ require_once dirname(__FILE__) . '/includes/install-current.php';
app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/mysql4-upgrade-1.2.0-4.0.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2010 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2010 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+
33
+ require_once dirname(__FILE__) . '/includes/install-current.php';
app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/mysql4-upgrade-1.2.2-4.0.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2010 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2010 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+
33
+ $oInstaller = $this;
34
+ /* @var $oInstaller Mage_Core_Model_Resource_Setup */
35
+
36
+ $oConnection = $oInstaller->getConnection();
37
+ /* @var $oConnection Varien_Db_Adapter_Pdo_Mysql */
38
+
39
+ // Fix for error in 1.2.2 breaking product name in overviews
40
+ $oSession = Mage::getSingleton('core/session');
41
+ /* @var $oSession Mage_Adminhtml_Model_Session */
42
+ $oCoreSetup = new Mage_Eav_Model_Entity_Setup('core_setup');
43
+
44
+ if ($oConnection->tableColumnExists('eav_entity_type', 'entity_attribute_collection'))
45
+ {
46
+ $oCoreSetup->updateEntityType('catalog_product', 'entity_attribute_collection',
47
+ 'catalog/product_attribute_collection');
48
+ $oSession->addNotice(Mage::helper('Eboekhouden_Export')->__('Aanpasing voor 1.2.2 uitgevoerd.'));
49
+ }
50
+
51
+ require_once dirname(__FILE__) . '/includes/install-current.php';
app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/mysql4-upgrade-1.2.6-4.0.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2010 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2010 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+
33
+ require_once dirname(__FILE__) . '/includes/install-current.php';
app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/mysql4-upgrade-1.3-4.0.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2010 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2010 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+
33
+ require_once dirname(__FILE__) . '/includes/install-current.php';
app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/mysql4-upgrade-1.4-4.0.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2010 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2010 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+
33
+ require_once dirname(__FILE__) . '/includes/install-current.php';
app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/mysql4-upgrade-1.5-4.0.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2010 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2010 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+
33
+ require_once dirname(__FILE__) . '/includes/install-current.php';
app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/mysql4-upgrade-1.6-4.0.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2010 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2010 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+
33
+ require_once dirname(__FILE__) . '/includes/install-current.php';
app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/mysql4-upgrade-2.0-4.0.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2010 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2010 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+
33
+ require_once dirname(__FILE__) . '/includes/install-current.php';
app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/mysql4-upgrade-3.0-4.0.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * The MIT License
6
+ *
7
+ * Copyright (c) 2010 e-Boekhouden.nl
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in
17
+ * all copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ * THE SOFTWARE.
26
+ *
27
+ * @package Eboekhouden_Export
28
+ * @copyright Copyright (c) 2010 e-Boekhouden.nl
29
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
30
+ * @author e-Boekhouden.nl
31
+ */
32
+
33
+ require_once dirname(__FILE__) . '/includes/install-current.php';
app/etc/modules/Eboekhouden_Export.xml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * The MIT License
7
+ *
8
+ * Copyright (c) 2011 e-Boekhouden.nl
9
+ *
10
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ * of this software and associated documentation files (the "Software"), to deal
12
+ * in the Software without restriction, including without limitation the rights
13
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ * copies of the Software, and to permit persons to whom the Software is
15
+ * furnished to do so, subject to the following conditions:
16
+ *
17
+ * The above copyright notice and this permission notice shall be included in
18
+ * all copies or substantial portions of the Software.
19
+ *
20
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26
+ * THE SOFTWARE.
27
+ *
28
+ * @package Eboekhouden_Export
29
+ * @copyright Copyright (c) 2010 e-Boekhouden.nl
30
+ * @license http://opensource.org/licenses/mit-license.php The MIT License
31
+ */
32
+ -->
33
+ <config>
34
+ <modules>
35
+ <Eboekhouden_Export>
36
+ <active>true</active>
37
+ <codePool>community</codePool>
38
+ </Eboekhouden_Export>
39
+ </modules>
40
+ </config>
package.xml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>EBoekhouden_Export</name>
4
+ <version>4.1.6</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/mit-license.php">MIT</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Directe export van bestellingen en facturen naar www.e-Boekhouden.nl</summary>
10
+ <description>Directe export van bestellingen naar www.e-Boekhouden.nl&#xD;
11
+ &#xD;
12
+ Heeft u een webshop van Magento? Dan kunt u voortaan met 1 klik op de knop alle bestellingen van uw webshop direct verwerken in uw boekhouding. Speciaal hiervoor heeft e-Boekhouden.nl een plugin voor Magento ontwikkeld waarvan u geheel gratis gebruik kunt maken.&#xD;
13
+ &#xD;
14
+ == Direct aan de slag! ==&#xD;
15
+ De nieuwe extensie is zeer eenvoudig te installeren. U installeert 'm gewoon via uw Magento-webshop. Bij installatie wordt uw Magento-webshop gekoppeld aan uw administratie in e-Boekhouden.nl. U kunt vervolgens direct online orders exporteren naar uw boekhouding. U hoeft dus nooit meer handmatig orders in te voeren.&#xD;
16
+ &#xD;
17
+ == Eenvoudig installeren ==&#xD;
18
+ Er is een uitgebreide installatiehandleiding beschikbaar om u door de installatie van de module te leiden:&#xD;
19
+ http://www.e-boekhouden.nl/handleiding/magento_connector.pdf&#xD;
20
+ De handleiding ondersteunt u bij installatie van de Magento-module en neemt samen met u alle benodigde stappen om het koppelen succesvol te laten verlopen. De totale installatie duurt slechts enkele minuten.&#xD;
21
+ &#xD;
22
+ == Alle voordelen op een rij ==&#xD;
23
+ - De module is gratis voor abonnees van e-Boekhouden.nl.&#xD;
24
+ - Geen wachttijd na installatie. De module is na installatie direct te gebruiken!&#xD;
25
+ - Snel en eenvoudig installeren door de uitgebreide installatiehandleiding.&#xD;
26
+ - Complete orders exporteren van uw webshop naar uw boekhouding met 1 klik op de knop.&#xD;
27
+ - Alle orders zijn overzichtelijk in uw boekhouding terug te vinden.&#xD;
28
+ &#xD;
29
+ Meer informatie over deze koppeling met Magento kunt u terugvinden als u ingelogd bent in e-Boekhouden onder 'Beheer&gt;Instellingen&gt;Magento'.&#xD;
30
+ &#xD;
31
+ -----------------------------------------------------&#xD;
32
+ Info about uninstalling can be found in &#xD;
33
+ app/code/community/Eboekhouden/Export/sql/HOWTO_UnInstall.sql</description>
34
+ <notes>Berekeningen verbeterd voor shops die hoofdzakelijk exclusief btw werken.</notes>
35
+ <authors><author><name>Ronald Kas</name><user>auto-converted</user><email>info@e-boekhouden.nl</email></author><author><name>Jeroen Vermeulen</name><user>auto-converted</user><email>info@jeroenvermeulen.eu</email></author></authors>
36
+ <date>2012-04-10</date>
37
+ <time>15:12:17</time>
38
+ <contents><target name="magecommunity"><dir name="Eboekhouden"><dir name="Export"><dir name="Block"><dir name="Sales"><dir name="Creditmemo"><file name="Grid.php" hash="5d323b6842ac429c346fc1a00d8b38ee"/></dir><dir name="Invoice"><file name="Grid.php" hash="264f95548e6d5dd501a4c613fb38b3a8"/></dir><dir name="Order"><file name="Grid.php" hash="a1a9fe52f445f7f40e553b4c7f6dce99"/></dir></dir><dir name="Tax"><dir name="Rate"><dir name="Grid"><dir name="Renderer"><file name="Ebvatcode.php" hash="d34d2edd9593e4d2c23a20c8e0864c95"/></dir></dir><file name="Form.php" hash="ea36d8fde2272e24f5187c0bfd9deb76"/><file name="Grid.php" hash="ca50f669ccd75b1365d5937d0390fe3e"/></dir></dir></dir><dir name="Helper"><file name="AccountNumber.php" hash="599c8af6b93e2206c631aa79e9ba5dd4"/><file name="Data.php" hash="2f92f90de33e89e321aa4385d56ced0e"/></dir><dir name="Model"><dir name="Config"><file name="Costcenter.php" hash="7f280ef51e003de0bf80f0ab2b9685f0"/><file name="Ledgeraccount.php" hash="318e87f5932d4bd898d1552d27c50bc7"/><file name="Taxcalculationrate.php" hash="9871b70f56e8fee7cd3364bc8b3de2c5"/></dir><dir name="Export"><file name="Sales.php" hash="6b71691d819f75342424719de6e20814"/></dir><dir name="Import"><file name="Costcenter.php" hash="593b1a269583073098f5c1f52002058f"/><file name="Ebcode.php" hash="4127f3460ccb06e800f88baf86a58008"/><file name="Gbcodes.php" hash="d513db427803e3c079f6577b7b240219"/></dir><dir name="Product"><dir name="Attribute"><file name="Costcenter.php" hash="3b1e02791a8ff9782d18f14afdc90221"/><file name="Ledgeraccount.php" hash="132f16b2407b579605cb24de6ea5b6ab"/></dir></dir><dir name="Tax"><dir name="Attribute"><file name="Ebtaxcode.php" hash="493372a121ba4490b4f3310373cc3e22"/></dir></dir><file name="Info.php" hash="c8dbbbaeead14393cb36c0eec5706882"/></dir><dir name="controllers"><dir name="Catalog"><file name="ProductController.php" hash="b19ff72404a75fcb1d89da436d3c68e9"/></dir><dir name="Export"><file name="SaleController.php" hash="c4f64b12685ad9558dff62f26ac7e6f2"/></dir><file name="MutatieController.php" hash="1634fcb7298ef44b369f9ac9fbdf87b4"/></dir><dir name="etc"><file name="config.xml" hash="fa4c164f6e65e4bfb8d6d4288542075d"/><file name="system.xml" hash="f8c0a0868c859a7f6fb35c77bddd2e38"/></dir><dir name="sql"><dir name="eboekhouden_setup"><dir name="includes"><file name="install-current.php" hash="f603e6d7289c9791d5357093f403313a"/></dir><file name="mysql4-install-4.0.php" hash="8febe17420f3a5a2e99eb86605ab3dd3"/><file name="mysql4-upgrade-1.0.2-4.0.php" hash="8febe17420f3a5a2e99eb86605ab3dd3"/><file name="mysql4-upgrade-1.0.7-4.0.php" hash="8febe17420f3a5a2e99eb86605ab3dd3"/><file name="mysql4-upgrade-1.1.5-4.0.php" hash="8febe17420f3a5a2e99eb86605ab3dd3"/><file name="mysql4-upgrade-1.2.0-4.0.php" hash="8febe17420f3a5a2e99eb86605ab3dd3"/><file name="mysql4-upgrade-1.2.2-4.0.php" hash="e0ce8dbd2e1de28479e90505abbc6297"/><file name="mysql4-upgrade-1.2.6-4.0.php" hash="8febe17420f3a5a2e99eb86605ab3dd3"/><file name="mysql4-upgrade-1.3-4.0.php" hash="8febe17420f3a5a2e99eb86605ab3dd3"/><file name="mysql4-upgrade-1.4-4.0.php" hash="8febe17420f3a5a2e99eb86605ab3dd3"/><file name="mysql4-upgrade-1.5-4.0.php" hash="8febe17420f3a5a2e99eb86605ab3dd3"/><file name="mysql4-upgrade-1.6-4.0.php" hash="8febe17420f3a5a2e99eb86605ab3dd3"/><file name="mysql4-upgrade-2.0-4.0.php" hash="b1b333b3815368af7d599e5126eca26e"/><file name="mysql4-upgrade-3.0-4.0.php" hash="b1b333b3815368af7d599e5126eca26e"/></dir><file name="HOWTO_UnInstall.sql" hash="691131453816d890630a6d3a21b6c7bf"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Eboekhouden_Export.xml" hash="9ced450b54f7225a83049f6bff3adbae"/></dir></target></contents>
39
+ <compatible/>
40
+ <dependencies/>
41
+ </package>