Search in sources :

Example 1 with HUReportService

use of de.metas.handlingunits.report.HUReportService in project metasfresh-webui-api by metasfresh.

the class WEBUI_Picking_TU_Label method printPickingLabel.

private void printPickingLabel(final HUToReportWrapper huToReport) {
    final HUReportService huReportService = HUReportService.get();
    huReportService.printPickingLabel(huToReport, false);
}
Also used : HUReportService(de.metas.handlingunits.report.HUReportService)

Example 2 with HUReportService

use of de.metas.handlingunits.report.HUReportService in project metasfresh-webui-api by metasfresh.

the class WEBUI_M_HU_PrintReceiptLabel method doIt.

@Override
@RunOutOfTrx
protected String doIt() throws Exception {
    final HUReportService huReportService = HUReportService.get();
    final int adProcessId = huReportService.retrievePrintReceiptLabelProcessId();
    final HUToReport hu = getSingleSelectedRow().getAsHUToReport();
    final List<HUToReport> husToProcess = huReportService.getHUsToProcess(hu, adProcessId);
    HUReportExecutor.newInstance(getCtx()).windowNo(getProcessInfo().getWindowNo()).numberOfCopies(p_copies).executeHUReportAfterCommit(adProcessId, husToProcess);
    return MSG_OK;
}
Also used : HUToReport(de.metas.handlingunits.report.HUToReport) HUReportService(de.metas.handlingunits.report.HUReportService) RunOutOfTrx(de.metas.process.RunOutOfTrx)

Example 3 with HUReportService

use of de.metas.handlingunits.report.HUReportService in project metasfresh-webui-api by metasfresh.

the class WEBUI_M_HU_PrintReceiptLabel method checkPreconditionsApplicable.

@Override
public ProcessPreconditionsResolution checkPreconditionsApplicable() {
    if (!isHUEditorView()) {
        return ProcessPreconditionsResolution.rejectWithInternalReason("not the HU view");
    }
    final HUReportService huReportService = HUReportService.get();
    // note: at this point, the JavaProces's ctx was not set so we are using the global context
    final Properties ctx = Env.getCtx();
    final int adProcessId = huReportService.retrievePrintReceiptLabelProcessId();
    if (adProcessId <= 0) {
        return ProcessPreconditionsResolution.reject("Receipt label process not configured via sysconfig " + HUReportService.SYSCONFIG_RECEIPT_LABEL_PROCESS_ID);
    }
    if (!getSelectedRowIds().isSingleDocumentId()) {
        return ProcessPreconditionsResolution.reject("No (single) row selected");
    }
    final HUToReport hu = getSingleSelectedRow().getAsHUToReportOrNull();
    if (hu == null) {
        return ProcessPreconditionsResolution.reject("No (single) HU selected");
    }
    final List<HUToReport> husToProcess = huReportService.getHUsToProcess(hu, adProcessId);
    if (husToProcess.isEmpty()) {
        return ProcessPreconditionsResolution.reject("current HU's type does not match the receipt label process");
    }
    return ProcessPreconditionsResolution.accept();
}
Also used : HUToReport(de.metas.handlingunits.report.HUToReport) HUReportService(de.metas.handlingunits.report.HUReportService) Properties(java.util.Properties)

Example 4 with HUReportService

use of de.metas.handlingunits.report.HUReportService in project metasfresh-webui-api by metasfresh.

the class WEBUI_Picking_PickQtyToNewHU method printPickingLabel.

private void printPickingLabel(final HUToReportWrapper huToReport) {
    final HUReportService huReportService = HUReportService.get();
    huReportService.printPickingLabel(huToReport, true);
}
Also used : HUReportService(de.metas.handlingunits.report.HUReportService)

Aggregations

HUReportService (de.metas.handlingunits.report.HUReportService)4 HUToReport (de.metas.handlingunits.report.HUToReport)2 RunOutOfTrx (de.metas.process.RunOutOfTrx)1 Properties (java.util.Properties)1