Search in sources :

Example 1 with InventoryLocation

use of com.storedobject.core.InventoryLocation in project SODevelopment by syampillai.

the class Remove method process.

@Override
protected boolean process() {
    InventoryLocation from = locationFromField.getValue();
    int action = actionField.getValue();
    Entity entity = null;
    if (RemoveItems.requiresEntity(action)) {
        entity = orgField.getObject();
        if (entity == null) {
            warning("Please select organization");
            return false;
        }
    }
    close();
    new RemoveItems(from, action, entity, dateField.getValue()).execute();
    return true;
}
Also used : Entity(com.storedobject.core.Entity) InventoryLocation(com.storedobject.core.InventoryLocation)

Example 2 with InventoryLocation

use of com.storedobject.core.InventoryLocation in project SODevelopment by syampillai.

the class SelectLocation method get.

public static InventoryLocation get(int... types) {
    Application a = Application.get();
    if (a == null) {
        return null;
    }
    SelectStore.Assignment assignment = a.getData(SelectStore.Assignment.class);
    if (assignment != null && assignment.location != null && checkType(assignment.location, types)) {
        return assignment.location;
    }
    InventoryLocation loc = a.getTransactionManager().getUser().listLinks(InventoryVirtualLocation.class).filter(l -> checkType(l, types)).single(false);
    if (loc == null) {
        return null;
    }
    if (assignment == null) {
        assignment = new SelectStore.Assignment();
        a.setData(SelectStore.Assignment.class, assignment);
    }
    assignment.location = loc;
    return loc;
}
Also used : InventoryLocation(com.storedobject.core.InventoryLocation) List(java.util.List) ObjectComboField(com.storedobject.ui.ObjectComboField) InventoryVirtualLocation(com.storedobject.core.InventoryVirtualLocation) Application(com.storedobject.ui.Application) DataForm(com.storedobject.vaadin.DataForm) Logic(com.storedobject.core.Logic) InventoryLocation(com.storedobject.core.InventoryLocation) Application(com.storedobject.ui.Application)

Example 3 with InventoryLocation

use of com.storedobject.core.InventoryLocation in project SODevelopment by syampillai.

the class Issue method process.

@Override
protected boolean process() {
    InventoryLocation from = locationFromField.getValue(), to = locationToField.getValue();
    if (from.getId().equals(to.getId())) {
        warning("Please select different locations");
        return false;
    }
    if (from.getType() != 0) {
        warning("Can not be issued from '" + from.toDisplay() + "'");
        return false;
    }
    close();
    new IssueItems(CAPTION, from, to, dateField.getValue()).execute();
    return true;
}
Also used : InventoryLocation(com.storedobject.core.InventoryLocation)

Example 4 with InventoryLocation

use of com.storedobject.core.InventoryLocation in project SODevelopment by syampillai.

the class DataPickup method process.

@Override
protected boolean process() {
    InventoryLocation location = locationField.getValue();
    if (location.getType() == 0) {
        close();
        new GetItems(CAPTION, location, InventoryTransaction.forDataPickup(getTransactionManager()), m -> m.getTransaction().dataPickup(m.getItem(), m.getLocationTo())).execute();
        return true;
    }
    warning("Movement to '" + location + "' is not supported");
    return false;
}
Also used : InventoryLocation(com.storedobject.core.InventoryLocation) InventoryTransaction(com.storedobject.core.InventoryTransaction) DataForm(com.storedobject.vaadin.DataForm) Transactional(com.storedobject.ui.Transactional) InventoryLocation(com.storedobject.core.InventoryLocation)

Aggregations

InventoryLocation (com.storedobject.core.InventoryLocation)4 DataForm (com.storedobject.vaadin.DataForm)2 Entity (com.storedobject.core.Entity)1 InventoryTransaction (com.storedobject.core.InventoryTransaction)1 InventoryVirtualLocation (com.storedobject.core.InventoryVirtualLocation)1 Logic (com.storedobject.core.Logic)1 Application (com.storedobject.ui.Application)1 ObjectComboField (com.storedobject.ui.ObjectComboField)1 Transactional (com.storedobject.ui.Transactional)1 List (java.util.List)1