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;
}
};
}
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;
}
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);
}
Aggregations