Search in sources :

Example 6 with Application

use of com.storedobject.ui.Application in project SODevelopment by syampillai.

the class Statement method process.

@Override
protected boolean process() {
    close();
    Application a = Application.get();
    PDFReport statement = new com.storedobject.report.AccountStatement(a, accountField.getObject(), datePeriodField.getValue());
    a.view("Statement", statement);
    return true;
}
Also used : Application(com.storedobject.ui.Application) PDFReport(com.storedobject.pdf.PDFReport)

Example 7 with Application

use of com.storedobject.ui.Application in project SODevelopment by syampillai.

the class TrialBalance method process.

@Override
protected boolean process() {
    close();
    if (systemEntity == null) {
        systemEntity = entityField.getObject();
    }
    if (date == null) {
        date = dateField.getValue();
    }
    Application a = Application.get();
    a.view("Trial Balance", new com.storedobject.report.TrialBalance(a, systemEntity, date));
    return true;
}
Also used : Application(com.storedobject.ui.Application)

Example 8 with Application

use of com.storedobject.ui.Application in project SODevelopment by syampillai.

the class DataTransfer method process.

@Override
protected boolean process() {
    if (getObjectClass() == null) {
        return true;
    }
    if (actionField.getValue() == 0) {
        TextContentProducer cp = new TextContentProducer() {

            @Override
            public void generateContent() throws Exception {
                Writer w = getWriter();
                for (StoredObject so : StoredObject.list(objectClass, where, orderBy, any)) {
                    so.save(w);
                }
            }
        };
        ((Application) getApplication()).view(cp);
        return true;
    }
    return true;
}
Also used : StoredObject(com.storedobject.core.StoredObject) TextContentProducer(com.storedobject.core.TextContentProducer) Application(com.storedobject.ui.Application) Writer(java.io.Writer)

Example 9 with Application

use of com.storedobject.ui.Application in project SODevelopment by syampillai.

the class SelectStore method getStore.

public static InventoryStore getStore() {
    Application a = Application.get();
    if (a == null) {
        return null;
    }
    Assignment assignment = a.getData(Assignment.class);
    if (assignment != null && assignment.store != null) {
        return assignment.store;
    }
    InventoryStore store = a.getTransactionManager().getUser().listLinks(InventoryStore.class, true).single(false);
    if (store == null) {
        return null;
    }
    if (assignment == null) {
        assignment = new Assignment();
        a.setData(Assignment.class, assignment);
    }
    assignment.store = store;
    return store;
}
Also used : Application(com.storedobject.ui.Application)

Aggregations

Application (com.storedobject.ui.Application)9 InventoryLocation (com.storedobject.core.InventoryLocation)1 InventoryVirtualLocation (com.storedobject.core.InventoryVirtualLocation)1 Logic (com.storedobject.core.Logic)1 StoredObject (com.storedobject.core.StoredObject)1 TextContentProducer (com.storedobject.core.TextContentProducer)1 PDFReport (com.storedobject.pdf.PDFReport)1 ObjectComboField (com.storedobject.ui.ObjectComboField)1 ButtonIcon (com.storedobject.vaadin.ButtonIcon)1 CustomTextField (com.storedobject.vaadin.CustomTextField)1 DataForm (com.storedobject.vaadin.DataForm)1 SpeakerButton (com.storedobject.vaadin.SpeakerButton)1 HasText (com.vaadin.flow.component.HasText)1 HtmlComponent (com.vaadin.flow.component.HtmlComponent)1 TextField (com.vaadin.flow.component.textfield.TextField)1 Writer (java.io.Writer)1 List (java.util.List)1