Search in sources :

Example 6 with AppProductionService

use of com.axelor.apps.production.service.app.AppProductionService in project axelor-open-suite by axelor.

the class ManufOrderServiceBusinessImpl method createManufOrder.

@Override
public ManufOrder createManufOrder(Product product, BigDecimal qty, int priority, boolean isToInvoice, Company company, BillOfMaterial billOfMaterial, LocalDateTime plannedStartDateT, LocalDateTime plannedEndDateT) throws AxelorException {
    ManufOrder manufOrder = super.createManufOrder(product, qty, priority, isToInvoice, company, billOfMaterial, plannedStartDateT, plannedEndDateT);
    AppProductionService appProductionService = Beans.get(AppProductionService.class);
    if (!appProductionService.isApp("production") || !appProductionService.getAppProduction().getManageBusinessProduction()) {
        return manufOrder;
    }
    manufOrder.setIsToInvoice(isToInvoice);
    return manufOrder;
}
Also used : ManufOrder(com.axelor.apps.production.db.ManufOrder) AppProductionService(com.axelor.apps.production.service.app.AppProductionService)

Example 7 with AppProductionService

use of com.axelor.apps.production.service.app.AppProductionService in project axelor-open-suite by axelor.

the class OperationOrderServiceBusinessImpl method copyProdHumanResource.

@Override
protected ProdHumanResource copyProdHumanResource(ProdHumanResource prodHumanResource) {
    AppProductionService appProductionService = Beans.get(AppProductionService.class);
    if (!appProductionService.isApp("production") || !appProductionService.getAppProduction().getManageBusinessProduction()) {
        return super.copyProdHumanResource(prodHumanResource);
    }
    ProdHumanResource prodHumanResourceCopy = new ProdHumanResource(prodHumanResource.getProduct(), prodHumanResource.getDuration());
    prodHumanResourceCopy.setEmployee(prodHumanResource.getEmployee());
    return prodHumanResourceCopy;
}
Also used : ProdHumanResource(com.axelor.apps.production.db.ProdHumanResource) AppProductionService(com.axelor.apps.production.service.app.AppProductionService)

Example 8 with AppProductionService

use of com.axelor.apps.production.service.app.AppProductionService in project axelor-open-suite by axelor.

the class TimesheetBusinessProductionServiceImpl method validate.

@Override
@Transactional
public void validate(Timesheet timesheet) {
    super.validate(timesheet);
    AppProductionService appProductionService = Beans.get(AppProductionService.class);
    if (appProductionService.isApp("production") && appProductionService.getAppProduction().getManageBusinessProduction()) {
        Beans.get(OperationOrderTimesheetServiceImpl.class).updateAllRealDuration(timesheet.getTimesheetLineList());
    }
}
Also used : AppProductionService(com.axelor.apps.production.service.app.AppProductionService) Transactional(com.google.inject.persist.Transactional)

Example 9 with AppProductionService

use of com.axelor.apps.production.service.app.AppProductionService in project axelor-open-suite by axelor.

the class TimesheetBusinessProductionServiceImpl method refuse.

@Override
@Transactional
public void refuse(Timesheet timesheet) {
    super.refuse(timesheet);
    AppProductionService appProductionService = Beans.get(AppProductionService.class);
    if (appProductionService.isApp("production") && appProductionService.getAppProduction().getManageBusinessProduction()) {
        Beans.get(OperationOrderTimesheetServiceImpl.class).updateAllRealDuration(timesheet.getTimesheetLineList());
    }
}
Also used : AppProductionService(com.axelor.apps.production.service.app.AppProductionService) Transactional(com.google.inject.persist.Transactional)

Example 10 with AppProductionService

use of com.axelor.apps.production.service.app.AppProductionService in project axelor-open-suite by axelor.

the class TimesheetBusinessProductionServiceImpl method confirm.

@Override
@Transactional(rollbackOn = { Exception.class })
public void confirm(Timesheet timesheet) throws AxelorException {
    super.confirm(timesheet);
    AppProductionService appProductionService = Beans.get(AppProductionService.class);
    if (appProductionService.isApp("production") && appProductionService.getAppProduction().getManageBusinessProduction()) {
        Beans.get(OperationOrderTimesheetServiceImpl.class).updateAllRealDuration(timesheet.getTimesheetLineList());
    }
}
Also used : AppProductionService(com.axelor.apps.production.service.app.AppProductionService) Transactional(com.google.inject.persist.Transactional)

Aggregations

AppProductionService (com.axelor.apps.production.service.app.AppProductionService)18 Transactional (com.google.inject.persist.Transactional)6 ManufOrder (com.axelor.apps.production.db.ManufOrder)4 AxelorException (com.axelor.exception.AxelorException)3 ProductionOrder (com.axelor.apps.production.db.ProductionOrder)2 Project (com.axelor.apps.project.db.Project)2 BigDecimal (java.math.BigDecimal)2 PriceList (com.axelor.apps.base.db.PriceList)1 Product (com.axelor.apps.base.db.Product)1 Sequence (com.axelor.apps.base.db.Sequence)1 InvoicingProject (com.axelor.apps.businessproject.db.InvoicingProject)1 Employee (com.axelor.apps.hr.db.Employee)1 BillOfMaterial (com.axelor.apps.production.db.BillOfMaterial)1 OperationOrder (com.axelor.apps.production.db.OperationOrder)1 ProdHumanResource (com.axelor.apps.production.db.ProdHumanResource)1 ManufOrderRepository (com.axelor.apps.production.db.repo.ManufOrderRepository)1 OperationOrderRepository (com.axelor.apps.production.db.repo.OperationOrderRepository)1 ProjectRepository (com.axelor.apps.project.db.repo.ProjectRepository)1 PurchaseOrder (com.axelor.apps.purchase.db.PurchaseOrder)1 LocalDateTime (java.time.LocalDateTime)1