Search in sources :

Example 1 with DatePeriod

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

the class SchedulerLogViewer method buildFields.

@Override
protected void buildFields() {
    jobField = new ObjectField<>("Scheduler", Schedule.class);
    setRequired(jobField);
    addField(jobField);
    periodField = new DatePeriodField("Period", new DatePeriod(DateUtility.yesterday(), DateUtility.today()));
    addField(periodField);
}
Also used : Schedule(com.storedobject.job.Schedule) DatePeriod(com.storedobject.core.DatePeriod) DatePeriodField(com.storedobject.ui.DatePeriodField)

Example 2 with DatePeriod

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

the class SchedulerLogViewer method process.

@Override
protected boolean process() {
    close();
    Schedule s = jobField.getObject();
    DatePeriod p = periodField.getValue();
    StringList cols = StringList.create("Status", "Message", "Date", "StartedAt", "CompletedAt");
    ObjectBrowser<Log> logs = new ObjectBrowser<>(Log.class, cols, EditorAction.VIEW, s.getName() + " (" + s.getDescription() + ")");
    logs.load("Schedule=" + s.getId() + " AND Date " + p.getDBCondition());
    logs.execute();
    return true;
}
Also used : StringList(com.storedobject.common.StringList) Log(com.storedobject.job.Log) Schedule(com.storedobject.job.Schedule) DatePeriod(com.storedobject.core.DatePeriod) ObjectBrowser(com.storedobject.ui.ObjectBrowser)

Example 3 with DatePeriod

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

the class StockMovementReport method buildFields.

@Override
protected void buildFields() {
    storeField = new ObjectField<>("Store", InventoryStore.class, true);
    addField(storeField);
    setRequired(storeField);
    periodField = new DatePeriodField("Period", new DatePeriod(DateUtility.startOfMonth(), DateUtility.today()));
    addField(periodField);
    summaryField = new BooleanField("Print Summary Only");
    addField(summaryField);
    zerosField = new BooleanField("Print Zero-Quantity Items");
    addField(zerosField);
}
Also used : InventoryStore(com.storedobject.core.InventoryStore) BooleanField(com.storedobject.vaadin.BooleanField) DatePeriod(com.storedobject.core.DatePeriod) DatePeriodField(com.storedobject.ui.DatePeriodField)

Aggregations

DatePeriod (com.storedobject.core.DatePeriod)3 Schedule (com.storedobject.job.Schedule)2 DatePeriodField (com.storedobject.ui.DatePeriodField)2 StringList (com.storedobject.common.StringList)1 InventoryStore (com.storedobject.core.InventoryStore)1 Log (com.storedobject.job.Log)1 ObjectBrowser (com.storedobject.ui.ObjectBrowser)1 BooleanField (com.storedobject.vaadin.BooleanField)1