Skip to content

Commit

Permalink
#11429 Create a Label for Finished goods report from HU Editor (#11430)
Browse files Browse the repository at this point in the history
* #11429 Add printing finished goods label

#11429 Create a Label for Finished goods report from HU Editor

* #11249 Add finished goods label process

* #11429 Add metasfresh finsihed goods lable jasper report

* #11429 Add Process WEBUI_M_HU_PrintFinishedGoodsLabel

* #11429 delete launcher

* #1429 Retrieve proper process

* #11429 Deactivate processes

* #11429 Do not filter hu's for top level

* #11429 Fix Printing process

* #11429 Fix process

* #11429 Use regular printing

* #11429 Fix imports
  • Loading branch information
cristinamghita committed Jul 2, 2021
1 parent 8718b34 commit d728194
Show file tree
Hide file tree
Showing 9 changed files with 397 additions and 0 deletions.
@@ -0,0 +1,132 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.5.1.final using JasperReports Library version 6.5.1 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="report" pageWidth="275" pageHeight="595" orientation="Landscape" columnWidth="275" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" resourceBundle="de/metas/label/finishedproduct/report" uuid="be165937-8a54-45bb-9624-cc1da8b204f3">
<property name="ireport.scriptlethandling" value="0"/>
<property name="ireport.encoding" value="UTF-8"/>
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="mf15"/>
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<property name="com.jaspersoft.studio.unit." value="pixel"/>
<import value="net.sf.jasperreports.engine.*"/>
<import value="java.util.*"/>
<import value="net.sf.jasperreports.engine.data.*"/>
<style name="Barcode" forecolor="#000000" fontName="Roboto" fontSize="7"/>
<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA[".\\"]]></defaultValueExpression>
</parameter>
<parameter name="ad_language" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA[$P{REPORT_LOCALE}.toString()]]></defaultValueExpression>
</parameter>
<parameter name="AD_PInstance_ID" class="java.lang.Integer"/>
<queryString>
<![CDATA[SELECT * FROM report.cu_product_label($P{AD_PInstance_ID})
ORDER BY value
;]]>
</queryString>
<field name="created" class="java.sql.Date">
<property name="com.jaspersoft.studio.field.label" value="created"/>
</field>
<field name="value" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="value"/>
</field>
<field name="serialno" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="serialno"/>
</field>
<field name="name" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="name"/>
</field>
<field name="prod_value" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="prod_value"/>
</field>
<field name="vendorname" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="vendorname"/>
</field>
<field name="purchaseorderno" class="java.lang.String">
<property name="com.jaspersoft.studio.field.label" value="purchaseorderno"/>
</field>
<detail>
<band height="119">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<staticText>
<reportElement x="23" y="13" width="38" height="15" uuid="8259b11a-7f1d-4bcf-bdc2-475439749e4e">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement markup="none">
<font fontName="Arial" size="11" isBold="true"/>
</textElement>
<text><![CDATA[HU-Nr.]]></text>
</staticText>
<textField>
<reportElement x="61" y="13" width="150" height="15" uuid="54ffa156-bd0d-4cc6-bc9b-068802965c61"/>
<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
<font fontName="Arial" size="11" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{value}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="24" y="33" width="66" height="11" uuid="b192d775-fe1e-4f72-8136-6bdd73210e42"/>
<textElement markup="none">
<font fontName="Arial" size="8" isBold="true"/>
</textElement>
<text><![CDATA[Artikelnummer]]></text>
</staticText>
<textField>
<reportElement x="90" y="33" width="117" height="11" uuid="06fb32e0-ab2e-4a64-bf35-9a2a3d5fc104"/>
<textElement markup="none">
<font fontName="Arial" size="8" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{prod_value}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="90" y="44" width="117" height="11" uuid="b0a5ab0c-75b8-418f-9472-251d7316084e"/>
<textElement markup="none">
<font fontName="Arial" size="8" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{name}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="24" y="44" width="66" height="11" uuid="085446c4-29f0-4722-9b43-fea50fe50d32"/>
<textElement markup="none">
<font fontName="Arial" size="8" isBold="true"/>
</textElement>
<text><![CDATA[Artikelname]]></text>
</staticText>
<staticText>
<reportElement x="24" y="55" width="66" height="11" uuid="75c43e17-9a8f-4dcf-9918-a42d402fb9ef"/>
<textElement markup="none">
<font fontName="Arial" size="8" isBold="true"/>
</textElement>
<text><![CDATA[Seriennummer]]></text>
</staticText>
<textField isBlankWhenNull="true">
<reportElement x="90" y="55" width="117" height="11" uuid="773f5518-b39d-47b9-bdd4-59efefb9551f"/>
<textElement markup="none">
<font fontName="Arial" size="8" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{serialno}]]></textFieldExpression>
</textField>
<componentElement>
<reportElement style="Barcode" x="2" y="74" width="132" height="34" uuid="b2179e7e-2c61-4447-acf7-bc189867f074">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<jr:EAN128 xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" moduleWidth="1.0">
<jr:codeExpression><![CDATA[$F{serialno}]]></jr:codeExpression>
</jr:EAN128>
</componentElement>
<componentElement>
<reportElement style="Barcode" positionType="FixRelativeToBottom" x="141" y="74" width="132" height="34" uuid="de73529c-d342-40c1-934b-8a0e56beee03">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<printWhenExpression><![CDATA[$F{value}!=null]]></printWhenExpression>
</reportElement>
<jr:Code128 xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" moduleWidth="1.0" textPosition="bottom">
<jr:codeExpression><![CDATA[$F{value}]]></jr:codeExpression>
</jr:Code128>
</componentElement>
</band>
</detail>
</jasperReport>
@@ -0,0 +1,3 @@
# Locale for report manufacuringorder
Allergens=May contain:
Nutrition=Nährwerte / nutritional values / Átlagos tápérték ´ / Ravintosisältö/ Näringsvärde:
@@ -0,0 +1,3 @@
# Locale for report manufacuringorder
Allergens=May contain:
Nutrition=Nährwerte / nutritional values / Átlagos tápérték ´ / Ravintosisältö/ Näringsvärde:
@@ -0,0 +1,3 @@
# Locale for report manufacuringorder
Allergens=May contain:
Nutrition=Nährwerte / nutritional values / Átlagos tápérték ́ / Ravintosisältö/ Näringsvärde:
@@ -0,0 +1,25 @@
-- 2020-05-25T07:48:26.951Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process (AD_Client_ID,IsActive,Created,CreatedBy,Updated,IsReport,IsDirectPrint,AccessLevel,ShowHelp,IsBetaFunctionality,Classname,CopyFromProcess,UpdatedBy,JasperReport,AD_Process_ID,Value,AllowProcessReRun,IsUseBPartnerLanguage,IsApplySecuritySettings,RefreshAllAfterExecution,IsOneInstanceOnly,LockWaitTimeout,Type,IsTranslateExcelHeaders,Name,EntityType,Description,AD_Org_ID,IsServerProcess) VALUES (0,'Y',TO_TIMESTAMP('2020-05-25 10:48:26','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2020-05-25 10:48:26','YYYY-MM-DD HH24:MI:SS'),'Y','Y','3','N','N','de.metas.report.jasper.client.process.JasperReportStarter','N',100,'@PREFIX@de/metas/label/finishedproduct/report.jasper',584694,'Finishedproduct Label','N','Y','N','N','N',0,'JasperReportsSQL','Y','Fertigprodukt Label','U','Fertigprodukt Label (Jasper)',0,'N')
;

-- 2020-05-25T07:48:26.985Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Trl (AD_Language,AD_Process_ID, Name,Description,Help, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Process_ID, t.Name,t.Description,t.Help, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Process_ID=584694 AND NOT EXISTS (SELECT 1 FROM AD_Process_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_ID=t.AD_Process_ID)
;

-- 2020-05-25T07:48:32.127Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2020-05-25 10:48:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Process_ID=584694
;

-- 2020-05-25T07:48:38.456Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Trl SET Description='Finishedproduct Label (Jasper)', IsTranslated='Y', Name='Finishedproduct Label',Updated=TO_TIMESTAMP('2020-05-25 10:48:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Process_ID=584694
;

-- 2020-05-25T07:52:19.132Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Table_Process (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Table_ID,AD_Table_Process_ID,Created,CreatedBy,EntityType,IsActive,Updated,UpdatedBy,WEBUI_DocumentAction,WEBUI_IncludedTabTopAction,WEBUI_ViewAction,WEBUI_ViewQuickAction,WEBUI_ViewQuickAction_Default) VALUES (0,0,584694,53027,540819,TO_TIMESTAMP('2020-05-25 10:52:18','YYYY-MM-DD HH24:MI:SS'),100,'U','Y',TO_TIMESTAMP('2020-05-25 10:52:18','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N')
;

@@ -0,0 +1,53 @@
-- 2021-07-01T09:25:35.982Z
-- URL zum Konzept
INSERT INTO AD_SysConfig (AD_Client_ID,AD_Org_ID,AD_SysConfig_ID,ConfigurationLevel,Created,CreatedBy,Description,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,541380,'O',TO_TIMESTAMP('2021-07-01 11:25:35','YYYY-MM-DD HH24:MI:SS'),100,'This specifies the process which the system shall use when printing material receipts labels for HUs. Note: AD_Process_ID=540370 is the process with the value "Wareneingangsetikett LU (Jasper)".','de.metas.handlingunits','Y','de.metas.handlingunits.FinishedGoodsLabel.AD_Process_ID',TO_TIMESTAMP('2021-07-01 11:25:35','YYYY-MM-DD HH24:MI:SS'),100,'584694')
;




-- 2021-07-01T10:31:56.219Z
-- URL zum Konzept
INSERT INTO AD_Table_Process (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Table_ID,AD_Table_Process_ID,Created,CreatedBy,EntityType,IsActive,Updated,UpdatedBy,WEBUI_DocumentAction,WEBUI_IncludedTabTopAction,WEBUI_ViewAction,WEBUI_ViewQuickAction,WEBUI_ViewQuickAction_Default) VALUES (0,0,584694,540516,540947,TO_TIMESTAMP('2021-07-01 12:31:56','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.handlingunits','Y',TO_TIMESTAMP('2021-07-01 12:31:56','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N')
;

-- 2021-07-01T10:35:06.776Z
-- URL zum Konzept
INSERT INTO AD_Process (AccessLevel,AD_Client_ID,AD_Org_ID,AD_Process_ID,AllowProcessReRun,Classname,CopyFromProcess,Created,CreatedBy,Description,EntityType,IsActive,IsApplySecuritySettings,IsBetaFunctionality,IsDirectPrint,IsNotifyUserAfterExecution,IsOneInstanceOnly,IsReport,IsTranslateExcelHeaders,IsUseBPartnerLanguage,LockWaitTimeout,Name,PostgrestResponseFormat,RefreshAllAfterExecution,ShowHelp,Type,Updated,UpdatedBy,Value) VALUES ('3',0,0,584852,'N','de.metas.ui.web.handlingunits.process.WEBUI_M_HU_PrintReceiptLabel','N',TO_TIMESTAMP('2021-07-01 12:35:06','YYYY-MM-DD HH24:MI:SS'),100,'Ein Wareneingangsetikett für die HU ausdrucken','U','Y','N','N','N','N','N','N','Y','Y',0,'Fertigprodukt Label','json','N','Y','Java',TO_TIMESTAMP('2021-07-01 12:35:06','YYYY-MM-DD HH24:MI:SS'),100,'WEBUI_M_HU_PrintFinishedGoodsLabel')
;

-- 2021-07-01T10:35:06.779Z
-- URL zum Konzept
INSERT INTO AD_Process_Trl (AD_Language,AD_Process_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Process_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Process_ID=584852 AND NOT EXISTS (SELECT 1 FROM AD_Process_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_ID=t.AD_Process_ID)
;

-- 2021-07-01T10:35:13.365Z
-- URL zum Konzept
UPDATE AD_Process_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2021-07-01 12:35:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Process_ID=584852
;

-- 2021-07-01T10:35:43.126Z
-- URL zum Konzept
UPDATE AD_Process_Trl SET Description='', IsTranslated='Y', Name='Finishedproduct Label',Updated=TO_TIMESTAMP('2021-07-01 12:35:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_GB' AND AD_Process_ID=584852
;

-- 2021-07-01T10:35:48.510Z
-- URL zum Konzept
UPDATE AD_Process_Trl SET Description='', IsTranslated='Y', Name='Finishedproduct Label',Updated=TO_TIMESTAMP('2021-07-01 12:35:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Process_ID=584852
;

-- 2021-07-01T10:36:11.264Z
-- URL zum Konzept
UPDATE AD_Process SET Classname='de.metas.ui.web.handlingunits.process.WEBUI_M_HU_PrintFinishedGoodsLabel',Updated=TO_TIMESTAMP('2021-07-01 12:36:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=584852
;

-- 2021-07-01T10:36:53.244Z
-- URL zum Konzept
INSERT INTO AD_Table_Process (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Table_ID,AD_Table_Process_ID,Created,CreatedBy,EntityType,IsActive,Updated,UpdatedBy,WEBUI_DocumentAction,WEBUI_IncludedTabTopAction,WEBUI_ViewAction,WEBUI_ViewQuickAction,WEBUI_ViewQuickAction_Default) VALUES (0,0,584852,540516,540948,TO_TIMESTAMP('2021-07-01 12:36:53','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.handlingunits','Y',TO_TIMESTAMP('2021-07-01 12:36:53','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N')
;

-- 2021-07-01T10:37:08.329Z
-- URL zum Konzept
UPDATE AD_Table_Process SET WEBUI_ViewQuickAction='Y',Updated=TO_TIMESTAMP('2021-07-01 12:37:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_Process_ID=540948
;

@@ -0,0 +1,25 @@
-- 2021-07-01T12:16:33.731Z
-- URL zum Konzept
INSERT INTO AD_Table_Process (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Table_ID,AD_Table_Process_ID,Created,CreatedBy,EntityType,IsActive,Updated,UpdatedBy,WEBUI_DocumentAction,WEBUI_IncludedTabTopAction,WEBUI_ViewAction,WEBUI_ViewQuickAction,WEBUI_ViewQuickAction_Default) VALUES (0,0,584694,208,540949,TO_TIMESTAMP('2021-07-01 14:16:33','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.handlingunits','Y',TO_TIMESTAMP('2021-07-01 14:16:33','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N')
;

-- 2021-07-01T12:24:33.767Z
-- URL zum Konzept
UPDATE AD_Table_Process SET IsActive='N',Updated=TO_TIMESTAMP('2021-07-01 14:24:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_Process_ID=540949
;

-- 2021-07-01T12:24:59.606Z
-- URL zum Konzept
UPDATE AD_Table_Process SET IsActive='N',Updated=TO_TIMESTAMP('2021-07-01 14:24:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_Process_ID=540819
;

-- 2021-07-01T12:25:04.319Z
-- URL zum Konzept
UPDATE AD_Table_Process SET IsActive='N',Updated=TO_TIMESTAMP('2021-07-01 14:25:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_Process_ID=540947
;

-- 2021-07-01T12:25:27.831Z
-- URL zum Konzept
UPDATE AD_Table_Process SET IsActive='N',Updated=TO_TIMESTAMP('2021-07-01 14:25:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_Process_ID=540948
;

Expand Up @@ -63,6 +63,7 @@ public static HUReportService get()
private static final transient Logger logger = LogManager.getLogger(HUReportService.class);

public static final String SYSCONFIG_RECEIPT_LABEL_PROCESS_ID = "de.metas.handlingunits.MaterialReceiptLabel.AD_Process_ID";
public static final String SYSCONFIG_FINISHEDGOODS_LABEL_PROCESS_ID = "de.metas.handlingunits.FinishedGoodsLabel.AD_Process_ID";
public static final String SYSCONFIG_RECEIPT_LABEL_AUTO_PRINT_ENABLED = "de.metas.handlingunits.MaterialReceiptLabel.AutoPrint.Enabled";
public static final String SYSCONFIG_RECEIPT_LABEL_AUTO_PRINT_ENABLED_C_BPARTNER_ID = SYSCONFIG_RECEIPT_LABEL_AUTO_PRINT_ENABLED + ".C_BPartner_ID_";
public static final String SYSCONFIG_RECEIPT_LABEL_AUTO_PRINT_COPIES = "de.metas.handlingunits.MaterialReceiptLabel.AutoPrint.Copies";
Expand All @@ -88,6 +89,11 @@ public AdProcessId retrievePrintReceiptLabelProcessIdOrNull()
return retrieveProcessIdBySysConfig(SYSCONFIG_RECEIPT_LABEL_PROCESS_ID);
}

public AdProcessId retrievePrintFinishedGoodsLabelProcessIdOrNull()
{
return retrieveProcessIdBySysConfig(SYSCONFIG_FINISHEDGOODS_LABEL_PROCESS_ID);
}

private AdProcessId retrievePickingLabelProcessIdOrNull()
{
return retrieveProcessIdBySysConfig(SYSCONFIG_PICKING_LABEL_PROCESS_ID);
Expand Down

0 comments on commit d728194

Please sign in to comment.