taxcalcs / taxcalculator Goto Github PK
View Code? Open in Web Editor NEWGenerated code for german tax calculation from https://www.bmf-steuerrechner.de/
License: MIT License
Generated code for german tax calculation from https://www.bmf-steuerrechner.de/
License: MIT License
You can not figure out which have the input values.
For example, if the input values are Strings (query parameter, form inputs), then you can not set without the type of each individual to know.
The type can be:
Version: 2016.1.1
IS:
The method TaxCalculatorFactory.getOutputs() returns the getClass() method key.
SHOULD:
The class to return only methods that are related to the tax calculation.
final TaxCalculatorFactory factory = new TaxCalculatorFactory();
final Set<String> outs = factory.getOutputs("2015Dezember")
// outs contains getClass method "CLASS"
The URLs to download the XMLs are changed.
Old: https://www.bmf-steuerrechner.de/pruefdaten/Lohnsteuer2018.xml
New: https://www.bmf-steuerrechner.de/javax.faces.resource/daten/xmls/Lohnsteuer2018.xml.xhtml
Add the attribute Automatic-Module-Name
to the manifest to set the module name for JDK 9.
see http://docs.oracle.com/javase/9/docs/specs/jar/jar.html#Main_Attributes
see http://docs.oracle.com/javase/9/docs/api/java/lang/module/ModuleFinder.html#automatic-modules
Module name is info.kuechler.bmf.taxcalculator
The gettersAndSetters
and getters
templates in the current XSLT definition don't match against the given xml format.
Expected is /PAP/VARIABLES/INPUT
where the actual path is /PAP/VARIABLES/INPUTS/INPUT
same story with:
/PAP/VARIABLES/OUTPUT
and /PAP/VARIABLES/OUTPUTS/OUTPUT
Add the calculation for 2018. Should be available in October or November 2017.
Add the calculation for 2020.
Add 2017 calculation.
It would be nice if there was a facility for programatically looking up
Lohnsteuer calculation strategies based on some key or date parameter.
This would be helpful for applications that need to dynamically
select the appropriate calculation strategy based on some context.
In order to support this there must be some sort of interface to abstract the actual calculation.
The interface needs to be able to deal with varying input since the calculation input and output fields
change from time to time.
I gave this a quick spin in my feature/calculator-lookup-support branch.
public class LohnsteuerCalculatorTest {
LohnsteuerCalculator calculator;
@Before
public void setup() {
calculator = new DefaultLohnsteuerCalculator();
}
@Test
public void testCalculateWithInputParameters() throws Exception {
Map<String, Object> input = new HashMap<>();
input.put("LZZ", 2); // monthly payment
input.put("STKL", 1); // tax class
input.put("RE4", new BigDecimal("223456")); // income in cent
input.put("LZZFREIB", BigDecimal.ZERO); // Freibeträge
input.put("PVS", 0); // not in saxony
input.put("PVZ", 0); // Additional care insurance for employee: birth > 1940, older
// than 23, no kids
input.put("R", 0); // no church
input.put("ZKF", new BigDecimal("0.5")); // a half child :)
input.put("KVZ", new BigDecimal("0.90")); // additional med insurance [percent]
input.put("KRV", 1); // pensions fund: east germany
input.put("VBEZ", BigDecimal.ZERO);
input.put("LZZHINZU", BigDecimal.ZERO);
input.put("SONSTB", BigDecimal.ZERO);
input.put("VKAPA", BigDecimal.ZERO);
input.put("VMT", BigDecimal.ZERO);
CalculationOutput output = calculator.calculate("201512", input);
assertThat(output.getProperty("LSTLZZ", BigDecimal.class).divide(new BigDecimal("100")),
is(new BigDecimal("239.41")));
assertThat(
output.getProperty("SOLZLZZ", BigDecimal.class).divide(new BigDecimal("100")),
is(new BigDecimal("7.79")));
System.out.println(output.getProperties());
}
}
Here the calculation is looked up based on a date kay pattern which internally resolves to
the appropriate LohnsteuerCalculation. The calculation input is provided as a Map
as well as the output but the latter is wrapped in a CalculationOutput
.
The DefaultLohnsteuerCalculator
provides access to the supported LohnsteuerCalculations
that can be resolved via a date pattern key that allow direct lookup as well as "lenient" lookups where we lookup the actual valid calculation for the particular date range a calculation is valid based on the provided key.
Some examples are show in the LohnsteuerCalculatorFactoryTests.
From the 2018 version on, the library will switch to Java 8. In addition, Reflection's generic access (TaxCalculatorFactory) will switch to a variant with Java functions.
Current Planned Tasks:
private static final Map<String, BiConsumer<Lohnsteuer2017Big, BigDecimal>> MAP;
static {
MAP.put(normalizeKey("ENTSCH"), Lohnsteuer2017Big::setENTSCH);
...
}
Performance will improve.
I try to keep the API as compatible as possible.
Add the calculation for 2019. Should be available in November 2018.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.