<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.20.6.final using JasperReports Library version 6.20.6-5c96b6aa8a39ac1dc6b6bea4b81168e16dd39231  -->
<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="Shipment Address" language="groovy" pageWidth="203" pageHeight="240" whenNoDataType="NoPages" columnWidth="203" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="83f515c1-b67e-4ed3-97e1-3cdefefa095c">
	<property name="com.jaspersoft.studio.data.defaultdataadapter" value="/MyReports/iDempiereProduction.jrdax"/>
	<template><![CDATA["styles.jrtx"]]></template>
	<parameter name="RECORD_ID" class="java.lang.Integer" isForPrompting="false">
		<defaultValueExpression><![CDATA[1036057]]></defaultValueExpression>
	</parameter>
	<queryString language="SQL">
		<![CDATA[SELECT
    ih.m_inout_id                                                   AS record_id,
    NULLIF(btrim(ih.bpgreeting), '')                                AS bpgreeting,
    COALESCE(NULLIF(btrim(ih.c_bp_location_name), ''), ih.name)     AS name,
    NULLIF(btrim(ih.addressname2), '')                              AS addressname2,
    ih.address1, ih.address2, ih.address3, ih.address4,
    ih.city,
    ih.regionname,
    COALESCE(cl.postal || cl.postal_add, cl.postal, cl.postal_add)  AS postal,
    COALESCE(cct.name, cc.name)                                     AS countryname,
    ih.ad_org_id,
    org.companyname                                                 AS org_name,
    orgloc.address1 AS org_address1, orgloc.address2 AS org_address2,
    orgloc.address3 AS org_address3, orgloc.address4 AS org_address4,
    COALESCE(orgloc.postal || orgloc.postal_add, orgloc.postal, orgloc.postal_add) AS org_postal,
    orgloc.city                                                     AS org_city,
    COALESCE(orgct.name, orgcountry.name, whct.name, whcountry.name) AS org_countryname,
    COALESCE(orgcountry.countrycode, whcountry.countrycode)         AS org_countrycode
FROM m_inout_header_v ih
LEFT JOIN c_location cl       ON cl.c_location_id = ih.c_location_id
LEFT JOIN c_country cc        ON cc.c_country_id = cl.c_country_id
LEFT JOIN c_country_trl cct   ON cct.c_country_id = cc.c_country_id AND cct.ad_language = 'de_DE'
JOIN ad_org org               ON org.ad_org_id = ih.ad_org_id
LEFT JOIN c_location orgloc   ON orgloc.c_location_id = ih.org_location_id
LEFT JOIN c_country orgcountry ON orgcountry.c_country_id = orgloc.c_country_id
LEFT JOIN c_country_trl orgct ON orgct.c_country_id = orgcountry.c_country_id AND orgct.ad_language = 'de_DE'
LEFT JOIN c_location whloc    ON whloc.c_location_id = ih.warehouse_location_id
LEFT JOIN c_country whcountry ON whcountry.c_country_id = whloc.c_country_id
LEFT JOIN c_country_trl whct  ON whct.c_country_id = whcountry.c_country_id AND whct.ad_language = 'de_DE'
WHERE ih.m_inout_id = $P{RECORD_ID}]]>
	</queryString>
	<field name="record_id" class="java.lang.Integer"/>
	<field name="bpgreeting" class="java.lang.String"/>
	<field name="name" class="java.lang.String"/>
	<field name="addressname2" class="java.lang.String"/>
	<field name="address1" class="java.lang.String"/>
	<field name="address2" class="java.lang.String"/>
	<field name="address3" class="java.lang.String"/>
	<field name="address4" class="java.lang.String"/>
	<field name="city" class="java.lang.String"/>
	<field name="regionname" class="java.lang.String"/>
	<field name="postal" class="java.lang.String"/>
	<field name="countryname" class="java.lang.String"/>
	<field name="ad_org_id" class="java.lang.Integer"/>
	<field name="org_name" class="java.lang.String"/>
	<field name="org_address1" class="java.lang.String"/>
	<field name="org_address2" class="java.lang.String"/>
	<field name="org_address3" class="java.lang.String"/>
	<field name="org_address4" class="java.lang.String"/>
	<field name="org_postal" class="java.lang.String"/>
	<field name="org_city" class="java.lang.String"/>
	<field name="org_countryname" class="java.lang.String"/>
	<field name="org_countrycode" class="java.lang.String"/>
	<detail>
		<band height="140" splitType="Stretch">
			<textField textAdjust="StretchHeight" isBlankWhenNull="true">
				<reportElement x="8" y="0" width="187" height="12" isRemoveLineWhenBlank="true" uuid="e5c6d20b-fa3a-441d-bbae-46266246eb5d"/>
				<textElement><font fontName="SansSerif" size="8" isUnderline="true"/></textElement>
				<textFieldExpression><![CDATA[$F{org_city} == null ? null : ($F{org_name} != null ? $F{org_name} + ", " : "") + ($F{org_address1}!=null?$F{org_address1}+", ":"") + ($F{org_address2}!=null?$F{org_address2}+", ":"") + ($F{org_address3}!=null?$F{org_address3}+", ":"") + ($F{org_address4}!=null?$F{org_address4}+", ":"") + ($F{countryname} != null && !$F{countryname}.equals($F{org_countryname})?$F{org_countrycode}+"-":"") + ($F{org_postal}!=null?$F{org_postal}+" ":"") + ($F{org_city}!=null?$F{org_city}:"")]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement positionType="Float" x="8" y="15" width="187" height="12" isRemoveLineWhenBlank="true" uuid="9e347970-cf70-4c2d-a53a-44f9f8717722"/>
				<textElement><font fontName="SansSerif" size="9"/></textElement>
				<textFieldExpression><![CDATA[$F{bpgreeting}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement positionType="Float" x="8" y="27" width="187" height="12" uuid="085121fa-c1ae-4007-aa79-b47862e175b1"/>
				<textElement><font fontName="SansSerif" size="9" isBold="true"/></textElement>
				<textFieldExpression><![CDATA[$F{name}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement positionType="Float" x="8" y="39" width="187" height="12" isRemoveLineWhenBlank="true" uuid="ce221faa-9c58-4c68-84c4-483cf46029bd"/>
				<textElement><font fontName="SansSerif" size="9" isBold="true"/></textElement>
				<textFieldExpression><![CDATA[$F{addressname2}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement positionType="Float" x="8" y="51" width="187" height="12" isRemoveLineWhenBlank="true" uuid="adb13467-6938-4fb7-a6c6-2cc8c19c5677"/>
				<textElement><font fontName="SansSerif" size="9" isBold="true"/></textElement>
				<textFieldExpression><![CDATA[$F{address1}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement positionType="Float" x="8" y="63" width="187" height="12" isRemoveLineWhenBlank="true" uuid="aa80297c-40d5-4739-bf05-58df109fbf83"/>
				<textElement><font fontName="SansSerif" size="9" isBold="true"/></textElement>
				<textFieldExpression><![CDATA[$F{address2}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement positionType="Float" x="8" y="75" width="187" height="12" isRemoveLineWhenBlank="true" uuid="ce8aba57-4fbf-48e5-a148-d2486b234434"/>
				<textElement><font fontName="SansSerif" size="9" isBold="true"/></textElement>
				<textFieldExpression><![CDATA[$F{address3}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement positionType="Float" x="8" y="87" width="187" height="12" isRemoveLineWhenBlank="true" uuid="e49c5179-7f85-4659-8692-3e7bdbc2585a"/>
				<textElement><font fontName="SansSerif" size="9" isBold="true"/></textElement>
				<textFieldExpression><![CDATA[$F{address4}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement positionType="Float" x="8" y="99" width="187" height="12" uuid="d66f5659-cada-4c11-be64-5b47c546d551"/>
				<textElement><font fontName="SansSerif" size="9" isBold="true"/></textElement>
				<textFieldExpression><![CDATA[($F{postal}!=null?$F{postal} + " ":"") + ($F{city}!=null?$F{city}:"")]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement positionType="Float" x="8" y="111" width="187" height="15" isRemoveLineWhenBlank="true" uuid="d5e15f85-1e69-4481-ac9b-0f3a230b21bd"/>
				<textElement verticalAlignment="Bottom"><font fontName="SansSerif" size="9" isBold="true" isUnderline="true"/></textElement>
				<textFieldExpression><![CDATA[$F{countryname}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
</jasperReport>
