You are on page 1of 12
© ong-es 9 BS: FLAN —wron ising ie Finney FIFO Accounting wy? 1. Questions ony bngpticinn 2 tei © Oy) Gain” 2, TaekFFO layers (PPV STD by tem aro liv ores (001 002, ,tmteyee 2%) Parameters " 1 Made "Ppv auld & Rate, sro Bute, ‘sroReler MG) lege. tov> Reliowe (ord ILGLDate— default SYSDATE Relic & 2 i, Initial Load—"Yes,No (default to No} PPVBulld & Ralef Logie 1 initia toad 1 Qacrtiod y Fey Bud & Rolf Negi bow voyinonat fe Sal loaves Mew abel ‘sro ik! eg! Soc the item quantity across the 3 inventory orgs Select snventory. item, sumloa.e oh aty ~ FROM invmt_parameters mp -invmtl_system _tems_b st ‘invatl_onhand_quantites-detall oq WHERE mp attrbuteS in (RETAL’ WAREHOUSE: DISTRIBUTION and sinventory_item_jd= oginventory_ teria troup bys. iventory fem id Sect the current standard cost foreach ite Selec ematela_cost from itl_parameters mp bom es tem costo bom est_cost types ct eze mp organization = mp:master_orgniation Jd and icinventory_ftem_ld= sinventory Item. from query #2 above, this section and icorganizaton_id = mp.organtzation i and iccosttype_id=cteost typed and ctcost types Frozen" 2S_INV_FIFO_LAVERS fle LAvER_NUM ~cet to LAYER_TYPE—set to "PPV" ITEM_ID-sLinventory, tem rom query #2 above, this section 4 INTIAL_ATY--sum(oq primary transaction_quantiy) from ‘query #1 above this section (e REUEVED_OTY-set 190 4. LAYER_COST-iemateral_cost from query #2 above, this seation REUEF_cOsT-set too /h. CREATION_OATE ~set to SYSDATE i CREATED_BY~ set to userId submitng conc request LAST_UPOATE_DATE set to SYSDATE K. LAST_UPDATED_8Y-set to user id submiting conc request iuSubsequent Runs 1. alleurrent quantity on hand (CUR_AITY) sing query #1 above in In Ru section 2. Pullcurent standard cost (CUR_STD) wing query #2 above in tia Run section 3. Select date of lst PPV layer created Select max{ereation date) maxct rom wes, ow_ffo layers where layer_type «PPV 4. Sumall ofthe receipts for an tem since the creation date ofthe Tas ayer for this tem select sume quantity) LYR_ATY, sume. quantity * ee po_unt._ price) uname from incantl_parameters mp pore transactions “pore shipment nes ‘iene mpattbte in (METAL -waRENOUsE oxsaaumiON (EQ cenreR and mp.organiation d= rLorgaizatlon td and rttransaction date > man(reation date from query #3 above, thissection and restination_type_code = INVENTORY And shipment line id tlshipment nei ‘and aitem i sinventory item _l fom query #1 above i ntl fun secon 5. Add next PPV layer, XXS_INV_FIFO_LAVERS lds ‘8. LAYER_NUM-~set to NEW LYR using SOL below ‘solctnlfmaxayernur.o) +2 NEW_LYR, rfmaxtayer_num)) OLD_LYR from wesw ffo layers ‘where item id= sLnventory. item. from query above in ita Run section LAYER 1YPE set to PPV" ITEM 0 -sLinventory_em_lefrom query #1 above in Inia Run ection INITIALOTY~L¥R_OTY fem query #8 above, this section REUEVED QTY set too LAYER _COST—LYR_AMT/ LYR_ATY fom query #4 above, this section RELIEF_COST-LAYER_COST—CUR_STD ‘CREATION_DATE —set to SYSDATE ‘CREATED_BY—st to userid submitting conc request LAST_UPDATE_DATE- sett SYSDATE LST_UPDATED_BYset o user submiting cone request ‘Then populate the GL_INTERFACE table as follows (2 recon): 1. STATUS "NEW H.LEDGER_O select oLorg_ information! from ivamt_parameters mp + heshr_organization_information a ‘winere mp. organization id imp.master_orgnization id and mp.organitation id=olorganizaton Id and olorg. information conte = Accounting Information” WL ACCOUNTING_DATE parameter GLa I. OURRENCY_CODE-"USD" \V.DATE_CREATED- SYSDATE We CREATED_BY -ueer id submit cane request Wi ACTUAL FLAG~'A i. USER JE_CATEGORY_NAME~ "INTERFACE __USER_JE_SOURCE_NAME ‘PPV LAYER’ SEGMENT —"200" i SEGMENT? ~ 00900" i. SEGMENTS (record) "1475" ll, SEGMENTS (record 2) -'3463" iv, ENTERED_OR (record) ~IFLYR_RLV_AMT > 0, then LVR_RLY_ AMT ENTERED CR (record #2) IFLYR_RLV_AMT <0, ‘then LR_RLV_AMT di ENTERED DR (rcord #2} ~ifLYR_RLV_AMT 0, ‘then LR_RLY_AMT ‘m. REFERENCE10~ concatenate mt_syster_items_b Segment using inventory Item_id frm query #1 above in Intl Run section |] ** "PPV LAYER’ [1 ** [I %S_INV_FIFO_LAYERS. LAYER NUM 5. Galeuate previous onhand quantity select sumo primary transaction quantity) PREV_TY FROM invant_ parameters mp imme onhand_quanttes. dtalog ‘WHERE mp attdbutetS in (RETAIL, WAREHOUSE, ‘CENTER) and mp organization. = oq organization ‘and oq inventory_Item_Id= sLventory. tem te from query a ‘boven Initial Run sation ‘and 04 date_received < mayfreation date) rom query #3 above, this section risTRIBUTION 7. Caleulate quantity tobe relieved 2. RLV_QTY= PREV_ATY +LYR_AQTY-CUR_ATY {8 Repeat the following steps unl RLY_ATY is exhausted, starting with ‘the first layer lowest ayer_num al) that has quant raleve (04S _INV_FIFO_LAVERS, INTIAL QTY RELIEVED_aTY >) LYR_RLV_QTY = RLV_ATY— QO _INV_FIFO_LAVERS. INITIAL GTY—09S_V_FIFO_UAYERS, RELIEVED_aTY) b. Update0s_W_FIFO_LAYERS. RELIEVED _ATY= 5, INV_FIFO_LAVERS, RELIVED QTY» YR. RLY_aTY LYR_ALV_AMT= LYR_RLV_QTY*906_INV_FIFO_LAYERS. REUEr_cost IFLYR_RLV_AMIF <>, then populte the GL_INTERFACE table as follows 2 records): |. STATUS "NEW .LEDGER IO ‘select oLorg_Informationt {rom inv mt_parameters mp | Rehr_organzation information ol ‘where mp oreanzation id= rmpaster_orgaization id and mp.organzaton_Id=oLorsanzation 16 and olorg_Information context = "Accounting Information’ |i. ACCOUNTING DATE parameter ‘6LDate! | _cUnReNcy_cove — uso’ \.DATE_CREATED- SYSDATE WW. CREATED_BY -user_Id submitting cone request vil. ACTUAL FLAG~'A' Vil. USER_IE_CATEGORY_NAME™ "INTERFACE" Jn. USER_JE_SOURCE_NAME ‘PPV RELIEF” x SEGMENT "200° Ml SEGMENT? ~ 00900" vil, SEGMENTS (recor) = 11473 il, SEGMENTS (record) - "3463 iv, ENTERED_OR (ecord i} —ifLYR_RLV_AMT <0, then LR_RLY_AMT ENTERED CR (record #2) —iFLYR_RLV_AMT >0, then LR_RLV_AMT vi ENTERED DR (record 82}IfLYR_RLV_AMT > 0, then URRLV_AMT vi, ENTERED CR record #2) LYR_RLV_AWT <0, then LYR_RLV_AMT vl, REFERENCEIO~ concatenate ‘mt syterm_items_b egmentL using Inventory_tem from query ft above In it Run section ||| PPVLAYER’ "| XS_I_FIFO_LAVERS.LAYER_ NUM STD Build Loge 1 Select the tems whose cst was changed inthe ast cost update, along with the curent standard cost and east updated ‘lect scnventory_tem Id scstandard_cost CUR STD, sc.cost updated ‘rom bom.st_standard_cost where secost update = (select maxcu.cost_updete id) from mt!_parameters mp | bomst_coet updates cu “where mp organization id= mpamaster_organzation 1 and mp organization jd = eu.orgaization 8) For each tem returned in query HL above, this section, select the tem quantity aeossthe 3imventory orgs Solecsinvetory_tem_[4, sumloqprimary_transation quantity) oh_aty FROM nvint_ parameters mp li mt_systom_jtems_ s ‘lw mtl_onhand_quanttes detallog WHERE mp.atributelS in (RETAIL WAREHOUSE, DISTRIBUTION CENTER) and mporganizaton id= organization Id and sinventory_jtem_id»scinventory_item_Id from query this section and sorganzaton id= o9rganitation 1d and sinventory_tem id= on inventory item Id sroup by sl. inventory_tem id 3. For each item returned in query above, pul the previous standard cost fortis item selec scstandard_cost PREV_SID from bom.est standard costs -mt|_parameters mp were scinventory_item_i4=scinventory. tem Id from query, this Seation and seorganization_l= mp,organzatlon_d and mprganzation_id= mp.master_orgaization_id and secost_updote i (select mansc2 cost updated) from bom.st_standard_ cost se2 where se2.cost updated <5ccost_update_ld from query this section ‘and se2.nventery, tem. =sc.nventory item id ‘ad se2.organization id= sc.orgnization id) 4. _INV_FIFO_LAVERS lds ‘3. LAYER NUM~ sett 1 for item's fat aye, then increment by 1 b. LAYER TYPE sett SID” {© TEM_1D~sLinventory. tem. from query #1 above this section 44 INTIAL_QTY -sumjog.pimary transaction quantity rom query #2 above, tis section AEUEVEO_ATY~eetto0 f. LAYER_COST~ CUR_STD ~PREV_STO from query #1 88 above, this ection 4 RELIEF_COST~zett00 hh, CREATION_DATE~set to SYSDATE ‘ i CREATED_BY ~settousr_id submitting cone request AST_UPOATE_DATE ~set to SYSDATE I. LAST_UPDATED_8Y-set to user submitting cone esuest fe. STO Ree Lape 4 Pull current quantity on hand (CUR_ATY) using query above in nial Run section PPV Bull & Rel Logie) 2. Pull current standard cost(CUR_STO) using query 2 above in nial Run section (PPV Buld& Rell Logie) 5. Select date of last TO ayer created select maxfcreation date) maxdt from os.6_Invfifo_ayers winerelayer_type «STO! 4 Sumall ofthe recaps for an tem since the creation. date ofthe last ayer for thisitem selec sum(.quanty) LYR_ary, sum(rt.quantity *r.po_unt pice) LyR_awr {rom invant_ parameters mp _ po.rey transactions {or shipmentlines sl ‘WHERE mp.atuibutds in (RETAIL WAREHOUSE, OISTRIBUTION CENTER) and mp.organivation id= rtorganztion_ and rtransaction_date> mayfereatlon-date) from query 43 above, this section and r.destination_type_code = INVENTORY fd shipment ne H= lhinment fine and rsitem. id shiventry item i fom query #1 above in nil Run section (PV Build & Rell Logie) Caleulate previous onkand quantity selec sum(oq primary transaction. quantity) PREV _ATY FROM invmt_parameters mp sivatl_onhand quantities detail og [WHERE rp attribute in (RETAIL WAREHOUSE, DISTRIBUTION CENTER) and mp.xganzation 1d = on.rganzation id an ogirwentory.tem_fd= shwentory_jtem_i from query above in Inia Run section (PPV Bull & Rel Loge) and og date_ received < manfereation date) from query #3 above, tis section 0) a. WYRRLY_aTY 1 IFRUY_ATY >= (XXS_INV_FIFO_LAVERS. INITIAL QTY 01S _INV_FIFO_LAVERS, RELEVED_AITY), then ¥%S_INV_FIFO_LAYERSINTIAL_CTY— 21S _INV_FFO_LAVERS, RELIEVED_aTY LIF ROV_QTY « 04S-INV_IFO_LAVERS, INITIAL aT ~ 1S.INV_FIFO_LAVERS, RELIEVED _ QTY), then = nuv_ay b. Update XS_IV_FIFO_LAYERS,RELEVED_CTY = 2S_INV_FIFO_LAVERS.RELVED QTY + LYR_RLY_aTY Reule_cost 14 LR RUV_AMT <>, then populate the GL_INTEREACE table as follows (2 record} L STaTUS~ "NEW" LEDGER select oLorg_Information! from invnt_parameters mp -hchr_orgaization_jnformationo| ‘where mp organization id= rmp.master_ organization id and mporganization_Id=ol.oganization id and oLarg_Information_context= "Accounting Information’ i, ACCOUNTING_DATE parameter ‘GL Date! |v. _CURRENEY_CODE ~ ‘uso’ \V-DATE_CREATED- SYSOATE We CREATED BY -usr_id submiting cone request vi ACTUAL FLAG "8" i, USER_JE_CATEGORY_NAME "INTERFACE f_USERLIE_SOURCE_NAME- ‘STD RELIEF” x SEGMENT "200" 8. SEGMENT? 00500" Xi SEGIENTS (record #3) -"1475" vl SEGWMENTS (coed 2) -"463" xiv, ENTERED_OR (record #1) FLYR_RLV_AMT <0, then LYR_RL_AM vu, ENTERED CR (record 1) LYR_RLV_AMT>0, vu, ENTERED DR (record 2) ~IFLYR_RUW_AMT>0, then LYR_RLV_AMT dell. ENTERED CR (record #2) ~ifLYR_ALV_AMT <9, then LYR_RLV_AMT 1 REFERENCE1O— concatenate mt_system_Items._b segment using Inventory tem i rom query # above initial Run section || || STO LAYER” [111 996_IW_FIFO_LAYERS.LAYER_NUM cie-nac- @) OX 74S eo sma) eS a = OZ £18 F o~ 81S = piy-gursrtay — WL-THUINI TIX i ©

You might also like