Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for Australia #53

Open
eprbell opened this issue Aug 9, 2022 · 3 comments
Open

Add Support for Australia #53

eprbell opened this issue Aug 9, 2022 · 3 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@eprbell
Copy link
Owner

eprbell commented Aug 9, 2022

RP2 and DaLI have a programmable plugin architecture for countries, accounting methods, report generators and more. Adding support for a new country is a high-impact activity because it allows many new potential users to get access to RP2 and DaLI.

Here's how to add support for a new country:

  1. add a new country plugin to RP2;
  2. if the country requires accounting methods that aren't already supported in RP2, add the necessary accounting method plugins;
  3. ensure any newly added accounting methods are reflected in the country plugin's get_default_accounting_method() and get_accounting_methods() methods;
  4. optionally, new country-specific report generators can be added. The built-in report generators (i.e. rp2_full_report and open_positions) are automatically supported;
  5. only for non-English speaking countries: translations for the built-in report generators and for any new report generator can be added;
  6. ensure any newly added report generators are reflected in the country plugin's get_report_generators() method;
  7. add the same country plugin to DaLI. The implementation on the DaLI side is trivial: it's just an entry point instantiating the RP2 country plugin and passing it to the main function;
  8. update the documentation of RP2 and DaLI to reflect the new country, accounting methods (if any) and report generators (if any).

If you notice the country-specific infrastructure is missing a feature that is required to express taxes for the new country, open an issue to let the RP2 community know.

@eprbell eprbell added help wanted Extra attention is needed good first issue Good for newcomers labels Aug 9, 2022
@peterpicard
Copy link

Hi @eprbell, Australia's tax year is from 1st July to 30th June. I don't see any way to change the default behaviour of report generation (1st January to 31st December) through the exposed class methods. Any suggestions?

@macanudo527
Copy link
Collaborator

There is nothing blocking you from sorting the data into years based on that calendar. RP2 gives you all the data by default and you can then sort that however you want. For example, in the tax report for Japan I sorted tax years like this:

# Sort all in and out transactions by year, the fee from intra transactions must be reported
for entry in chain(in_transaction_set, out_transaction_set, intra_transaction_set):  # type: ignore
  transaction: AbstractTransaction = cast(AbstractTransaction, entry)
  years_2_transaction_sets.setdefault(transaction.timestamp.year, []).append(entry)

I just used the timestamp year, but you could easily change that to filter the data however you want.

@eprbell
Copy link
Owner Author

eprbell commented Apr 26, 2023

What @macanudo527 is correct. I'll only add a couple of details:

  1. there is one class in RP2 that computes yearly summaries (YearlyGainLoss). It has hard-coded year start at Jan 1st. However the generator plugins for Australia (or another country) can simply ignore it (and compute its own summaries, if needed, or no summaries).
  2. tax year begin date could become a new method of country plugins
  3. YearlyGainLoss could use the new tax year begin date method to adjust its computation.

Point 1 is available today. Points 2 and 3 could be done as an enhancement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants