EBoekhouden_Export - Version 4.1.38

Version Notes

Small bugfixes

Download this release

Release Info

Developer Ronald Kas
Extension EBoekhouden_Export
Version 4.1.38
Comparing to
See all releases


Code changes from version 4.1.37 to 4.1.38

app/code/community/Eboekhouden/Export/Model/Export/Sales.php CHANGED
@@ -298,20 +298,20 @@ class Eboekhouden_Export_Model_Export_Sales
298
 
299
  $aOrderItems = $oContainer->getItemsCollection();
300
  $fDiscountLeft = $oContainer->getBaseDiscountAmount();
301
-
302
  $totalBaseAmountItems = 0;
303
  $totalBaseAmountInclTaxItems = 0;
304
  $totalBaseTaxItems = 0;
305
-
306
  foreach ($aOrderItems as $oItem)
307
  /* @var $oItem Mage_Sales_Model_Order_Invoice_Item */
308
  {
309
  $fDbProductTaxAmount = $oItem->getBaseTaxAmount();
310
- //add to order totals
311
  $totalBaseTaxItems += $fDbProductTaxAmount;
312
  $totalBaseAmountItems += $oItem->getBaseRowTotal();
313
  $totalBaseAmountInclTaxItems += $oItem->getBaseRowTotalInclTax();
314
-
315
  $aWeeItems = $this->_oWeeeHelper->getApplied( $oItem );
316
  foreach ( $aWeeItems as $aWeeData )
317
  {
@@ -325,6 +325,7 @@ class Eboekhouden_Export_Model_Export_Sales
325
  && $oWeeeItem->getBaseRowTotal() == $oWeeeItem->getBaseRowTotalInclTax() // No tax calculated for WEEE
326
  )
327
  {
 
328
  $fRowAllTotalEx = $oItem->getBaseRowTotal() - $oItem->getBaseDiscountAmount() + $oItem->getWeeeTaxAppliedRowAmount();
329
  $fAllTaxPerc = 100 * $fDbProductTaxAmount / $fRowAllTotalEx;
330
  $fAllTaxPerc = $this->_vatPercRound( $fAllTaxPerc );
@@ -383,11 +384,11 @@ class Eboekhouden_Export_Model_Export_Sales
383
  $fShipFactor = $oContainer->getBaseShippingAmount() / $fBaseShippingAmount;
384
  }
385
  }
386
- //add to order totals
387
  $totalBaseTaxItems += $fShipFactor * $oContainer->getBaseShippingTaxAmount();
388
  $totalBaseAmountItems += $fShipFactor * $oContainer->getBaseShippingAmount();
389
  $totalBaseAmountInclTaxItems += $fShipFactor * $oContainer->getBaseShippingInclTax();
390
-
391
  // Shipping & Handling cost, create a virtual order_item
392
  $oShippingItem = new Mage_Sales_Model_Order_Item();
393
  $oShippingItem->setStoreId($iStoreId);
@@ -420,18 +421,20 @@ class Eboekhouden_Export_Model_Export_Sales
420
 
421
  $sXml .= $this->_getItemXml($oContainer, $oAdjustmentItem);
422
  }
423
-
424
  //add additional fee price (in case invoice price is higher then itemprice + shipping)
425
- $orderGrandTotal = round(floatval($oOrder->getGrandTotal()), 4);
426
  if (0.0001 < abs($orderGrandTotal - round($totalBaseAmountInclTaxItems, 4))) {
427
-
 
 
428
  $orderSubtotal = round(floatval($oOrder->getSubtotal()) + floatval($oOrder->getBaseShippingAmount()), 4);
429
  $orderTaxAmount = round(floatval($oOrder->getTaxAmount()), 4);
430
-
431
  $feeRowTotal = $orderSubtotal - round($totalBaseAmountItems, 4);
432
  $feeRowTotalInclTax = $orderGrandTotal - round($totalBaseAmountInclTaxItems, 4);
433
  $feeTaxAmount = $orderTaxAmount - round($totalBaseTaxItems, 4);
434
-
435
  $feeItem = new Mage_Sales_Model_Order_Item();
436
  $feeItem->setStoreId($iStoreId);
437
  $feeItem->setProductId('payment_fee');
@@ -439,10 +442,10 @@ class Eboekhouden_Export_Model_Export_Sales
439
  $feeItem->setBaseRowTotalInclTax($feeRowTotalInclTax);
440
  $feeItem->setBaseTaxAmount($feeTaxAmount);
441
  $feeItem->setBaseDiscountAmount(0);
442
-
443
  $sXml .= $this->_getItemXml($oContainer, $feeItem);
444
  }
445
-
446
  $sXml .= '
447
  </MUTATIEREGELS>
448
  </MUTATIE>';
@@ -632,7 +635,6 @@ class Eboekhouden_Export_Model_Export_Sales
632
  $addItem = $oProduct->getPriceType() != '1'; // priceType '1' is Fixed
633
  }
634
  }
635
-
636
  if ($addItem)
637
  {
638
  $iStoreId = $oContainer->getStoreId();
@@ -667,10 +669,11 @@ class Eboekhouden_Export_Model_Export_Sales
667
  $sComment .= ' ['.$fPriceIn.' = '.$oItem->getBaseRowTotal().' * '.$fVatFactor.'] ';
668
  }
669
  }
670
-
671
  $fDiscountAmount = $oItem->getBaseDiscountAmount();
 
672
  if (!empty($fDiscountAmount) && 0 < $fDiscountAmount)
673
  {
 
674
  if ( $this->_oTaxConfig->applyTaxAfterDiscount() )
675
  {
676
  // Apply Tax after Discount
298
 
299
  $aOrderItems = $oContainer->getItemsCollection();
300
  $fDiscountLeft = $oContainer->getBaseDiscountAmount();
301
+
302
  $totalBaseAmountItems = 0;
303
  $totalBaseAmountInclTaxItems = 0;
304
  $totalBaseTaxItems = 0;
305
+
306
  foreach ($aOrderItems as $oItem)
307
  /* @var $oItem Mage_Sales_Model_Order_Invoice_Item */
308
  {
309
  $fDbProductTaxAmount = $oItem->getBaseTaxAmount();
310
+ //add to order totals
311
  $totalBaseTaxItems += $fDbProductTaxAmount;
312
  $totalBaseAmountItems += $oItem->getBaseRowTotal();
313
  $totalBaseAmountInclTaxItems += $oItem->getBaseRowTotalInclTax();
314
+
315
  $aWeeItems = $this->_oWeeeHelper->getApplied( $oItem );
316
  foreach ( $aWeeItems as $aWeeData )
317
  {
325
  && $oWeeeItem->getBaseRowTotal() == $oWeeeItem->getBaseRowTotalInclTax() // No tax calculated for WEEE
326
  )
327
  {
328
+
329
  $fRowAllTotalEx = $oItem->getBaseRowTotal() - $oItem->getBaseDiscountAmount() + $oItem->getWeeeTaxAppliedRowAmount();
330
  $fAllTaxPerc = 100 * $fDbProductTaxAmount / $fRowAllTotalEx;
331
  $fAllTaxPerc = $this->_vatPercRound( $fAllTaxPerc );
384
  $fShipFactor = $oContainer->getBaseShippingAmount() / $fBaseShippingAmount;
385
  }
386
  }
387
+ //add to order totals
388
  $totalBaseTaxItems += $fShipFactor * $oContainer->getBaseShippingTaxAmount();
389
  $totalBaseAmountItems += $fShipFactor * $oContainer->getBaseShippingAmount();
390
  $totalBaseAmountInclTaxItems += $fShipFactor * $oContainer->getBaseShippingInclTax();
391
+
392
  // Shipping & Handling cost, create a virtual order_item
393
  $oShippingItem = new Mage_Sales_Model_Order_Item();
394
  $oShippingItem->setStoreId($iStoreId);
421
 
422
  $sXml .= $this->_getItemXml($oContainer, $oAdjustmentItem);
423
  }
424
+
425
  //add additional fee price (in case invoice price is higher then itemprice + shipping)
426
+ $orderGrandTotal = round(floatval($oOrder->getGrandTotal()), 4) - $oOrder->getBaseDiscountAmount();
427
  if (0.0001 < abs($orderGrandTotal - round($totalBaseAmountInclTaxItems, 4))) {
428
+
429
+ # debug($oOrder->debug());
430
+
431
  $orderSubtotal = round(floatval($oOrder->getSubtotal()) + floatval($oOrder->getBaseShippingAmount()), 4);
432
  $orderTaxAmount = round(floatval($oOrder->getTaxAmount()), 4);
433
+
434
  $feeRowTotal = $orderSubtotal - round($totalBaseAmountItems, 4);
435
  $feeRowTotalInclTax = $orderGrandTotal - round($totalBaseAmountInclTaxItems, 4);
436
  $feeTaxAmount = $orderTaxAmount - round($totalBaseTaxItems, 4);
437
+
438
  $feeItem = new Mage_Sales_Model_Order_Item();
439
  $feeItem->setStoreId($iStoreId);
440
  $feeItem->setProductId('payment_fee');
442
  $feeItem->setBaseRowTotalInclTax($feeRowTotalInclTax);
443
  $feeItem->setBaseTaxAmount($feeTaxAmount);
444
  $feeItem->setBaseDiscountAmount(0);
445
+
446
  $sXml .= $this->_getItemXml($oContainer, $feeItem);
447
  }
448
+
449
  $sXml .= '
450
  </MUTATIEREGELS>
451
  </MUTATIE>';
635
  $addItem = $oProduct->getPriceType() != '1'; // priceType '1' is Fixed
636
  }
637
  }
 
638
  if ($addItem)
639
  {
640
  $iStoreId = $oContainer->getStoreId();
669
  $sComment .= ' ['.$fPriceIn.' = '.$oItem->getBaseRowTotal().' * '.$fVatFactor.'] ';
670
  }
671
  }
 
672
  $fDiscountAmount = $oItem->getBaseDiscountAmount();
673
+
674
  if (!empty($fDiscountAmount) && 0 < $fDiscountAmount)
675
  {
676
+ var_dump($this->_oTaxConfig->applyTaxAfterDiscount());
677
  if ( $this->_oTaxConfig->applyTaxAfterDiscount() )
678
  {
679
  // Apply Tax after Discount
app/code/community/Eboekhouden/Export/etc/config.xml CHANGED
@@ -35,7 +35,7 @@
35
  <modules>
36
  <Eboekhouden_Export>
37
  <!-- When changing version: Don't forget to rename the mysql4-install script in sql/eboekhouden_setup -->
38
- <version>4.1.37</version>
39
  </Eboekhouden_Export>
40
  </modules>
41
 
35
  <modules>
36
  <Eboekhouden_Export>
37
  <!-- When changing version: Don't forget to rename the mysql4-install script in sql/eboekhouden_setup -->
38
+ <version>4.1.38</version>
39
  </Eboekhouden_Export>
40
  </modules>
41
 
app/code/community/Eboekhouden/Export/sql/eboekhouden_setup/{mysql4-install-4.1.37.php → mysql4-install-4.1.38.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.37</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/mit-license.php">MIT</license>
7
  <channel>community</channel>
@@ -33,9 +33,9 @@ Info about uninstalling can be found in &#xD;
33
  app/code/community/Eboekhouden/Export/sql/HOWTO_UnInstall.sql</description>
34
  <notes>Small bugfixes</notes>
35
  <authors><author><name>Ronald Kas</name><user>eboekhoudennl</user><email>info@e-boekhouden.nl</email></author></authors>
36
- <date>2015-10-01</date>
37
- <time>12:08:34</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"><file name="Form.php" hash="ea36d8fde2272e24f5187c0bfd9deb76"/><dir name="Grid"><dir name="Renderer"><file name="Ebvatcode.php" hash="d34d2edd9593e4d2c23a20c8e0864c95"/></dir></dir><file name="Grid.php" hash="ca50f669ccd75b1365d5937d0390fe3e"/></dir></dir></dir><dir name="Helper"><file name="AccountNumber.php" hash="599c8af6b93e2206c631aa79e9ba5dd4"/><file name="Data.php" hash="74a043943649eeab7f204f333e50219f"/></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="210249d32ed22057b87d9912b823a20c"/></dir><dir name="Import"><file name="Costcenter.php" hash="593b1a269583073098f5c1f52002058f"/><file name="Ebcode.php" hash="4127f3460ccb06e800f88baf86a58008"/><file name="Gbcodes.php" hash="d513db427803e3c079f6577b7b240219"/></dir><file name="Info.php" hash="c8dbbbaeead14393cb36c0eec5706882"/><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="0b34f8d566896c3fbab02ddaabf55536"/></dir></dir></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="70aa4525c771ba12eb495f4ba5b9e665"/><file name="system.xml" hash="aed3ba1bbe341d0cbed0d2b8b848339d"/></dir><dir name="sql"><file name="HOWTO_UnInstall.sql" hash="691131453816d890630a6d3a21b6c7bf"/><dir name="eboekhouden_setup"><dir name="includes"><file name="install-current.php" hash="ddb3ff7895f4ec22fc6b4866207c9575"/></dir><file name="mysql4-install-4.1.37.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></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Eboekhouden_Export.xml" hash="9ced450b54f7225a83049f6bff3adbae"/></dir></target></contents>
39
  <compatible/>
40
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
41
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>EBoekhouden_Export</name>
4
+ <version>4.1.38</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/mit-license.php">MIT</license>
7
  <channel>community</channel>
33
  app/code/community/Eboekhouden/Export/sql/HOWTO_UnInstall.sql</description>
34
  <notes>Small bugfixes</notes>
35
  <authors><author><name>Ronald Kas</name><user>eboekhoudennl</user><email>info@e-boekhouden.nl</email></author></authors>
36
+ <date>2015-10-20</date>
37
+ <time>11:59:18</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"><file name="Form.php" hash="ea36d8fde2272e24f5187c0bfd9deb76"/><dir name="Grid"><dir name="Renderer"><file name="Ebvatcode.php" hash="d34d2edd9593e4d2c23a20c8e0864c95"/></dir></dir><file name="Grid.php" hash="ca50f669ccd75b1365d5937d0390fe3e"/></dir></dir></dir><dir name="Helper"><file name="AccountNumber.php" hash="599c8af6b93e2206c631aa79e9ba5dd4"/><file name="Data.php" hash="74a043943649eeab7f204f333e50219f"/></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="018f51ca9b9173f94aab12d0954a88dd"/></dir><dir name="Import"><file name="Costcenter.php" hash="593b1a269583073098f5c1f52002058f"/><file name="Ebcode.php" hash="4127f3460ccb06e800f88baf86a58008"/><file name="Gbcodes.php" hash="d513db427803e3c079f6577b7b240219"/></dir><file name="Info.php" hash="c8dbbbaeead14393cb36c0eec5706882"/><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="0b34f8d566896c3fbab02ddaabf55536"/></dir></dir></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="f064b84c8225b36d81078ef69c941b9f"/><file name="system.xml" hash="aed3ba1bbe341d0cbed0d2b8b848339d"/></dir><dir name="sql"><file name="HOWTO_UnInstall.sql" hash="691131453816d890630a6d3a21b6c7bf"/><dir name="eboekhouden_setup"><dir name="includes"><file name="install-current.php" hash="ddb3ff7895f4ec22fc6b4866207c9575"/></dir><file name="mysql4-install-4.1.38.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></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Eboekhouden_Export.xml" hash="9ced450b54f7225a83049f6bff3adbae"/></dir></target></contents>
39
  <compatible/>
40
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
41
  </package>