Monday, 31 October 2011

PO_DELIVERY_TERMS_UPD_QRY_v1.0

/* Formatted on 17-09-2011 21:58:33 (QP5 v5.115.810.9015) */
SELECT   FLV1.MEANING Delivery_Terms,
         FLV1.LOOKUP_CODE,
         FLV2.MEANING Freight,
         FLV2.DESCRIPTION,
         PH.SHIP_VIA_LOOKUP_CODE Carrier
  FROM   po_headers_all ph, FND_LOOKUP_VALUES FLV1, FND_LOOKUP_VALUES FLV2
 WHERE       FLV1.LOOKUP_CODE(+) = PH.FOB_LOOKUP_CODE
         AND FLV2.LOOKUP_CODE(+) = PH.FREIGHT_TERMS_LOOKUP_CODE
         AND FLV1.LOOKUP_TYPE(+) = 'FOB'
         AND FLV2.LOOKUP_TYPE(+) = 'FREIGHT TERMS'
         and FLV1.MEANING is not null and FLV2.MEANING is not null
        
Due
INCLUSIVE
PAID BY YOU
Paid
TOPAY
SELECT DISTINCT  SHIP_VIA_LOOKUP_CODE
  FROM   po_headers_All
 WHERE   segment1 IN (SELECT   po_no FROM XX_186_PO_FOB) AND org_id = 90
SELECT   FREIGHT_TERMS_LOOKUP_CODE, SHIP_VIA_LOOKUP_CODE, FOB_LOOKUP_CODE
  FROM   po_headers_All
 WHERE   segment1 IN (SELECT   po_no FROM XX_186_PO_FOB) AND org_id = 90 --and FOB_LOOKUP_CODE <> 'Ex Works'

 /* Formatted on 17-09-2011 22:07:00 (QP5 v5.115.810.9015) */
/* Formatted on 17-09-2011 22:07:27 (QP5 v5.115.810.9015) */
UPDATE   po_headers_All
   SET   FOB_LOOKUP_CODE = 'F.O.R  BALLARPUR'
 WHERE       FOB_LOOKUP_CODE = 'FOR  BALLARPUR'
         AND segment1 IN (SELECT   po_no FROM XX_186_PO_FOB)
         AND org_id = 90

    NEW
-----------
SELECT   FLV1.MEANING Delivery_Terms,
         ph.SEGMENT1 po_num,
        -- ph.org_id,
         ood.ORGANIZATION_NAME,
         ood.OPERATING_UNIT,
         FLV1.LOOKUP_CODE,
         FLV2.MEANING Freight,
         FLV2.DESCRIPTION,
         PH.SHIP_VIA_LOOKUP_CODE Carrier
  FROM   po_headers_all ph, FND_LOOKUP_VALUES FLV1, FND_LOOKUP_VALUES FLV2,org_organization_definitions ood
 WHERE       FLV1.LOOKUP_CODE(+) = PH.FOB_LOOKUP_CODE
         AND FLV2.LOOKUP_CODE(+) = PH.FREIGHT_TERMS_LOOKUP_CODE
         AND ood.OPERATING_UNIT(+) = ph.org_id
         AND FLV1.LOOKUP_TYPE(+) = 'FOB'
         AND FLV2.LOOKUP_TYPE(+) = 'FREIGHT TERMS'
         and FLV1.MEANING is not null and FLV2.MEANING is not null
        

No comments:

Post a Comment