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;
}
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;
}
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;
}
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;
}
Aggregations