Closed aaronallen8455 closed 2 years ago
let
recvWarehouse = buildMainWarehouse $ pociRecvWhse inputs
validatedSupplierData = pociValidatedSupplierData inputs
spurData = vsdSpurData validatedSupplierData
mkItemDetails
= buildItemCreatedDetailsFromPoadItem
(pociWarehouseItems inputs) (snd $ pociCostComponents inputs)
itemDetails
= fromListByKey icdItemCode
$ catMaybes
$ zipWith mkItemDetails [ItemSequence 1 .. ] (Poad.poadItems poad)
departureDateTime
= ExpectedDepartureDateTime . WDT.originalPickupDateToUTCTime
$ Poad.poadPickupDateTime poad
departureType = _
inventoryAnalyst = InventoryAnalystNumber "77"
in
PurchaseOrderCreatedDetails
{pocdWimsId = pociWimsId inputs, pocdState = Approved,
pocdSubType = derivePurchaseOrderSubtype,
pocdSupplier = buildSupplierFromSpur validatedSupplierData,
pocdCosts = fst $ pociCostComponents inputs,
pocdReceivingWarehouse = recvWarehouse,
pocdInventoryAnalystName = InventoryAnalystName "WFR",
pocdInventoryAnalystNumber = inventoryAnalyst,
pocdOrderSource = buildOrderSource Wfr,
pocdOrderedDateTime = pociOrderedDateTime inputs,
pocdOriginalDeparture = ExpectedDeparture
departureType departureDateTime,
pocdOriginalArrivalDateTime = Poad.poadArrivalDateTime poad,
pocdOrderTags = fromList $ pociExtraOrderTags inputs,
pocdNextTmsSequence = ItemSequence . fromIntegral
$ length itemDetails + 1,
pocdJdaLoadId = Just $ Poad.poadLoadId poad,
pocdFreightPaymentType = deriveFreightPaymentTypeFromSpurData
spurData,
pocdFreightType = deriveFreightTypeFromSpurData spurData,
pocdFreightBillType = None,
pocdEdiMode = spurToEdiMode $ Spur.posEDIMode spurData,
pocdSpurOriginLocationUuid = Nothing,
pocdITradeFacilityNumber = Nothing, pocdIsITradePo = IsNotITradePo,
pocdSupplierPickupReferenceNumber = Nothing,
pocdFpmConfirmCode = Nothing, pocdFpmDemandId = Nothing,
pocdItems = itemDetails}
"Relevant bindings include"
PurchaseOrderCreatedDetails
{pocdWimsId = pociWimsId inputs, pocdState = Approved,
pocdSubType = derivePurchaseOrderSubtype,
pocdSupplier = buildSupplierFromSpur validatedSupplierData,
pocdCosts = fst $ pociCostComponents inputs,
pocdReceivingWarehouse = recvWarehouse,
pocdInventoryAnalystName = InventoryAnalystName "WFR",
pocdInventoryAnalystNumber = inventoryAnalyst,
pocdOrderSource = buildOrderSource Wfr,
pocdOrderedDateTime = pociOrderedDateTime inputs,
pocdOriginalDeparture = ExpectedDeparture _ departureDateTime,
pocdOriginalArrivalDateTime = Poad.poadArrivalDateTime poad,
pocdOrderTags = fromList $ pociExtraOrderTags inputs,
pocdNextTmsSequence = ItemSequence . fromIntegral
$ length itemDetails + 1,
pocdJdaLoadId = Just $ Poad.poadLoadId poad,
pocdFreightPaymentType = deriveFreightPaymentTypeFromSpurData
spurData,
pocdFreightType = deriveFreightTypeFromSpurData spurData,
pocdFreightBillType = None,
pocdEdiMode = spurToEdiMode $ Spur.posEDIMode spurData,
pocdSpurOriginLocationUuid = Nothing,
pocdITradeFacilityNumber = Nothing, pocdIsITradePo = IsNotITradePo,
pocdSupplierPickupReferenceNumber = Nothing,
pocdFpmConfirmCode = Nothing, pocdFpmDemandId = Nothing,
pocdItems = itemDetails}
anything with an opening but no closing bracket