How to implement country-specific report in Manager

I have made some progress on these report teansformations but I faced two issues:

  1. couldn’t get the net VAT payable. I already tried looping through transactions to get the sum if transactions.TaxCode == UUID and it summed to 0, I then tried GeneralLedgerAccount instead of TaxCode and the sum is still 0. I first thought that maybe the for loop was not working but then I got the loop to get the count and that worked so I checked the transactions fields and these fields were blank so maybe it’s summing up all the debits and credits. Is there another way to get the sum of tax_on_sales and tax_on_purchases?

  2. For now I need to give restricted users access to report transformations in the settings. It would be much better if they have access to transformations in the reports tab but not in the settings.

Read #1 Post, or share your code.

I think you are trying to hard.
An easier way is to

  • load report transformations from other countries into a test business, looking most closely at countries with a similar tax system to your country.

  • then import the localisation into your software development businesses and clone it or just copy and edit the bits you want.

To more directly address your current problems.

  • Manager is double entry accounting system so sum of everything balances/ equals zero. You need where searches to restrict the transaction you are summing

  • use the filters in post by Lubos

Are Docs uploaded? I cannot find it in Guides section.

Thanks, how did I miss it, it’s on the first line.

Or maybe I just wasn’t trying hard enough.

I need to have localizations under version control and also have a system in place so everybody can contribute but changes will be merged only after review.

I just created GitHub project at https://github.com/Manager-io/Localizations.json

This is where all country-specific Manager databases will be stored in JSON format (this will allow for version control).

There is a tutorial you can follow to get familiar with submission process.

I assume the problem is

  • Where… filters (transaction database searches) could be combined. This includes the filters between: taxcode: where_payslip_…_item:

  • But only one display specification can be used for each set of transactions (Select, order by, Group by). This includes (reverse_sign, tax_amount, tax_exclusive_amount). I’m less sure about the tax… filters with a sales/purchases specifier as they appear to be combined select and where filter

I assume the solution will be to either give an error when concat: is used with variables containing different display specifications or just pick the display specification from one of the variables and use that.

I would agree if the target audience was general programmers. However I think the main target market is Manager users, as such having a direct correspondence between

  • Managers custom reports definition
  • Mangers “Report transformation” definition

Is more valuable in my opinion. That way user can write custom reports and if that doesn’t provide the functionality they want, they can recreate the custom report filters in report transformations by just typing in the custom report menu selections. Then add further customization.

If I am not wrong basically copy to clipboard will reveal the .json file that we used to have when we could push on export settings. We still need the way back… a way to manually import all these settings under different businesses.

Hi, I’m just scanning the Australia.json file and notice that there are UTF8 dashes used in some instances instead of a standard dash (looks like EN or EM Dash). In other places there are ordinary dashes. (e.g. ⁠— vs -) Is this intentional?

I realise it probably is not apparent (or an issue) in Apple and Linux as the Text Editors appear to be UTF8 aware and most people would not even notice. However, in Windows using the wrong editor could easily break these characters.

Specifically the STP custom fields (Payment Basis Dropdown Values) and 1 line in the “PAYG payment summary - individual non-business” script section (S ⁠— Pension or Annuity)

Are you saying basically that we will be able to import Custom Reports inside Report Transformation and edit them?

That would be great

Not exactly but as close as the difference between a menu and text interface allows.

The suggestion is that report transformation have filters

  • Where:
  • Group:
  • Select:

Each of these filters using the same parameters and in the same order as custom reports. Or at least Lubos implements as much as is readily achievable but using the format demonstrated in custom reports.

That way if a user can write custom reports, it is only a small step to writing report transformations. Alternatively when writing a report transformation, you could experiment with custom reports to see how to extract the data you want.

For example of how close they are currently

In report transformations we can
10 Group by supplier - custom report

The equivalent in Report transformations is
{% assign taxTransactionsPerSupplier = transactions | between: report.From, report.To | taxcode: gst_10, gst_10_capex, gst_free | group_by_supplier %}

Similar where a Manager business has this payslip earing item

In custom reports we can do

The equivalent in Report transformation is
{% assign W1 = period | where_payslip_earnings_item: '8198caf2-1125-4f8e-9469-527583e3ea5e', 'Gross payments' %}

Note the GUID of the custom field “ATO reporting category” is “8198caf2-1125-4f8e-9469-527583e3ea5e”

Yes - it’s intentional.

Normally you wouldn’t make straight edits using text editor. You’d import JSON into Manager, make changes, then export JSON out of Manager. So you’d use Manager as your “JSON editor” for these files.

I’m starting to understand the logic behind Report Transformation. A question: is it possible to JOIN two or more tables with AND and/or OR operators or are we stuck to the tables that are listed? Is there also a CONCAT function to concatenate two lists?

Can you give an example what you need to do? Because when you have transaction, it has Customer attribute but this attribute doesn’t represent UUID of the customer. It’s an actual customer object so the inner join is done automatically for you.

1 Like

I’m just experimenting so it’s not related to country localization.

I was trying to extract a whole list of all the inventory kits with all the attributes (including all custom fields) that were not sold (so not linked to a transaction).

To be complete there should be:

SELECT
FROM List of tables with JOIN and ON
WHERE
ORDER BY
GROUP BY

since SQL is an international standard that works so well I think that we can simply follow it.

1 Like

Thanks for the response and clarification.

Yes I agree completely, for the average Manager user you have created a very easy workflow and kudos to you! Then, if you’re already familiar with the normal GitHub workflow and are familiar with .json structure (and it’s a definite improvement over xml) I find text editors are quicker and easier.

Anyway you have confirmed what I wanted to know and I will be mindful of that fact or just use phpStorm as it appears to works correctly in that (VSCode and Notepad++ are troublesome in windows).

Here is simple code which will give you list of inventory kits not used by any transaction.

{% assign inventoryKitsInUse = transactions | map: "InventoryKit" | uniq | compact | map: "Key" %}
{% for e in inventoryKits %}
{% if inventoryKitsInUse contains e.Key %}{% continue %}{% endif %}
{{ e.Name }}<br />
{% endfor %}

The first line will get list of inventory kits used by transactions. Then we loop through all inventory kits and skip those which are used by transactions.

There is no point to add SQL if you can already do everything using Liquid. Liquid can handle data querying and presentation while SQL can only handle data querying. You still need scripting language for presentation so SQL cannot really replace Liquid but Liquid can replace SQL.

For that reason SQL is redundant.

So I will have to learn liquid. Thanks a lot.

It’s amazing how liquid can do so much with so little.