1
0
Fork 0
Browse Source

2022-12-05

master
Tom Lee-Gough 10 months ago
parent
commit
55d0ed0b87
  1. BIN
      __pycache__/pelicanconf.cpython-310.pyc
  2. 0
      __pycache__/pelicanconf.cpython-37.pyc
  3. 0
      __pycache__/pelicanconf.cpython-38.pyc
  4. 0
      __pycache__/pelicanconf.cpython-38.sync-conflict-20220309-214519-STGZPU6.pyc
  5. 0
      __pycache__/pelicanconf.cpython-39.pyc
  6. 0
      __pycache__/pelicanconf.cpython-39.sync-conflict-20220224-230029-OZA5ELD.pyc
  7. 0
      content/articles/-blog_ideas.md
  8. 0
      content/articles/2018-09-23_gnucash.md
  9. 0
      content/articles/2021-01-03_accounting_systems.md
  10. 0
      content/articles/2021-01-12_sage_to_netsuite.md
  11. 0
      content/articles/2021-01-26 - api_ftp_csv_wtf.md
  12. 0
      content/articles/2021-01-26 - python_basics.md
  13. 0
      content/articles/2021-04-11_the_goal.md
  14. 0
      content/articles/2021-07-27_accounting_database_design.md
  15. 0
      content/articles/2021-10-03_why_virtual_fd_cfo.md
  16. 0
      content/articles/2022-04-18_energy_bookkeeing.md
  17. 0
      content/articles/2022-04-27_xero_export.md
  18. 0
      content/articles/2022-05-06_create_xero_json_object.md
  19. 0
      content/articles/2022-05-15_cloud_software_missing_feature.md
  20. 0
      content/articles/2022-06-14_offline_accounting.md
  21. 45
      content/articles/2022-12-05_netsuite_fx_rates.md
  22. 32
      content/articles/ecommerce.md
  23. 0
      content/images/favicon/android-chrome-192x192.png
  24. 0
      content/images/favicon/android-chrome-512x512.png
  25. 0
      content/images/favicon/apple-touch-icon.png
  26. 0
      content/images/favicon/favicon-16x16.png
  27. 0
      content/images/favicon/favicon-32x32.png
  28. 0
      content/images/favicon/favicon.ico
  29. 0
      content/images/origin/Hermes.png
  30. 0
      content/images/origin/cosearch.png
  31. 0
      content/images/origin/database.png
  32. 0
      content/images/origin/gnucash.png
  33. 0
      content/images/origin/gnucash_energy.png
  34. 0
      content/images/origin/gnucash_energy_entries.png
  35. 0
      content/images/origin/python.png
  36. 0
      content/images/origin/xero_convert_code.png
  37. 0
      content/images/origin/xero_export.png
  38. 0
      content/images/pexels/pexels-lukas-590022.jpg
  39. 0
      content/images/pexels/pexels-negative-space-160107.jpg
  40. 0
      content/images/pexels/pexels-negative-space-97077.jpg
  41. 0
      content/images/pexels/pexels-picjumbocom-461077.jpg
  42. 0
      content/images/pexels/pexels-pixabay-220301.jpg
  43. 0
      content/images/pexels/pexels-pixabay-373076.jpg
  44. 0
      content/images/pexels/pexels-pixabay-39578.jpg
  45. 0
      content/images/pexels/pexels-pixabay-53621.jpg
  46. 0
      content/images/storyset/Agreement-amico.svg
  47. 0
      content/images/storyset/Business decisions-amico.svg
  48. 0
      content/images/storyset/Data analysis-amico.svg
  49. 0
      content/images/storyset/Documents-amico.svg
  50. 0
      content/images/storyset/Fill out-amico.svg
  51. 0
      content/images/storyset/Finance app-amico.svg
  52. 0
      content/images/storyset/Money income-amico.svg
  53. 0
      content/images/storyset/Report-amico.svg
  54. 0
      content/images/storyset/Site Stats-amico.svg
  55. 0
      content/images/storyset/Statistics-amico.svg
  56. 0
      content/layout.txt
  57. 0
      content/pages/about.html
  58. 0
      content/pages/meta.md
  59. 0
      content/pages/services.html
  60. 0
      content/pages/software.html
  61. 0
      content/site.webmanifest
  62. 0
      output/accounting-database-design.html
  63. 0
      output/accounting-softwares-missing-killer-feature.html
  64. 0
      output/api-ftp-wtf.html
  65. 13
      output/archives.html
  66. 0
      output/author/tom-lee-gough.html
  67. 0
      output/authors.html
  68. 0
      output/bookkeeing-for-energy-usage.html
  69. 92
      output/bookkeeping-for-energy-usage.html
  70. 0
      output/categories.html
  71. 0
      output/category/articles.html
  72. 0
      output/convert-xero-journals-for-netsuite-and-dynamics.html
  73. 0
      output/drafts/blog-ideas.html
  74. 0
      output/drafts/thoughts-on-ecommerce-and-online-marketing.html
  75. 169
      output/exchange-rates-in-netsuite.html
  76. 0
      output/export-your-xero-transactions-to-use-in-any-erp.html
  77. 184
      output/feed.rss
  78. 0
      output/gnucash.html
  79. 0
      output/images/favicon/android-chrome-192x192.png
  80. 0
      output/images/favicon/android-chrome-512x512.png
  81. 0
      output/images/favicon/apple-touch-icon.png
  82. 0
      output/images/favicon/favicon-16x16.png
  83. 0
      output/images/favicon/favicon-32x32.png
  84. 0
      output/images/favicon/favicon.ico
  85. 0
      output/images/origin/Hermes.png
  86. 0
      output/images/origin/cosearch.png
  87. 0
      output/images/origin/database.png
  88. 0
      output/images/origin/gnucash.png
  89. 0
      output/images/origin/gnucash_energy.png
  90. 0
      output/images/origin/gnucash_energy_entries.png
  91. 0
      output/images/origin/python.png
  92. 0
      output/images/origin/xero_convert_code.png
  93. 0
      output/images/origin/xero_export.png
  94. 0
      output/images/pexels/pexels-lukas-590022.jpg
  95. 0
      output/images/pexels/pexels-negative-space-160107.jpg
  96. 0
      output/images/pexels/pexels-negative-space-97077.jpg
  97. 0
      output/images/pexels/pexels-picjumbocom-461077.jpg
  98. 0
      output/images/pexels/pexels-pixabay-220301.jpg
  99. 0
      output/images/pexels/pexels-pixabay-373076.jpg
  100. 0
      output/images/pexels/pexels-pixabay-39578.jpg
  101. Some files were not shown because too many files have changed in this diff Show More

BIN
__pycache__/pelicanconf.cpython-310.pyc

Binary file not shown.

0
__pycache__/pelicanconf.cpython-37.pyc

0
__pycache__/pelicanconf.cpython-38.pyc

0
__pycache__/pelicanconf.cpython-38.sync-conflict-20220309-214519-STGZPU6.pyc

0
__pycache__/pelicanconf.cpython-39.pyc

0
__pycache__/pelicanconf.cpython-39.sync-conflict-20220224-230029-OZA5ELD.pyc

0
content/articles/-blog_ideas.md

0
content/articles/2018-09-23_gnucash.md

0
content/articles/2021-01-03_accounting_systems.md

0
content/articles/2021-01-12_sage_to_netsuite.md

0
content/articles/2021-01-26 - api_ftp_csv_wtf.md

0
content/articles/2021-01-26 - python_basics.md

0
content/articles/2021-04-11_the_goal.md

0
content/articles/2021-07-27_accounting_database_design.md

0
content/articles/2021-10-03_why_virtual_fd_cfo.md

0
content/articles/2022-04-18_energy_bookkeeing.md

0
content/articles/2022-04-27_xero_export.md

0
content/articles/2022-05-06_create_xero_json_object.md

0
content/articles/2022-05-15_cloud_software_missing_feature.md

0
content/articles/2022-06-14_offline_accounting.md

45
content/articles/2022-12-05_netsuite_fx_rates.md

@ -0,0 +1,45 @@ @@ -0,0 +1,45 @@
Title: Exchange Rates in Netsuite
Date: 2022-12-05
Tags: Accounting, Netsuite
Summary: How do foreign currency translations work in Netsuite
Netsuite is one of my favourite ERP programs for finance. It has great reporting, is relatively easy to use, and looks good too. Where I have found that it really excels is when it is the only finance system of a group of companies. It works really well consolidating results up to a group level. However, it can get a bit confusing how it translates currencies especially with consolidation.
Netsuite performs translations at two different stages: on the transaction and on consolidation. Netsuite holds a daily transaction rate, and three consolidated rate (current, average, historical).
## Transactions
Each subsidiary has a reporting currency. Any foreign currency transaction is translated into the reporting currency on the date of the transaction. Balances get translated at the rate on last day of the reporting period.
When running non-consolidated financial statements for a given subsidiary, Netsuite will give you the results in the reporting currency of the subsidiary.
## Consolidation
Netsuite has one single subsidiary which is the top of the consolidation tree. The reporting currency of this entity is dictated by the edition that you use. For example, UK Netsuite uses GBP.
Consolidated rates are calcluated as part of the period close process. There are three types:
- Current - This is the closing rate for the period (Usually used for Stock)
- Average - Average rate for the period
- Historical - The average rate for the whole history of the account. (Usually used for Equity, Fixed Assets)
Each nominal code has an exchange rate set on it to tell Netsuite how to translate it according to one of the three methods above. Ultimately, all your subsidiaries regardless of their reporting currency will consolidate up to the currency of the lead subsidiary.
## Calculations
To get consolidated financial statements, Netsuite first translates transactions into the reporting currency of the subsidary. Then translates the whole financial statement into the reporting currency of the lead subsidiary.
On the whole, consolidated rates and daily exchange rates should match, however, sometimes they may not. Netsuite can automatic rates from either HSBC or Xignite. These do not triangulate, the inverse of an exchange rate is not always 1/n. This can lead to a situation where a GBP transaction in a USD entity, could be a different GBP value when consolidated. The fx variance is a small number, but on big transsactions can make a big difference....
## Cumulative Translation Reserve
When consolidatding a trial balance, balance sheets will end up imbalanced. This is due to the different exchange rates (current, average, historical) being used. The balancing figure on consolidation ends up going to the cumulative translation adjustment. Have enough exchange volatility and this can be a big number too.
Netsuite does not post a journal for the cumulative translation adjustment, it calculates it when running financial statements.
## Conclusion
Exchange rates can be pretty complex, here is a list of things to note:
- Netsuite has two types of exchange rate: daily rates and consolidated rates.
- Daily rates come from HSBC or Xignite
- Daily rates don't always work both ways. EUR->GBP is not the same as GBP->EUR
- Consolidated rates are calculated from daily rates
- Consolidated rates are three different types (current, average, historical)
- Translation formula = transaction * daily fx rate * consolidated rate
- Cumlative translation adjustment is the value of the imbalance caused on consolidation

32
content/articles/ecommerce.md

@ -1,32 +0,0 @@ @@ -1,32 +0,0 @@
Title: Thoughts on Ecommerce and Online Marketing
Date: 2022-05-01
Tags: Ecommerce, Paid Search, SEO, Marketing
Summary: Why you need a Virtual Finance Director
Image:
Status: draft
I've been reading about online advertising and marketing. Most online advertising organisations say that the can measure the ROI (Return On Investment) of advertising spend. It reminds me of a TV commercial in the early '00's from Adobe, where a bunch of corporate types discuss marketing and ask "What's the ROI on that?" Adobe claimed that they could, in fact, measure the ROI on that. Facebook and Google et al, have lots more data on their users, and so have more credibility to claim that they can target adverts better, giving a higher ROI.
## Sales funnel
Many marketers talk about the (sales funnel)[https://en.wikipedia.org/wiki/Purchase_funnel]. It is a way of identifying at what stage your potential customer is of making a purchase. Marketing activity differs for potential customers at different stages of the funnel.
## Search Rankings
Where you appear in the search results list is important. Users do not like to look through several pages to find what they are looking for. There are literlly millions of websites that will give you the techniques to rank higher for a given topic.
## Paid Search
DISCLAIMER: I am not an expert in this area. I think that Google and Facebook et al are not telling the truth about the efficacy of their advertising channels.
## Background
I've been reading about online marketing. Specifically, paid search and SEO and how they interact. SEO is Search Engine Optimisation - essentially these are the techniques that you should use to appear near the top of the results lists on Google. Presumably, these techniques would work with other search providers, but apparently SEO practitioners do not recognise other search engines. Paid search is when an advertiser buys an advert to appear in your search results. It seems to be pretty well established that appearing on the first results page is important as traffic to websites on subsequent results pages drops off.
## Paid Search
Despite what the online advertisers say, I do not believe that you can measure the ROI (Return On Investment) of advertising and marketing. Establishing causality requires [some very complex](https://en.wikipedia.org/wiki/Autoregressive_conditional_heteroskedasticity) statistics. From what I have seen from the likes of Google, it is not that complex. If you are using Google's suite of tools to place adverts and track website visitors, Google will attempt to attribute the revenue to the source of the traffic.

0
content/images/favicon/android-chrome-192x192.png

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

0
content/images/favicon/android-chrome-512x512.png

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

0
content/images/favicon/apple-touch-icon.png

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

0
content/images/favicon/favicon-16x16.png

Before

Width:  |  Height:  |  Size: 475 B

After

Width:  |  Height:  |  Size: 475 B

0
content/images/favicon/favicon-32x32.png

Before

Width:  |  Height:  |  Size: 979 B

After

Width:  |  Height:  |  Size: 979 B

0
content/images/favicon/favicon.ico

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

0
content/images/origin/Hermes.png

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

0
content/images/origin/cosearch.png

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

0
content/images/origin/database.png

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

0
content/images/origin/gnucash.png

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

0
content/images/origin/gnucash_energy.png

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

0
content/images/origin/gnucash_energy_entries.png

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

0
content/images/origin/python.png

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

0
content/images/origin/xero_convert_code.png

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

0
content/images/origin/xero_export.png

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

0
content/images/pexels/pexels-lukas-590022.jpg

Before

Width:  |  Height:  |  Size: 218 KiB

After

Width:  |  Height:  |  Size: 218 KiB

0
content/images/pexels/pexels-negative-space-160107.jpg

Before

Width:  |  Height:  |  Size: 331 KiB

After

Width:  |  Height:  |  Size: 331 KiB

0
content/images/pexels/pexels-negative-space-97077.jpg

Before

Width:  |  Height:  |  Size: 420 KiB

After

Width:  |  Height:  |  Size: 420 KiB

0
content/images/pexels/pexels-picjumbocom-461077.jpg

Before

Width:  |  Height:  |  Size: 135 KiB

After

Width:  |  Height:  |  Size: 135 KiB

0
content/images/pexels/pexels-pixabay-220301.jpg

Before

Width:  |  Height:  |  Size: 642 KiB

After

Width:  |  Height:  |  Size: 642 KiB

0
content/images/pexels/pexels-pixabay-373076.jpg

Before

Width:  |  Height:  |  Size: 295 KiB

After

Width:  |  Height:  |  Size: 295 KiB

0
content/images/pexels/pexels-pixabay-39578.jpg

Before

Width:  |  Height:  |  Size: 115 KiB

After

Width:  |  Height:  |  Size: 115 KiB

0
content/images/pexels/pexels-pixabay-53621.jpg

Before

Width:  |  Height:  |  Size: 219 KiB

After

Width:  |  Height:  |  Size: 219 KiB

0
content/images/storyset/Agreement-amico.svg

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

0
content/images/storyset/Business decisions-amico.svg

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 78 KiB

0
content/images/storyset/Data analysis-amico.svg

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

0
content/images/storyset/Documents-amico.svg

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

0
content/images/storyset/Fill out-amico.svg

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 91 KiB

0
content/images/storyset/Finance app-amico.svg

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 105 KiB

0
content/images/storyset/Money income-amico.svg

Before

Width:  |  Height:  |  Size: 145 KiB

After

Width:  |  Height:  |  Size: 145 KiB

0
content/images/storyset/Report-amico.svg

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

0
content/images/storyset/Site Stats-amico.svg

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 59 KiB

0
content/images/storyset/Statistics-amico.svg

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

0
content/layout.txt

0
content/pages/about.html

0
content/pages/meta.md

0
content/pages/services.html

0
content/pages/software.html

0
content/site.webmanifest

0
output/accounting-database-design.html

0
output/accounting-softwares-missing-killer-feature.html

0
output/api-ftp-wtf.html

13
output/archives.html

@ -71,6 +71,19 @@ @@ -71,6 +71,19 @@
<div class="column col-12 bg-gray text-primary hero hero-sm">
<div class="columns">
<div class="column col-3 col-md-6 col-sm-12 mt-2">
<div class="card">
<div class="card-image hide-md">
<!-- <img class="img-responsive" src="../images/"> -->
</div>
<div class="card-body">
<a href="./exchange-rates-in-netsuite.html">Exchange Rates in Netsuite</a>
<p><p>How do foreign currency translations work in Netsuite</p></p>
</div>
</div>
</div>
<div class="column col-3 col-md-6 col-sm-12 mt-2">
<div class="card">

0
output/author/tom-lee-gough.html

0
output/authors.html

0
output/bookkeeing-for-energy-usage.html

92
output/bookkeeping-for-energy-usage.html

@ -88,8 +88,8 @@ @@ -88,8 +88,8 @@
<th>Nominal</th>
<th>Description</th>
<th>Unit</th>
<th align="right">DR</th>
<th align="right">CR</th>
<th style="text-align: right;">DR</th>
<th style="text-align: right;">CR</th>
</tr>
</thead>
<tbody>
@ -98,16 +98,16 @@ @@ -98,16 +98,16 @@
<td>BS</td>
<td>Cash</td>
<td>£</td>
<td align="right"></td>
<td align="right">I</td>
<td style="text-align: right;"></td>
<td style="text-align: right;">I</td>
</tr>
<tr>
<td>DR</td>
<td>BS</td>
<td>Payables</td>
<td>£</td>
<td align="right">I</td>
<td align="right"></td>
<td style="text-align: right;">I</td>
<td style="text-align: right;"></td>
</tr>
</tbody>
</table>
@ -119,8 +119,8 @@ @@ -119,8 +119,8 @@
<th>Nominal</th>
<th>Description</th>
<th>Unit</th>
<th align="right">DR</th>
<th align="right">CR</th>
<th style="text-align: right;">DR</th>
<th style="text-align: right;">CR</th>
</tr>
</thead>
<tbody>
@ -129,16 +129,16 @@ @@ -129,16 +129,16 @@
<td>BS</td>
<td>Payables</td>
<td>£</td>
<td align="right"></td>
<td align="right">J</td>
<td style="text-align: right;"></td>
<td style="text-align: right;">J</td>
</tr>
<tr>
<td>DR</td>
<td>IS</td>
<td>Energy Usage</td>
<td>£</td>
<td align="right">J</td>
<td align="right"></td>
<td style="text-align: right;">J</td>
<td style="text-align: right;"></td>
</tr>
</tbody>
</table>
@ -150,8 +150,8 @@ @@ -150,8 +150,8 @@
<th>Nominal</th>
<th>Description</th>
<th>Unit</th>
<th align="right">DR</th>
<th align="right">CR</th>
<th style="text-align: right;">DR</th>
<th style="text-align: right;">CR</th>
</tr>
</thead>
<tbody>
@ -160,48 +160,48 @@ @@ -160,48 +160,48 @@
<td>IS</td>
<td>Water</td>
<td>m^3</td>
<td align="right">X</td>
<td align="right"></td>
<td style="text-align: right;">X</td>
<td style="text-align: right;"></td>
</tr>
<tr>
<td>CR</td>
<td>BS</td>
<td>Water</td>
<td>m^3</td>
<td align="right"></td>
<td align="right">-X</td>
<td style="text-align: right;"></td>
<td style="text-align: right;">-X</td>
</tr>
<tr>
<td>DR</td>
<td>IS</td>
<td>Gas</td>
<td>m^3</td>
<td align="right">Y</td>
<td align="right"></td>
<td style="text-align: right;">Y</td>
<td style="text-align: right;"></td>
</tr>
<tr>
<td>CR</td>
<td>BS</td>
<td>Gas</td>
<td>m^3</td>
<td align="right"></td>
<td align="right">-Y</td>
<td style="text-align: right;"></td>
<td style="text-align: right;">-Y</td>
</tr>
<tr>
<td>DR</td>
<td>IS</td>
<td>Elec</td>
<td>kWh</td>
<td align="right">Z</td>
<td align="right"></td>
<td style="text-align: right;">Z</td>
<td style="text-align: right;"></td>
</tr>
<tr>
<td>CR</td>
<td>BS</td>
<td>Elec</td>
<td>kWh</td>
<td align="right"></td>
<td align="right">-Z</td>
<td style="text-align: right;"></td>
<td style="text-align: right;">-Z</td>
</tr>
</tbody>
</table>
@ -210,45 +210,45 @@ @@ -210,45 +210,45 @@
<thead>
<tr>
<th>Date</th>
<th align="right">DR</th>
<th align="right">CR</th>
<th style="text-align: right;">DR</th>
<th style="text-align: right;">CR</th>
</tr>
</thead>
<tbody>
<tr>
<td>Jan 31</td>
<td align="right">1000</td>
<td align="right"></td>
<td style="text-align: right;">1000</td>
<td style="text-align: right;"></td>
</tr>
<tr>
<td>Feb 01</td>
<td align="right"></td>
<td align="right">-1000</td>
<td style="text-align: right;"></td>
<td style="text-align: right;">-1000</td>
</tr>
<tr>
<td>Feb 29</td>
<td align="right">1200</td>
<td align="right"></td>
<td style="text-align: right;">1200</td>
<td style="text-align: right;"></td>
</tr>
<tr>
<td>Mar 01</td>
<td align="right"></td>
<td align="right">-1200</td>
<td style="text-align: right;"></td>
<td style="text-align: right;">-1200</td>
</tr>
<tr>
<td>Mar 31</td>
<td align="right">1350</td>
<td align="right"></td>
<td style="text-align: right;">1350</td>
<td style="text-align: right;"></td>
</tr>
<tr>
<td>Apr 01</td>
<td align="right"></td>
<td align="right">-1350</td>
<td style="text-align: right;"></td>
<td style="text-align: right;">-1350</td>
</tr>
<tr>
<td>Apr 30</td>
<td align="right">1600</td>
<td align="right"></td>
<td style="text-align: right;">1600</td>
<td style="text-align: right;"></td>
</tr>
</tbody>
</table>
@ -260,21 +260,21 @@ Screenshow from entries in Gnucash: @@ -260,21 +260,21 @@ Screenshow from entries in Gnucash:
<thead>
<tr>
<th>Period</th>
<th align="right">Usage (m^3)</th>
<th style="text-align: right;">Usage (m^3)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Feb</td>
<td align="right">200</td>
<td style="text-align: right;">200</td>
</tr>
<tr>
<td>Mar</td>
<td align="right">150</td>
<td style="text-align: right;">150</td>
</tr>
<tr>
<td>Apr</td>
<td align="right">250</td>
<td style="text-align: right;">250</td>
</tr>
</tbody>
</table>

0
output/categories.html

0
output/category/articles.html

0
output/convert-xero-journals-for-netsuite-and-dynamics.html

0
output/drafts/blog-ideas.html

0
output/drafts/thoughts-on-ecommerce-and-online-marketing.html

169
output/exchange-rates-in-netsuite.html

@ -0,0 +1,169 @@ @@ -0,0 +1,169 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Corax FM - Exchange Rates in Netsuite</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="apple-touch-icon" sizes="180x180" href="../images/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="../images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="../images/favicon/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="stylesheet" href="./theme/css/fontawesome/css/all.min.css" />
<link rel="stylesheet" href="./theme/css/spectre.min.css" />
<link rel="stylesheet" href="./theme/css/style.css" />
<link href="https://coraxfm.uk/feed.rss" type="application/atom+xml" rel="alternate" title="Corax FM Full Atom Feed" />
<meta name="tags" content="Accounting" />
<meta name="tags" content="Netsuite" />
<script src="https://swetrix.org/swetrix.js" defer></script>
</head>
<body id="index">
<div class="container">
<header class="navbar m-2">
<section class="navbar-section">
<a href="../" class="navbar-brand mr-2"><span class="text-primary text-large">Corax FM</span></a>
</section>
<section class="navbar-section">
<a class="btn btn-link bg-primary text-light hide-sm" href="mailto:info@coraxfm.uk">info@coraxfm.uk</a>
<a class="btn btn-link" href="./pages/about.html">About</a>
<a class="btn btn-link" href="./pages/services.html">Services</a>
<a class="btn btn-link" href="./pages/software.html">Software</a>
<a class="btn btn-link mr-2" href="../archives.html">Blog</a>
<a class="btn btn-link bg-success text-light hide-sm" href="../">Get A Quote</a>
</section>
<secion class="navbar-section show-sm">
<a class="btn btn-link bg-primary text-light" href="mailto:info@coraxfm.uk">info@coraxfm.uk</a>
<a class="btn btn-link bg-success text-light" href="../">Get A Quote</a>
</secion>
</header>
<div class="page-content">
<div class="columns">
<div class="column hero col-12 bg-primary text-light">
<div class="columns">
<div class="column col-8 col-lg-10 col-md-12 col-mx-auto">
<div class="columns">
<div class="column col-12 text-center">
<h1>Exchange Rates in Netsuite</h1>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="columns">
<div class="column col-12 bg-gray text-primary hero hero-sm">
<div class="column col-8 col-sm-10 col-mx-auto">
<div class="columns">
<div class="column col-12">
<p>Netsuite is one of my favourite ERP programs for finance. It has great reporting, is relatively easy to use, and looks good too. Where I have found that it really excels is when it is the only finance system of a group of companies. It works really well consolidating results up to a group level. However, it can get a bit confusing how it translates currencies especially with consolidation.</p>
<p>Netsuite performs translations at two different stages: on the transaction and on consolidation. Netsuite holds a daily transaction rate, and three consolidated rate (current, average, historical).</p>
<h2>Transactions</h2>
<p>Each subsidiary has a reporting currency. Any foreign currency transaction is translated into the reporting currency on the date of the transaction. Balances get translated at the rate on last day of the reporting period.</p>
<p>When running non-consolidated financial statements for a given subsidiary, Netsuite will give you the results in the reporting currency of the subsidiary.</p>
<h2>Consolidation</h2>
<p>Netsuite has one single subsidiary which is the top of the consolidation tree. The reporting currency of this entity is dictated by the edition that you use. For example, UK Netsuite uses GBP.</p>
<p>Consolidated rates are calcluated as part of the period close process. There are three types:
- Current - This is the closing rate for the period (Usually used for Stock)
- Average - Average rate for the period
- Historical - The average rate for the whole history of the account. (Usually used for Equity, Fixed Assets)</p>
<p>Each nominal code has an exchange rate set on it to tell Netsuite how to translate it according to one of the three methods above. Ultimately, all your subsidiaries regardless of their reporting currency will consolidate up to the currency of the lead subsidiary.</p>
<h2>Calculations</h2>
<p>To get consolidated financial statements, Netsuite first translates transactions into the reporting currency of the subsidary. Then translates the whole financial statement into the reporting currency of the lead subsidiary.</p>
<p>On the whole, consolidated rates and daily exchange rates should match, however, sometimes they may not. Netsuite can automatic rates from either HSBC or Xignite. These do not triangulate, the inverse of an exchange rate is not always 1/n. This can lead to a situation where a GBP transaction in a USD entity, could be a different GBP value when consolidated. The fx variance is a small number, but on big transsactions can make a big difference....</p>
<h2>Cumulative Translation Reserve</h2>
<p>When consolidatding a trial balance, balance sheets will end up imbalanced. This is due to the different exchange rates (current, average, historical) being used. The balancing figure on consolidation ends up going to the cumulative translation adjustment. Have enough exchange volatility and this can be a big number too.</p>
<p>Netsuite does not post a journal for the cumulative translation adjustment, it calculates it when running financial statements.</p>
<h2>Conclusion</h2>
<p>Exchange rates can be pretty complex, here is a list of things to note:</p>
<ul>
<li>Netsuite has two types of exchange rate: daily rates and consolidated rates.</li>
<li>Daily rates come from HSBC or Xignite</li>
<li>Daily rates don't always work both ways. EUR-&gt;GBP is not the same as GBP-&gt;EUR</li>
<li>Consolidated rates are calculated from daily rates</li>
<li>Consolidated rates are three different types (current, average, historical)</li>
<li>Translation formula = transaction * daily fx rate * consolidated rate</li>
<li>Cumlative translation adjustment is the value of the imbalance caused on consolidation</li>
</ul>
</div>
<div class="column col-12">
<footer class="post-info text-left">
<p>If you have any comments about this blog post, email me at <a href="mailto:info@coraxfm.uk">info@coraxfm.uk</a><p>
<time class="published" datetime="2022-12-05T00:00:00+00:00">
Mon 05 December 2022
</time>
<div class="tags">
Tags:
<a href="./tag/accounting.html">Accounting</a>
<a href="./tag/netsuite.html">Netsuite</a>
</div>
</footer><!-- /.post-info -->
</div>
</div>
</div>
</div>
</div>
<footer class="hero hero-sm">
<div class="">
<a href="mailto:info@coraxfm.uk" class="btn btn-link">info@coraxfm.uk</a>
<a href="https://www.cimaglobal.com/About-us/Find-a-CIMA-Accountant/Corax-FM-13911/" class="btn btn-link">CIMA</a>
<a href="https://www.linkedin.com/company/coraxfm/" class="btn btn-link">LinkedIn</a>
<a href="https://hermes.huginn.uk" class="btn btn-link">Hermes</a>
<a href="https://cosearch.huginn.uk" class="btn btn-link">Cosearch</a>
<a href="https://storyset.com/" class="btn btn-link">Storyset</a>
<a href="#" class="btn btn-link">TOP</a>
</div>
<!-- <p>&copy; 2017 - 2021 Tom Lee-Gough</p> -->
</footer>
</div>
<script>
document.addEventListener('DOMContentLoaded', () => {
// Initialising the script with the Project ID
// you can find in the dashboard
swetrix.init('tQ4Waqjms8ss')
// Tracking page views
swetrix.trackViews()
})
</script>
<noscript>
<!--
Don't forget to change YOUR_PROJECT_ID in the link to your Project ID
-->
<img
src="https://api.swetrix.com/log/noscript?pid=tQ4Waqjms8ss"
alt=""
referrerpolicy="no-referrer-when-downgrade"
/>
</noscript>
</body>
</html>

0
output/export-your-xero-transactions-to-use-in-any-erp.html

184
output/feed.rss

@ -1,5 +1,33 @@ @@ -1,5 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Corax FM</title><link href="https://coraxfm.uk/" rel="alternate"></link><link href="https://coraxfm.uk/feed.rss" rel="self"></link><id>https://coraxfm.uk/</id><updated>2022-06-14T00:00:00+01:00</updated><entry><title>Take Your Accounts Offline</title><link href="https://coraxfm.uk/take-your-accounts-offline.html" rel="alternate"></link><published>2022-06-14T00:00:00+01:00</published><updated>2022-06-14T00:00:00+01:00</updated><author><name>Tom Lee-Gough</name></author><id>tag:coraxfm.uk,2022-06-14:/take-your-accounts-offline.html</id><summary type="html">&lt;p&gt;Take your accounts out of the cloud and back onto your own computer&lt;/p&gt;</summary><content type="html">&lt;p&gt;There is a huge push accross the accounting industry to push accounts into the cloud. You can find no end of articles that sell the benefits of moving your accounts online and into "the cloud" (&lt;a href="https://www.xero.com/uk/guides/small-business-cloud-accounting/"&gt;here&lt;/a&gt;, &lt;a href="https://quickbooks.intuit.com/uk/blog/cloud-accounting-top-benefits/"&gt;here&lt;/a&gt;, &lt;a href="https://www.accountingweb.co.uk/community/industry-insights/the-benefits-of-cloud-accounting"&gt;here&lt;/a&gt;, &lt;a href="https://duckduckgo.com/?t=ffab&amp;amp;q=cloud+accounting+benefits&amp;amp;ia=web"&gt;and many more&lt;/a&gt;).&lt;/p&gt;
<feed xmlns="http://www.w3.org/2005/Atom"><title>Corax FM</title><link href="https://coraxfm.uk/" rel="alternate"></link><link href="https://coraxfm.uk/feed.rss" rel="self"></link><id>https://coraxfm.uk/</id><updated>2022-12-05T00:00:00+00:00</updated><entry><title>Exchange Rates in Netsuite</title><link href="https://coraxfm.uk/exchange-rates-in-netsuite.html" rel="alternate"></link><published>2022-12-05T00:00:00+00:00</published><updated>2022-12-05T00:00:00+00:00</updated><author><name>Tom Lee-Gough</name></author><id>tag:coraxfm.uk,2022-12-05:/exchange-rates-in-netsuite.html</id><summary type="html">&lt;p&gt;How do foreign currency translations work in Netsuite&lt;/p&gt;</summary><content type="html">&lt;p&gt;Netsuite is one of my favourite ERP programs for finance. It has great reporting, is relatively easy to use, and looks good too. Where I have found that it really excels is when it is the only finance system of a group of companies. It works really well consolidating results up to a group level. However, it can get a bit confusing how it translates currencies especially with consolidation.&lt;/p&gt;
&lt;p&gt;Netsuite performs translations at two different stages: on the transaction and on consolidation. Netsuite holds a daily transaction rate, and three consolidated rate (current, average, historical).&lt;/p&gt;
&lt;h2&gt;Transactions&lt;/h2&gt;
&lt;p&gt;Each subsidiary has a reporting currency. Any foreign currency transaction is translated into the reporting currency on the date of the transaction. Balances get translated at the rate on last day of the reporting period.&lt;/p&gt;
&lt;p&gt;When running non-consolidated financial statements for a given subsidiary, Netsuite will give you the results in the reporting currency of the subsidiary.&lt;/p&gt;
&lt;h2&gt;Consolidation&lt;/h2&gt;
&lt;p&gt;Netsuite has one single subsidiary which is the top of the consolidation tree. The reporting currency of this entity is dictated by the edition that you use. For example, UK Netsuite uses GBP.&lt;/p&gt;
&lt;p&gt;Consolidated rates are calcluated as part of the period close process. There are three types:
- Current - This is the closing rate for the period (Usually used for Stock)
- Average - Average rate for the period
- Historical - The average rate for the whole history of the account. (Usually used for Equity, Fixed Assets)&lt;/p&gt;
&lt;p&gt;Each nominal code has an exchange rate set on it to tell Netsuite how to translate it according to one of the three methods above. Ultimately, all your subsidiaries regardless of their reporting currency will consolidate up to the currency of the lead subsidiary.&lt;/p&gt;
&lt;h2&gt;Calculations&lt;/h2&gt;
&lt;p&gt;To get consolidated financial statements, Netsuite first translates transactions into the reporting currency of the subsidary. Then translates the whole financial statement into the reporting currency of the lead subsidiary.&lt;/p&gt;
&lt;p&gt;On the whole, consolidated rates and daily exchange rates should match, however, sometimes they may not. Netsuite can automatic rates from either HSBC or Xignite. These do not triangulate, the inverse of an exchange rate is not always 1/n. This can lead to a situation where a GBP transaction in a USD entity, could be a different GBP value when consolidated. The fx variance is a small number, but on big transsactions can make a big difference....&lt;/p&gt;
&lt;h2&gt;Cumulative Translation Reserve&lt;/h2&gt;
&lt;p&gt;When consolidatding a trial balance, balance sheets will end up imbalanced. This is due to the different exchange rates (current, average, historical) being used. The balancing figure on consolidation ends up going to the cumulative translation adjustment. Have enough exchange volatility and this can be a big number too.&lt;/p&gt;
&lt;p&gt;Netsuite does not post a journal for the cumulative translation adjustment, it calculates it when running financial statements.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Exchange rates can be pretty complex, here is a list of things to note:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Netsuite has two types of exchange rate: daily rates and consolidated rates.&lt;/li&gt;
&lt;li&gt;Daily rates come from HSBC or Xignite&lt;/li&gt;
&lt;li&gt;Daily rates don't always work both ways. EUR-&amp;gt;GBP is not the same as GBP-&amp;gt;EUR&lt;/li&gt;
&lt;li&gt;Consolidated rates are calculated from daily rates&lt;/li&gt;
&lt;li&gt;Consolidated rates are three different types (current, average, historical)&lt;/li&gt;
&lt;li&gt;Translation formula = transaction * daily fx rate * consolidated rate&lt;/li&gt;
&lt;li&gt;Cumlative translation adjustment is the value of the imbalance caused on consolidation&lt;/li&gt;
&lt;/ul&gt;</content><category term="articles"></category><category term="Accounting"></category><category term="Netsuite"></category></entry><entry><title>Take Your Accounts Offline</title><link href="https://coraxfm.uk/take-your-accounts-offline.html" rel="alternate"></link><published>2022-06-14T00:00:00+01:00</published><updated>2022-06-14T00:00:00+01:00</updated><author><name>Tom Lee-Gough</name></author><id>tag:coraxfm.uk,2022-06-14:/take-your-accounts-offline.html</id><summary type="html">&lt;p&gt;Take your accounts out of the cloud and back onto your own computer&lt;/p&gt;</summary><content type="html">&lt;p&gt;There is a huge push accross the accounting industry to push accounts into the cloud. You can find no end of articles that sell the benefits of moving your accounts online and into "the cloud" (&lt;a href="https://www.xero.com/uk/guides/small-business-cloud-accounting/"&gt;here&lt;/a&gt;, &lt;a href="https://quickbooks.intuit.com/uk/blog/cloud-accounting-top-benefits/"&gt;here&lt;/a&gt;, &lt;a href="https://www.accountingweb.co.uk/community/industry-insights/the-benefits-of-cloud-accounting"&gt;here&lt;/a&gt;, &lt;a href="https://duckduckgo.com/?t=ffab&amp;amp;q=cloud+accounting+benefits&amp;amp;ia=web"&gt;and many more&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Cloud accounting is great for lots of use cases. However, there are some risks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Reliance on the external provider - A cloud provider could terminate your service or there could be outages.&lt;/li&gt;
@ -111,8 +139,8 @@ with open(xero_export, 'r') as input_file: @@ -111,8 +139,8 @@ with open(xero_export, 'r') as input_file:
&lt;th&gt;Nominal&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Unit&lt;/th&gt;
&lt;th align="right"&gt;DR&lt;/th&gt;
&lt;th align="right"&gt;CR&lt;/th&gt;
&lt;th style="text-align: right;"&gt;DR&lt;/th&gt;
&lt;th style="text-align: right;"&gt;CR&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
@ -121,16 +149,16 @@ with open(xero_export, 'r') as input_file: @@ -121,16 +149,16 @@ with open(xero_export, 'r') as input_file:
&lt;td&gt;BS&lt;/td&gt;
&lt;td&gt;Cash&lt;/td&gt;
&lt;td&gt;£&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td align="right"&gt;I&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;I&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DR&lt;/td&gt;
&lt;td&gt;BS&lt;/td&gt;
&lt;td&gt;Payables&lt;/td&gt;
&lt;td&gt;£&lt;/td&gt;
&lt;td align="right"&gt;I&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;I&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
@ -142,8 +170,8 @@ with open(xero_export, 'r') as input_file: @@ -142,8 +170,8 @@ with open(xero_export, 'r') as input_file:
&lt;th&gt;Nominal&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Unit&lt;/th&gt;
&lt;th align="right"&gt;DR&lt;/th&gt;
&lt;th align="right"&gt;CR&lt;/th&gt;
&lt;th style="text-align: right;"&gt;DR&lt;/th&gt;
&lt;th style="text-align: right;"&gt;CR&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
@ -152,16 +180,16 @@ with open(xero_export, 'r') as input_file: @@ -152,16 +180,16 @@ with open(xero_export, 'r') as input_file:
&lt;td&gt;BS&lt;/td&gt;
&lt;td&gt;Payables&lt;/td&gt;
&lt;td&gt;£&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td align="right"&gt;J&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;J&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DR&lt;/td&gt;
&lt;td&gt;IS&lt;/td&gt;
&lt;td&gt;Energy Usage&lt;/td&gt;
&lt;td&gt;£&lt;/td&gt;
&lt;td align="right"&gt;J&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;J&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
@ -173,8 +201,8 @@ with open(xero_export, 'r') as input_file: @@ -173,8 +201,8 @@ with open(xero_export, 'r') as input_file:
&lt;th&gt;Nominal&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Unit&lt;/th&gt;
&lt;th align="right"&gt;DR&lt;/th&gt;
&lt;th align="right"&gt;CR&lt;/th&gt;
&lt;th style="text-align: right;"&gt;DR&lt;/th&gt;
&lt;th style="text-align: right;"&gt;CR&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
@ -183,48 +211,48 @@ with open(xero_export, 'r') as input_file: @@ -183,48 +211,48 @@ with open(xero_export, 'r') as input_file:
&lt;td&gt;IS&lt;/td&gt;
&lt;td&gt;Water&lt;/td&gt;
&lt;td&gt;m^3&lt;/td&gt;
&lt;td align="right"&gt;X&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;X&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CR&lt;/td&gt;
&lt;td&gt;BS&lt;/td&gt;
&lt;td&gt;Water&lt;/td&gt;
&lt;td&gt;m^3&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td align="right"&gt;-X&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;-X&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DR&lt;/td&gt;
&lt;td&gt;IS&lt;/td&gt;
&lt;td&gt;Gas&lt;/td&gt;
&lt;td&gt;m^3&lt;/td&gt;
&lt;td align="right"&gt;Y&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;Y&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CR&lt;/td&gt;
&lt;td&gt;BS&lt;/td&gt;
&lt;td&gt;Gas&lt;/td&gt;
&lt;td&gt;m^3&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td align="right"&gt;-Y&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;-Y&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DR&lt;/td&gt;
&lt;td&gt;IS&lt;/td&gt;
&lt;td&gt;Elec&lt;/td&gt;
&lt;td&gt;kWh&lt;/td&gt;
&lt;td align="right"&gt;Z&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;Z&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CR&lt;/td&gt;
&lt;td&gt;BS&lt;/td&gt;
&lt;td&gt;Elec&lt;/td&gt;
&lt;td&gt;kWh&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td align="right"&gt;-Z&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;-Z&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
@ -233,45 +261,45 @@ with open(xero_export, 'r') as input_file: @@ -233,45 +261,45 @@ with open(xero_export, 'r') as input_file:
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Date&lt;/th&gt;
&lt;th align="right"&gt;DR&lt;/th&gt;
&lt;th align="right"&gt;CR&lt;/th&gt;
&lt;th style="text-align: right;"&gt;DR&lt;/th&gt;
&lt;th style="text-align: right;"&gt;CR&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Jan 31&lt;/td&gt;
&lt;td align="right"&gt;1000&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;1000&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Feb 01&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td align="right"&gt;-1000&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;-1000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Feb 29&lt;/td&gt;
&lt;td align="right"&gt;1200&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;1200&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mar 01&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td align="right"&gt;-1200&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;-1200&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mar 31&lt;/td&gt;
&lt;td align="right"&gt;1350&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;1350&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Apr 01&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td align="right"&gt;-1350&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;-1350&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Apr 30&lt;/td&gt;
&lt;td align="right"&gt;1600&lt;/td&gt;
&lt;td align="right"&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;1600&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
@ -283,21 +311,21 @@ Screenshow from entries in Gnucash: @@ -283,21 +311,21 @@ Screenshow from entries in Gnucash:
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Period&lt;/th&gt;
&lt;th align="right"&gt;Usage (m^3)&lt;/th&gt;
&lt;th style="text-align: right;"&gt;Usage (m^3)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Feb&lt;/td&gt;
&lt;td align="right"&gt;200&lt;/td&gt;
&lt;td style="text-align: right;"&gt;200&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mar&lt;/td&gt;
&lt;td align="right"&gt;150&lt;/td&gt;
&lt;td style="text-align: right;"&gt;150&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Apr&lt;/td&gt;
&lt;td align="right"&gt;250&lt;/td&gt;
&lt;td style="text-align: right;"&gt;250&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
@ -381,34 +409,34 @@ Gnucash Income statement: @@ -381,34 +409,34 @@ Gnucash Income statement:
returns result
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nv"&gt;def&lt;/span&gt; &lt;span class="nv"&gt;another_function&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;a&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;:
&lt;span class="nv"&gt;this&lt;/span&gt; &lt;span class="nv"&gt;function&lt;/span&gt; &lt;span class="nv"&gt;is&lt;/span&gt; &lt;span class="nv"&gt;different&lt;/span&gt; &lt;span class="nv"&gt;to&lt;/span&gt; &lt;span class="nv"&gt;above&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;result&lt;/span&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nv"&gt;def&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;another_function&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;a&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;:&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;this&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;function&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;is&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;different&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;above&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;result&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Variables&lt;/h2&gt;
&lt;p&gt;Any one that has taken GCSE maths would have come across variables. It's not a popular subject, but algebra is all variables. A variable is a container. In algebra it is a number, in programming it can be anything. For example, the formula &lt;em&gt;Y = X&lt;sup&gt;2&lt;/sup&gt; + 4&lt;/em&gt; both &lt;strong&gt;Y&lt;/strong&gt; and &lt;strong&gt;X&lt;/strong&gt; are variables. To plot a graph of &lt;strong&gt;Y&lt;/strong&gt;, you would plug values into &lt;strong&gt;X&lt;/strong&gt; and solve for &lt;strong&gt;Y&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Here's how you can assign a variable in Python:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# assign a string to a variable called &amp;quot;name&amp;quot;&lt;/span&gt;
&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;guitar&amp;#39;&lt;/span&gt;
&lt;span class="c1"&gt;# assign a number to a variable&lt;/span&gt;
&lt;span class="n"&gt;strings&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;
&lt;span class="c1"&gt;# assign a list to a variable&lt;/span&gt;
&lt;span class="n"&gt;types&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;electric&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;acoustic&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# assign a string to a variable called &amp;quot;name&amp;quot;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;guitar&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="c1"&gt;# assign a number to a variable&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="n"&gt;strings&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="c1"&gt;# assign a list to a variable&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="n"&gt;types&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;electric&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;acoustic&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Arrays&lt;/h2&gt;
&lt;p&gt;An array is a collection of data. Python has several types. I mainly use lists and dicts.&lt;/p&gt;
&lt;h3&gt;Lists&lt;/h3&gt;
&lt;p&gt;Lists are pretty simple. A list is a series of items that are separated by commas within square brackets. They can contain any data types, and can be mixed.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# list of strings&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;hello&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;this&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;is&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;a&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;string&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="c1"&gt;# list of numbers&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;4.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;6.7&lt;/span&gt; &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="c1"&gt;# list of variables&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;second&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;third&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="c1"&gt;# mix list&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;string&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;1&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# list of strings&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;hello&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;this&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;is&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;a&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;string&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="c1"&gt;# list of numbers&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;4.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;6.7&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="c1"&gt;# list of variables&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;second&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;third&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="c1"&gt;# mix list&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;string&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;1&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Dicts / JSON&lt;/h3&gt;
@ -430,9 +458,9 @@ Gnucash Income statement: @@ -430,9 +458,9 @@ Gnucash Income statement:
&lt;h2&gt;Functions&lt;/h2&gt;
&lt;p&gt;A function is an action that you regularly perform within a script. This saves you time in your code, as you only have to write the thing once. There are lots of built in functions in Python, you will definitely write your own.&lt;/p&gt;
&lt;p&gt;Using the formula from above, we could write it as a function:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nv"&gt;def&lt;/span&gt; &lt;span class="nv"&gt;solve_y&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;:
&lt;span class="nv"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;y&lt;/span&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nv"&gt;def&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;solve_y&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;:&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;y&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;y&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Functions start &lt;em&gt;def&lt;/em&gt; then the name of the function followed by brackets and a colon. In the example we can pass a number to the function and the function performs the action. The "return" part means that the function will give the result of the function back. This can be assigned to a variable or something else.&lt;/p&gt;
@ -444,22 +472,22 @@ Gnucash Income statement: @@ -444,22 +472,22 @@ Gnucash Income statement:
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Our &lt;em&gt;solve_y&lt;/em&gt; function can be writted using the in-built power function. It raises any number to the power of another number:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nv"&gt;def&lt;/span&gt; &lt;span class="nv"&gt;solve_y&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;:
&lt;span class="nv"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;pow&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;, &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;y&lt;/span&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nv"&gt;def&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;solve_y&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;:&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;y&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;pow&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;y&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In our particular case, it doesn't really make it a lot simpler. However, it a bit clearer from a BODMAS point of view.&lt;/p&gt;
&lt;h3&gt;For Loop&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;For loops&lt;/strong&gt; are used lots. A for loop iterates over an item, assigning each of results to a variable. It's kind of hard for non-programmers to get your head around, however, it very powerful. Here are some examples:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt; &lt;span class="nv"&gt;in&lt;/span&gt; &lt;span class="nv"&gt;range&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;:
... &lt;span class="nv"&gt;i&lt;/span&gt;
...
&lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="mi"&gt;2&lt;/span&gt;
&lt;span class="mi"&gt;3&lt;/span&gt;
&lt;span class="mi"&gt;4&lt;/span&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;i&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;range&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;:&lt;span class="w"&gt;&lt;/span&gt;
...&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;i&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
...&lt;span class="w"&gt; &lt;/span&gt;
&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;