Version Notes
Mise à jour du module vers la version 0.2.4.
Pour plus d'informations, se référer à la documentation.
Download this release
Release Info
Developer | Magento Core Team |
Extension | Speedinfo_Opensi |
Version | 0.2.4 |
Comparing to | |
See all releases |
Code changes from version 0.2.3 to 0.2.4
app/code/community/Speedinfo/Opensi/Model/Webservices.php
CHANGED
@@ -91,11 +91,11 @@ class Speedinfo_Opensi_Model_Webservices extends Mage_Core_Model_Abstract {
|
|
91 |
}
|
92 |
$commandeWeb->setAttribute('Mode_Expedition', $shippingDesc);
|
93 |
$commandeWeb->setAttribute('Edition_TTC', "true");
|
94 |
-
|
95 |
// recuperation du taux de tva sur les frais de port
|
96 |
$taxClassId = Mage::getStoreConfig('tax/classes/shipping_tax_class', $storeId);
|
97 |
-
if ($taxClassId != 0) {
|
98 |
-
$taxRequest = Mage::getSingleton('tax/calculation')->getRateRequest($order->getShippingAddress(), $order->getBillingAddress(), "", $storeId);
|
|
|
99 |
if ($taxRequest->getCustomerClassId()) {
|
100 |
$percent = Mage::getSingleton('tax/calculation')->getRate($taxRequest->setProductClassId($taxClassId));
|
101 |
} else if ($taxRequest->getProductClassId()) {
|
@@ -107,7 +107,6 @@ class Speedinfo_Opensi_Model_Webservices extends Mage_Core_Model_Abstract {
|
|
107 |
$percent = 0;
|
108 |
}
|
109 |
$commandeWeb->setAttribute('Frais_Port', $order->getShippingAmount() * (1 + $percent / 100));
|
110 |
-
|
111 |
$commandeWeb->setAttribute('Taux_Tva_Port', $percent);
|
112 |
$totalTTC = $order->getSubtotal() + $order->getBaseTaxAmount();
|
113 |
//$commandeWeb->setAttribute('Remise_Pourc', ((($totalTTC - ($order->getBaseGrandTotal() - $order->getBaseShippingAmount())) / $totalTTC) * 100));
|
@@ -546,20 +545,45 @@ class Speedinfo_Opensi_Model_Webservices extends Mage_Core_Model_Abstract {
|
|
546 |
if ($etatCommande->getAttribute('Statut_Paiement') == 'T') {
|
547 |
|
548 |
if ($order->canInvoice()) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
549 |
$invoiceCollection = $order->getInvoiceCollection();
|
550 |
$invoiceId = '';
|
551 |
foreach ($invoiceCollection as $invoice) {
|
552 |
$invoiceId = $invoice->getIncrementId();
|
553 |
}
|
554 |
-
|
555 |
-
if (empty($invoiceId))
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
561 |
}
|
562 |
-
$invoice->save();
|
563 |
}
|
564 |
}
|
565 |
|
91 |
}
|
92 |
$commandeWeb->setAttribute('Mode_Expedition', $shippingDesc);
|
93 |
$commandeWeb->setAttribute('Edition_TTC', "true");
|
|
|
94 |
// recuperation du taux de tva sur les frais de port
|
95 |
$taxClassId = Mage::getStoreConfig('tax/classes/shipping_tax_class', $storeId);
|
96 |
+
if ($taxClassId != 0) {
|
97 |
+
// $taxRequest = Mage::getSingleton('tax/calculation')->getRateRequest($order->getShippingAddress(), $order->getBillingAddress(), "", $storeId);
|
98 |
+
$taxRequest = Mage::getSingleton('tax/calculation')->getRateRequest();
|
99 |
if ($taxRequest->getCustomerClassId()) {
|
100 |
$percent = Mage::getSingleton('tax/calculation')->getRate($taxRequest->setProductClassId($taxClassId));
|
101 |
} else if ($taxRequest->getProductClassId()) {
|
107 |
$percent = 0;
|
108 |
}
|
109 |
$commandeWeb->setAttribute('Frais_Port', $order->getShippingAmount() * (1 + $percent / 100));
|
|
|
110 |
$commandeWeb->setAttribute('Taux_Tva_Port', $percent);
|
111 |
$totalTTC = $order->getSubtotal() + $order->getBaseTaxAmount();
|
112 |
//$commandeWeb->setAttribute('Remise_Pourc', ((($totalTTC - ($order->getBaseGrandTotal() - $order->getBaseShippingAmount())) / $totalTTC) * 100));
|
545 |
if ($etatCommande->getAttribute('Statut_Paiement') == 'T') {
|
546 |
|
547 |
if ($order->canInvoice()) {
|
548 |
+
// $invoiceCollection = $order->getInvoiceCollection();
|
549 |
+
// $invoiceId = '';
|
550 |
+
// foreach ($invoiceCollection as $invoice) {
|
551 |
+
// $invoiceId = $invoice->getIncrementId();
|
552 |
+
// }
|
553 |
+
//
|
554 |
+
// if (empty($invoiceId))
|
555 |
+
// $invoiceId = Mage::getModel('sales/order_invoice_api')->create($order->getIncrementId(), array());
|
556 |
+
//
|
557 |
+
// $invoice = Mage::getModel('sales/order_invoice')->loadByIncrementId($invoiceId);
|
558 |
+
// if ($invoice->canCapture()) {
|
559 |
+
// $invoice->capture();
|
560 |
+
// }
|
561 |
$invoiceCollection = $order->getInvoiceCollection();
|
562 |
$invoiceId = '';
|
563 |
foreach ($invoiceCollection as $invoice) {
|
564 |
$invoiceId = $invoice->getIncrementId();
|
565 |
}
|
566 |
+
|
567 |
+
if (empty($invoiceId)){
|
568 |
+
$convertor = Mage::getModel('sales/convert_order');
|
569 |
+
|
570 |
+
$invoice = $convertor->toInvoice($order);
|
571 |
+
|
572 |
+
foreach ($order->getAllItems() as $orderItem) {
|
573 |
+
if (!$orderItem->getQtyToInvoice()) {
|
574 |
+
continue;
|
575 |
+
}
|
576 |
+
|
577 |
+
$item = $convertor->itemToInvoiceItem($orderItem);
|
578 |
+
$item->setQty($orderItem->getQtyToInvoice());
|
579 |
+
$invoice->addItem($item);
|
580 |
+
}
|
581 |
+
$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_OFFLINE);
|
582 |
+
$invoice->collectTotals();
|
583 |
+
$invoice->register()->pay();
|
584 |
+
|
585 |
+
$invoice->save();
|
586 |
}
|
|
|
587 |
}
|
588 |
}
|
589 |
|
app/code/community/Speedinfo/Opensi/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Speedinfo_Opensi>
|
5 |
-
<version>0.2.
|
6 |
</Speedinfo_Opensi>
|
7 |
</modules>
|
8 |
<global>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Speedinfo_Opensi>
|
5 |
+
<version>0.2.4</version>
|
6 |
</Speedinfo_Opensi>
|
7 |
</modules>
|
8 |
<global>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Speedinfo_Opensi</name>
|
4 |
-
<version>0.2.
|
5 |
<stability>stable</stability>
|
6 |
<license>GPL</license>
|
7 |
<channel>community</channel>
|
@@ -10,12 +10,12 @@
|
|
10 |
<description>Le module OpenSi Connect vous permet de coupler Magento au logiciel de gestion commerciale et de comptabilité OpenSi E-Commerce.
|
11 |
Speedinfo a conçu un connecteur pour OpenSi E-Commerce et Magento sous la forme du module OpenSi Connect
|
12 |
OpenSi E-Commerce, est un logiciel de gestion commerciale et de comptabilité dédié à l'e-commerce.</description>
|
13 |
-
<notes>Mise à jour du module vers la version 0.2.
|
14 |
Pour plus d'informations, se référer à la documentation.</notes>
|
15 |
<authors><author><name>Dray</name><user>auto-converted</user><email>rony.dray@speedinfo.fr</email></author></authors>
|
16 |
-
<date>2011-01-
|
17 |
-
<time>
|
18 |
-
<contents><target name="mage"><dir name="app"><dir name="design"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="opensi"><dir name="tab"><file name="webservices.phtml" hash="dc2a8632a3780c7e9ffaae2b94f0fde4"/></dir></dir></dir></dir></dir></dir></dir><dir name="etc"><dir name="modules"><file name="Speedinfo_Opensi.xml" hash="16cc3fbf8e32ce7b8add016bfbc89c5f"/></dir></dir><dir name="locale"><dir name="fr_FR"><file name="Speedinfo_OpenSi.csv" hash="51f46b50056059d178766fa9111fe072"/></dir></dir></dir></target><target name="magecommunity"><dir name="Speedinfo"><dir name="Opensi"><dir name="Block"><dir name="Adminhtml"><dir name="Edit"><dir name="Tab"><file name="Attributs.php" hash="562e895af0d5f2a1cffa1be63d0b5fa4"/><file name="Familles.php" hash="317e2361f1dcb6c494ca9ab6bf0d5cae"/><file name="General.php" hash="485e888e215dde1762a42d147cced3e1"/><file name="Webservices.php" hash="c75830c9708f854a26345d22be5edb01"/></dir><file name="Form.php" hash="3ce2dc7af0ec4c5a44178ac46d6178a8"/></dir><file name="Edit.php" hash="b91602dd06e9432d879db352fa2aaeaa"/><file name="Grid.php" hash="6ace416ae5264fed2bbc57aa5d152e6e"/><file name="Tabs.php" hash="4383dd11c3e1fffe43868e489f6b977f"/></dir></dir><dir name="controllers"><file name="IndexController.php" hash="b4e7604d12a41cebbeb8dc2e83399075"/></dir><dir name="etc"><file name="config.xml" hash="
|
19 |
<compatible/>
|
20 |
<dependencies/>
|
21 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Speedinfo_Opensi</name>
|
4 |
+
<version>0.2.4</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>GPL</license>
|
7 |
<channel>community</channel>
|
10 |
<description>Le module OpenSi Connect vous permet de coupler Magento au logiciel de gestion commerciale et de comptabilité OpenSi E-Commerce.
|
11 |
Speedinfo a conçu un connecteur pour OpenSi E-Commerce et Magento sous la forme du module OpenSi Connect
|
12 |
OpenSi E-Commerce, est un logiciel de gestion commerciale et de comptabilité dédié à l'e-commerce.</description>
|
13 |
+
<notes>Mise à jour du module vers la version 0.2.4.
|
14 |
Pour plus d'informations, se référer à la documentation.</notes>
|
15 |
<authors><author><name>Dray</name><user>auto-converted</user><email>rony.dray@speedinfo.fr</email></author></authors>
|
16 |
+
<date>2011-01-12</date>
|
17 |
+
<time>08:37:41</time>
|
18 |
+
<contents><target name="mage"><dir name="app"><dir name="design"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="opensi"><dir name="tab"><file name="webservices.phtml" hash="dc2a8632a3780c7e9ffaae2b94f0fde4"/></dir></dir></dir></dir></dir></dir></dir><dir name="etc"><dir name="modules"><file name="Speedinfo_Opensi.xml" hash="16cc3fbf8e32ce7b8add016bfbc89c5f"/></dir></dir><dir name="locale"><dir name="fr_FR"><file name="Speedinfo_OpenSi.csv" hash="51f46b50056059d178766fa9111fe072"/></dir></dir></dir></target><target name="magecommunity"><dir name="Speedinfo"><dir name="Opensi"><dir name="Block"><dir name="Adminhtml"><dir name="Edit"><dir name="Tab"><file name="Attributs.php" hash="562e895af0d5f2a1cffa1be63d0b5fa4"/><file name="Familles.php" hash="317e2361f1dcb6c494ca9ab6bf0d5cae"/><file name="General.php" hash="485e888e215dde1762a42d147cced3e1"/><file name="Webservices.php" hash="c75830c9708f854a26345d22be5edb01"/></dir><file name="Form.php" hash="3ce2dc7af0ec4c5a44178ac46d6178a8"/></dir><file name="Edit.php" hash="b91602dd06e9432d879db352fa2aaeaa"/><file name="Grid.php" hash="6ace416ae5264fed2bbc57aa5d152e6e"/><file name="Tabs.php" hash="4383dd11c3e1fffe43868e489f6b977f"/></dir></dir><dir name="controllers"><file name="IndexController.php" hash="b4e7604d12a41cebbeb8dc2e83399075"/></dir><dir name="etc"><file name="config.xml" hash="f4131f662437ba35f65a33bfaa2e8800"/></dir><dir name="Helper"><file name="Data.php" hash="b5798cdae9319b34ada4c3de5964c0b4"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Errorlog"><file name="Collection.php" hash="ad19bb95ad5e56f0dcaeff4db10cf52f"/></dir><dir name="Webservice"><file name="Collection.php" hash="3a5e5d973ffb834d4eadec4f9335b36e"/></dir><file name="Client.php" hash="0b47754c6aace0dc54340dfd807eb17a"/><file name="Errorlog.php" hash="9a8c882377bbdeada65c7c5d8346af35"/><file name="Webservice.php" hash="781eb93e76ba8bffe881f091904d0f98"/></dir><file name="Client.php" hash="f89aeb3dda8d8a27bf6a05e5082a945e"/><file name="Cron.php" hash="94436f6e624d9f665bc27cb92cadb001"/><file name="Errorlog.php" hash="d269ec20ae481684a1daa2c515848252"/><file name="Webservice.php" hash="c77708c3507d79a83e64a1801ea255c2"/><file name="Webservices.php" hash="136456ed98a080680fd353d176fffdc9"/></dir><dir name="sql"><dir name="opensi_setup"><file name="mysql4-install-0.1.0.php" hash="ce8cef17aac76ccfadf09d7d84d23841"/><file name="mysql4-upgrade-0.2.0-0.2.1.php" hash="f207b0704a6cad542dced6b40ac25341"/></dir></dir></dir></dir></target></contents>
|
19 |
<compatible/>
|
20 |
<dependencies/>
|
21 |
</package>
|