Search in sources :

Example 21 with ReportLine

use of eu.ggnet.dwoss.report.ee.entity.ReportLine in project dwoss by gg-net.

the class ReturnsReportTableModel method setReportLines.

/**
 * @param lines the value of lines
 */
public void setReportLines(Collection<ReportLine> lines) {
    this.clear();
    for (ReportLine reportLine : lines) {
        this.add(new TableLine(reportLine));
    }
    fireTableDataChanged();
}
Also used : ReportLine(eu.ggnet.dwoss.report.ee.entity.ReportLine)

Example 22 with ReportLine

use of eu.ggnet.dwoss.report.ee.entity.ReportLine in project dwoss by gg-net.

the class ReturnsReportView method accept.

@Override
public void accept(List<ReportLine> lines) {
    ReturnsTableModel model = new ReturnsTableModel();
    for (ReportLine reportLine : lines) {
        model.add(new TableLine(reportLine));
    }
    reportTableViewCask.setModel(model);
}
Also used : ReportLine(eu.ggnet.dwoss.report.ee.entity.ReportLine)

Example 23 with ReportLine

use of eu.ggnet.dwoss.report.ee.entity.ReportLine in project dwoss by gg-net.

the class ReportViewTryout method main.

public static void main(String[] args) {
    Dl.local().add(RemoteLookup.class, new RemoteLookup() {

        @Override
        public <T> boolean contains(Class<T> clazz) {
            return false;
        }

        @Override
        public <T> T lookup(Class<T> clazz) {
            return null;
        }
    });
    TradeName tradeName = TradeName.FUJITSU;
    UiCore.startSwing(() -> new JLabel("Main Applikation"));
    EnumMap<ViewReportResult.Type, NavigableSet<ReportLine>> lines = new EnumMap<>(ViewReportResult.Type.class);
    ReportLineGenerator op = new ReportLineGenerator();
    NavigableSet<ReportLine> invoicedLines = new TreeSet<>();
    NavigableSet<ReportLine> repayedLinesLines = new TreeSet<>();
    for (int i = 0; i < 30; i++) {
        invoicedLines.add(op.makeReportLine(Arrays.asList(tradeName), new Date(), i));
        repayedLinesLines.add(op.makeReportLine(Arrays.asList(tradeName), new Date(), i));
    }
    lines.put(INVOICED, invoicedLines);
    lines.put(REPAYMENTS, repayedLinesLines);
    ViewReportResult result = new ViewReportResult(lines, ReportParameter.builder().reportName("JUnit " + tradeName + " Report").contractor(tradeName).start(new Date()).end(new Date()).build());
    Ui.build().fxml().show(() -> new ReportController.In(result, false), ReportController.class);
}
Also used : TradeName(eu.ggnet.dwoss.rules.TradeName) ReportLine(eu.ggnet.dwoss.report.ee.entity.ReportLine) JLabel(javax.swing.JLabel) RemoteLookup(eu.ggnet.saft.core.cap.RemoteLookup) ViewReportResult(eu.ggnet.dwoss.report.ee.ReportAgent.ViewReportResult) ReportController(eu.ggnet.dwoss.report.ui.main.ReportController) ReportLineGenerator(eu.ggnet.dwoss.report.ee.assist.gen.ReportLineGenerator)

Example 24 with ReportLine

use of eu.ggnet.dwoss.report.ee.entity.ReportLine in project dwoss by gg-net.

the class ReturnsReportTryout method main.

public static void main(String[] args) {
    ReportLineGenerator gen = new ReportLineGenerator();
    List<ReportLine> list = new ArrayList<>();
    for (int i = 0; i < 10; i++) {
        list.add(gen.makeReportLine());
    }
    UiCore.startSwing(() -> new JLabel("Main Applikation"));
    Ui.exec(() -> {
        Ui.build().swing().show(() -> list, () -> new ReturnsReportView());
    });
}
Also used : ReportLine(eu.ggnet.dwoss.report.ee.entity.ReportLine) ReturnsReportView(eu.ggnet.dwoss.report.ui.returns.ReturnsReportView) ArrayList(java.util.ArrayList) JLabel(javax.swing.JLabel) ReportLineGenerator(eu.ggnet.dwoss.report.ee.assist.gen.ReportLineGenerator)

Example 25 with ReportLine

use of eu.ggnet.dwoss.report.ee.entity.ReportLine in project dwoss by gg-net.

the class SimpleReportLineTryout method main.

public static void main(String[] args) {
    ReportAgent rastub = new ReportAgent() {

        List<eu.ggnet.dwoss.report.ee.entity.partial.SimpleReportLine> all = Arrays.asList(eu.ggnet.dwoss.report.ee.entity.partial.SimpleReportLine.builder().amount(1).contractor(TradeName.ACER).contractorReferencePrice(100).documentType(DocumentType.INVOICE).positionType(PositionType.UNIT).price(50).productName("ABCDEFG").purchasePrice(40).refurbishId("1234567").partNo("AA.BBBBB.CC").uniqueUnitId(1000).reportingDate(new Date()).build(), eu.ggnet.dwoss.report.ee.entity.partial.SimpleReportLine.builder().amount(1).contractor(TradeName.DELL).contractorReferencePrice(100).documentType(DocumentType.INVOICE).positionType(PositionType.UNIT).price(10).productName("ABCDEFG").purchasePrice(40).refurbishId("1234567").partNo("AA.BBBBB.CC").uniqueUnitId(1000).reportingDate(new Date()).build(), eu.ggnet.dwoss.report.ee.entity.partial.SimpleReportLine.builder().amount(1).contractor(TradeName.HP).contractorReferencePrice(100).documentType(DocumentType.INVOICE).positionType(PositionType.UNIT).price(23).productName("ABCDEFG").purchasePrice(40).refurbishId("1234567").partNo("AA.BBBBB.CC").uniqueUnitId(1000).reportingDate(new Date()).build(), eu.ggnet.dwoss.report.ee.entity.partial.SimpleReportLine.builder().amount(1).contractor(TradeName.AMAZON).contractorReferencePrice(100).documentType(DocumentType.INVOICE).positionType(PositionType.UNIT).price(50).productName("ABCDEFG").purchasePrice(40).refurbishId("1234567").partNo("AA.BBBBB.CC").uniqueUnitId(1000).reportingDate(new Date()).build(), eu.ggnet.dwoss.report.ee.entity.partial.SimpleReportLine.builder().amount(1).contractor(TradeName.EMACHINES).contractorReferencePrice(100).documentType(DocumentType.INVOICE).positionType(PositionType.UNIT).price(50).productName("ABCDEFG").purchasePrice(40).refurbishId("1234567").partNo("AA.BBBBB.CC").uniqueUnitId(1000).reportingDate(new Date()).build(), eu.ggnet.dwoss.report.ee.entity.partial.SimpleReportLine.builder().amount(1).contractor(TradeName.FUJITSU).contractorReferencePrice(100).documentType(DocumentType.INVOICE).positionType(PositionType.UNIT).price(50).productName("ABCDEFG").purchasePrice(40).refurbishId("1234567").partNo("AA.BBBBB.CC").uniqueUnitId(1000).reportingDate(new Date()).build(), eu.ggnet.dwoss.report.ee.entity.partial.SimpleReportLine.builder().amount(1).contractor(TradeName.ONESELF).contractorReferencePrice(100).documentType(DocumentType.INVOICE).positionType(PositionType.UNIT).price(50).productName("ABCDEFG").purchasePrice(40).refurbishId("1234567").partNo("AA.BBBBB.CC").uniqueUnitId(1000).reportingDate(new Date()).build(), eu.ggnet.dwoss.report.ee.entity.partial.SimpleReportLine.builder().amount(1).contractor(TradeName.LENOVO).contractorReferencePrice(100).documentType(DocumentType.INVOICE).positionType(PositionType.UNIT).price(50).productName("ABCDEFG").purchasePrice(40).refurbishId("1234567").partNo("AA.BBBBB.CC").uniqueUnitId(1000).reportingDate(new Date()).build(), eu.ggnet.dwoss.report.ee.entity.partial.SimpleReportLine.builder().amount(1).contractor(TradeName.FUJITSU).contractorReferencePrice(100).documentType(DocumentType.INVOICE).positionType(PositionType.UNIT).price(50).productName("ABCDEFG").purchasePrice(40).refurbishId("1234567").reportingDate(new Date()).build(), eu.ggnet.dwoss.report.ee.entity.partial.SimpleReportLine.builder().amount(1).contractor(TradeName.SAMSUNG).contractorReferencePrice(100).documentType(DocumentType.INVOICE).positionType(PositionType.UNIT).price(50).productName("ABCDEFG").purchasePrice(40).refurbishId("1234567").reportingDate(new Date()).build(), eu.ggnet.dwoss.report.ee.entity.partial.SimpleReportLine.builder().amount(1).contractor(TradeName.SAMSUNG).contractorReferencePrice(100).documentType(DocumentType.INVOICE).positionType(PositionType.UNIT).price(50).productName("ABCDEFG").purchasePrice(40).refurbishId("1234567").reportingDate(new Date()).build(), eu.ggnet.dwoss.report.ee.entity.partial.SimpleReportLine.builder().amount(1).contractor(TradeName.AMAZON).contractorReferencePrice(100).documentType(DocumentType.INVOICE).positionType(PositionType.UNIT).price(50).productName("ABCDEFG").purchasePrice(40).refurbishId("1234567").reportingDate(new Date()).build(), eu.ggnet.dwoss.report.ee.entity.partial.SimpleReportLine.builder().amount(1).contractor(TradeName.ALSO).contractorReferencePrice(100).documentType(DocumentType.INVOICE).positionType(PositionType.UNIT).price(50).productName("ABCDEFG").purchasePrice(40).refurbishId("1234567").reportingDate(new Date()).build());

        @Override
        public <T> List<T> findAll(Class<T> entityClass) {
            if (entityClass.equals(eu.ggnet.dwoss.report.ee.entity.partial.SimpleReportLine.class))
                return (List<T>) all;
            return Collections.EMPTY_LIST;
        }

        @Override
        public <T> List<T> findAll(Class<T> entityClass, int start, int amount) {
            if (entityClass.equals(eu.ggnet.dwoss.report.ee.entity.partial.SimpleReportLine.class)) {
                if (start > all.size())
                    return Collections.EMPTY_LIST;
                if (start < 0)
                    start = 0;
                if (amount + start > all.size())
                    amount = all.size() - start;
                return (List<T>) all.subList(start, amount + start);
            }
            return Collections.EMPTY_LIST;
        }

        @Override
        public List<eu.ggnet.dwoss.report.ee.entity.partial.SimpleReportLine> findSimple(SearchParameter search, int firstResult, int maxResults) {
            return findAll(eu.ggnet.dwoss.report.ee.entity.partial.SimpleReportLine.class, firstResult, maxResults);
        }

        @Override
        public long count(SearchParameter search) {
            return all.size();
        }

        @Override
        public <T> long count(Class<T> entityClass) {
            if (entityClass.equals(eu.ggnet.dwoss.report.ee.entity.partial.SimpleReportLine.class))
                return all.size();
            return 0;
        }

        // <editor-fold defaultstate="collapsed" desc="Unused Methods">
        @Override
        public Report store(Report report, Collection<Storeable> storeables) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public List<ReportLine> findAllReportLinesReverse(int firstResult, int maxResults) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public Set<ReportLine> attachDanglingComplaints(TradeName type, Date till) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public <T> List<T> findAllEager(Class<T> entityClass) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public <T> List<T> findAllEager(Class<T> entityClass, int start, int amount) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public <T> T findById(Class<T> entityClass, Object id) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public <T> T findById(Class<T> entityClass, Object id, LockModeType lockModeType) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public <T> T findByIdEager(Class<T> entityClass, Object id) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public <T> T findByIdEager(Class<T> entityClass, Object id, LockModeType lockModeType) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public List<ReportLine> find(SearchParameter search, int firstResult, int maxResults) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public ViewReportResult findReportResult(long reportId) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public List<ReportLine> findReportLinesByDocumentType(DocumentType type, Date from, Date till) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public ViewReportResult prepareReport(ReportParameter p, boolean loadUnreported) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public boolean updateReportLineComment(int optLock, long reportId, String comment) {
            System.out.println("Line = " + reportId + " adding comment " + comment);
            return true;
        }

        @Override
        public Reply<String> updateReportName(Report.OptimisticKey key, String name) {
            System.out.println("Report = " + key + " changing name = " + name);
            return Reply.success(name);
        }
    };
    Dl.remote().add(ReportAgent.class, rastub);
    Ui.exec(() -> {
        UiCore.startSwing(() -> new JLabel("Main Applikation"));
        Ui.build().fx().show(() -> {
            RawReportView srl = new RawReportView();
            srl.load(new SearchParameter());
            return srl;
        });
    });
}
Also used : ReportLine(eu.ggnet.dwoss.report.ee.entity.ReportLine) ReportParameter(eu.ggnet.dwoss.report.ee.ReportAgent.ReportParameter) ReportAgent(eu.ggnet.dwoss.report.ee.ReportAgent) SearchParameter(eu.ggnet.dwoss.report.ee.ReportAgent.SearchParameter) Report(eu.ggnet.dwoss.report.ee.entity.Report) RawReportView(eu.ggnet.dwoss.report.ui.RawReportView) JLabel(javax.swing.JLabel) LockModeType(javax.persistence.LockModeType)

Aggregations

ReportLine (eu.ggnet.dwoss.report.ee.entity.ReportLine)45 Test (org.junit.Test)18 Report (eu.ggnet.dwoss.report.ee.entity.Report)13 ReportParameter (eu.ggnet.dwoss.report.ee.ReportAgent.ReportParameter)5 ReportLineEao (eu.ggnet.dwoss.report.ee.eao.ReportLineEao)5 SimpleReportLine (eu.ggnet.dwoss.report.ee.entity.partial.SimpleReportLine)5 ViewReportResult (eu.ggnet.dwoss.report.ee.ReportAgent.ViewReportResult)4 Document (eu.ggnet.dwoss.redtape.ee.entity.Document)3 Position (eu.ggnet.dwoss.redtape.ee.entity.Position)3 ReportAgent (eu.ggnet.dwoss.report.ee.ReportAgent)3 SearchParameter (eu.ggnet.dwoss.report.ee.ReportAgent.SearchParameter)3 YearSplit (eu.ggnet.dwoss.report.ee.entity.Report.YearSplit)3 eu.ggnet.dwoss.rules (eu.ggnet.dwoss.rules)3 Date (java.util.Date)3 JLabel (javax.swing.JLabel)3 AutoLogger (eu.ggnet.dwoss.common.log.AutoLogger)2 RepaymentCustomers (eu.ggnet.dwoss.mandator.api.value.RepaymentCustomers)2 ResolveRepayment (eu.ggnet.dwoss.misc.ee.ResolveRepayment)2 SubMonitor (eu.ggnet.dwoss.progress.SubMonitor)2 Dossier (eu.ggnet.dwoss.redtape.ee.entity.Dossier)2