DBA Data[Home] [Help]

APPS.PO_AP_INVOICE_MATCH_GRP SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 31

PROCEDURE update_document_ap_values(
  p_api_version			IN		NUMBER
, p_line_loc_changes_rec	IN OUT NOCOPY	PO_AP_LINE_LOC_REC_TYPE
, p_dist_changes_rec		IN OUT NOCOPY	PO_AP_DIST_REC_TYPE
, x_return_status		OUT NOCOPY	VARCHAR2
, x_msg_data			OUT NOCOPY	VARCHAR2
)
IS
  l_api_version CONSTANT NUMBER := 1.0;
Line: 40

  l_api_name CONSTANT VARCHAR2(30) := 'update_document_ap_values';
Line: 47

  SAVEPOINT update_document_ap_values_SP;
Line: 90

  UPDATE po_line_locations_all pll
  SET quantity_billed =
        DECODE(p_line_loc_changes_rec.quantity_billed
               , NULL, quantity_billed
               , nvl(quantity_billed, 0) + p_line_loc_changes_rec.quantity_billed),
      amount_billed =
        DECODE(p_line_loc_changes_rec.amount_billed
               , NULL, amount_billed
               , nvl(amount_billed, 0) + p_line_loc_changes_rec.amount_billed),
      quantity_financed =
        DECODE(p_line_loc_changes_rec.quantity_financed
               , NULL, quantity_financed
               , nvl(quantity_financed, 0) + p_line_loc_changes_rec.quantity_financed),
      amount_financed =
        DECODE(p_line_loc_changes_rec.amount_financed
               , NULL, amount_financed
               , nvl(amount_financed, 0) + p_line_loc_changes_rec.amount_financed),
      quantity_recouped =
        DECODE(p_line_loc_changes_rec.quantity_recouped
               , NULL, quantity_recouped
               , nvl(quantity_recouped, 0) + p_line_loc_changes_rec.quantity_recouped),
      amount_recouped =
        DECODE(p_line_loc_changes_rec.amount_recouped
               , NULL, amount_recouped
               , nvl(amount_recouped, 0) + p_line_loc_changes_rec.amount_recouped),
      retainage_withheld_amount =
        DECODE(p_line_loc_changes_rec.retainage_withheld_amt
               , NULL, retainage_withheld_amount
               , nvl(retainage_withheld_amount, 0) + p_line_loc_changes_rec.retainage_withheld_amt),
      retainage_released_amount =
        DECODE(p_line_loc_changes_rec.retainage_released_amt
               , NULL, retainage_released_amount
               , nvl(retainage_released_amount, 0) + p_line_loc_changes_rec.retainage_released_amt),
      last_update_login = nvl(p_line_loc_changes_rec.last_update_login, last_update_login),
      request_id = nvl(p_line_loc_changes_rec.request_id, request_id)
  WHERE pll.line_location_id = p_line_loc_changes_rec.po_line_location_id
     OR (pll.shipment_type = 'PLANNED'
         AND pll.line_location_id =
             (SELECT pll2.source_shipment_id
              FROM   po_line_locations pll2
              WHERE  pll2.shipment_type = 'SCHEDULED'
              AND  pll2.line_location_id = p_line_loc_changes_rec.po_line_location_id)
     )
  ;
Line: 137

    PO_LOG.stmt(d_mod,d_position,'Line Locations updated: ' || SQL%ROWCOUNT);
Line: 145

  UPDATE po_distributions_all pod
  SET quantity_billed =
        DECODE(p_dist_changes_rec.quantity_billed_tbl(i)
               , NULL, quantity_billed
               , nvl(quantity_billed, 0) + p_dist_changes_rec.quantity_billed_tbl(i)),
      amount_billed =
        DECODE(p_dist_changes_rec.amount_billed_tbl(i)
               , NULL, amount_billed
               , nvl(amount_billed, 0) + p_dist_changes_rec.amount_billed_tbl(i)),
      quantity_financed =
        DECODE(p_dist_changes_rec.quantity_financed_tbl(i)
               , NULL, quantity_financed
               , nvl(quantity_financed, 0) + p_dist_changes_rec.quantity_financed_tbl(i)),
      amount_financed =
        DECODE(p_dist_changes_rec.amount_financed_tbl(i)
               , NULL, amount_financed
               , nvl(amount_financed, 0) + p_dist_changes_rec.amount_financed_tbl(i)),
      quantity_recouped =
        DECODE(p_dist_changes_rec.quantity_recouped_tbl(i)
               , NULL, quantity_recouped
               , nvl(quantity_recouped, 0) + p_dist_changes_rec.quantity_recouped_tbl(i)),
      amount_recouped =
        DECODE(p_dist_changes_rec.amount_recouped_tbl(i)
               , NULL, amount_recouped
               , nvl(amount_recouped, 0) + p_dist_changes_rec.amount_recouped_tbl(i)),
      retainage_withheld_amount =
        DECODE(p_dist_changes_rec.retainage_withheld_amt_tbl(i)
               , NULL, retainage_withheld_amount
               , nvl(retainage_withheld_amount, 0) + p_dist_changes_rec.retainage_withheld_amt_tbl(i)),
      retainage_released_amount =
        DECODE(p_dist_changes_rec.retainage_released_amt_tbl(i)
               , NULL, retainage_released_amount
               , nvl(retainage_released_amount, 0) + p_dist_changes_rec.retainage_released_amt_tbl(i)),
      last_update_login = nvl(p_dist_changes_rec.last_update_login_tbl(i), last_update_login),
      request_id = nvl(p_dist_changes_rec.request_id_tbl(i), request_id)
  WHERE pod.po_distribution_id = p_dist_changes_rec.po_distribution_id_tbl(i)
     OR (pod.distribution_type = 'PLANNED'
         AND pod.po_distribution_id =
             (SELECT pod2.source_distribution_id
              FROM   po_distributions pod2
              WHERE pod2.distribution_type = 'SCHEDULED'
              AND   pod2.po_distribution_id = p_dist_changes_rec.po_distribution_id_tbl(i)))
  ;
Line: 191

    PO_LOG.stmt(d_mod,d_position,'Distributions updated: ' || SQL%ROWCOUNT);
Line: 202

    ROLLBACK TO update_document_ap_values_SP;
Line: 213

END; --update_document_ap_values
Line: 283

  SELECT PO_SESSION_GT_S.nextval
  INTO l_gt_key
  FROM dual;
Line: 296

  INSERT INTO PO_SESSION_GT GTT(
    key,
    num1,
    num2
  )
  SELECT
    l_gt_key,
    p_line_location_id_tbl(i),
    NVL2(POL.max_retainage_amount,
          least(p_line_loc_match_amt_tbl(i) * (POL.retainage_rate/100),POL.max_retainage_amount - nvl(PO_LINES_INT.retained_amount,0)),
            p_line_loc_match_amt_tbl(i) * (POL.retainage_rate/100)
             )
  FROM PO_LINES_ALL POL,
       PO_LINE_LOCATIONS_ALL PLL,
              ( select  PLL1.po_line_id ,
                SUM(PLL1.RETAINAGE_WITHHELD_AMOUNT) retained_amount
                FROM  PO_LINE_LOCATIONS_ALL PLL1
                WHERE PLL1.po_line_id = (select po_line_id from po_line_locations_all PLL2
                                        where PLL2.line_location_id = p_line_location_id_tbl(i))
               GROUP BY PLL1.po_line_id
      ) PO_LINES_INT
  WHERE PLL.line_location_id = p_line_location_id_tbl(i)
  AND   POL.po_line_id = PLL.po_line_id
  AND   PO_LINES_INT.po_line_id = POL.po_line_id
  ;
Line: 325

  SELECT GTT.num2
  BULK COLLECT INTO x_amount_to_retain_tbl
  FROM PO_SESSION_GT GTT
  WHERE GTT.key = l_gt_key
  ORDER BY GTT.num1  --input and output tbls have same ordering
  ;
Line: 335

  DELETE FROM PO_SESSION_GT GTT WHERE GTT.key = l_gt_key;
Line: 427

       SELECT pll.amount,
              pll.amount_cancelled
       INTO   x_ship_amt_ordered,
              x_ship_amt_cancelled
       FROM   po_line_locations pll,
              rcv_transactions rt
       WHERE  rt.po_line_location_id = pll.line_location_id
       AND    rt.transaction_id = p_receive_transaction_id;
Line: 508

       SELECT pod.amount_ordered,
              pod.amount_cancelled
       INTO   x_dist_amt_ordered,
              x_dist_amt_cancelled
       FROM   po_distributions pod
       WHERE  pod.po_distribution_id = p_po_distribution_id;
Line: 556

PROCEDURE update_po_ship_amounts (p_api_version              IN          NUMBER,
                                  p_po_line_location_id      IN          PO_LINE_LOCATIONS_ALL.line_location_id%TYPE,
                                  p_ship_amt_billed          IN          PO_LINE_LOCATIONS_ALL.amount_billed%TYPE,
                                  x_ret_status               OUT NOCOPY  VARCHAR2,
                                  x_msg_count                OUT NOCOPY  NUMBER,
                                  x_msg_data                 OUT NOCOPY  VARCHAR2)   IS

l_api_name              CONSTANT VARCHAR2(30) := 'update_po_ship_amounts';
Line: 580

       UPDATE po_line_locations_all
       SET    amount_billed = nvl(amount_billed,0) + nvl(p_ship_amt_billed,0)
       WHERE  line_location_id = p_po_line_location_id;
Line: 626

PROCEDURE update_po_dist_amounts (p_api_version              IN          NUMBER,
                                  p_po_distribution_id       IN          PO_DISTRIBUTIONS_ALL.po_distribution_id%TYPE,
                                  p_dist_amt_billed          IN          PO_DISTRIBUTIONS_ALL.amount_billed%TYPE,
                                  x_ret_status               OUT NOCOPY  VARCHAR2,
                                  x_msg_count                OUT NOCOPY  NUMBER,
                                  x_msg_data                 OUT NOCOPY  VARCHAR2)   IS

l_api_name              CONSTANT VARCHAR2(30) := 'update_po_dist_amounts';
Line: 650

       UPDATE po_distributions_all
       SET    amount_billed = nvl(amount_billed,0) + nvl(p_dist_amt_billed,0)
       WHERE  po_distribution_id = p_po_distribution_id;
Line: 748

	       UPDATE po_line_locations_all
	       SET    final_match_flag = p_final_match_flag
	       WHERE  line_location_id = p_entity_id_tbl(i);