EBoekhouden_Export - Version 4.1.12

Version Notes

Verbetering BTW berekening.

Download this release

Release Info

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


Code changes from version 4.1.11 to 4.1.12

app/code/community/Eboekhouden/Export/Model/Export/Sales.php CHANGED
@@ -736,14 +736,19 @@ class Eboekhouden_Export_Model_Export_Sales
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() )
@@ -770,6 +775,11 @@ class Eboekhouden_Export_Model_Export_Sales
770
  }
771
  $fVatPercent = floatval($fVatPercent);
772
  $fVatPercent = $this->_vatPercRound($fVatPercent);
 
 
 
 
 
773
  return $fVatPercent;
774
  }
775
 
@@ -893,7 +903,7 @@ class Eboekhouden_Export_Model_Export_Sales
893
  */
894
  private function _vatPercRound($fVatPercent)
895
  {
896
- $aKnownRates = array(0, 6, 19); // TODO Fill this based on db data
897
  foreach ($aKnownRates as $fKnownRate)
898
  {
899
  if (0.1 > abs($fVatPercent - $fKnownRate))
@@ -906,6 +916,18 @@ class Eboekhouden_Export_Model_Export_Sales
906
  return round($fVatPercent, 3);
907
  }
908
 
 
 
 
 
 
 
 
 
 
 
 
 
909
 
910
  /**
911
  * @param $oItem Mage_Sales_Model_Invoice_Item|Mage_Sales_Model_Order_Item
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,$iAttempt=0)
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->getBaseRowTotalInclTax() - $fTempTaxAmount;
747
+ if ( 1 == $iAttempt )
748
+ {
749
+ // Fix for wrong VAT calculation due to bad Magento configuration
750
+ $fTempPriceEx = $oItem->getBaseRowTotal();
751
+ }
752
 
753
  $fDiscountAmount = $oItem->getBaseDiscountAmount();
754
  if ( !empty($fDiscountAmount) && $this->_oTaxConfig->applyTaxAfterDiscount() )
775
  }
776
  $fVatPercent = floatval($fVatPercent);
777
  $fVatPercent = $this->_vatPercRound($fVatPercent);
778
+ $aKnownRates = $this->_getKnownVatRates();
779
+ if ( $iAttempt <= 1 && false === array_search($fVatPercent,$aKnownRates) )
780
+ {
781
+ $fVatPercent = $this->_getItemVatPerc( $oContainer,$oItem,$iAttempt+1 );
782
+ }
783
  return $fVatPercent;
784
  }
785
 
903
  */
904
  private function _vatPercRound($fVatPercent)
905
  {
906
+ $aKnownRates = $this->_getKnownVatRates();
907
  foreach ($aKnownRates as $fKnownRate)
908
  {
909
  if (0.1 > abs($fVatPercent - $fKnownRate))
916
  return round($fVatPercent, 3);
917
  }
918
 
919
+ private function _getKnownVatRates()
920
+ {
921
+ $aResult = array();
922
+
923
+ $oCollection = Mage::getModel('tax/calculation_rate')->getCollection(); /* @var $oCollection Mage_Tax_Model_Resource_Calculation_Rate_Collection */
924
+ foreach($oCollection as $oItem)
925
+ {
926
+ $aResult[ $oItem->getCode() ] = floatval( $oItem->getRate() );
927
+ }
928
+
929
+ return $aResult;
930
+ }
931
 
932
  /**
933
  * @param $oItem Mage_Sales_Model_Invoice_Item|Mage_Sales_Model_Order_Item
app/code/community/Eboekhouden/Export/etc/config.xml CHANGED
@@ -34,7 +34,7 @@
34
 
35
  <modules>
36
  <Eboekhouden_Export>
37
- <version>4.1.11</version>
38
  </Eboekhouden_Export>
39
  </modules>
40
 
34
 
35
  <modules>
36
  <Eboekhouden_Export>
37
+ <version>4.1.12</version>
38
  </Eboekhouden_Export>
39
  </modules>
40
 
app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/{mysql4-install-4.1.11.php → mysql4-install-4.1.12.php} RENAMED
File without changes
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>EBoekhouden_Export</name>
4
- <version>4.1.11</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/mit-license.php">MIT</license>
7
  <channel>community</channel>
@@ -31,11 +31,11 @@ Meer informatie over deze koppeling met Magento kunt u terugvinden als u ingelog
31
  -----------------------------------------------------&#xD;
32
  Info about uninstalling can be found in &#xD;
33
  app/code/community/Eboekhouden/Export/sql/HOWTO_UnInstall.sql</description>
34
- <notes>In de configuratie wordt getoond welke versie van deze extensie ge&#xEF;nstalleerd is.</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-07-13</date>
37
- <time>15:47:07</time>
38
- <contents><target name="magecommunity"><dir name="Eboekhouden"><dir name="Export"><dir name="Block"><dir name="Config"><dir name="Info"><file name="Version.php" hash="e8957685d4f906457d1eb45853702e1f"/></dir></dir><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="649880c1071e2453ae8536e89349527c"/></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="ad994b03059aec468f5e7d80fe9612f9"/></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="b45185c2b60a3903bbf9066dc2a5f327"/><file name="system.xml" hash="8f9f3db645acf4e736d80e4f50510428"/></dir><dir name="sql"><dir name="eboekhouden_setup"><dir name="includes"><file name="install-current.php" hash="f603e6d7289c9791d5357093f403313a"/></dir><file name="mysql4-install-4.1.11.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>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>EBoekhouden_Export</name>
4
+ <version>4.1.12</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/mit-license.php">MIT</license>
7
  <channel>community</channel>
31
  -----------------------------------------------------&#xD;
32
  Info about uninstalling can be found in &#xD;
33
  app/code/community/Eboekhouden/Export/sql/HOWTO_UnInstall.sql</description>
34
+ <notes>Verbetering BTW berekening.</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-07-24</date>
37
+ <time>11:24:47</time>
38
+ <contents><target name="magecommunity"><dir name="Eboekhouden"><dir name="Export"><dir name="Block"><dir name="Config"><dir name="Info"><file name="Version.php" hash="e8957685d4f906457d1eb45853702e1f"/></dir></dir><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="649880c1071e2453ae8536e89349527c"/></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="43324bf492f24a290549c6fe95cfdbc8"/></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="80f498362ca108b4db961637deb5679b"/><file name="system.xml" hash="8f9f3db645acf4e736d80e4f50510428"/></dir><dir name="sql"><dir name="eboekhouden_setup"><dir name="includes"><file name="install-current.php" hash="f603e6d7289c9791d5357093f403313a"/></dir><file name="mysql4-install-4.1.12.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>