<?xml version="1.0" encoding="UTF-8"?>
<!--
@author Last Changed:$Author: Kalyan G. $
@version $Revision: 1 $
@date $Date: 2011-11-17 $
-->
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:bod="http://schema.infor.com/InforOAGIS/2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:saxon="http://xml.apache.org/saxon" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ext="com.infor.tfs.mappings.extensions.XsltExt" xmlns:java="http://xml.apache.org/saxon/java" xmlns:tfs="http://www.infor.com/tfs" exclude-result-prefixes="java">
	<!---->
	<!-- imports -->
	<xsl:import href="includes/GRNOTE_segments.xsl" xml:base="../../"/>
	<!---->
	<xsl:decimal-format name="qtyFrmt" decimal-separator="," grouping-separator=" "/>
	<xsl:output indent="yes" method="xml" encoding="UTF-8"/>
	<!---->
	<!--****************************************************************************************************-->
	<!-- Root -->
	<!--****************************************************************************************************-->
	<xsl:template match="/">
		<xsl:apply-templates select="bod:SyncReceiveDelivery"/>
	</xsl:template>
	<!---->
	<!--****************************************************************************************************-->
	<!-- SyncReceivDelivery -->
	<!--****************************************************************************************************-->
	<xsl:template match="bod:SyncReceiveDelivery">
		<xsl:element name="GRNOTE">
			<xsl:for-each select="bod:DataArea/bod:ReceiveDelivery/bod:ReceiveDeliveryItem">
				<!--****************************************************************************************************-->
				<!-- Segment SG01 -->
				<!--****************************************************************************************************-->
				<xsl:call-template name="SG01">
					<xsl:with-param name="documentDate" select="tfs:getBODDate(/bod:SyncReceiveDelivery/bod:DataArea/bod:ReceiveDelivery/bod:ReceiveDeliveryHeader/bod:DocumentDateTime)"/>
					<xsl:with-param name="postingDate" select="tfs:getBODDate(bod:UserArea/bod:Property/bod:NameValue[@name='BookingDate'])"/>
					<xsl:with-param name="referenceDocument" select="bod:UserArea/bod:Property/bod:NameValue[@name='ReferenceDocument']"/>
					<!--<xsl:with-param name="documentHeader" select=""/>-->
					<!--<xsl:with-param name="consignmentNoteNumber" select=""/>-->
					<!--<xsl:with-param name="goodsReceiptSlipNumber" select=""/>-->
					<!--<xsl:with-param name="currentTransactionCode" select=""/>-->
					<xsl:with-param name="materialDocumentNumber" select="bod:UserArea/bod:Property/bod:NameValue[@name='MaterialDocumentNumber']"/>
					<xsl:with-param name="postingProcedure" select="bod:UserArea/bod:Property/bod:NameValue[@name='PostingProcedure']"/>
					<!--<xsl:with-param name="returnShipmentNoteNumber" select=""/>-->
					<!--<xsl:with-param name="deliveryNoteType" select=""/>-->
					<xsl:with-param name="shippingType" select="bod:UserArea/bod:Property/bod:NameValue[@name='ShippingType']"/>
					<!--<xsl:with-param name="bookingDate" select=""/>-->
					<!--<xsl:with-param name="customsIndicator" select=""/>-->
					<!--<xsl:with-param name="numberOfCollisions" select=""/>-->
					<xsl:with-param name="consignmentNoteDate" select="tfs:getBODDate(/bod:SyncReceiveDelivery/bod:DataArea/bod:ReceiveDelivery/bod:ReceiveDeliveryHeader/bod:DocumentDateTime)"/>
					<xsl:with-param name="receiptDate" select="tfs:getBODDate(/bod:SyncReceiveDelivery/bod:DataArea/bod:ReceiveDelivery/bod:ReceiveDeliveryHeader/bod:ActualDeliveryDateTime)"/>
					<xsl:with-param name="indicatorOfPostingContainer" select="bod:UserArea/bod:Property/bod:NameValue[@name='IndicatorOfPostingContainer']"/>
					<!--<xsl:with-param name="user" select=""/>-->
					<!--<xsl:with-param name="meansOfTransportKey" select=""/>-->
					<!--<xsl:with-param name="meansOfTransportIndicator" select=""/>-->
					<!--<xsl:with-param name="bordereauNumber" select=""/>-->
					<!--<xsl:with-param name="bordereauDate" select=""/>-->
					<!--<xsl:with-param name="carrier" select=""/>-->
					<!--<xsl:with-param name="entryStatus" select=""/>-->
					<!--<xsl:with-param name="extraTourNumber" select=""/>-->
					<!--<xsl:with-param name="freightCarrierNumber" select=""/>-->
					<!--<xsl:with-param name="containerIndicator" select=""/>-->
					<!--<xsl:with-param name="shipmentSizeKey" select=""/>-->
					<!--<xsl:with-param name="arrivalDate" select=""/>-->
					<!--<xsl:with-param name="departureDate" select=""/>-->
					<!--<xsl:with-param name="receipttimeByCustomer" select=""/>-->
					<!--<xsl:with-param name="departureTimeFromCustomer" select=""/>-->
					<!--<xsl:with-param name="shipmentReferenceNumber" select=""/>-->
					<!--<xsl:with-param name="vendorPostalCode" select=""/>-->
					<!--<xsl:with-param name="vendorPostalCodeAdviceNote" select=""/>-->
					<!--<xsl:with-param name="shipmentKey" select=""/>-->
					<!--<xsl:with-param name="shipmentWeight" select=""/>-->
					<!--<xsl:with-param name="indicatorItemAlreadyProcessed" select=""/>-->
					<!--<xsl:with-param name="indicatorCancellation" select=""/>-->
					<xsl:with-param name="materialnumberCardFormat" select="concat(' ',bod:ItemID/bod:ID)"/>
					<!--<xsl:with-param name="plant" select=""/>-->
					<!--<xsl:with-param name="VWStorageLocationSAP" select=""/>-->
					<!--<xsl:with-param name="batchNumber" select=""/>-->
					<!--<xsl:with-param name="movementType" select=""/>-->
					<!--<xsl:with-param name="stockType" select=""/>-->
					<!--<xsl:with-param name="specialStockIndicator" select=""/>-->
					<!--<xsl:with-param name="consumptionPosting" select=""/>-->
					<xsl:with-param name="vendorAccountNumber" select="/bod:SyncReceiveDelivery/bod:DataArea/bod:ReceiveDelivery/bod:ReceiveDeliveryHeader/bod:ShipFromParty/bod:PartyIDs/bod:ID"/>
					<!--<xsl:with-param name="customerAccountNumber" select=""/>-->
					<!--<xsl:with-param name="salesOrderNumber" select=""/>-->
					<!--<xsl:with-param name="itemNumberInSalesOrder" select=""/>-->
					<!--<xsl:with-param name="deliveryScheduleforSalesOrder" select=""/>-->
					<xsl:with-param name="debitCreditIndicator" select="bod:UserArea/bod:Property/bod:NameValue[@name='DebitCreditIndicator']"/>
					<xsl:with-param name="currencyKey" select="bod:UserArea/bod:Property/bod:NameValue[@name='Currency']"/>
					<!--<xsl:with-param name="amountInLocalCurrency" select=""/>-->
					<!--<xsl:with-param name="valuationType" select=""/>-->
					<xsl:with-param name="unitOfEntryQuantity" select="format-number((bod:ReceivedQuantity) div 100,'############,00','qtyFrmt')"/>
					<xsl:with-param name="unitOfEntry" select="bod:ReceivedQuantity/@unitCode"/>
					<!--<xsl:with-param name="purchaseOrderPriceUnitQuantity" select=""/>-->
					<!--<xsl:with-param name="orderPriceUnitPurchasing" select=""/>-->
					<xsl:with-param name="purchaseOrderNumber" select="bod:PurchaseOrderReference/bod:DocumentID/bod:ID"/>
					<!--<xsl:with-param name="itemNumberOfPurchasingDocument" select=""/>-->
					<!--<xsl:with-param name="deliveryCompletedIndicator" select=""/>-->
					<!--<xsl:with-param name="itemText" select=""/>-->
					<!--<xsl:with-param name="transferID" select=""/>-->
					<!--<xsl:with-param name="dunsNumber" select=""/>-->
					<!--<xsl:with-param name="filler01" select=""/>-->
					<!--<xsl:with-param name="shipToParty" select=""/>-->
					<!--<xsl:with-param name="unloadingPoint" select=""/>-->
					<!--<xsl:with-param name="costCenter" select=""/>-->
					<!--<xsl:with-param name="orderNumber" select=""/>-->
					<!--<xsl:with-param name="mainAssetNumber" select=""/>-->
					<!--<xsl:with-param name="assetSubnumber" select=""/>-->
					<!--<xsl:with-param name="numberOfReservation" select=""/>-->
					<!--<xsl:with-param name="itemNumberofReservation" select=""/>-->
					<!--<xsl:with-param name="filler02" select=""/>-->
					<!--<xsl:with-param name="finalIssueforThisReservation" select=""/>-->
					<!--<xsl:with-param name="receivingMaterial" select=""/>-->
					<!--<xsl:with-param name="filler03" select=""/>-->
					<!--<xsl:with-param name="receivingPlant" select=""/>-->
					<!--<xsl:with-param name="receivingStorageLocation" select=""/>-->
					<!--<xsl:with-param name="receivingBatch" select=""/>-->
					<!--<xsl:with-param name="movementIndicator" select=""/>-->
					<!--<xsl:with-param name="goodsReceiptNonValuated" select=""/>-->
					<!--<xsl:with-param name="warehouseNumber" select=""/>-->
					<!--<xsl:with-param name="storageType" select=""/>-->
					<!--<xsl:with-param name="storageBin" select=""/>-->
					<!--<xsl:with-param name="reasonForMovement" select=""/>-->
					<!--<xsl:with-param name="shippingInstructions" select=""/>-->
					<!--<xsl:with-param name="KRIASRecordType" select=""/>-->
					<!--<xsl:with-param name="companyNumber" select=""/>-->
					<!--<xsl:with-param name="objectType" select=""/>-->
					<!--<xsl:with-param name="priceUnit" select=""/>-->
					<!--<xsl:with-param name="priceAtDocumentCurrency" select=""/>-->
					<!--<xsl:with-param name="invoicedValue" select=""/>-->
					<!--<xsl:with-param name="leadingSignOfInvoicedValue" select=""/>-->
					<!--<xsl:with-param name="VWStorageLocation" select=""/>-->
					<!--<xsl:with-param name="estimatedPriceIndicator" select=""/>-->
					<!--<xsl:with-param name="orderType" select=""/>-->
					<!--<xsl:with-param name="priceIndicator" select=""/>-->
					<!--<xsl:with-param name="valueDate" select=""/>-->
					<!--<xsl:with-param name="paymentTerms" select=""/>-->
					<!--<xsl:with-param name="termsOfDelivery" select=""/>-->
					<!--<xsl:with-param name="verificationDate" select=""/>-->
					<!--<xsl:with-param name="logisticCostIndicator" select=""/>-->
					<!--<xsl:with-param name="storageLocation" select=""/>-->
					<!--<xsl:with-param name="deliveryNoteItemNumber" select=""/>-->
					<xsl:with-param name="VWStockPlant" select="bod:UserArea/bod:Property/bod:NameValue[@name='StockPlant']"/>
					<xsl:with-param name="countryOfOrigin" select="bod:UserArea/bod:Property/bod:NameValue[@name='CountryOfOrigin']"/>
					<xsl:with-param name="VWWarehousePlant" select="bod:UserArea/bod:Property/bod:NameValue[@name='WarehousePlant']"/>
					<xsl:with-param name="VWWarehouseNumber" select="bod:UserArea/bod:Property/bod:NameValue[@name='WarehouseNumber']"/>
					<xsl:with-param name="VWWarehouseGroup" select="bod:UserArea/bod:Property/bod:NameValue[@name='WarehouseGroup']"/>
					<!--<xsl:with-param name="transportDamageIndicator" select=""/>-->
					<!--<xsl:with-param name="deliveryNote" select=""/>-->
					<!--<xsl:with-param name="materialGroup" select=""/>-->
					<!--<xsl:with-param name="containerItem" select=""/>-->
					<!--<xsl:with-param name="containerNumber" select=""/>-->
					<!--<xsl:with-param name="contentOfContainer" select=""/>-->
					<!--<xsl:with-param name="containerType" select=""/>-->
					<!--<xsl:with-param name="grossWeight" select=""/>-->
					<!--<xsl:with-param name="counterContainerItem" select=""/>-->
					<!--<xsl:with-param name="containerID" select=""/>-->
					<!--<xsl:with-param name="componentSupplier" select=""/>-->
					<xsl:with-param name="activityCategory" select="bod:UserArea/bod:Property/bod:NameValue[@name='ActivityCategory']"/>
					<xsl:with-param name="usageIndicator" select="bod:UserArea/bod:Property/bod:NameValue[@name='UsageIndicator']"/>
					<!--<xsl:with-param name="controlCommandGoodsReceipt" select=""/>-->
					<!--<xsl:with-param name="sumDVS" select=""/>-->
					<xsl:with-param name="iDocNumber" select="bod:UserArea/bod:Property/bod:NameValue[@name='IDOCNumber']"/>
					<xsl:with-param name="partner" select="bod:UserArea/bod:Property/bod:NameValue[@name='Partner']"/>
					<!--<xsl:with-param name="specialDocument" select=""/>-->
					<!--<xsl:with-param name="stock" select=""/>-->
					<!--<xsl:with-param name="account" select=""/>-->
					<xsl:with-param name="timestamp" select="concat(tfs:getBODDate(bod:UserArea/bod:Property/bod:NameValue[@name='BookingDate']),tfs:getBODTime(bod:UserArea/bod:Property/bod:NameValue[@name='BookingDate'],'HHmmss'))"/>
					<xsl:with-param name="interfaceProvidingIndicator" select="bod:UserArea/bod:Property/bod:NameValue[@name='InterfaceProvidingIndicator']"/>
					<!--<xsl:with-param name="vendorAccountNumberfromJITCall" select=""/>-->
					<!--<xsl:with-param name="stockUnfree" select=""/>-->
					<xsl:with-param name="interfaceProvidingIndicatorMABES" select="bod:UserArea/bod:Property/bod:NameValue[@name='InterfaceProvidingIndicatorMABES']"/>
					<!--<xsl:with-param name="filler04" select=""/>-->
				</xsl:call-template>
				<!---->
			</xsl:for-each>
		</xsl:element>
	</xsl:template>
</xsl:stylesheet>
