-- WorkOrder Full Query
-- Source: JDESTAGE.F4801_VIEW
-- Destination: WorkOrder_Curr
-- Schedule: Mass/Daily/Hourly

SELECT wo.DOCUMENTORDERINVOICEE_WADOCO AS WorkOrderNumber,
       TRIM(wo.COSTCENTERALT_WAMMCU) AS BranchCode,
       TRIM(wo.LOT_WALOTN) AS LotNumber,
       TRIM(wo.IDENTIFIER2NDITEM_WALITM) AS ItemNumber,
       wo.IDENTIFIERSHORTITEM_WAITM AS ShortItemNumber,
       TRIM(wo.PARENTWONUMBER_WAPARS) AS ParentWorkOrderNumber,
       wo.UNITSTRANSACTIONQTY_WAUORG AS OrderQuantity,
       wo.UNITSQUANBACKORHELD_WASOBK AS HeldQuantity,
       wo.UNITSQUANTITYCANCELED_WASOCN AS ScrappedQuantity,
       wo.UNITSQUANTITYSHIPPED_WASOQS AS ShippedQuantity,
       TRIM(wo.STATUSCODEWO_WASRST) AS StatusCode,
       wo.DATESTATUSCHANGED_WADCG AS StatusCodeUpdateDT,
       wo.DATETRANSACTIONJULIAN_WATRDJ AS IssueDate,
       wo.DATESTART_WASTRT AS StartDate,
       TRIM(wo.TYPEROUTING_WATRT) AS RoutingType,
       wo.DATEUPDATED_WAUPMJ AS DateUpdated,
       wo.TIMEOFDAY_WATDAY AS TimeUpdated
  FROM JDESTAGE.F4801_VIEW wo
