Search in sources :

Example 1 with OrderInvoiceLine

use of org.estatio.module.capex.imports.OrderInvoiceLine in project estatio by estatio.

the class OrderInvoiceImportMenu method importOrdersAndInvoices.

@Action(semantics = SemanticsOf.SAFE)
@MemberOrder(sequence = "1")
public OrderInvoiceSheet importOrdersAndInvoices(final String sheetName, final Blob spreadSheet) {
    final List<OrderInvoiceLine> lines = orderInvoiceImportService.createLines(sheetName, spreadSheet);
    final OrderInvoiceSheet sheet = factoryService.instantiate(OrderInvoiceSheet.class);
    sheet.setLines(lines);
    return sheet;
}
Also used : OrderInvoiceSheet(org.estatio.module.capex.imports.OrderInvoiceSheet) OrderInvoiceLine(org.estatio.module.capex.imports.OrderInvoiceLine) Action(org.apache.isis.applib.annotation.Action) MemberOrder(org.apache.isis.applib.annotation.MemberOrder)

Example 2 with OrderInvoiceLine

use of org.estatio.module.capex.imports.OrderInvoiceLine in project estatio by estatio.

the class OrderInvoiceImportForDemoXlsxFixture method execute.

@Override
protected void execute(final ExecutionContext executionContext) {
    setExcelResource(Resources.getResource(getClass(), "OrderInvoiceImportForDemo.xlsx"));
    setMatcher(sheetName -> {
        if (sheetName.startsWith("OXFORD")) {
            return new WorksheetSpec(rowFactoryFor(OrderInvoiceImportHandler.class, executionContext), sheetName, Mode.RELAXED);
        } else {
            return null;
        }
    });
    super.execute(executionContext);
    for (FixtureResult result : executionContext.getResults()) {
        if (result.getClassName().equals(OrderInvoiceLine.class.getName())) {
            OrderInvoiceLine line = (OrderInvoiceLine) result.getObject();
            OrderInvoiceLine._apply applyMixin = factoryService.mixin(OrderInvoiceLine._apply.class, line);
            if (applyMixin.disableAct() == null) {
                applyMixin.act();
            }
        }
    }
}
Also used : WorksheetSpec(org.isisaddons.module.excel.dom.WorksheetSpec) OrderInvoiceImportHandler(org.estatio.module.capex.imports.OrderInvoiceImportHandler) FixtureResult(org.apache.isis.applib.fixturescripts.FixtureResult) OrderInvoiceLine(org.estatio.module.capex.imports.OrderInvoiceLine)

Aggregations

OrderInvoiceLine (org.estatio.module.capex.imports.OrderInvoiceLine)2 Action (org.apache.isis.applib.annotation.Action)1 MemberOrder (org.apache.isis.applib.annotation.MemberOrder)1 FixtureResult (org.apache.isis.applib.fixturescripts.FixtureResult)1 OrderInvoiceImportHandler (org.estatio.module.capex.imports.OrderInvoiceImportHandler)1 OrderInvoiceSheet (org.estatio.module.capex.imports.OrderInvoiceSheet)1 WorksheetSpec (org.isisaddons.module.excel.dom.WorksheetSpec)1