Version Notes
Minor bugfixes
Download this release
Release Info
Developer | Casper Mekel |
Extension | Qinvoice_Connect |
Version | 1.0.7 |
Comparing to | |
See all releases |
Code changes from version 1.0.6 to 1.0.7
- app/code/community/Qinvoice/Connect/Model/Order/Observer.php +5 -5
- app/code/community/Qinvoice/Connect/Model/Source/CalcMethod.php +0 -13
- app/code/community/Qinvoice/Connect/Model/Source/{Calculationmethod.php → Method.php} +1 -1
- app/code/community/Qinvoice/Connect/etc/config.xml +1 -1
- app/code/community/Qinvoice/Connect/etc/system.xml +10 -10
- package.xml +5 -5
app/code/community/Qinvoice/Connect/Model/Order/Observer.php
CHANGED
@@ -100,7 +100,7 @@ class Qinvoice_Connect_Model_Order_Observer
|
|
100 |
$varCurrenyCode = Mage::app()->getStore()->getCurrentCurrency()->getCode();
|
101 |
// GETTING ORDER STATUS
|
102 |
$prefix = Mage::getConfig()->getTablePrefix();
|
103 |
-
$resultOne = $db->query("SELECT entity_id, status, customer_email, base_currency_code, shipping_description, shipping_amount, shipping_tax_amount, increment_id, grand_total, total_paid, billing_address_id, shipping_address_id FROM {$prefix}sales_flat_order WHERE entity_id=".$varOrderID);
|
104 |
$rowOne = $resultOne->fetch(PDO::FETCH_ASSOC);
|
105 |
|
106 |
|
@@ -180,7 +180,7 @@ class Qinvoice_Connect_Model_Order_Observer
|
|
180 |
$invoice->zipcode = $rowThree['postcode']; // Self-explanatory
|
181 |
$invoice->city = $rowThree['city']; // Self-explanatory
|
182 |
$invoice->country = $rowThree['country_id']; // 2 character country code: NL for Netherlands, DE for Germany etc
|
183 |
-
$invoice->vatnumber = $rowThree['vat_id'];
|
184 |
|
185 |
$prefix = Mage::getConfig()->getTablePrefix();
|
186 |
$resultFour = $db->query("SELECT firstname, lastname, company, email, telephone, street, city, region, postcode, country_id FROM {$prefix}sales_flat_order_address WHERE entity_id='".$rowOne['shipping_address_id']."'");
|
@@ -308,7 +308,8 @@ class Qinvoice_Connect_Model_Order_Observer
|
|
308 |
}
|
309 |
if($rowOne['shipping_amount'] > 0)
|
310 |
{
|
311 |
-
$params = array(
|
|
|
312 |
'description' => trim($rowOne['shipping_description']),
|
313 |
'price' => $rowOne['shipping_amount']*100,
|
314 |
'price_inl' => $rowOne['shipping_amount']*100,
|
@@ -325,7 +326,6 @@ class Qinvoice_Connect_Model_Order_Observer
|
|
325 |
|
326 |
|
327 |
$result = $invoice->sendRequest();
|
328 |
-
die();
|
329 |
if($result == 1){
|
330 |
//notify_to_admin('Casper Mekel','casper@newday.sk','Invoice generated!');
|
331 |
}else{
|
@@ -415,7 +415,7 @@ class qinvoice{
|
|
415 |
}
|
416 |
|
417 |
public function addItem($params){
|
418 |
-
$item['code'] = $params['code'];
|
419 |
$item['description'] = $params['description'];
|
420 |
$item['price'] = $params['price'];
|
421 |
$item['price_incl'] = $params['price_incl'];
|
100 |
$varCurrenyCode = Mage::app()->getStore()->getCurrentCurrency()->getCode();
|
101 |
// GETTING ORDER STATUS
|
102 |
$prefix = Mage::getConfig()->getTablePrefix();
|
103 |
+
$resultOne = $db->query("SELECT entity_id, status, customer_email, base_currency_code, shipping_description, shipping_amount, shipping_tax_amount, increment_id, grand_total, total_paid, billing_address_id, shipping_address_id, customer_taxvat FROM {$prefix}sales_flat_order WHERE entity_id=".$varOrderID);
|
104 |
$rowOne = $resultOne->fetch(PDO::FETCH_ASSOC);
|
105 |
|
106 |
|
180 |
$invoice->zipcode = $rowThree['postcode']; // Self-explanatory
|
181 |
$invoice->city = $rowThree['city']; // Self-explanatory
|
182 |
$invoice->country = $rowThree['country_id']; // 2 character country code: NL for Netherlands, DE for Germany etc
|
183 |
+
$invoice->vatnumber = strlen($rowThree['vat_id']) > 3 ? $rowThree['vat_id'] : $rowOne['customer_taxvat'];
|
184 |
|
185 |
$prefix = Mage::getConfig()->getTablePrefix();
|
186 |
$resultFour = $db->query("SELECT firstname, lastname, company, email, telephone, street, city, region, postcode, country_id FROM {$prefix}sales_flat_order_address WHERE entity_id='".$rowOne['shipping_address_id']."'");
|
308 |
}
|
309 |
if($rowOne['shipping_amount'] > 0)
|
310 |
{
|
311 |
+
$params = array(
|
312 |
+
'code' => '',
|
313 |
'description' => trim($rowOne['shipping_description']),
|
314 |
'price' => $rowOne['shipping_amount']*100,
|
315 |
'price_inl' => $rowOne['shipping_amount']*100,
|
326 |
|
327 |
|
328 |
$result = $invoice->sendRequest();
|
|
|
329 |
if($result == 1){
|
330 |
//notify_to_admin('Casper Mekel','casper@newday.sk','Invoice generated!');
|
331 |
}else{
|
415 |
}
|
416 |
|
417 |
public function addItem($params){
|
418 |
+
$item['code'] = (isset($params['code']) ? $params['code'] : "");
|
419 |
$item['description'] = $params['description'];
|
420 |
$item['price'] = $params['price'];
|
421 |
$item['price_incl'] = $params['price_incl'];
|
app/code/community/Qinvoice/Connect/Model/Source/CalcMethod.php
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Qinvoice_Connect_Model_Source_Invoice
|
3 |
-
{
|
4 |
-
public function toOptionArray()
|
5 |
-
{
|
6 |
-
return array(
|
7 |
-
array('value' => 0, 'label' => 'Save invoice as concept'),
|
8 |
-
array('value' => 1, 'label' => 'Finalize invoice'),
|
9 |
-
array('value' => 2, 'label' => 'Finalize and send via email')
|
10 |
-
);
|
11 |
-
}
|
12 |
-
}
|
13 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Qinvoice/Connect/Model/Source/{Calculationmethod.php → Method.php}
RENAMED
@@ -1,5 +1,5 @@
|
|
1 |
<?php
|
2 |
-
class
|
3 |
{
|
4 |
public function toOptionArray()
|
5 |
{
|
1 |
<?php
|
2 |
+
class Qinvoice_Connect_Model_Source_Method
|
3 |
{
|
4 |
public function toOptionArray()
|
5 |
{
|
app/code/community/Qinvoice/Connect/etc/config.xml
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<config>
|
4 |
<modules>
|
5 |
<Qinvoice_Connect>
|
6 |
-
<version>1.0.
|
7 |
</Qinvoice_Connect>
|
8 |
</modules>
|
9 |
<global>
|
3 |
<config>
|
4 |
<modules>
|
5 |
<Qinvoice_Connect>
|
6 |
+
<version>1.0.7</version>
|
7 |
</Qinvoice_Connect>
|
8 |
</modules>
|
9 |
<global>
|
app/code/community/Qinvoice/Connect/etc/system.xml
CHANGED
@@ -49,16 +49,6 @@
|
|
49 |
<show_in_website>1</show_in_website>
|
50 |
<show_in_store>1</show_in_store>
|
51 |
</api_password>
|
52 |
-
<calculation_method translate="label">
|
53 |
-
<label>Calculation method</label>
|
54 |
-
<frontend_type>select</frontend_type>
|
55 |
-
<source_model>invoice/source_calculationmethod</source_model>
|
56 |
-
<sort_order>7</sort_order>
|
57 |
-
<show_in_default>1</show_in_default>
|
58 |
-
<show_in_website>1</show_in_website>
|
59 |
-
<show_in_store>1</show_in_store>
|
60 |
-
<comment><![CDATA[Select leading price type]]></comment>
|
61 |
-
</calculation_method>
|
62 |
<layout_code translate="label">
|
63 |
<label>Layout Code</label>
|
64 |
<frontend_type>text</frontend_type>
|
@@ -125,6 +115,16 @@
|
|
125 |
<show_in_store>1</show_in_store>
|
126 |
<comment><![CDATA[Save customer details to address book?]]></comment>
|
127 |
</save_relation>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
</fields>
|
129 |
</invoice>
|
130 |
</groups>
|
49 |
<show_in_website>1</show_in_website>
|
50 |
<show_in_store>1</show_in_store>
|
51 |
</api_password>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
<layout_code translate="label">
|
53 |
<label>Layout Code</label>
|
54 |
<frontend_type>text</frontend_type>
|
115 |
<show_in_store>1</show_in_store>
|
116 |
<comment><![CDATA[Save customer details to address book?]]></comment>
|
117 |
</save_relation>
|
118 |
+
<calculation_method translate="label">
|
119 |
+
<label>Calculation method</label>
|
120 |
+
<frontend_type>select</frontend_type>
|
121 |
+
<source_model>invoice/source_method</source_model>
|
122 |
+
<sort_order>10</sort_order>
|
123 |
+
<show_in_default>1</show_in_default>
|
124 |
+
<show_in_website>1</show_in_website>
|
125 |
+
<show_in_store>1</show_in_store>
|
126 |
+
<comment><![CDATA[Select leading price type]]></comment>
|
127 |
+
</calculation_method>
|
128 |
</fields>
|
129 |
</invoice>
|
130 |
</groups>
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Qinvoice_Connect</name>
|
4 |
-
<version>1.0.
|
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>
|
12 |
<authors><author><name>Casper Mekel</name><user>caspermekel</user><email>info@q-invoice.com</email></author></authors>
|
13 |
-
<date>2014-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Qinvoice"><file name="CHANGELOG" hash="b13454004c420dfb97201b73d79598f9"/><dir name="Connect"><dir name="Helper"><file name="Data.php" hash="ccb4b09674319e8b20e9c06a94adfa38"/></dir><dir name="Model"><dir name="Order"><file name="Observer.php" hash="
|
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.8.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.7</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>Minor bugfixes</notes>
|
12 |
<authors><author><name>Casper Mekel</name><user>caspermekel</user><email>info@q-invoice.com</email></author></authors>
|
13 |
+
<date>2014-03-29</date>
|
14 |
+
<time>13:40:57</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Qinvoice"><file name="CHANGELOG" hash="b13454004c420dfb97201b73d79598f9"/><dir name="Connect"><dir name="Helper"><file name="Data.php" hash="ccb4b09674319e8b20e9c06a94adfa38"/></dir><dir name="Model"><dir name="Order"><file name="Observer.php" hash="19880b506d22198d32a4a077d6322463"/></dir><dir name="Source"><file name="Invoice.php" hash="4661f369f7e116fd761e5fffac9efeaf"/><file name="Method.php" hash="ac6891fc7e403250b24f5b0f2d6199bc"/><file name="Relation.php" hash="89ab031937b846ab5f0bcac7ccaa31b7"/><file name="Trigger.php" hash="e65427cc9773baaedae2b3897c7bf28a"/></dir></dir><dir name="etc"><file name="config.xml" hash="51c977950c924bd644562f8883be1ac1"/><file name="system.xml" hash="83e6dd86e5488715edb32c180cfbf35c"/></dir><file name="readme.txt" hash="d41d8cd98f00b204e9800998ecf8427e"/></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.8.0</max></package><extension><name>curl</name><min>5.1</min><max>6.0</max></extension></required></dependencies>
|
18 |
</package>
|