DBA Data[Home] [Help]

APPS.GML_OP_CUST_MST_PKG dependencies on OP_CUST_MST

Line 1: PACKAGE BODY GML_OP_CUST_MST_PKG AS

1: PACKAGE BODY GML_OP_CUST_MST_PKG AS
2: /* $Header: GMLUPDB.pls 115.13 2002/10/18 20:55:00 gmangari ship $ */
3:
4:
5: /*#############################################################################

Line 13: # To update the customer balances in op_cust_mst and op_updt_bal_wk

9: #
10: # DESCRIPTION
11: #
12: #
13: # To update the customer balances in op_cust_mst and op_updt_bal_wk
14: #
15: #
16: # MODIFICATION HISTORY
17: #

Line 54: FROM op_cust_mst;

50: --End Bug#2611290
51:
52: CURSOR Cur_max_cust_id IS
53: SELECT MAX(cust_id)
54: FROM op_cust_mst;
55:
56: /*Begin Bug#2611290 Piyush K. Mishra
57: Changed the NVL used in below query, previously it was
58: NVL(V_from_cust_no, 'X') and NVL(V_from_cust_no, 'X').

Line 69: FROM op_cust_mst cus, op_ordr_hdr hdr

65: hdr.order_id,
66: hdr.order_date,
67: hdr.billing_currency,
68: SUM(hdr.total_open_amount) total_open_amount
69: FROM op_cust_mst cus, op_ordr_hdr hdr
70: WHERE hdr.billcust_id = cus.cust_id and
71: hdr.completed_ind <> -1 and
72: hdr.delete_mark = 0 and
73: hdr.order_status < 20 and

Line 75: (cus.cust_id IN(SELECT cust_id from op_cust_mst where cust_no >= NVL(V_from_cust_no, cust_no)) and

71: hdr.completed_ind <> -1 and
72: hdr.delete_mark = 0 and
73: hdr.order_status < 20 and
74: -- hdr.billcust_id = cus.cust_id and
75: (cus.cust_id IN(SELECT cust_id from op_cust_mst where cust_no >= NVL(V_from_cust_no, cust_no)) and
76: (cus.cust_id IN(SELECT cust_id from op_cust_mst where cust_no <= NVL(V_to_cust_no, cust_no)))) and
77: cus.co_code = V_co_code
78: GROUP BY cus.cust_id,
79: cus.cust_no,

Line 76: (cus.cust_id IN(SELECT cust_id from op_cust_mst where cust_no <= NVL(V_to_cust_no, cust_no)))) and

72: hdr.delete_mark = 0 and
73: hdr.order_status < 20 and
74: -- hdr.billcust_id = cus.cust_id and
75: (cus.cust_id IN(SELECT cust_id from op_cust_mst where cust_no >= NVL(V_from_cust_no, cust_no)) and
76: (cus.cust_id IN(SELECT cust_id from op_cust_mst where cust_no <= NVL(V_to_cust_no, cust_no)))) and
77: cus.co_code = V_co_code
78: GROUP BY cus.cust_id,
79: cus.cust_no,
80: cus.cust_name,

Line 188: UPDATE op_cust_mst

184: is executed. This should be executed only once per customer before updating
185: the open balance with the open amounts from sales orders */
186:
187: IF X_prvs_cust_id <> X_cust_details.cust_id THEN
188: UPDATE op_cust_mst
189: SET open_balance = 0
190: WHERE bill_ind = 1
191: AND co_code = V_co_code
192: AND cust_id = X_cust_details.cust_id;

Line 196: FROM op_cust_mst cus,op_ordr_hdr hdr

192: AND cust_id = X_cust_details.cust_id;
193: /*Commented following conditions
194: AND cust_id NOT IN
195: (SELECT cust_id
196: FROM op_cust_mst cus,op_ordr_hdr hdr
197: WHERE hdr.billcust_id = cus.cust_id
198: AND hdr.completed_ind <> -1
199: AND hdr.delete_mark = 0
200: AND hdr.order_status < 20

Line 202: AND (cus.cust_id IN(SELECT cust_id from op_cust_mst where cust_no >= NVL(V_from_cust_no,'X'))

198: AND hdr.completed_ind <> -1
199: AND hdr.delete_mark = 0
200: AND hdr.order_status < 20
201: AND hdr.billcust_id = cus.cust_id
202: AND (cus.cust_id IN(SELECT cust_id from op_cust_mst where cust_no >= NVL(V_from_cust_no,'X'))
203: AND (cus.cust_id IN(SELECT cust_id from op_cust_mst where cust_no <= NVL(V_to_cust_no,'X')))));*/
204: X_prvs_cust_id := X_cust_details.cust_id;
205: END IF;
206: /*End Bug#2611290*/

Line 203: AND (cus.cust_id IN(SELECT cust_id from op_cust_mst where cust_no <= NVL(V_to_cust_no,'X')))));*/

199: AND hdr.delete_mark = 0
200: AND hdr.order_status < 20
201: AND hdr.billcust_id = cus.cust_id
202: AND (cus.cust_id IN(SELECT cust_id from op_cust_mst where cust_no >= NVL(V_from_cust_no,'X'))
203: AND (cus.cust_id IN(SELECT cust_id from op_cust_mst where cust_no <= NVL(V_to_cust_no,'X')))));*/
204: X_prvs_cust_id := X_cust_details.cust_id;
205: END IF;
206: /*End Bug#2611290*/
207:

Line 210: UPDATE op_cust_mst

206: /*End Bug#2611290*/
207:
208: --Begin Bug#2521042 Piyush K. Mishra
209: --Open_balance should be updated with open_balance + X_cust_details.total_open_amount
210: UPDATE op_cust_mst
211: SET open_balance = Open_balance + X_cust_details.total_open_amount
212: WHERE cust_id = X_cust_details.cust_id
213: AND co_code = V_co_code;
214: --End Bug#2521042

Line 223: UPDATE op_cust_mst

219: /* Begin Bug#2611290 Piyush K. Mishra */
220: /* This update statement updates the open balances to zero, for the customers for whom no
221: open amounts exist and are within the range criteria. The customers fetched in the above
222: loop are excluded in this update. */
223: UPDATE op_cust_mst
224: SET open_balance = 0
225: WHERE bill_ind = 1
226: AND co_code = V_co_code
227: AND cust_id NOT IN

Line 229: FROM op_cust_mst cus,op_ordr_hdr hdr

225: WHERE bill_ind = 1
226: AND co_code = V_co_code
227: AND cust_id NOT IN
228: (SELECT cust_id
229: FROM op_cust_mst cus,op_ordr_hdr hdr
230: WHERE hdr.billcust_id = cus.cust_id
231: AND hdr.completed_ind <> -1
232: AND hdr.delete_mark = 0
233: AND hdr.order_status < 20

Line 234: AND (cus.cust_id IN(SELECT cust_id from op_cust_mst where cust_no >= NVL(V_from_cust_no,cust_no))

230: WHERE hdr.billcust_id = cus.cust_id
231: AND hdr.completed_ind <> -1
232: AND hdr.delete_mark = 0
233: AND hdr.order_status < 20
234: AND (cus.cust_id IN(SELECT cust_id from op_cust_mst where cust_no >= NVL(V_from_cust_no,cust_no))
235: AND (cus.cust_id IN(SELECT cust_id from op_cust_mst where cust_no <= NVL(V_to_cust_no,cust_no)))))
236: AND (cust_id IN(SELECT cust_id from op_cust_mst where cust_no >= NVL(V_from_cust_no, cust_no))
237: AND (cust_id IN(SELECT cust_id from op_cust_mst where cust_no <= NVL(V_to_cust_no, cust_no))));
238: /* End Bug#2611290 */

Line 235: AND (cus.cust_id IN(SELECT cust_id from op_cust_mst where cust_no <= NVL(V_to_cust_no,cust_no)))))

231: AND hdr.completed_ind <> -1
232: AND hdr.delete_mark = 0
233: AND hdr.order_status < 20
234: AND (cus.cust_id IN(SELECT cust_id from op_cust_mst where cust_no >= NVL(V_from_cust_no,cust_no))
235: AND (cus.cust_id IN(SELECT cust_id from op_cust_mst where cust_no <= NVL(V_to_cust_no,cust_no)))))
236: AND (cust_id IN(SELECT cust_id from op_cust_mst where cust_no >= NVL(V_from_cust_no, cust_no))
237: AND (cust_id IN(SELECT cust_id from op_cust_mst where cust_no <= NVL(V_to_cust_no, cust_no))));
238: /* End Bug#2611290 */
239:

Line 236: AND (cust_id IN(SELECT cust_id from op_cust_mst where cust_no >= NVL(V_from_cust_no, cust_no))

232: AND hdr.delete_mark = 0
233: AND hdr.order_status < 20
234: AND (cus.cust_id IN(SELECT cust_id from op_cust_mst where cust_no >= NVL(V_from_cust_no,cust_no))
235: AND (cus.cust_id IN(SELECT cust_id from op_cust_mst where cust_no <= NVL(V_to_cust_no,cust_no)))))
236: AND (cust_id IN(SELECT cust_id from op_cust_mst where cust_no >= NVL(V_from_cust_no, cust_no))
237: AND (cust_id IN(SELECT cust_id from op_cust_mst where cust_no <= NVL(V_to_cust_no, cust_no))));
238: /* End Bug#2611290 */
239:
240: END UPDATE_CUST_BALANCE;

Line 237: AND (cust_id IN(SELECT cust_id from op_cust_mst where cust_no <= NVL(V_to_cust_no, cust_no))));

233: AND hdr.order_status < 20
234: AND (cus.cust_id IN(SELECT cust_id from op_cust_mst where cust_no >= NVL(V_from_cust_no,cust_no))
235: AND (cus.cust_id IN(SELECT cust_id from op_cust_mst where cust_no <= NVL(V_to_cust_no,cust_no)))))
236: AND (cust_id IN(SELECT cust_id from op_cust_mst where cust_no >= NVL(V_from_cust_no, cust_no))
237: AND (cust_id IN(SELECT cust_id from op_cust_mst where cust_no <= NVL(V_to_cust_no, cust_no))));
238: /* End Bug#2611290 */
239:
240: END UPDATE_CUST_BALANCE;
241:

Line 242: END GML_OP_CUST_MST_PKG;

238: /* End Bug#2611290 */
239:
240: END UPDATE_CUST_BALANCE;
241:
242: END GML_OP_CUST_MST_PKG;