-- LotUsage Full Query
-- Source: JDESTAGE.F4111_VIEW
-- Destination: LotUsage_Curr
-- Schedule: Mass/Daily/Hourly

SELECT lu.UNIQUEKEYIDINTERNAL_ILUKID AS UniqueID,
       lu.DOCUMENTORDERINVOICEE_ILDOCO AS WorkOrderNumber,
       TRIM(lu.LOT_ILLOTN) AS LotNumber,
       TRIM(lu.COSTCENTER_ILMCU) AS BranchCode,
       lu.IDENTIFIERSHORTITEM_ILITM AS ShortItemNumber,
       lu.QUANTITYTRANSACTION_ILTRQT AS Quantity,
       lu.DATETRANSACTIONJULIAN_ILTRDJ AS DateUpdated,
       lu.TIMEOFDAY_ILTDAY AS TimeUpdated
  FROM JDESTAGE.F4111_VIEW lu
 WHERE lu.DOCUMENTTYPE_ILDCT = 'IM' AND
       TRIM(lu.LOT_ILLOTN) IS NOT NULL
