Adventos_OrderExport - Version 1.3.2

Version Notes

added addressID and vatId to both addresses export vat only when order customer group set in backend

Download this release

Release Info

Developer Karsten Hoffmann
Extension Adventos_OrderExport
Version 1.3.2
Comparing to
See all releases


Code changes from version 1.3.1 to 1.3.2

app/code/local/Adventos/OrderExport/Model/Observer.php CHANGED
@@ -150,7 +150,8 @@ class Adventos_OrderExport_Model_Observer
150
  $streetSA = $order->getShippingAddress()->getStreet();
151
 
152
  $customerGroupId = $order->getCustomerGroupId ();
153
-
 
154
  $group = Mage::getModel ('customer/group')->load ($customerGroupId);
155
  if ($group->getId()){
156
  $customerGroupName = $group->getCode();
@@ -162,6 +163,17 @@ class Adventos_OrderExport_Model_Observer
162
  $customerEmail = $customer->getEmail();
163
  }
164
 
 
 
 
 
 
 
 
 
 
 
 
165
  $saleorder = array(
166
  "id" => $order->getRealOrderId(),
167
  "store_id" => $order->getStoreId(),
@@ -193,7 +205,9 @@ class Adventos_OrderExport_Model_Observer
193
  "city" => $order->getShippingAddress()->getCity(),
194
  "postcode" => $order->getShippingAddress()->getPostcode(),
195
  "country" => $order->getShippingAddress()->getCountry(),
196
- "phone" => $order->getShippingAddress()->getTelephone()
 
 
197
  ),
198
  "billing_address" => array(
199
  "firstname" => $order->getBillingAddress()->getFirstname(),
@@ -204,7 +218,9 @@ class Adventos_OrderExport_Model_Observer
204
  "city" => $order->getBillingAddress()->getCity(),
205
  "postcode" => $order->getBillingAddress()->getPostcode(),
206
  "country" => $order->getBillingAddress()->getCountry(),
207
- "phone" => $order->getBillingAddress()->getTelephone()
 
 
208
  ),
209
  "lines" => $productArray,
210
  );
@@ -233,7 +249,7 @@ class Adventos_OrderExport_Model_Observer
233
  {
234
  Mage::logException($e);
235
  }
236
-
237
  $web_exported = @array();
238
  $allStores = Mage::app()->getStores();
239
  foreach ($allStores as $_eachStoreId => $val) {
150
  $streetSA = $order->getShippingAddress()->getStreet();
151
 
152
  $customerGroupId = $order->getCustomerGroupId ();
153
+ $customerGroupName = "";
154
+
155
  $group = Mage::getModel ('customer/group')->load ($customerGroupId);
156
  if ($group->getId()){
157
  $customerGroupName = $group->getCode();
163
  $customerEmail = $customer->getEmail();
164
  }
165
 
166
+ $exportVatGroup = Mage::getStoreConfig('catalog/orderexport/B2B_HomeGroup');
167
+ $exportVatGroup = explode(",", $exportVatGroup);
168
+
169
+ if (in_array($customerGroupId, $exportVatGroup)) {
170
+ $order->getBillingAddress()->getvat_id() ? $billing_vat_id = $order->getBillingAddress()->getCountry().$order->getBillingAddress()->getvat_id() : $billing_vat_id = "";
171
+ $order->getShippingAddress()->getvat_id() ? $shipping_vat_id = $order->getShippingAddress()->getCountry().$order->getShippingAddress()->getvat_id() : $shipping_vat_id = "";
172
+ }else{
173
+ $billing_vat_id = "";
174
+ $shipping_vat_id = "";
175
+ }
176
+
177
  $saleorder = array(
178
  "id" => $order->getRealOrderId(),
179
  "store_id" => $order->getStoreId(),
205
  "city" => $order->getShippingAddress()->getCity(),
206
  "postcode" => $order->getShippingAddress()->getPostcode(),
207
  "country" => $order->getShippingAddress()->getCountry(),
208
+ "phone" => $order->getShippingAddress()->getTelephone(),
209
+ "addressid" => $order->getShippingAddress()->getCustomerAddressId(),
210
+ "vatid" => $shipping_vat_id
211
  ),
212
  "billing_address" => array(
213
  "firstname" => $order->getBillingAddress()->getFirstname(),
218
  "city" => $order->getBillingAddress()->getCity(),
219
  "postcode" => $order->getBillingAddress()->getPostcode(),
220
  "country" => $order->getBillingAddress()->getCountry(),
221
+ "phone" => $order->getBillingAddress()->getTelephone(),
222
+ "addressid" => $order->getBillingAddress()->getCustomerAddressId(),
223
+ "vatid" => $billing_vat_id
224
  ),
225
  "lines" => $productArray,
226
  );
249
  {
250
  Mage::logException($e);
251
  }
252
+
253
  $web_exported = @array();
254
  $allStores = Mage::app()->getStores();
255
  foreach ($allStores as $_eachStoreId => $val) {
app/code/local/Adventos/OrderExport/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Adventos_OrderExport>
5
- <version>1.3.1</version>
6
  </Adventos_OrderExport>
7
  </modules>
8
  <global>
@@ -47,7 +47,8 @@
47
  <storage_id>2</storage_id>
48
  <store_language>de</store_language>
49
  <export_path></export_path>
 
50
  </orderexport>
51
  </catalog>
52
  </default>
53
- </config>
2
  <config>
3
  <modules>
4
  <Adventos_OrderExport>
5
+ <version>1.3.2</version>
6
  </Adventos_OrderExport>
7
  </modules>
8
  <global>
47
  <storage_id>2</storage_id>
48
  <store_language>de</store_language>
49
  <export_path></export_path>
50
+ <B2B_HomeGroup></B2B_HomeGroup>
51
  </orderexport>
52
  </catalog>
53
  </default>
54
+ </config>
app/code/local/Adventos/OrderExport/etc/system.xml CHANGED
@@ -47,7 +47,19 @@
47
  <show_in_default>1</show_in_default>
48
  <show_in_website>1</show_in_website>
49
  <show_in_store>1</show_in_store>
50
- </export_path>
 
 
 
 
 
 
 
 
 
 
 
 
51
  </fields>
52
  </orderexport>
53
  </groups>
47
  <show_in_default>1</show_in_default>
48
  <show_in_website>1</show_in_website>
49
  <show_in_store>1</show_in_store>
50
+ </export_path>
51
+ <B2B_HomeGroup translate="label">
52
+ <label>Vat Export Customer Group</label>
53
+ <comment>
54
+ <![CDATA[Export Vat in Shipping and Billing Address for Customer Group]]>
55
+ </comment>
56
+ <frontend_type>Multiselect</frontend_type>
57
+ <source_model>adminhtml/system_config_source_customer_group</source_model>
58
+ <sort_order>5</sort_order>
59
+ <show_in_default>1</show_in_default>
60
+ <show_in_website>1</show_in_website>
61
+ <show_in_store>1</show_in_store>
62
+ </B2B_HomeGroup>
63
  </fields>
64
  </orderexport>
65
  </groups>
package.xml CHANGED
@@ -1,19 +1,19 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Adventos_OrderExport</name>
4
- <version>1.3.1</version>
5
  <stability>stable</stability>
6
  <license>OSL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Magento integration for HeadOffice</summary>
10
  <description>Create Order XML file to integrate Magento with HeadOffice and synchronize stock, order status, invoice, shipments and credit memos.</description>
11
- <notes>Add new tag store language&#xD;
12
- Define export path multistore enviroment</notes>
13
  <authors><author><name>Karsten Hoffmann</name><user>adventos</user><email>karsten@adventos.de</email></author></authors>
14
- <date>2013-01-23</date>
15
- <time>09:29:16</time>
16
- <contents><target name="magelocal"><dir name="Adventos"><dir name="OrderExport"><dir name="Helper"><file name="Data.php" hash="f90dd7d2136cfb6349ba1d7ee939cd15"/></dir><dir name="Model"><dir name="Creditmemo"><dir name="Api"><file name="V2.php" hash="afba3391027e1ebe798253cdc034d034"/></dir><file name="Api.php" hash="c41e82cf79235d51f25d248719e93f92"/></dir><dir name="Invoice"><dir name="Api"><file name="V2.php" hash="ed0e742f85e0f450c3387bb8a7738033"/></dir><file name="Api.php" hash="280512b1ae37690871384b3cba0a3a2b"/></dir><file name="Observer.php" hash="334de5c28e0217f39108640778724f09"/><dir name="Shipment"><dir name="Api"><file name="V2.php" hash="22acaee0fe176a65fc1071d4dab5d6f5"/></dir><file name="Api.php" hash="0b9bf452b7e36c1ee5cefbb3d6c5eb3b"/></dir></dir><dir name="etc"><file name="api.xml" hash="8126b41684e8ee21ed6c8916e29f67d3"/><file name="config.xml" hash="9f0f84a6b50dfdacfb3d861e19b172d6"/><file name="system.xml" hash="f261813f3d5fb14ddabda24dab86921b"/><file name="wsdl.xml" hash="b3e1086c7e06ece8e0c0e5f537b1480f"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Adventos_OrderExport.xml" hash="479b13bf3a08de9f93f5f58d77d3f9bb"/></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
19
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Adventos_OrderExport</name>
4
+ <version>1.3.2</version>
5
  <stability>stable</stability>
6
  <license>OSL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Magento integration for HeadOffice</summary>
10
  <description>Create Order XML file to integrate Magento with HeadOffice and synchronize stock, order status, invoice, shipments and credit memos.</description>
11
+ <notes>added addressID and vatId to both addresses export vat only when order customer group set in backend&#xD;
12
+ </notes>
13
  <authors><author><name>Karsten Hoffmann</name><user>adventos</user><email>karsten@adventos.de</email></author></authors>
14
+ <date>2013-03-20</date>
15
+ <time>15:08:43</time>
16
+ <contents><target name="magelocal"><dir name="Adventos"><dir name="OrderExport"><dir name="Helper"><file name="Data.php" hash="f90dd7d2136cfb6349ba1d7ee939cd15"/></dir><dir name="Model"><dir name="Creditmemo"><dir name="Api"><file name="V2.php" hash="afba3391027e1ebe798253cdc034d034"/></dir><file name="Api.php" hash="c41e82cf79235d51f25d248719e93f92"/></dir><dir name="Invoice"><dir name="Api"><file name="V2.php" hash="ed0e742f85e0f450c3387bb8a7738033"/></dir><file name="Api.php" hash="280512b1ae37690871384b3cba0a3a2b"/></dir><file name="Observer.php" hash="cb4c069b82ec33747b6218998c4b3feb"/><dir name="Shipment"><dir name="Api"><file name="V2.php" hash="22acaee0fe176a65fc1071d4dab5d6f5"/></dir><file name="Api.php" hash="0b9bf452b7e36c1ee5cefbb3d6c5eb3b"/></dir></dir><dir name="etc"><file name="api.xml" hash="8126b41684e8ee21ed6c8916e29f67d3"/><file name="config.xml" hash="79ceae9a80cd5d4488c7e4f5cfdf6e62"/><file name="system.xml" hash="6204155a5c875e4db24c107fb375ff25"/><file name="wsdl.xml" hash="b3e1086c7e06ece8e0c0e5f537b1480f"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Adventos_OrderExport.xml" hash="479b13bf3a08de9f93f5f58d77d3f9bb"/></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
19
  </package>