Search in sources :

Example 11 with Shipment

use of eu.ggnet.dwoss.stock.ee.entity.Shipment in project dwoss by gg-net.

the class ShipmentUpdateTryout method tryout.

@Test
public void tryout() throws InterruptedException {
    Dl.remote().add(Mandators.class, new Mandators() {

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

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

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

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

        @Override
        public Contractors loadContractors() {
            return new Contractors(EnumSet.allOf(TradeName.class), EnumSet.allOf(TradeName.class));
        }

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

        @Override
        public ShippingTerms loadShippingTerms() {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }
    });
    // To start the platform
    new JFXPanel();
    Shipment s = new Shipment();
    Platform.runLater(() -> {
        ShipmentUpdateStage stage = new ShipmentUpdateStage(s);
        stage.showAndWait();
        System.out.println(stage.getShipment());
        complete = true;
    });
    while (!complete) {
        Thread.sleep(500);
    }
}
Also used : JFXPanel(javafx.embed.swing.JFXPanel) Shipment(eu.ggnet.dwoss.stock.ee.entity.Shipment) Mandators(eu.ggnet.dwoss.mandator.Mandators) Test(org.junit.Test)

Example 12 with Shipment

use of eu.ggnet.dwoss.stock.ee.entity.Shipment in project dwoss by gg-net.

the class ShipmentController method editShipment.

public void editShipment() {
    Platform.runLater(() -> {
        Shipment shipment = model.getSelected();
        if (shipment == null)
            return;
        ShipmentUpdateStage stage = new ShipmentUpdateStage(shipment);
        stage.initModality(Modality.APPLICATION_MODAL);
        stage.showAndWait();
        if (!stage.isOk())
            return;
        shipment = stage.getShipment();
        model.remove(shipment);
        shipment = stockAgent.merge(shipment);
        model.add(shipment);
    });
}
Also used : Shipment(eu.ggnet.dwoss.stock.ee.entity.Shipment)

Example 13 with Shipment

use of eu.ggnet.dwoss.stock.ee.entity.Shipment in project dwoss by gg-net.

the class ShipmentController method deleteShipment.

public void deleteShipment() {
    Shipment shipment = model.getSelected();
    if (shipment == null)
        return;
    if (JOptionPane.showConfirmDialog(view, "Shipment " + shipment.getShipmentId() + " wirklich löschen ?", "Shipment löschen", JOptionPane.YES_NO_OPTION) != JOptionPane.YES_OPTION)
        return;
    stockAgent.delete(shipment);
    model.remove(shipment);
}
Also used : Shipment(eu.ggnet.dwoss.stock.ee.entity.Shipment)

Example 14 with Shipment

use of eu.ggnet.dwoss.stock.ee.entity.Shipment in project dwoss by gg-net.

the class ShipmentController method inclusion.

/**
 * Starts the Inclusion.
 *
 * @param row
 */
public void inclusion() {
    Shipment shipment = model.getSelected();
    if (shipment == null)
        return;
    StockTransaction stockTransaction = stockAgent.findOrCreateRollInTransaction(Dl.local().lookup(StockUpi.class).getActiveStock().getId(), Dl.local().lookup(Guardian.class).getUsername(), "Roll in through Inclusion");
    ShipmentInclusionViewCask sip = new ShipmentInclusionViewCask(view, shipment, stockTransaction);
    sip.setLocationRelativeTo(view);
    sip.setVisible(true);
    if (sip.isInclusionClosed())
        shipment.setStatus(Shipment.Status.CLOSED);
    else if (sip.isInclusionAbort())
        shipment.setStatus(Shipment.Status.OPENED);
    else
        return;
    model.remove(shipment);
    shipment = stockAgent.merge(shipment);
    model.add(shipment);
}
Also used : Shipment(eu.ggnet.dwoss.stock.ee.entity.Shipment) StockUpi(eu.ggnet.dwoss.stock.upi.StockUpi) StockTransaction(eu.ggnet.dwoss.stock.ee.entity.StockTransaction)

Example 15 with Shipment

use of eu.ggnet.dwoss.stock.ee.entity.Shipment in project dwoss by gg-net.

the class ShipmentInclusionViewCask method main.

// End of variables declaration//GEN-END:variables
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    Shipment shipment = new Shipment();
    shipment.setShipmentId("Muuuh");
    shipment.setContractor(TradeName.LENOVO);
    ShipmentInclusionViewCask sid = new ShipmentInclusionViewCask(null, shipment, null);
    sid.setLocationRelativeTo(null);
    sid.setVisible(true);
    System.out.println("Is Aborted" + sid.isInclusionAbort());
    System.out.println("Is Closed" + sid.isInclusionClosed());
    System.exit(0);
}
Also used : Shipment(eu.ggnet.dwoss.stock.ee.entity.Shipment)

Aggregations

Shipment (eu.ggnet.dwoss.stock.ee.entity.Shipment)15 StockTransaction (eu.ggnet.dwoss.stock.ee.entity.StockTransaction)4 ProductSpec (eu.ggnet.dwoss.spec.ee.entity.ProductSpec)3 Stock (eu.ggnet.dwoss.stock.ee.entity.Stock)3 Product (eu.ggnet.dwoss.uniqueunit.ee.entity.Product)3 UniqueUnit (eu.ggnet.dwoss.uniqueunit.ee.entity.UniqueUnit)3 ShipmentLabelValidator (eu.ggnet.dwoss.mandator.api.service.ShipmentLabelValidator)2 Test (org.junit.Test)2 Mandators (eu.ggnet.dwoss.mandator.Mandators)1 SubMonitor (eu.ggnet.dwoss.progress.SubMonitor)1 ReceiptOperation (eu.ggnet.dwoss.rules.ReceiptOperation)1 StockUpi (eu.ggnet.dwoss.stock.upi.StockUpi)1 Date (java.util.Date)1 JFXPanel (javafx.embed.swing.JFXPanel)1