How to implement country-specific report in Manager

@lubos

  • The filter structure in liquid enables transactions to be readily filtered out. Effectively this provides the ability to search for Filter1 “and” Filter2 via:
    {% assign Filter1AndFilter2 = Transactions | filter1 | Filter2 %}

  • “Transactions” appears to be an array of general ledger transaction entries

  • An array containing the transactions from Filter1 “or” Filter2 can readily be generated via:
    {% assign Set1 = Transactions | filter1 %}
    {% assign Set2 = Transactions | filter2 %}
    {% assign Set3 = Set1 | concat: Set2 %}

Individual transaction can be enumerated for Set3 however I must be missing something as the resulting array is not displayed nor does the filter “hyperlink” work. I guess this is because how you have set the environment up, in particular “Transactions” is probably not just an array of transaction.

Is it currently possible for a report transformation author to generate “or” searches? If not, I would find it very useful if you could add some form of “or_transactions” filter to the report transformation environment. Although with my limited understanding of the back end, I don’t know how hard a task that would be.

It seems that is still doesn’t work for inventory items and kits.

I think that they should be written in SQL which is a more standard and diffuse language than Liquid.

@Patch concat filter is not yet fully supported. The reason is that I need to make sure whatever collection you end up after filters is still something you can convert into hyperlink. This hasn’t been implemented yet - that’s why concat filter will break hyperlink.

It would certainly be useful to support so you can emulate OR filters by simply creating individual collections and then concat them. I think or_filters would be ugly. Your example with Set1, Set2, Set3 is more elegant.

@Davide I just tested inventory kits and it worked:

{% for e in inventoryKits %}
{{ e.Name }}<br />
{% endfor %}

There was a bug with inventory items which I have fixed now.

2 Likes

I’m not still onto the language for Report Transformation. Can we have a litte explanation/transposition of what we usually obtain from SQL queries?

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).