Qinvoice_Connect - Version 1.0.1

Version Notes

Added support for product_category in q-invoice.

To enable please follow these steps.

1) Add attribute 'qinvoice_category' (without the quotes) to your installation and hide this attribute from frontend.

2) For every product add one or more categories, separated by commas.

3) Done.

Download this release

Release Info

Developer Casper Mekel
Extension Qinvoice_Connect
Version 1.0.1
Comparing to
See all releases


Code changes from version 1.0.0 to 1.0.1

app/code/community/Qinvoice/CHANGELOG ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ CHANGELOG
2
+
3
+ v1.0.1 - 2013/08/14
4
+ - Added support for productgroups/attributes (qinvoice_category)
5
+
6
+ v1.0.0 - 2013/08/13
7
+ - Initial release
app/code/community/Qinvoice/Connect/Model/Order/Observer.php CHANGED
@@ -83,8 +83,9 @@ class Qinvoice_Connect_Model_Order_Observer
83
  $varStatus = 'Sent';
84
  }
85
 
86
- $result = $db->query("SELECT item_id, product_type, product_options, order_id, sku, name, description, qty_ordered, base_price, tax_percent, tax_amount, base_discount_amount FROM sales_flat_order_item WHERE order_id=".$varOrderID." AND parent_item_id IS NULL GROUP BY sku HAVING (order_id > 0) ORDER BY item_id desc");
87
 
 
88
  if(!$result) {
89
  //return false;
90
  }
@@ -167,7 +168,12 @@ class Qinvoice_Connect_Model_Order_Observer
167
 
168
 
169
  for($i=0;$i<count($arrData);$i++)
170
- {
 
 
 
 
 
171
  $arrItemOptions = unserialize($arrData[$i]['product_options']);
172
 
173
  $varDescription = '';
@@ -196,7 +202,7 @@ class Qinvoice_Connect_Model_Order_Observer
196
  'vatpercentage' => trim(number_format($arrData[$i]['tax_percent'],2,'.', ''))*100,
197
  'discount' => trim(number_format($arrData[$i]['base_discount_amount'], 2, '.', '')/$arrData[$i]['base_price'])*100,
198
  'quantity' => $arrData[$i]['qty_ordered']*100,
199
- 'categories' => ''
200
  );
201
  //mail('casper@expertnetwork.nl', 'vat', $arrData[$i]['tax_percent']);
202
  $invoice->addItem($params);
83
  $varStatus = 'Sent';
84
  }
85
 
86
+ $result = $db->query("SELECT item_id, product_type, product_id, product_options, order_id, sku, name, description, qty_ordered, base_price, tax_percent, tax_amount, base_discount_amount FROM sales_flat_order_item WHERE order_id=".$varOrderID." AND parent_item_id IS NULL GROUP BY sku HAVING (order_id > 0) ORDER BY item_id desc");
87
 
88
+
89
  if(!$result) {
90
  //return false;
91
  }
168
 
169
 
170
  for($i=0;$i<count($arrData);$i++)
171
+ {
172
+ $category = '';
173
+ $_productId = $arrData[$i]['product_id'];
174
+ $_product = Mage::getModel('catalog/product')->load($_productId);
175
+ $category = $_product->getData('qinvoice_category');
176
+
177
  $arrItemOptions = unserialize($arrData[$i]['product_options']);
178
 
179
  $varDescription = '';
202
  'vatpercentage' => trim(number_format($arrData[$i]['tax_percent'],2,'.', ''))*100,
203
  'discount' => trim(number_format($arrData[$i]['base_discount_amount'], 2, '.', '')/$arrData[$i]['base_price'])*100,
204
  'quantity' => $arrData[$i]['qty_ordered']*100,
205
+ 'categories' => $category
206
  );
207
  //mail('casper@expertnetwork.nl', 'vat', $arrData[$i]['tax_percent']);
208
  $invoice->addItem($params);
app/code/community/Qinvoice/Connect/etc/config.xml CHANGED
@@ -3,7 +3,7 @@
3
  <config>
4
  <modules>
5
  <Qinvoice_Connect>
6
- <version>1.0.0</version>
7
  </Qinvoice_Connect>
8
  </modules>
9
  <global>
3
  <config>
4
  <modules>
5
  <Qinvoice_Connect>
6
+ <version>1.0.1</version>
7
  </Qinvoice_Connect>
8
  </modules>
9
  <global>
package.xml CHANGED
@@ -1,18 +1,26 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Qinvoice_Connect</name>
4
- <version>1.0.0</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Connects to q-invoice for sending invoices.</summary>
10
  <description>Manage your financial adminstration with q-invoice. All orders are invoiced through q-invoice and automatically added to your administration.</description>
11
- <notes>Initial release.</notes>
 
 
 
 
 
 
 
 
12
  <authors><author><name>Casper Mekel</name><user>caspermekel</user><email>info@q-invoice.com</email></author></authors>
13
  <date>2013-08-14</date>
14
- <time>08:44:13</time>
15
- <contents><target name="magecommunity"><dir name="Qinvoice"><dir name="Connect"><dir name="Model"><dir name="Order"><file name="Observer.php" hash="9abf5f820e75ea2e1b0f6e6eab74eca9"/></dir></dir><dir name="etc"><file name="config.xml" hash="2b8a24a7f27977c3ddd27abae710a995"/><file name="system.xml" hash="0146af102e16b6a8450aee736085e00f"/></dir></dir><dir name="Invoice_"><dir name="Helper"><file name="Data.php" hash="b17b2a7e7d551b9b24924d667759febb"/></dir><dir name="Order"><file name="Observer.php" hash="16bc431c2fb1c47f006ce7e0840683c5"/></dir><dir name="etc"><file name="config.xml" hash="dab71cf14d17e66a498adc4fe5e17f7d"/><file name="configold.xml" hash="190809fc9045610c7749b762b8568ced"/><file name="system.xml" hash="b8047d3ed2e8d3adcc12eb0b49ef25fc"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Qinvoice_Connect.xml" hash="fbedefa4e926092705c6941ad28f51f8"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.6.0.0</min><max>1.7.0</max></package><extension><name>curl</name><min>5.1</min><max>6.0</max></extension></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Qinvoice_Connect</name>
4
+ <version>1.0.1</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Connects to q-invoice for sending invoices.</summary>
10
  <description>Manage your financial adminstration with q-invoice. All orders are invoiced through q-invoice and automatically added to your administration.</description>
11
+ <notes>Added support for product_category in q-invoice.&#xD;
12
+ &#xD;
13
+ To enable please follow these steps.&#xD;
14
+ &#xD;
15
+ 1) Add attribute 'qinvoice_category' (without the quotes) to your installation and hide this attribute from frontend.&#xD;
16
+ &#xD;
17
+ 2) For every product add one or more categories, separated by commas. &#xD;
18
+ &#xD;
19
+ 3) Done.</notes>
20
  <authors><author><name>Casper Mekel</name><user>caspermekel</user><email>info@q-invoice.com</email></author></authors>
21
  <date>2013-08-14</date>
22
+ <time>14:25:20</time>
23
+ <contents><target name="magecommunity"><dir name="Qinvoice"><file name="CHANGELOG" hash="260c1b211fcfc288a3973f2031bd79a7"/><dir name="Connect"><dir name="Model"><dir name="Order"><file name="Observer.php" hash="aafc8f08226c818c562ada10fae878e4"/></dir></dir><dir name="etc"><file name="config.xml" hash="63a43c7562033ed41aec59498b1da5c8"/><file name="system.xml" hash="0146af102e16b6a8450aee736085e00f"/></dir></dir><dir name="Invoice_"><dir name="Helper"><file name="Data.php" hash="b17b2a7e7d551b9b24924d667759febb"/></dir><dir name="Order"><file name="Observer.php" hash="16bc431c2fb1c47f006ce7e0840683c5"/></dir><dir name="etc"><file name="config.xml" hash="dab71cf14d17e66a498adc4fe5e17f7d"/><file name="configold.xml" hash="190809fc9045610c7749b762b8568ced"/><file name="system.xml" hash="b8047d3ed2e8d3adcc12eb0b49ef25fc"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Qinvoice_Connect.xml" hash="fbedefa4e926092705c6941ad28f51f8"/></dir></target></contents>
24
  <compatible/>
25
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.6.0.0</min><max>1.7.0</max></package><extension><name>curl</name><min>5.1</min><max>6.0</max></extension></required></dependencies>
26
  </package>