Bluejalappeno_Orderexport - Version 2.8.4

Version Notes

Sage export includes configurable values for codes and account numbers

Download this release

Release Info

Developer Magento Core Team
Extension Bluejalappeno_Orderexport
Version 2.8.4
Comparing to
See all releases


Code changes from version 2.8.1 to 2.8.4

app/code/community/Bluejalappeno/Orderexport/Model/Export/Highrise.php CHANGED
@@ -201,7 +201,9 @@ class Bluejalappeno_Orderexport_Model_Export_Highrise extends Mage_Core_Model_Ab
201
  }
202
  }
203
  }
204
-
 
 
205
 
206
  return $id;
207
  }
201
  }
202
  }
203
  }
204
+ else {
205
+ Mage::throwException('Error: unable to connect to ' .$this->highrise_url .' please check the URL and API key in your configuration');
206
+ }
207
 
208
  return $id;
209
  }
app/code/community/Bluejalappeno/Orderexport/Model/Export/Sage.php CHANGED
@@ -35,10 +35,9 @@ class Bluejalappeno_Orderexport_Model_Export_Sage extends Bluejalappeno_Orderexp
35
  $fp = fopen(Mage::getBaseDir('export').'/'.$fileName, 'w');
36
 
37
  // $this->writeHeadRow($fp);
38
-
39
  $csv = '';
40
- foreach ($orders as $order) {
41
- $order = Mage::getModel('sales/order')->loadByAttribute('entity_id',$order);
42
  if ($order->getStatus() == Mage_Sales_Model_Order::STATE_COMPLETE || $order->getStatus() == Mage_Sales_Model_Order::STATE_CLOSED) {
43
  $this->writeOrder($order, $fp);
44
  }
@@ -127,7 +126,7 @@ class Bluejalappeno_Orderexport_Model_Export_Sage extends Bluejalappeno_Orderexp
127
  */
128
  protected function writeHeadRow($fp)
129
  {
130
- fputcsv($fp, $this->getHeadRowValues(), self::DELIMITER, self::ENCLOSURE);
131
  }
132
 
133
  /**
@@ -141,23 +140,42 @@ class Bluejalappeno_Orderexport_Model_Export_Sage extends Bluejalappeno_Orderexp
141
  {
142
  $customerDetails = $order->getBillingAddress();
143
 
144
-
145
  $orderdate = substr_replace($order->getData('created_at'), '', -8);
146
  $orderId = $order->getData('increment_id');
147
 
148
  $customerFirstName = $customerDetails->getFirstname();
149
  $customerLastName = $customerDetails->getLastname();
150
- $fullName = $customerFirstName.$customerLastName;
151
- $grandTotal = $order->getData('subtotal');
152
  $taxAmount = $order->getData('tax_amount');
153
  $paymentMethod = $this->getPaymentMethod($order);
154
  $taxcode = $this->setTaxCode($customerDetails->getCountry(),$order);
 
 
 
 
 
 
 
155
 
156
-
157
- $csvData = array('SI',date("Y/m/d"),'4000', '0',$orderdate,$orderId,$fullName,$grandTotal,$taxcode,$taxAmount,'1',$paymentMethod,'import');
158
 
159
  fputcsv($fp, $csvData, self::DELIMITER, self::ENCLOSURE);
160
-
 
 
 
 
 
 
 
 
 
 
 
 
 
161
 
162
  }
163
 
@@ -185,5 +203,5 @@ class Bluejalappeno_Orderexport_Model_Export_Sage extends Bluejalappeno_Orderexp
185
  );
186
  }
187
 
188
-
189
  }
35
  $fp = fopen(Mage::getBaseDir('export').'/'.$fileName, 'w');
36
 
37
  // $this->writeHeadRow($fp);
 
38
  $csv = '';
39
+ foreach ($orders as $orderId) {
40
+ $order = Mage::getModel('sales/order')->loadByAttribute('entity_id',$orderId);
41
  if ($order->getStatus() == Mage_Sales_Model_Order::STATE_COMPLETE || $order->getStatus() == Mage_Sales_Model_Order::STATE_CLOSED) {
42
  $this->writeOrder($order, $fp);
43
  }
126
  */
127
  protected function writeHeadRow($fp)
128
  {
129
+ fputcsv($fp, $this->getHeadRowValues(), self::DELIMITER, self::ENCLOSURE);
130
  }
131
 
132
  /**
140
  {
141
  $customerDetails = $order->getBillingAddress();
142
 
 
143
  $orderdate = substr_replace($order->getData('created_at'), '', -8);
144
  $orderId = $order->getData('increment_id');
145
 
146
  $customerFirstName = $customerDetails->getFirstname();
147
  $customerLastName = $customerDetails->getLastname();
148
+ $fullName = $customerFirstName .' ' .$customerLastName;
149
+ $grandTotal = $order->getData('subtotal');
150
  $taxAmount = $order->getData('tax_amount');
151
  $paymentMethod = $this->getPaymentMethod($order);
152
  $taxcode = $this->setTaxCode($customerDetails->getCountry(),$order);
153
+ $refundedAmount = $order->getData('total_refunded');
154
+ $refundedTaxAmount = $order->getData('tax_refunded');
155
+ $accountCodeSales = Mage::getStoreConfig('order_export/sage/sage_sales_account');
156
+ $nominalCodeSales = Mage::getStoreConfig('order_export/sage/sage_sales_nominal');
157
+ $nominalCodeShip = Mage::getStoreConfig('order_export/sage/sage_ship_nominal');
158
+ $accountCodePayments = Mage::getStoreConfig('order_export/sage/sage_pay_account');
159
+ $nominalCodePayments = Mage::getStoreConfig('order_export/sage/sage_pay_nominal');
160
 
161
+ $csvData = array('SI',$accountCodeSales,$nominalCodeSales, '0',$orderdate,$orderId,$fullName,$grandTotal,$taxcode,$taxAmount,'1',$paymentMethod,'import');
162
+ $payCsvData = array('SA' ,$accountCodePayments, $nominalCodePayments, '0', $orderdate,$orderId,$fullName,$grandTotal,$taxcode,$taxAmount,'1',$paymentMethod,'import');
163
 
164
  fputcsv($fp, $csvData, self::DELIMITER, self::ENCLOSURE);
165
+ fputcsv($fp, $payCsvData, self::DELIMITER, self::ENCLOSURE);
166
+ if ($order->getShippingAmount()!= NULL && $order->getShippingAmount() != 0) {
167
+ $shippingAmount = $order->getData('shipping_amount');
168
+ $shipTaxAmount = $order->getData('shipping_tax_amount');
169
+
170
+ $ship_csvData = array('SI',$accountCodeSales,$nominalCodeShip, '0',$orderdate,$orderId,$fullName,$shippingAmount,$taxcode,$shipTaxAmount,'1',$paymentMethod,'import');
171
+ fputcsv($fp, $ship_csvData, self::DELIMITER, self::ENCLOSURE);
172
+ }
173
+
174
+ if ($refundedAmount > 0) {
175
+ $refundcsvData = array('SC',$accountCodeSales,$nominalCodeSales, '0',$orderdate,$orderId,$fullName,$refundedAmount,$taxcode,$refundedTaxAmount,'1',$paymentMethod,'import');
176
+ fputcsv($fp, $refundcsvData, self::DELIMITER, self::ENCLOSURE);
177
+ }
178
+
179
 
180
  }
181
 
203
  );
204
  }
205
 
206
+
207
  }
app/code/community/Bluejalappeno/Orderexport/Model/Observer.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * @category Bluejalappeno
5
+ * @package Bluejalappeno_Orderexport
6
+ * @copyright Copyright (c) 2012 Wimbolt Ltd (http://www.bluejalappeno.com)
7
+ * @license http://www.bluejalappeno.com/license.txt - Commercial license
8
+ */
9
+
10
+
11
+ class Bluejalappeno_Orderexport_Model_Observer
12
+ {
13
+ public function addMassAction($observer) {
14
+ $block = $observer->getEvent()->getBlock();
15
+ if(get_class($block) =='Mage_Adminhtml_Block_Widget_Grid_Massaction'
16
+ && strstr( $block->getRequest()->getControllerName(), 'sales_order') && Mage::getStoreConfig("order_export/export_orders/active"))
17
+ {
18
+ $block->addItem('orderexport', array(
19
+ 'label' => Mage::helper('sales')->__('Export Orders'),
20
+ 'url' => Mage::app()->getStore()->getUrl('*/sales_order_export/csvexport'),
21
+ ));
22
+
23
+ }
24
+
25
+
26
+ }
27
+
28
+ }
app/code/community/Bluejalappeno/Orderexport/changelog.txt CHANGED
@@ -9,3 +9,7 @@ v2.6 - added credit card type to export
9
  v2.7 - resolved issue with exporting street address and currency symbols
10
 
11
  v2.8 - Rebranded to Blue Jalappeno
 
 
 
 
9
  v2.7 - resolved issue with exporting street address and currency symbols
10
 
11
  v2.8 - Rebranded to Blue Jalappeno
12
+
13
+ v2.9 - Resolved issue with compilation
14
+
15
+ v2.10 - Sage export includes shipping and payment entry
app/code/community/Bluejalappeno/Orderexport/etc/config.xml CHANGED
@@ -42,13 +42,6 @@
42
  <class>Bluejalappeno_Orderexport_Helper</class>
43
  </bluejalappeno_orderexport>
44
  </helpers>
45
- <blocks>
46
- <adminhtml>
47
- <rewrite>
48
- <sales_order_grid>Bluejalappeno_Orderexport_Block_Sales_Order_Grid</sales_order_grid>
49
- </rewrite>
50
- </adminhtml>
51
- </blocks>
52
  </global>
53
  <admin>
54
  <routers>
@@ -62,6 +55,16 @@
62
  </routers>
63
  </admin>
64
  <adminhtml>
 
 
 
 
 
 
 
 
 
 
65
  <translate>
66
  <modules>
67
  <Bluejalappeno_Orderexport>
42
  <class>Bluejalappeno_Orderexport_Helper</class>
43
  </bluejalappeno_orderexport>
44
  </helpers>
 
 
 
 
 
 
 
45
  </global>
46
  <admin>
47
  <routers>
55
  </routers>
56
  </admin>
57
  <adminhtml>
58
+ <events>
59
+ <core_block_abstract_prepare_layout_before>
60
+ <observers>
61
+ <orderexport_block_abstract_prepare_layout_before>
62
+ <class>bluejalappeno_orderexport/observer</class>
63
+ <method>addMassAction</method>
64
+ </orderexport_block_abstract_prepare_layout_before>
65
+ </observers>
66
+ </core_block_abstract_prepare_layout_before>
67
+ </events>
68
  <translate>
69
  <modules>
70
  <Bluejalappeno_Orderexport>
app/code/community/Bluejalappeno/Orderexport/etc/system.xml CHANGED
@@ -49,7 +49,7 @@
49
  This module was developed by <a href="http://www.bluejalappeno.com" target="_blank">www.BlueJalappeno.com</a> - <b>Magento Extension Specialists</b>.
50
  <br/>For docs & examples refer to the Blue Jalappeno <a href="http://wiki.bluejalappeno.com/home/order-export">wiki</a>.
51
  <br/>Need an order summary export or more features? We offer <a href="http://www.webshopapps.com/order-export-premium.html" target="_blank">Order Export Premium</a> including adding configurable attributes to export and automatic export with FTP.
52
- <br/>We have many more extensions for pricing, post order workflow and tax. Visit <a href="www.webshopapps.com/appshop.html" target="_blank">the WebShopApps App Store</a> for more information.</a>
53
  </div>
54
  ]]>
55
  </comment>
@@ -66,7 +66,7 @@
66
  <output_type translate="label">
67
  <label>Output type</label>
68
  <frontend_type>select</frontend_type>
69
- <source_model>bluejalappeno_orderexport_model_options_options</source_model>
70
  <sort_order>1</sort_order>
71
  <show_in_default>1</show_in_default>
72
  <show_in_website>1</show_in_website>
@@ -74,8 +74,58 @@
74
  </output_type>
75
  </fields>
76
  </export_orders>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  <highrise translate="label">
78
- <label>Blue Jalappeno Highrise Export</label>
79
  <frontend_type>text</frontend_type>
80
  <sort_order>3</sort_order>
81
  <show_in_default>1</show_in_default>
49
  This module was developed by <a href="http://www.bluejalappeno.com" target="_blank">www.BlueJalappeno.com</a> - <b>Magento Extension Specialists</b>.
50
  <br/>For docs & examples refer to the Blue Jalappeno <a href="http://wiki.bluejalappeno.com/home/order-export">wiki</a>.
51
  <br/>Need an order summary export or more features? We offer <a href="http://www.webshopapps.com/order-export-premium.html" target="_blank">Order Export Premium</a> including adding configurable attributes to export and automatic export with FTP.
52
+ <br/>We have many more extensions for pricing, post order workflow and tax. Visit <a href="http://www.webshopapps.com" target="_blank">the WebShopApps App Shop</a> for more information.</a>
53
  </div>
54
  ]]>
55
  </comment>
66
  <output_type translate="label">
67
  <label>Output type</label>
68
  <frontend_type>select</frontend_type>
69
+ <source_model>Bluejalappeno_Orderexport_Model_Options_Options</source_model>
70
  <sort_order>1</sort_order>
71
  <show_in_default>1</show_in_default>
72
  <show_in_website>1</show_in_website>
74
  </output_type>
75
  </fields>
76
  </export_orders>
77
+ <sage translate="label">
78
+ <label>Blue Jalappeno Order Export Community - Sage Export</label>
79
+ <frontend_type>text</frontend_type>
80
+ <sort_order>2</sort_order>
81
+ <show_in_default>1</show_in_default>
82
+ <show_in_website>1</show_in_website>
83
+ <show_in_store>1</show_in_store>
84
+ <fields>
85
+ <sage_sales_account translate="label">
86
+ <label>Account Code For Sales</label>
87
+ <frontend_type>text</frontend_type>
88
+ <sort_order>0</sort_order>
89
+ <show_in_default>1</show_in_default>
90
+ <show_in_website>1</show_in_website>
91
+ <show_in_store>0</show_in_store>
92
+ </sage_sales_account>
93
+ <sage_sales_nominal translate="label">
94
+ <label>Nominal Code For Sales</label>
95
+ <frontend_type>text</frontend_type>
96
+ <sort_order>1</sort_order>
97
+ <show_in_default>1</show_in_default>
98
+ <show_in_website>1</show_in_website>
99
+ <show_in_store>0</show_in_store>
100
+ </sage_sales_nominal>
101
+ <sage_ship_nominal translate="label">
102
+ <label>Nominal Code For Shipping Charges</label>
103
+ <frontend_type>text</frontend_type>
104
+ <sort_order>2</sort_order>
105
+ <show_in_default>1</show_in_default>
106
+ <show_in_website>1</show_in_website>
107
+ <show_in_store>0</show_in_store>
108
+ </sage_ship_nominal>
109
+ <sage_pay_account translate="label">
110
+ <label>Account Code For Payments</label>
111
+ <frontend_type>text</frontend_type>
112
+ <sort_order>3</sort_order>
113
+ <show_in_default>1</show_in_default>
114
+ <show_in_website>1</show_in_website>
115
+ <show_in_store>0</show_in_store>
116
+ </sage_pay_account>
117
+ <sage_pay_nominal translate="label">
118
+ <label>Nominal Code For Payments</label>
119
+ <frontend_type>text</frontend_type>
120
+ <sort_order>4</sort_order>
121
+ <show_in_default>1</show_in_default>
122
+ <show_in_website>1</show_in_website>
123
+ <show_in_store>0</show_in_store>
124
+ </sage_pay_nominal>
125
+ </fields>
126
+ </sage>
127
  <highrise translate="label">
128
+ <label>Blue Jalappeno Order Export Community - Highrise Export</label>
129
  <frontend_type>text</frontend_type>
130
  <sort_order>3</sort_order>
131
  <show_in_default>1</show_in_default>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Bluejalappeno_Orderexport</name>
4
- <version>2.8.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -13,11 +13,11 @@
13
  - standard csv format also includes item details and custom options with one line item per row&#xD;
14
  -Sage export is pre-formatted for upload to Sage accounting systems&#xD;
15
  -Highrise export will connect with your Highrise CRM account and update your customer details, order history and background information.</description>
16
- <notes>Latest version including format changes for street address and multiple currencies</notes>
17
  <authors><author><name>Genevieve Eddison</name><user>auto-converted</user><email>sales@bluejalappeno.com</email></author></authors>
18
- <date>2012-07-20</date>
19
- <time>08:06:19</time>
20
- <contents><target name="magecommunity"><dir name="Bluejalappeno"><dir name="Orderexport"><dir name="Block"><dir name="Sales"><dir name="Order"><file name="Grid.php" hash="b9b3a0b810c7fd756d5dbd7ec99a83a5"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="54167d4d52bbe2a993031b12d29f0b89"/></dir><dir name="Model"><dir name="Export"><file name="Abstractcsv.php" hash="01607a1c81b14816fa8236a2f9eaf2bd"/><file name="Csv.php" hash="f00ae2076f43a7f73e30fd86ca940371"/><file name="Highrise.php" hash="31ae70d18988e31ab951bae6ebe0445a"/><file name="Sage.php" hash="1a0ddeb628010327883a9ca7390932af"/><file name="Status.php" hash="9864800aa692cfc3846a50cead36c4b1"/></dir><dir name="Options"><file name="Options.php" hash="21f4fdf0df408aad2a0898d1e1459cfd"/></dir></dir><dir name="controllers"><dir name="Sales"><dir name="Order"><file name="ExportController.php" hash="8343ada483bb5813eb7d04387267cef0"/></dir></dir></dir><dir name="etc"><file name="config.xml" hash="ca9f504d6cf8da1ec80808e2c19046ba"/><file name="system.xml" hash="84050b2d60b7706351982d86a9ccaea2"/></dir><file name="changelog.txt" hash="8751dfd9d46306c70b2d0428a70d863d"/><file name="versions_supported.txt" hash="a3e69dd4d9f892aab0dcbf0a5dd246e2"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Bluejalappeno_Orderexport.xml" hash="2475d3204e4ed96a2969993d51eacfe2"/></dir></target></contents>
21
  <compatible/>
22
  <dependencies/>
23
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Bluejalappeno_Orderexport</name>
4
+ <version>2.8.4</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
13
  - standard csv format also includes item details and custom options with one line item per row&#xD;
14
  -Sage export is pre-formatted for upload to Sage accounting systems&#xD;
15
  -Highrise export will connect with your Highrise CRM account and update your customer details, order history and background information.</description>
16
+ <notes>Sage export includes configurable values for codes and account numbers</notes>
17
  <authors><author><name>Genevieve Eddison</name><user>auto-converted</user><email>sales@bluejalappeno.com</email></author></authors>
18
+ <date>2012-11-05</date>
19
+ <time>06:13:40</time>
20
+ <contents><target name="magecommunity"><dir name="Bluejalappeno"><dir name="Orderexport"><dir name="Block"><dir name="Sales"><dir name="Order"><file name="Grid.php" hash="b9b3a0b810c7fd756d5dbd7ec99a83a5"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="54167d4d52bbe2a993031b12d29f0b89"/></dir><dir name="Model"><dir name="Export"><file name="Abstractcsv.php" hash="01607a1c81b14816fa8236a2f9eaf2bd"/><file name="Csv.php" hash="f00ae2076f43a7f73e30fd86ca940371"/><file name="Highrise.php" hash="846f2903af565ded408c8d68745545bb"/><file name="Sage.php" hash="be588e3698b0cc0ebd46e1f623181c57"/><file name="Status.php" hash="9864800aa692cfc3846a50cead36c4b1"/></dir><dir name="Options"><file name="Options.php" hash="21f4fdf0df408aad2a0898d1e1459cfd"/></dir><file name="Observer.php" hash="146ec38b9f087792217d3ba4f55bd25c"/></dir><dir name="controllers"><dir name="Sales"><dir name="Order"><file name="ExportController.php" hash="8343ada483bb5813eb7d04387267cef0"/></dir></dir></dir><dir name="etc"><file name="config.xml" hash="ea64eff226e20394b5514700b31a9b58"/><file name="system.xml" hash="b2d7e6ec001938c450e602b45eefcad1"/></dir><file name="changelog.txt" hash="0a771d5f5ac8433ae40f46d57103746b"/><file name="versions_supported.txt" hash="a3e69dd4d9f892aab0dcbf0a5dd246e2"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Bluejalappeno_Orderexport.xml" hash="2475d3204e4ed96a2969993d51eacfe2"/></dir></target></contents>
21
  <compatible/>
22
  <dependencies/>
23
  </package>