Billys_Billing_Invoicer - Version 1.2.6

Version Notes

Added usage of order currency as currency for the invoice with shop currency as fallback.

Download this release

Release Info

Developer Billy's Billing
Extension Billys_Billing_Invoicer
Version 1.2.6
Comparing to
See all releases


Code changes from version 1.2.5 to 1.2.6

app/code/community/BillysBilling/Invoicer/Model/Observer.php CHANGED
@@ -101,6 +101,13 @@ class BillysBilling_Invoicer_Model_Observer {
101
  // Order date
102
  $date = date("Y-m-d", $order->getCreatedAtDate()->getTimestamp());
103
  $dueDate = date("Y-m-d", $order->getCreatedAtDate()->getTimestamp() + $this->dueDateOffset * 86400);
 
 
 
 
 
 
 
104
  // Set invoice data
105
  $invoice = array(
106
  "type" => "invoice",
@@ -108,7 +115,7 @@ class BillysBilling_Invoicer_Model_Observer {
108
  "contactMessage" => str_replace("{order_id}", $order->getIncrementId(), $this->contactMessage),
109
  "entryDate" => $date,
110
  "dueDate" => $dueDate,
111
- "currencyId" => Mage::app()->getStore()->getCurrentCurrencyCode(),
112
  "state" => "approved",
113
  "lines" => $products
114
  );
101
  // Order date
102
  $date = date("Y-m-d", $order->getCreatedAtDate()->getTimestamp());
103
  $dueDate = date("Y-m-d", $order->getCreatedAtDate()->getTimestamp() + $this->dueDateOffset * 86400);
104
+ // Find currency
105
+ $currency = $order->getOrderCurrency();
106
+ if (is_object($currency)) {
107
+ $currencyCode = $currency->getCurrencyCode();
108
+ } else {
109
+ $currencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();
110
+ }
111
  // Set invoice data
112
  $invoice = array(
113
  "type" => "invoice",
115
  "contactMessage" => str_replace("{order_id}", $order->getIncrementId(), $this->contactMessage),
116
  "entryDate" => $date,
117
  "dueDate" => $dueDate,
118
+ "currencyId" => $currencyCode,
119
  "state" => "approved",
120
  "lines" => $products
121
  );
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Billys_Billing_Invoicer</name>
4
- <version>1.2.5</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>
@@ -15,11 +15,11 @@
15
  This extension has been tested with the latest releases of version 1.5, 1.6, 1.7, and 1.8.&#xD;
16
  &#xD;
17
  When this extension has been installed, you should go to System Configuration and access the Billy's Billing configuration page. From here you enter an API key (you can get this from organization settings in Billy's Billing) and save the configuration. When this is done, you will be able to change the dropdown boxes for shipping product, sales account, VAT model, and bank account. After they have been selected, you are ready to use the extension.</description>
18
- <notes>Expanded support for PHP to include 5.4.25</notes>
19
  <authors><author><name>Billy's Billing</name><user>billysbilling</user><email>michael@billysbilling.com</email></author></authors>
20
- <date>2014-02-12</date>
21
- <time>09:47:38</time>
22
- <contents><target name="magecommunity"><dir name="BillysBilling"><dir name="Invoicer"><dir name="Helper"><file name="Data.php" hash="2e73f30c86e3cb150b91856d2efeebf4"/></dir><dir name="Model"><file name="Accounts.php" hash="a6861ea516d74d199d52be6e4a8eeb1c"/><file name="Observer.php" hash="81ed7c3196decf0da567b9adcbfcf49f"/><file name="Products.php" hash="86953a3321a191587b6da1ab57626c53"/><file name="VatModels.php" hash="e87151fe22f857340476d1d4ebaeb31c"/><file name="YesNo.php" hash="0948b76080b9829e733980dad3649fd9"/><dir name="billysbilling-php"><dir name="Billy"><file name="Client.php" hash="b947948ae0063e2a121751782f44c751"/><file name="Exception.php" hash="239b2ecc8821b6e55faef561d0f3089c"/><file name="Request.php" hash="60d6c8d0661ff97cfc828cc785e7c942"/></dir><file name="bootstrap.php" hash="95d828828c4fdf4d338407f4a270c397"/></dir><file name=".DS_Store" hash="ca785700948b047adfbbc0be14cc757c"/></dir><dir name="etc"><file name="config.xml" hash="cccab1c9918bb815482290a750a48266"/><file name="system.xml" hash="9d2ed460ff9d16ce45539e83034513a4"/></dir><file name=".DS_Store" hash="0321a487d2882bd14b9b6ba789812495"/></dir><file name=".DS_Store" hash="be7a0a0fbf3672d076eac1f6bf183e1d"/></dir></target><target name="mageetc"><dir name="modules"><file name="BillysBilling_Invoicer.xml" hash="4b11b30f403a358332323f04da27d1d4"/></dir></target></contents>
23
  <compatible/>
24
  <dependencies><required><php><min>5.2.0</min><max>5.4.25</max></php></required></dependencies>
25
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Billys_Billing_Invoicer</name>
4
+ <version>1.2.6</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>
15
  This extension has been tested with the latest releases of version 1.5, 1.6, 1.7, and 1.8.&#xD;
16
  &#xD;
17
  When this extension has been installed, you should go to System Configuration and access the Billy's Billing configuration page. From here you enter an API key (you can get this from organization settings in Billy's Billing) and save the configuration. When this is done, you will be able to change the dropdown boxes for shipping product, sales account, VAT model, and bank account. After they have been selected, you are ready to use the extension.</description>
18
+ <notes>Added usage of order currency as currency for the invoice with shop currency as fallback.</notes>
19
  <authors><author><name>Billy's Billing</name><user>billysbilling</user><email>michael@billysbilling.com</email></author></authors>
20
+ <date>2014-08-21</date>
21
+ <time>07:06:38</time>
22
+ <contents><target name="magecommunity"><dir name="BillysBilling"><dir name="Invoicer"><dir name="Helper"><file name="Data.php" hash="2e73f30c86e3cb150b91856d2efeebf4"/></dir><dir name="Model"><file name="Accounts.php" hash="a6861ea516d74d199d52be6e4a8eeb1c"/><file name="Observer.php" hash="b0334810f19dc213ff66d58fcd29c4f0"/><file name="Products.php" hash="86953a3321a191587b6da1ab57626c53"/><file name="VatModels.php" hash="e87151fe22f857340476d1d4ebaeb31c"/><file name="YesNo.php" hash="0948b76080b9829e733980dad3649fd9"/><dir name="billysbilling-php"><dir name="Billy"><file name="Client.php" hash="b947948ae0063e2a121751782f44c751"/><file name="Exception.php" hash="239b2ecc8821b6e55faef561d0f3089c"/><file name="Request.php" hash="60d6c8d0661ff97cfc828cc785e7c942"/></dir><file name="bootstrap.php" hash="95d828828c4fdf4d338407f4a270c397"/></dir><file name=".DS_Store" hash="ca785700948b047adfbbc0be14cc757c"/></dir><dir name="etc"><file name="config.xml" hash="cccab1c9918bb815482290a750a48266"/><file name="system.xml" hash="9d2ed460ff9d16ce45539e83034513a4"/></dir><file name=".DS_Store" hash="0321a487d2882bd14b9b6ba789812495"/></dir><file name=".DS_Store" hash="be7a0a0fbf3672d076eac1f6bf183e1d"/></dir></target><target name="mageetc"><dir name="modules"><file name="BillysBilling_Invoicer.xml" hash="4b11b30f403a358332323f04da27d1d4"/></dir></target></contents>
23
  <compatible/>
24
  <dependencies><required><php><min>5.2.0</min><max>5.4.25</max></php></required></dependencies>
25
  </package>