Search in sources :

Example 11 with Tax

use of org.estatio.module.tax.dom.Tax in project estatio by estatio.

the class TaxRateMenu_Test method setup.

@Before
public void setup() {
    tax = new Tax();
    date = new LocalDate(2013, 4, 1);
    taxRateMenu = new TaxRateMenu() {

        @Override
        protected <T> T firstMatch(Query<T> query) {
            finderInteraction = new FinderInteraction(query, FinderMethod.FIRST_MATCH);
            return null;
        }

        @Override
        protected List<TaxRate> allInstances() {
            finderInteraction = new FinderInteraction(null, FinderMethod.ALL_INSTANCES);
            return null;
        }

        @Override
        protected <T> List<T> allMatches(Query<T> query) {
            finderInteraction = new FinderInteraction(query, FinderMethod.ALL_MATCHES);
            return null;
        }
    };
}
Also used : Tax(org.estatio.module.tax.dom.Tax) List(java.util.List) LocalDate(org.joda.time.LocalDate) FinderInteraction(org.incode.module.unittestsupport.dom.repo.FinderInteraction) Before(org.junit.Before)

Example 12 with Tax

use of org.estatio.module.tax.dom.Tax in project estatio by estatio.

the class IncomingInvoice method copyWithLinks.

private IncomingInvoiceItem copyWithLinks(final IncomingInvoiceItem itemToReverse, final Sort sort) {
    final IncomingInvoiceType type = itemToReverse.getIncomingInvoiceType();
    final String description = itemToReverse.getDescription();
    final Charge charge = itemToReverse.getCharge();
    final BigDecimal netAmount = itemToReverse.getNetAmount();
    final BigDecimal vatAmount = itemToReverse.getVatAmount();
    final BigDecimal grossAmount = itemToReverse.getGrossAmount();
    final Tax tax = itemToReverse.getTax();
    final LocalDate dueDate = itemToReverse.getDueDate();
    final String period = itemToReverse.getPeriod();
    final FixedAsset fixedAsset = itemToReverse.getFixedAsset();
    final Project project = itemToReverse.getProject();
    final BudgetItem budgetItem = itemToReverse.getBudgetItem();
    final IncomingInvoiceItem copyItem = addItemToThis(type, charge, sort.prefixTo(description), sort.adjust(netAmount), sort.adjust(vatAmount), sort.adjust(grossAmount), tax, dueDate, period, fixedAsset, project, budgetItem);
    if (sort == Sort.REVERSAL) {
        copyItem.setReversalOf(itemToReverse);
    }
    final Optional<OrderItemInvoiceItemLink> linkIfAny = orderItemInvoiceItemLinkRepository.findByInvoiceItem(itemToReverse);
    linkIfAny.ifPresent(link -> {
        orderItemInvoiceItemLinkRepository.createLink(link.getOrderItem(), copyItem, sort.adjust(link.getNetAmount()));
    });
    return copyItem;
}
Also used : Project(org.estatio.module.capex.dom.project.Project) BudgetItem(org.estatio.module.budget.dom.budgetitem.BudgetItem) OrderItemInvoiceItemLink(org.estatio.module.capex.dom.orderinvoice.OrderItemInvoiceItemLink) Charge(org.estatio.module.charge.dom.Charge) Tax(org.estatio.module.tax.dom.Tax) FixedAsset(org.estatio.module.asset.dom.FixedAsset) LocalDate(org.joda.time.LocalDate) BigDecimal(java.math.BigDecimal)

Example 13 with Tax

use of org.estatio.module.tax.dom.Tax in project estatio by estatio.

the class InvoiceItemForLeaseDtoFactory_Test method setUp.

@Before
public void setUp() throws Exception {
    // given
    ChargeGroup chargeGroup = new ChargeGroup();
    chargeGroup.setReference("CG");
    Charge charge = new Charge();
    charge.setReference("CH");
    charge.setExternalReference("CHE");
    charge.setGroup(chargeGroup);
    Tax tax = new Tax();
    Unit unit = new Unit();
    unit.setReference("UN");
    Brand brand = new Brand();
    brand.setName("BRAND");
    Occupancy occupancy = new Occupancy();
    occupancy.setEndDate(new LocalDate(2013, 12, 31));
    occupancy.setUnit(unit);
    occupancy.setBrand(brand);
    Lease lease = new Lease();
    lease.getOccupancies().add(occupancy);
    InvoiceForLease invoice = new InvoiceForLease();
    invoice.setLease(lease);
    invoiceItem = new InvoiceItemForLease();
    invoiceItem.setInvoice(invoice);
    invoiceItem.setCharge(charge);
    invoiceItem.setTax(tax);
}
Also used : Brand(org.estatio.module.lease.dom.occupancy.tags.Brand) Lease(org.estatio.module.lease.dom.Lease) InvoiceForLease(org.estatio.module.lease.dom.invoicing.InvoiceForLease) InvoiceItemForLease(org.estatio.module.lease.dom.invoicing.InvoiceItemForLease) InvoiceForLease(org.estatio.module.lease.dom.invoicing.InvoiceForLease) ChargeGroup(org.estatio.module.charge.dom.ChargeGroup) Occupancy(org.estatio.module.lease.dom.occupancy.Occupancy) Charge(org.estatio.module.charge.dom.Charge) InvoiceItemForLease(org.estatio.module.lease.dom.invoicing.InvoiceItemForLease) Tax(org.estatio.module.tax.dom.Tax) Unit(org.estatio.module.asset.dom.Unit) LocalDate(org.joda.time.LocalDate) Before(org.junit.Before)

Aggregations

Tax (org.estatio.module.tax.dom.Tax)13 Charge (org.estatio.module.charge.dom.Charge)9 BigDecimal (java.math.BigDecimal)5 Project (org.estatio.module.capex.dom.project.Project)5 LocalDate (org.joda.time.LocalDate)5 Programmatic (org.apache.isis.applib.annotation.Programmatic)4 Property (org.estatio.module.asset.dom.Property)4 BudgetItem (org.estatio.module.budget.dom.budgetitem.BudgetItem)4 ChargeGroup (org.estatio.module.charge.dom.ChargeGroup)4 Test (org.junit.Test)4 TaxRate (org.estatio.module.tax.dom.TaxRate)3 FixedAsset (org.estatio.module.asset.dom.FixedAsset)2 Lease (org.estatio.module.lease.dom.Lease)2 InvoiceForLease (org.estatio.module.lease.dom.invoicing.InvoiceForLease)2 InvoiceItemForLease (org.estatio.module.lease.dom.invoicing.InvoiceItemForLease)2 Occupancy (org.estatio.module.lease.dom.occupancy.Occupancy)2 Brand (org.estatio.module.lease.dom.occupancy.tags.Brand)2 ApplicationTenancy (org.isisaddons.module.security.dom.tenancy.ApplicationTenancy)2 Before (org.junit.Before)2 BigInteger (java.math.BigInteger)1