5821: * This procedure is equivalent to witpspr_po_req in wiltps4.ppc
5822: * This procedure is used to insert purchase order requisition into
5823: * PO_REQUISITIONS_INTERFACE_ALL
5824: * NOTES:
5825: * IF the purchase item lead time falls outside of BOM_CALENDAR_DATES
5826: * THEN no PO req will be created
5827: ****************************************************************************/
5828: PROCEDURE insert_po_req(p_gib IN group_rec_t,
5829: x_returnStatus OUT NOCOPY VARCHAR2) IS
6059: wip_operation_resources wor,
6060: bom_resources br,
6061: mtl_system_items msi,
6062: mtl_parameters mp,
6063: -- bom_calendar_dates bcd2, Bug 4398047 join to bcd2 not required
6064: bom_calendar_dates bcd4,
6065: -- bom_calendar_dates bcd1, Bug 4398047 join to bcd1 not required
6066: bom_calendar_dates bcd3,
6067: fnd_user fu,
6060: bom_resources br,
6061: mtl_system_items msi,
6062: mtl_parameters mp,
6063: -- bom_calendar_dates bcd2, Bug 4398047 join to bcd2 not required
6064: bom_calendar_dates bcd4,
6065: -- bom_calendar_dates bcd1, Bug 4398047 join to bcd1 not required
6066: bom_calendar_dates bcd3,
6067: fnd_user fu,
6068: bom_departments bd,
6061: mtl_system_items msi,
6062: mtl_parameters mp,
6063: -- bom_calendar_dates bcd2, Bug 4398047 join to bcd2 not required
6064: bom_calendar_dates bcd4,
6065: -- bom_calendar_dates bcd1, Bug 4398047 join to bcd1 not required
6066: bom_calendar_dates bcd3,
6067: fnd_user fu,
6068: bom_departments bd,
6069: hr_organization_information hoi,
6062: mtl_parameters mp,
6063: -- bom_calendar_dates bcd2, Bug 4398047 join to bcd2 not required
6064: bom_calendar_dates bcd4,
6065: -- bom_calendar_dates bcd1, Bug 4398047 join to bcd1 not required
6066: bom_calendar_dates bcd3,
6067: fnd_user fu,
6068: bom_departments bd,
6069: hr_organization_information hoi,
6070: wip_discrete_jobs wdj,
6270: NULL, -- group_code
6271: msi.buyer_id -- suggested_buyer_id
6272: FROM bom_resources br,
6273: bom_departments bd,
6274: bom_calendar_dates bcd1,
6275: bom_calendar_dates bcd2,
6276: fnd_user fu,
6277: mtl_system_items msi,
6278: mtl_parameters mp,
6271: msi.buyer_id -- suggested_buyer_id
6272: FROM bom_resources br,
6273: bom_departments bd,
6274: bom_calendar_dates bcd1,
6275: bom_calendar_dates bcd2,
6276: fnd_user fu,
6277: mtl_system_items msi,
6278: mtl_parameters mp,
6279: hr_organization_information hoi,
6483: wip_operation_resources wor,
6484: bom_resources br,
6485: mtl_system_items msi,
6486: mtl_parameters mp,
6487: -- bom_calendar_dates bcd2, Bug 4398047 join no longer required
6488: bom_calendar_dates bcd4,
6489: -- bom_calendar_dates bcd1, Bug 4398047 join no longer required
6490: bom_calendar_dates bcd3,
6491: fnd_user fu,
6484: bom_resources br,
6485: mtl_system_items msi,
6486: mtl_parameters mp,
6487: -- bom_calendar_dates bcd2, Bug 4398047 join no longer required
6488: bom_calendar_dates bcd4,
6489: -- bom_calendar_dates bcd1, Bug 4398047 join no longer required
6490: bom_calendar_dates bcd3,
6491: fnd_user fu,
6492: bom_departments bd,
6485: mtl_system_items msi,
6486: mtl_parameters mp,
6487: -- bom_calendar_dates bcd2, Bug 4398047 join no longer required
6488: bom_calendar_dates bcd4,
6489: -- bom_calendar_dates bcd1, Bug 4398047 join no longer required
6490: bom_calendar_dates bcd3,
6491: fnd_user fu,
6492: bom_departments bd,
6493: hr_organization_information hoi,
6486: mtl_parameters mp,
6487: -- bom_calendar_dates bcd2, Bug 4398047 join no longer required
6488: bom_calendar_dates bcd4,
6489: -- bom_calendar_dates bcd1, Bug 4398047 join no longer required
6490: bom_calendar_dates bcd3,
6491: fnd_user fu,
6492: bom_departments bd,
6493: hr_organization_information hoi,
6494: wip_discrete_jobs wdj,
6711: NULL, -- group_code
6712: MAX(msi.buyer_id) -- suggested_buyer_id
6713: FROM bom_departments bd,
6714: bom_resources br,
6715: bom_calendar_dates bcd1,
6716: bom_calendar_dates bcd2,
6717: fnd_user fu,
6718: mtl_item_revisions mir,
6719: mtl_system_items msi,
6712: MAX(msi.buyer_id) -- suggested_buyer_id
6713: FROM bom_departments bd,
6714: bom_resources br,
6715: bom_calendar_dates bcd1,
6716: bom_calendar_dates bcd2,
6717: fnd_user fu,
6718: mtl_item_revisions mir,
6719: mtl_system_items msi,
6720: mtl_parameters mp,