Waterstone_Winvoice - Version 1.0.3

Version Notes

Fixed bugs and errors

Download this release

Release Info

Developer Waterstone
Extension Waterstone_Winvoice
Version 1.0.3
Comparing to
See all releases


Code changes from version 1.0.2.2 to 1.0.3

app/code/community/Waterstone/Winvoice/Model/AddInvoice.php CHANGED
@@ -70,8 +70,10 @@ class Waterstone_Winvoice_Model_AddInvoice extends Mage_Core_Model_Abstract
70
  $this->client = new \nusoap_client(Mage::getStoreConfig('winvoice/wconfig/wapi'));
71
  $this->password = Mage::getStoreConfig('winvoice/wconfig/wpassword');
72
 
73
- Mage::log("Winvoice | Foi criado um cliente: ".print_r($this->client), null, 'winvoice.log', true);
74
- Mage::log("Winvoice | Password do cliente: {$this->password}", null, 'winvoice.log', true);
 
 
75
  }
76
 
77
  /**
@@ -134,20 +136,23 @@ class Waterstone_Winvoice_Model_AddInvoice extends Mage_Core_Model_Abstract
134
  'type' => 'S',
135
  'quantity' => '1',
136
  'price' => number_format((float)$invoice->getOrder()->getBaseShippingAmount(), 2, '.', ''),
137
- 'discount' => '0.00',
138
  'tax' => $vat,
139
  'taxreason' => '',
140
  );
141
 
142
  $Products[] = $Product;
 
 
 
143
 
144
  $params = array(
145
  'client' => $this->getClientNumber($invoice),
146
  'type' => '1', //Tipo de documento (ver tabela Tipos de Documento)
147
  'date' => date("Y-m-d"), //Data do documento (ex: 2011-01-01)
148
  'payment_date' => date("Y-m-d"), //date (*) Data de vencimento do documento (ex: 2011-01-01)
149
- 'description' => 'F'.$invoice->getEntityId(),
150
- 'footer' => 'Numero Interno '.$invoice->getEntityId(),
151
  'products' => $Products,
152
  'password' => $this->password,
153
  );
@@ -230,7 +235,7 @@ class Waterstone_Winvoice_Model_AddInvoice extends Mage_Core_Model_Abstract
230
  Mage::log("Winvoice | Os dados do cliente na invoice são:", null, 'winvoice.log', true);
231
  Mage::log("Winvoice | Nome:".$invoice->getOrder()->getCustomerName(), null, 'winvoice.log', true);
232
  Mage::log("Winvoice | ID:".$invoice->getOrder()->getCustomerId(), null, 'winvoice.log', true);
233
- Mage::log("Winvoice | NIF:".$invoice->getOrder()->getCustomerTaxvat(), null, 'winvoice.log', true);
234
  Mage::log("Winvoice | WSClient do cliente:".$customer->getWsclient(), null, 'winvoice.log', true);
235
  Mage::log("Winvoice | WSClient da encomenda:".$invoice->getOrder()->getCustomerWsclient(), null, 'winvoice.log', true);
236
  Mage::log("Winvoice | Morada: ".$address->getStreetFull(), null, 'winvoice.log', true);
@@ -299,7 +304,7 @@ class Waterstone_Winvoice_Model_AddInvoice extends Mage_Core_Model_Abstract
299
  $customer->save();
300
  } else {
301
  Mage::log("Winvoice | Erro ao criar factura.", null, 'winvoice.log', true);
302
- $this->wLog->log("info", "One time costumer processed");
303
  }
304
 
305
  Mage::log("Winvoice | Foi criado um novo WSClient com o numero ".$result['description1'], null, 'winvoice.log', true);
@@ -323,7 +328,8 @@ class Waterstone_Winvoice_Model_AddInvoice extends Mage_Core_Model_Abstract
323
  {
324
  return;
325
 
326
- $this->wLog->Log("info", "AutoInvoice trigger for order".$observer->getEvent()->getOrder());
 
327
 
328
  $order = $observer->getEvent()->getShipment()->getOrder();
329
 
70
  $this->client = new \nusoap_client(Mage::getStoreConfig('winvoice/wconfig/wapi'));
71
  $this->password = Mage::getStoreConfig('winvoice/wconfig/wpassword');
72
 
73
+
74
+ Mage::log("Winvoice | Foi criado um cliente SOAP.", null, 'winvoice.log', true);
75
+ Mage::log("Winvoice | Password do cliente SOAP: {$this->password}", null, 'winvoice.log', true);
76
+
77
  }
78
 
79
  /**
136
  'type' => 'S',
137
  'quantity' => '1',
138
  'price' => number_format((float)$invoice->getOrder()->getBaseShippingAmount(), 2, '.', ''),
139
+ 'discount' => number_format((float)$invoice->getOrder()->getBaseShippingDiscountAmount(), 2, '.', ''),
140
  'tax' => $vat,
141
  'taxreason' => '',
142
  );
143
 
144
  $Products[] = $Product;
145
+
146
+
147
+ Mage::log("Winvoice | Id do client a enviar para factura weo: ".$this->getClientNumber($invoice), null, 'winvoice.log', true);
148
 
149
  $params = array(
150
  'client' => $this->getClientNumber($invoice),
151
  'type' => '1', //Tipo de documento (ver tabela Tipos de Documento)
152
  'date' => date("Y-m-d"), //Data do documento (ex: 2011-01-01)
153
  'payment_date' => date("Y-m-d"), //date (*) Data de vencimento do documento (ex: 2011-01-01)
154
+ 'description' => '',
155
+ 'footer' => 'Encomenda: '.$invoice->getOrder()->getIncrementId(),
156
  'products' => $Products,
157
  'password' => $this->password,
158
  );
235
  Mage::log("Winvoice | Os dados do cliente na invoice são:", null, 'winvoice.log', true);
236
  Mage::log("Winvoice | Nome:".$invoice->getOrder()->getCustomerName(), null, 'winvoice.log', true);
237
  Mage::log("Winvoice | ID:".$invoice->getOrder()->getCustomerId(), null, 'winvoice.log', true);
238
+ Mage::log("Winvoice | NIF:".$address->getVatId()/*$invoice->getOrder()->getCustomerTaxvat()*/, null, 'winvoice.log', true);
239
  Mage::log("Winvoice | WSClient do cliente:".$customer->getWsclient(), null, 'winvoice.log', true);
240
  Mage::log("Winvoice | WSClient da encomenda:".$invoice->getOrder()->getCustomerWsclient(), null, 'winvoice.log', true);
241
  Mage::log("Winvoice | Morada: ".$address->getStreetFull(), null, 'winvoice.log', true);
304
  $customer->save();
305
  } else {
306
  Mage::log("Winvoice | Erro ao criar factura.", null, 'winvoice.log', true);
307
+ Mage::log("Winvoice | One time costumer processed.", null, 'winvoice.log', true);
308
  }
309
 
310
  Mage::log("Winvoice | Foi criado um novo WSClient com o numero ".$result['description1'], null, 'winvoice.log', true);
328
  {
329
  return;
330
 
331
+ Mage::log("Winvoice | AutoInvoice trigger for order".$observer->getEvent()->getOrder(), null, 'winvoice.log', true);
332
+
333
 
334
  $order = $observer->getEvent()->getShipment()->getOrder();
335
 
app/code/community/Waterstone/Winvoice/Model/nusoap/lib/nusoap.php CHANGED
@@ -8145,4 +8145,4 @@ if (!extension_loaded('soap')) {
8145
  class soapclient extends nusoap_client {
8146
  }
8147
  }
8148
- ?>
8145
  class soapclient extends nusoap_client {
8146
  }
8147
  }
8148
+ ?>
app/code/community/Waterstone/Winvoice/etc/config.xml CHANGED
@@ -17,7 +17,8 @@
17
  <config>
18
  <modules>
19
  <Waterstone_Winvoice>
20
- <version>1.0.0</version>
 
21
  </Waterstone_Winvoice>
22
  </modules>
23
  <global>
17
  <config>
18
  <modules>
19
  <Waterstone_Winvoice>
20
+ <!-- current version 1.0.3 -->
21
+ <version>1.0.0</version>
22
  </Waterstone_Winvoice>
23
  </modules>
24
  <global>
package.xml CHANGED
@@ -1,19 +1,20 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Waterstone_Winvoice</name>
4
- <version>1.0.2.2</version>
5
  <stability>stable</stability>
6
- <license uri="http://opensource.org/licenses/osl-3.0.php">OSLv3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Generates shipping documents registered by Portuguese Tax and Customs Authority (Autoridade Tribut&#xE1;ria).</summary>
10
- <description>This extension allows you to get a registered shipping document when the Magento shipment is created. Each time a shipment is created, the extension communicates with AT via SOAP web service, and saves the returned data. The most important data is the code attributed by AT to the document, which is the legal identification of the shipping document.</description>
11
- <notes>- Bug fixes.&#xD;
12
- </notes>
 
13
  <authors><author><name>Waterstone Consulting</name><user>waterstone</user><email>info@waterstone.pt</email></author></authors>
14
- <date>2014-09-15</date>
15
- <time>18:30:54</time>
16
- <contents><target name="magecommunity"><dir name="Waterstone"><dir name="Winvoice"><dir name="Helper"><file name="Data.php" hash="4594de10b13553a77b77ea70dea289aa"/></dir><dir name="Model"><file name="AddInvoice.php" hash="e389de4c3ec9666dd1d7e339252936eb"/><dir name="Email"><dir name="Template"><file name="Mailer.php" hash="d990fe62b70529b6fcdb2c3e72cb0480"/></dir></dir><dir name="Order"><file name="Invoice.php" hash="3670cfdea82e27da66d32556760c7e22"/></dir><dir name="nusoap"><dir name="lib"><file name="changelog" hash="3919a6a82b4f75206da9feaf8ceec3ed"/><file name="class.nusoap_base.php" hash="926c4daafe38a19c5d8444c270714741"/><file name="class.soap_fault.php" hash="cfd584361ababce6337b99e5979d7c4d"/><file name="class.soap_parser.php" hash="99ebb296b20d61d0161a037904366759"/><file name="class.soap_server.php" hash="5fd364995957f5c38a535a04a4be4384"/><file name="class.soap_transport_http.php" hash="2fedc17e37799b06e489d6a89c66453e"/><file name="class.soap_val.php" hash="ddd9047b47c42e5cbb2a88897372cb4f"/><file name="class.soapclient.php" hash="682f206b6917a163bc085d5093817767"/><file name="class.wsdl.php" hash="cafbf5025785922c4b6ecb005fd9b387"/><file name="class.wsdlcache.php" hash="89e38c3a9b266bce6ce70953829e0b70"/><file name="class.xmlschema.php" hash="f2a76931ddbd07c85ec882e736c2b90d"/><file name="nusoap.php" hash="675597fb030e84c0a3041bbceff9a2de"/><file name="nusoapmime.php" hash="29d372d39482f75b12655a562a10b822"/></dir><dir name="samples"><file name="client1.php" hash="d409d0bae57e8d4c13fefd63bec70b84"/><file name="client2.php" hash="7b95031a64f7b5975610520385503c37"/><file name="client3.php" hash="c6f1a9a2c44fac36fadcd4631373a998"/><file name="getfile1client.php" hash="c8e9b2d47e157bea50cd4285d6989e3d"/><file name="getfile2client.php" hash="b1338a810f91d58973c95b9d12c579e3"/><file name="index.html" hash="b52de1d66171cade209a651328ac3f97"/><file name="mimeclient.php" hash="0b1196705730ee220b42f1197599dcfa"/><file name="sslclient.php" hash="b790bf099c5d983c848cdd3571ee05df"/><file name="wsdlclient1.php" hash="b114369ba77f166e02da529678f0e74b"/><file name="wsdlclient10.php" hash="b63c4edc9cdbe4fe0ef69ca2250538e8"/><file name="wsdlclient11.php" hash="f3bc441f4b1747612510c3644dd00367"/><file name="wsdlclient12.php" hash="b1413252ca52f96a01b6d30ad1dc341e"/><file name="wsdlclient13.php" hash="d93cbd256bffa0fc637012451466ff0d"/><file name="wsdlclient14.php" hash="496b7d67e53bf2573ca2a35c4f0e696e"/><file name="wsdlclient15.php" hash="7ef02ec40fb271b281a4dc698035ae25"/><file name="wsdlclient2.php" hash="9fd136cd8355714cf3780116d1cb6b2f"/><file name="wsdlclient3.php" hash="5cb748a2989ae8c6c151c43a9b16a51b"/><file name="wsdlclient3b.php" hash="d7eb5f646f946438b034b818098f941d"/><file name="wsdlclient3c.php" hash="22220ca28722857ff04a519b1a89280f"/><file name="wsdlclient4.php" hash="06160017a0748dc2e39d63150a17b869"/><file name="wsdlclient5.php" hash="4503ba03f13e5f75c7a69e09253c5ba9"/><file name="wsdlclient6.php" hash="9376d30095c9572d50cec1294914b51f"/><file name="wsdlclient7.php" hash="92640c4e76c3c024d57434d638fedd78"/><file name="wsdlclient8.php" hash="61fea89801914afc8c99119a5ea090ef"/><file name="wsdlclient9.php" hash="d2111b6ae75bb3fe104a51e845208e4b"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="28cda20f40db5efb00659ae4bd83f19e"/><file name="config.xml" hash="ec82de303eb439432573a3caaca0464a"/><file name="system.xml" hash="b0ecef65a0b7a75b0d3f91abe112cc73"/></dir><dir name="sql"><dir name="winvoice_setup"><file name="mysql4-install-0.1.0.php" hash="ef4bb8d83cdaadf47cdb23244eaad6bc"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Waterstone_Winvoice.xml" hash="b0e049ceaf46088498533b5caa69eae9"/></dir></target></contents>
17
  <compatible/>
18
- <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
19
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Waterstone_Winvoice</name>
4
+ <version>1.0.3</version>
5
  <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Generates shipping documents registered by Portuguese Tax and Customs Authority (Autoridade Tribut&#xE1;ria).</summary>
10
+ <description>Get certified invoices in your Magento store (Portuguese legal requirements only).&#xD;
11
+ &#xD;
12
+ This extension allows you to get a certified invoice when the Magento invoice is generated. It uses an external service (weoInvoice) that automatically generates your certified invoice which is sent to you in PDF, annexed to the Magento invoice email.</description>
13
+ <notes>Fixed bugs and errors</notes>
14
  <authors><author><name>Waterstone Consulting</name><user>waterstone</user><email>info@waterstone.pt</email></author></authors>
15
+ <date>2015-02-10</date>
16
+ <time>18:43:11</time>
17
+ <contents><target name="magecommunity"><dir name="Waterstone"><dir name="Winvoice"><dir name="Helper"><file name="Data.php" hash="4594de10b13553a77b77ea70dea289aa"/></dir><dir name="Model"><file name="AddInvoice.php" hash="f64fe9ec4fc55018ac053c3e8f75c9f5"/><dir name="Email"><dir name="Template"><file name="Mailer.php" hash="d990fe62b70529b6fcdb2c3e72cb0480"/></dir></dir><dir name="Order"><file name="Invoice.php" hash="3670cfdea82e27da66d32556760c7e22"/></dir><dir name="nusoap"><dir name="lib"><file name="changelog" hash="3919a6a82b4f75206da9feaf8ceec3ed"/><file name="class.nusoap_base.php" hash="926c4daafe38a19c5d8444c270714741"/><file name="class.soap_fault.php" hash="cfd584361ababce6337b99e5979d7c4d"/><file name="class.soap_parser.php" hash="99ebb296b20d61d0161a037904366759"/><file name="class.soap_server.php" hash="5fd364995957f5c38a535a04a4be4384"/><file name="class.soap_transport_http.php" hash="2fedc17e37799b06e489d6a89c66453e"/><file name="class.soap_val.php" hash="ddd9047b47c42e5cbb2a88897372cb4f"/><file name="class.soapclient.php" hash="682f206b6917a163bc085d5093817767"/><file name="class.wsdl.php" hash="cafbf5025785922c4b6ecb005fd9b387"/><file name="class.wsdlcache.php" hash="89e38c3a9b266bce6ce70953829e0b70"/><file name="class.xmlschema.php" hash="f2a76931ddbd07c85ec882e736c2b90d"/><file name="nusoap.php" hash="5af85479dec05dab223bd53d9400339b"/><file name="nusoapmime.php" hash="29d372d39482f75b12655a562a10b822"/></dir><dir name="samples"><file name="client1.php" hash="d409d0bae57e8d4c13fefd63bec70b84"/><file name="client2.php" hash="7b95031a64f7b5975610520385503c37"/><file name="client3.php" hash="c6f1a9a2c44fac36fadcd4631373a998"/><file name="getfile1client.php" hash="c8e9b2d47e157bea50cd4285d6989e3d"/><file name="getfile2client.php" hash="b1338a810f91d58973c95b9d12c579e3"/><file name="index.html" hash="b52de1d66171cade209a651328ac3f97"/><file name="mimeclient.php" hash="0b1196705730ee220b42f1197599dcfa"/><file name="sslclient.php" hash="b790bf099c5d983c848cdd3571ee05df"/><file name="wsdlclient1.php" hash="b114369ba77f166e02da529678f0e74b"/><file name="wsdlclient10.php" hash="b63c4edc9cdbe4fe0ef69ca2250538e8"/><file name="wsdlclient11.php" hash="f3bc441f4b1747612510c3644dd00367"/><file name="wsdlclient12.php" hash="b1413252ca52f96a01b6d30ad1dc341e"/><file name="wsdlclient13.php" hash="d93cbd256bffa0fc637012451466ff0d"/><file name="wsdlclient14.php" hash="496b7d67e53bf2573ca2a35c4f0e696e"/><file name="wsdlclient15.php" hash="7ef02ec40fb271b281a4dc698035ae25"/><file name="wsdlclient2.php" hash="9fd136cd8355714cf3780116d1cb6b2f"/><file name="wsdlclient3.php" hash="5cb748a2989ae8c6c151c43a9b16a51b"/><file name="wsdlclient3b.php" hash="d7eb5f646f946438b034b818098f941d"/><file name="wsdlclient3c.php" hash="22220ca28722857ff04a519b1a89280f"/><file name="wsdlclient4.php" hash="06160017a0748dc2e39d63150a17b869"/><file name="wsdlclient5.php" hash="4503ba03f13e5f75c7a69e09253c5ba9"/><file name="wsdlclient6.php" hash="9376d30095c9572d50cec1294914b51f"/><file name="wsdlclient7.php" hash="92640c4e76c3c024d57434d638fedd78"/><file name="wsdlclient8.php" hash="61fea89801914afc8c99119a5ea090ef"/><file name="wsdlclient9.php" hash="d2111b6ae75bb3fe104a51e845208e4b"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="28cda20f40db5efb00659ae4bd83f19e"/><file name="config.xml" hash="b987e8146a9ad34b3993a103c764f3e8"/><file name="system.xml" hash="b0ecef65a0b7a75b0d3f91abe112cc73"/></dir><dir name="sql"><dir name="winvoice_setup"><file name="mysql4-install-0.1.0.php" hash="ef4bb8d83cdaadf47cdb23244eaad6bc"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Waterstone_Winvoice.xml" hash="b0e049ceaf46088498533b5caa69eae9"/></dir></target></contents>
18
  <compatible/>
19
+ <dependencies><required><php><min>5.4.12</min><max>5.5.11</max></php></required></dependencies>
20
  </package>