Search in sources :

Example 1 with Currency

use of org.estatio.module.currency.dom.Currency in project estatio by estatio.

the class CurrencyBuilder method execute.

@Override
protected void execute(ExecutionContext ec) {
    checkParam("reference", ec, String.class);
    defaultParam("reference", ec, getName());
    final Currency currency = currencyRepository.findOrCreateCurrency(reference, name);
    ec.addResult(this, currency.getReference(), currency);
    object = currency;
}
Also used : Currency(org.estatio.module.currency.dom.Currency)

Example 2 with Currency

use of org.estatio.module.currency.dom.Currency in project estatio by estatio.

the class PaymentBatch_Test method newInvoice.

IncomingInvoice newInvoice(final LocalDate invoiceDate, final Party seller, final BankAccount sellerBankAccount, final String currencyRef, final String grossAmount, final String invoiceNumber) {
    final IncomingInvoice invoice = new IncomingInvoice();
    invoice.setInvoiceDate(invoiceDate);
    invoice.setSeller(seller);
    invoice.setBankAccount(sellerBankAccount);
    invoice.setGrossAmount(new BigDecimal(grossAmount));
    invoice.setInvoiceNumber(invoiceNumber);
    final Currency currency = new Currency();
    currency.setReference(currencyRef);
    invoice.setCurrency(currency);
    return invoice;
}
Also used : Currency(org.estatio.module.currency.dom.Currency) IncomingInvoice(org.estatio.module.capex.dom.invoice.IncomingInvoice) BigDecimal(java.math.BigDecimal)

Example 3 with Currency

use of org.estatio.module.currency.dom.Currency in project estatio by estatio.

the class IncomingInvoiceRepository method create.

@Programmatic
public IncomingInvoice create(final IncomingInvoiceType type, final String invoiceNumber, final Property property, final String atPath, final Party buyer, final Party seller, final LocalDate invoiceDate, final LocalDate dueDate, final PaymentMethod paymentMethod, final InvoiceStatus invoiceStatus, final LocalDate dateReceived, final BankAccount bankAccount, final IncomingInvoiceApprovalState approvalStateIfAny) {
    final Currency currency = currencyRepository.findCurrency("EUR");
    final IncomingInvoice invoice = new IncomingInvoice(type, invoiceNumber, property, atPath, buyer, seller, invoiceDate, dueDate, paymentMethod, invoiceStatus, dateReceived, bankAccount, approvalStateIfAny);
    invoice.setCurrency(currency);
    serviceRegistry2.injectServicesInto(invoice);
    repositoryService.persistAndFlush(invoice);
    return invoice;
}
Also used : Currency(org.estatio.module.currency.dom.Currency) Programmatic(org.apache.isis.applib.annotation.Programmatic)

Aggregations

Currency (org.estatio.module.currency.dom.Currency)3 BigDecimal (java.math.BigDecimal)1 Programmatic (org.apache.isis.applib.annotation.Programmatic)1 IncomingInvoice (org.estatio.module.capex.dom.invoice.IncomingInvoice)1