Search in sources :

Example 6 with SupplierViewService

use of com.axelor.apps.supplierportal.service.SupplierViewService in project axelor-open-suite by axelor.

the class SupplierViewController method getPurchaseQuotationInProgress.

public void getPurchaseQuotationInProgress(ActionRequest request, ActionResponse response) {
    try {
        SupplierViewService supplierViewService = Beans.get(SupplierViewService.class);
        User user = supplierViewService.getSupplierUser();
        String domain = Beans.get(SupplierViewService.class).getPurchaseQuotationsInProgressOfSupplier(user);
        response.setView(ActionView.define(I18n.get("Quotation In Progress")).model(PurchaseOrder.class.getName()).add("grid", "purchase-order-grid").add("form", "purchase-order-form").domain(domain).map());
    } catch (Exception e) {
        TraceBackService.trace(response, e);
    }
}
Also used : User(com.axelor.auth.db.User) SupplierViewService(com.axelor.apps.supplierportal.service.SupplierViewService)

Example 7 with SupplierViewService

use of com.axelor.apps.supplierportal.service.SupplierViewService in project axelor-open-suite by axelor.

the class SupplierViewController method getTotalRemaining.

public void getTotalRemaining(ActionRequest request, ActionResponse response) {
    try {
        SupplierViewService supplierViewService = Beans.get(SupplierViewService.class);
        User user = supplierViewService.getSupplierUser();
        String domain = Beans.get(SupplierViewService.class).getTotalRemainingOfSupplier(user);
        response.setView(ActionView.define(I18n.get("Total remaining")).model(Invoice.class.getName()).add("grid", "invoice-grid").add("form", "invoice-form").domain(domain).map());
    } catch (Exception e) {
        TraceBackService.trace(response, e);
    }
}
Also used : User(com.axelor.auth.db.User) SupplierViewService(com.axelor.apps.supplierportal.service.SupplierViewService)

Example 8 with SupplierViewService

use of com.axelor.apps.supplierportal.service.SupplierViewService in project axelor-open-suite by axelor.

the class SupplierViewController method getNextDelivery.

public void getNextDelivery(ActionRequest request, ActionResponse response) {
    try {
        SupplierViewService supplierViewService = Beans.get(SupplierViewService.class);
        User user = supplierViewService.getSupplierUser();
        String domain = Beans.get(SupplierViewService.class).getNextDeliveryOfSupplier(user);
        StockMove stockMove = Beans.get(StockMoveRepository.class).all().filter(domain).fetchOne();
        if (stockMove != null) {
            response.setView(ActionView.define(I18n.get("Next delivery")).model(StockMove.class.getName()).add("form", "stock-move-supplier-form").domain(domain).context("_showRecord", stockMove.getId()).map());
        }
    } catch (Exception e) {
        TraceBackService.trace(response, e);
    }
}
Also used : User(com.axelor.auth.db.User) StockMove(com.axelor.apps.stock.db.StockMove) SupplierViewService(com.axelor.apps.supplierportal.service.SupplierViewService) StockMoveRepository(com.axelor.apps.stock.db.repo.StockMoveRepository)

Example 9 with SupplierViewService

use of com.axelor.apps.supplierportal.service.SupplierViewService in project axelor-open-suite by axelor.

the class SupplierViewController method getPurchaseOrders.

/* PurchaseOrder OnClick */
public void getPurchaseOrders(ActionRequest request, ActionResponse response) {
    try {
        SupplierViewService supplierViewService = Beans.get(SupplierViewService.class);
        User user = supplierViewService.getSupplierUser();
        String domain = Beans.get(SupplierViewService.class).getPurchaseOrdersOfSupplier(user);
        response.setView(ActionView.define(I18n.get("Purchase orders")).model(PurchaseOrder.class.getName()).add("grid", "purchase-order-grid").add("form", "purchase-order-form").domain(domain).map());
    } catch (Exception e) {
        TraceBackService.trace(response, e);
    }
}
Also used : User(com.axelor.auth.db.User) SupplierViewService(com.axelor.apps.supplierportal.service.SupplierViewService)

Aggregations

SupplierViewService (com.axelor.apps.supplierportal.service.SupplierViewService)9 User (com.axelor.auth.db.User)9 StockMove (com.axelor.apps.stock.db.StockMove)2 StockMoveRepository (com.axelor.apps.stock.db.repo.StockMoveRepository)2 PurchaseOrder (com.axelor.apps.purchase.db.PurchaseOrder)1 PurchaseOrderRepository (com.axelor.apps.purchase.db.repo.PurchaseOrderRepository)1