Search in sources :

Example 1 with WarehouseIssueProductsSource

use of com.qcadoo.mes.productFlowThruDivision.constants.WarehouseIssueProductsSource in project mes by qcadoo.

the class SupplyParametersListenersPFTD method toggleGenerateIssuesTo.

public void toggleGenerateIssuesTo(final ViewDefinitionState view, final ComponentState componentState, final String[] args) {
    String value = (String) componentState.getFieldValue();
    if (StringUtils.isNotEmpty(value)) {
        WarehouseIssueProductsSource warehouseIssueProductsSource = WarehouseIssueProductsSource.parseString(value);
        CheckBoxComponent generateWarehouseIssuesToDeliveries = (CheckBoxComponent) view.getComponentByReference(ParameterFieldsPFTD.GENERATE_WAREHOUSE_ISSUES_TO_DELIVERIES);
        CheckBoxComponent generateWarehouseIssuesToOrders = (CheckBoxComponent) view.getComponentByReference(ParameterFieldsPFTD.GENERATE_WAREHOUSE_ISSUES_TO_ORDERS);
        if (WarehouseIssueProductsSource.MANUAL.equals(warehouseIssueProductsSource)) {
            generateWarehouseIssuesToDeliveries.setEnabled(true);
            uncheckAndDisable(generateWarehouseIssuesToOrders);
            lockDeliveriesComponents(view, generateWarehouseIssuesToDeliveries, args);
        } else if (WarehouseIssueProductsSource.ORDER.equals(warehouseIssueProductsSource)) {
            generateWarehouseIssuesToOrders.setEnabled(true);
            uncheckAndDisable(generateWarehouseIssuesToDeliveries);
            onGenerateWarehouseIssuesToOrdersChange(view, generateWarehouseIssuesToOrders, args);
        }
    }
}
Also used : WarehouseIssueProductsSource(com.qcadoo.mes.productFlowThruDivision.constants.WarehouseIssueProductsSource) CheckBoxComponent(com.qcadoo.view.api.components.CheckBoxComponent)

Aggregations

WarehouseIssueProductsSource (com.qcadoo.mes.productFlowThruDivision.constants.WarehouseIssueProductsSource)1 CheckBoxComponent (com.qcadoo.view.api.components.CheckBoxComponent)1