<?xml version="1.0"?>
<!--
@author Last Changed:$Author: theegarten $
@version $Revision: 4772 $
@date $Date: 2010-09-06 15:04:22 +0200 (Mo, 06. Sep 2010) $
-->
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://schema.infor.com/InforOAGIS/2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:java="http://xml.apache.org/saxon/java" xmlns:tfs="http://www.infor.com/tfs" exclude-result-prefixes="java tfs">
	<!---->
	<!--****************************************************************************************************-->
	<!-- retrieves the EDIFACT Quantity Unit from the BOD Quantity Unit -->
	<!--****************************************************************************************************-->
	<xsl:function name="tfs:getQuantityUnit_BOD2EDI">
		<xsl:param name="unit"/>
		<xsl:param name="tradingPartner"/>
		<!---->
		<xsl:choose>
			<xsl:when test="$tradingPartner !='' ">
				<xsl:value-of select="document('codes/unitCodeMapping.xml')/units/measureunit/measureunitBOD[@bod=$unit and @TP=$tradingPartner ]"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="document('codes/unitCodeMapping.xml')/units/measureunit/measureunitBOD[@bod=$unit and not(@TP)]"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:function>
</xsl:stylesheet>
