Search in sources :

Example 1 with TaxRate

use of org.estatio.tax.dom.TaxRate in project estatio by estatio.

the class Api method putTax.

// //////////////////////////////////////
@ActionSemantics(Of.IDEMPOTENT)
public void putTax(@Named("atPath") final String atPath, @Named("reference") final String reference, @Named("name") final String name, @Named("description") final String description, @Named("externalReference") @Optional final String externalReference, @Named("ratePercentage") final BigDecimal percentage, @Named("rateStartDate") final LocalDate startDate, @Named("rateExternalReference") @Optional final String rateExternalReference) {
    final ApplicationTenancy applicationTenancy = applicationTenancies.findTenancyByPath(atPath);
    final Tax tax = taxes.findOrCreate(reference, name, applicationTenancy);
    tax.setExternalReference(externalReference);
    tax.setDescription(description);
    final TaxRate rate = tax.newRate(startDate, percentage);
    rate.setExternalReference(rateExternalReference);
}
Also used : TaxRate(org.estatio.tax.dom.TaxRate) Tax(org.estatio.tax.dom.Tax) ApplicationTenancy(org.isisaddons.module.security.dom.tenancy.ApplicationTenancy)

Aggregations

Tax (org.estatio.tax.dom.Tax)1 TaxRate (org.estatio.tax.dom.TaxRate)1 ApplicationTenancy (org.isisaddons.module.security.dom.tenancy.ApplicationTenancy)1