Search in sources :

Example 1 with ProductionConfigService

use of com.axelor.apps.production.service.config.ProductionConfigService in project axelor-open-suite by axelor.

the class ManufOrderServiceImpl method getManufOrderSeq.

@Override
public String getManufOrderSeq(ManufOrder manufOrder) throws AxelorException {
    ProductionConfigService productionConfigService = Beans.get(ProductionConfigService.class);
    ProductionConfig productionConfig = productionConfigService.getProductionConfig(manufOrder.getCompany());
    Sequence sequence = productionConfigService.getManufOrderSequence(productionConfig, manufOrder.getWorkshopStockLocation());
    String seq = sequenceService.getSequenceNumber(sequence);
    if (seq == null) {
        throw new AxelorException(TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, I18n.get(IExceptionMessage.MANUF_ORDER_SEQ));
    }
    return seq;
}
Also used : AxelorException(com.axelor.exception.AxelorException) ProductionConfigService(com.axelor.apps.production.service.config.ProductionConfigService) ProductionConfig(com.axelor.apps.production.db.ProductionConfig) Sequence(com.axelor.apps.base.db.Sequence)

Aggregations

Sequence (com.axelor.apps.base.db.Sequence)1 ProductionConfig (com.axelor.apps.production.db.ProductionConfig)1 ProductionConfigService (com.axelor.apps.production.service.config.ProductionConfigService)1 AxelorException (com.axelor.exception.AxelorException)1