Search in sources :

Example 6 with Position

use of eu.ggnet.dwoss.redtape.ee.entity.Position in project dwoss by gg-net.

the class DocumentSupporterFlagIT method modify2ndPosition.

private void modify2ndPosition(Document doc) {
    Position p2 = doc.getPosition(2);
    p2.setPrice(p2.getPrice() + 50);
}
Also used : Position(eu.ggnet.dwoss.redtape.ee.entity.Position)

Example 7 with Position

use of eu.ggnet.dwoss.redtape.ee.entity.Position in project dwoss by gg-net.

the class ReceiptUnitOperationIT method assertsUpdate.

private void assertsUpdate(UniqueUnit receiptUnit, StockTransaction stockTransaction, ReceiptOperation receiptOperation, TradeName contractor) {
    asserts(receiptUnit, stockTransaction, receiptOperation, contractor);
    List<Dossier> allDossiers = redTapeAgent.findAllEager(Dossier.class);
    List<Document> allDocumentsWithUnit = new ArrayList<>();
    for (Dossier dossier : allDossiers) {
        for (Document document : dossier.getActiveDocuments()) {
            for (Position position : document.getPositions(PositionType.UNIT).values()) {
                if (position.getUniqueUnitId() == receiptUnit.getId()) {
                    allDocumentsWithUnit.add(document);
                }
            }
        }
    }
    List<Long> documentIds = new ArrayList<>();
    for (Document document : allDocumentsWithUnit) {
        documentIds.add(document.getId());
    }
    assertTrue("The UniqueUnit " + receiptUnit.getId() + " is in more than one document. DocumentsIds: " + documentIds, documentIds.size() <= 1);
}
Also used : Position(eu.ggnet.dwoss.redtape.ee.entity.Position) Dossier(eu.ggnet.dwoss.redtape.ee.entity.Dossier) Document(eu.ggnet.dwoss.redtape.ee.entity.Document)

Example 8 with Position

use of eu.ggnet.dwoss.redtape.ee.entity.Position in project dwoss by gg-net.

the class DocumentUpdateView method removePositionAction.

// GEN-LAST:event_addNonUnitPosition
private void removePositionAction(java.awt.event.ActionEvent evt) {
    // GEN-FIRST:event_removePositionAction
    final MultipleSelectionModel<Position> selection = positionsFxList.getSelectionModel();
    final int index = selection.getSelectedIndex();
    Position selectedItem = selection.getSelectedItem();
    if (index == -1)
        return;
    if (isChangeAllowed()) {
        document.removeAt(selectedItem.getId());
        refreshAll();
    } else {
        JOptionPane.showMessageDialog(this, "Ă„nderungen am Dokument sind nicht erlaubt.");
    }
}
Also used : Position(eu.ggnet.dwoss.redtape.ee.entity.Position)

Example 9 with Position

use of eu.ggnet.dwoss.redtape.ee.entity.Position in project dwoss by gg-net.

the class AnnulationViewTryout method main.

public static void main(String[] args) {
    StockAgent stockStub = mock(StockAgent.class);
    Dl.remote().add(StockAgent.class, stockStub);
    Position p1 = Position.builder().amount(1).name("P1").price(12.).tax(1.19).build();
    Position p2 = Position.builder().amount(1).name("P2").price(20.).tax(1.19).build();
    Position p3 = Position.builder().amount(1).name("P3").price(13.24).tax(1.19).build();
    Position p4 = Position.builder().amount(1).name("P4").price(400.).tax(1.19).build();
    Position p5 = Position.builder().amount(1).name("P5").price(1234.).tax(1.19).build();
    List<AfterInvoicePosition> positions = new ArrayList<>();
    positions.add(new AfterInvoicePosition(p1));
    positions.add(new AfterInvoicePosition(p2));
    positions.add(new AfterInvoicePosition(p3));
    positions.add(new AfterInvoicePosition(p4));
    positions.add(new AfterInvoicePosition(p5));
    CreditMemoView view = new CreditMemoView(positions);
    OkCancelDialog<CreditMemoView> dialog = new OkCancelDialog<>("Test", view);
    dialog.setVisible(true);
    System.out.println(view.getPositions());
    System.exit(0);
}
Also used : AfterInvoicePosition(eu.ggnet.dwoss.redtapext.ui.cao.document.AfterInvoicePosition) Position(eu.ggnet.dwoss.redtape.ee.entity.Position) AfterInvoicePosition(eu.ggnet.dwoss.redtapext.ui.cao.document.AfterInvoicePosition) StockAgent(eu.ggnet.dwoss.stock.ee.StockAgent) ArrayList(java.util.ArrayList) OkCancelDialog(eu.ggnet.dwoss.util.OkCancelDialog) CreditMemoView(eu.ggnet.dwoss.redtapext.ui.cao.document.annulation.CreditMemoView)

Example 10 with Position

use of eu.ggnet.dwoss.redtape.ee.entity.Position in project dwoss by gg-net.

the class UnitAvailabillityTryout method main.

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

        private Map<String, Tuple2<UnitShard, String>> data = new HashMap<>();

        {
            data.put("1", new Tuple2<>(new UnitShard("1", 1, "SopoNr.: 1", Boolean.TRUE, 1), "Details zu Unit 1"));
            data.put("2", new Tuple2<>(new UnitShard("2", 2, "SopoNr.: 2", Boolean.FALSE, 1), "Details zu Unit 2"));
            data.put("3", new Tuple2<>(new UnitShard("3", 3, "SopoNr.: 3", Boolean.TRUE, 1), "Details zu Unit 3"));
            data.put("4", new Tuple2<>(new UnitShard("4", 4, "SopoNr.: 4", Boolean.FALSE, 1), "Details zu Unit 4"));
            data.put("5", new Tuple2<>(new UnitShard("5", 5, "SopoNr.: 5 exitiert nicht", null, null), "Existiert Nicht"));
            data.put("6", new Tuple2<>(new UnitShard("6", 6, "SopoNr.: 6", Boolean.FALSE, null), "Details zu Unit 6"));
        }

        @Override
        public String toDetailedHtml(String refurbishId, String username) {
            if (!data.containsKey(refurbishId))
                return refurbishId + " existiert nicht";
            return data.get(refurbishId)._2;
        }

        @Override
        public UnitShard find(String refurbishId) {
            if (!data.containsKey(refurbishId))
                return new UnitShard(refurbishId, 0, "SopoNr.: " + refurbishId + " exitiert nicht", null, null);
            return data.get(refurbishId)._1;
        }

        @Override
        public boolean isAvailable(String refurbishId) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public void lockStockUnit(long dossierId, String refurbishedId) throws IllegalStateException {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public Result<List<Position>> createUnitPosition(String refurbishId, long documentId) throws UserInfoException {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public String toDetailedHtml(int uniqueUnitId, String username) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }
    });
    Ui.exec(() -> {
        UiCore.startSwing(() -> new JLabel("Main Application"));
        Ui.build().swing().show(() -> new UnitAvailabilityViewCask());
    });
}
Also used : UnitAvailabilityViewCask(eu.ggnet.dwoss.redtapext.ui.cap.UnitAvailabilityViewCask) UnitOverseer(eu.ggnet.dwoss.redtapext.ee.UnitOverseer) Position(eu.ggnet.dwoss.redtape.ee.entity.Position) UnitShard(eu.ggnet.dwoss.uniqueunit.api.UnitShard) JLabel(javax.swing.JLabel) Result(eu.ggnet.dwoss.util.interactiveresult.Result) Tuple2(eu.ggnet.dwoss.util.Tuple2) UserInfoException(eu.ggnet.dwoss.util.UserInfoException)

Aggregations

Position (eu.ggnet.dwoss.redtape.ee.entity.Position)37 Document (eu.ggnet.dwoss.redtape.ee.entity.Document)23 Dossier (eu.ggnet.dwoss.redtape.ee.entity.Dossier)11 Test (org.junit.Test)8 UniqueUnit (eu.ggnet.dwoss.uniqueunit.ee.entity.UniqueUnit)6 UiCustomer (eu.ggnet.dwoss.customer.opi.UiCustomer)5 SubMonitor (eu.ggnet.dwoss.progress.SubMonitor)5 UniqueUnitEao (eu.ggnet.dwoss.uniqueunit.ee.eao.UniqueUnitEao)5 OkCancelDialog (eu.ggnet.dwoss.util.OkCancelDialog)5 RedTapeWorker (eu.ggnet.dwoss.redtapext.ee.RedTapeWorker)4 AfterInvoicePosition (eu.ggnet.dwoss.redtapext.ui.cao.document.AfterInvoicePosition)4 LogicTransaction (eu.ggnet.dwoss.stock.ee.entity.LogicTransaction)4 CreditMemoView (eu.ggnet.dwoss.redtapext.ui.cao.document.annulation.CreditMemoView)3 ReportLineEao (eu.ggnet.dwoss.report.ee.eao.ReportLineEao)3 ReportLine (eu.ggnet.dwoss.report.ee.entity.ReportLine)3 UNIT (eu.ggnet.dwoss.rules.PositionType.UNIT)3 StockUnit (eu.ggnet.dwoss.stock.ee.entity.StockUnit)3 UserInfoException (eu.ggnet.dwoss.util.UserInfoException)3 Logger (org.slf4j.Logger)3 DocumentEao (eu.ggnet.dwoss.redtape.ee.eao.DocumentEao)2