DBA Data[Home] [Help]

PACKAGE: APPS.WMS_CARTNZN_PUB

Source


1 PACKAGE WMS_CARTNZN_PUB AS
2 /* $Header: WMSCRTNS.pls 120.3 2008/01/28 18:30:55 rsagar ship $*/
3 
4 
5 -- File        : WMSCRTNS.pls
6 -- Content     : WMS_CARTNZN_PUB package specification
7 -- Description : WMS cartonization API
8 -- Notes       :
9 -- Modified    : 09/12/2000 cjandhya created
10 
11 -- MOdified    : 03/13/2002 cjandhya Added Multilevel Cartonization
12 
13 -- API name    : cartonize
14 -- Type        : group
15 -- Function    : populates the cartonization_id, container_item_id columns,
16 --               of rows belonging to a particular move order header id in
17 --               mtl_material_transactions_temp.
18 
19 -- Pre-reqs    :  Those columns won't be populated if the cartonization_id
20 --                for that row is already populated,
21 --                or if values for organization_id, inventory_item_id ,
22 --                primary qunatity, transaction_quantity,  transaction_uom,
23 --                trans action_temp_id are not all filled or if there is no
24 --                conversion defined between primary and transaction uoms of
25 --                the item of interest. each item has to be assigned to a
26 --                category of contained_item category set and that category
27 --                should have some container items.
28 --                The lines that can be packed together are identified by the
29 --                carton_grouping_id(MTL_TXN_REQEST_LINES) for the
30 --                move_order_line_id of that line.
31 
32 
33 -- Parameters  :
34 --   p_api_version          Standard Input Parameter
35 --   p_init_msg_list        Standard Input Parameter
36 --   p_commit               Standard Input Parameter
37 --   p_validation_level     Standard Input Parameter
38 --   l_out_bound            specifies if the call is for outbound process
39 --   org_id                 organization_id
40 --   l_move_order_header_id header_id for the lines to be cartonized
41 
42 
43 -- Output Parameters
44 --   x_return_status        Standard Output Parameter
45 --   x_msg_count            Standard Output Parameter
46 --   x_msg_data             Standard Output Parameter
47 
48 -- Version
49 --   Currently version is 1.0
50 
51 
52 
53 -- Package constants for different modes in which cartonization is called
54 
55 PR_pKG_mode              NUMBER := 1;--Pick Release Mode
56 int_bP_pkg_mode          NUMBER := 2;--Bulk Pack mode, invoked from interface tables
57 mob_bP_pKG_mode          NUMBER := 3;--Bulk Pack mode, invoked from mobile forms
58 prepack_pkg_mode         NUMBER := 4;--Prepack mode, invoked by prepack conc prog
59 mfg_pr_pkg_mode          NUMBER := 5;--Manufacturing Pick Release Mode
60 
61 
62 g_org_cartonization_value      NUMBER;
63 g_org_cartonize_so_flag        VARCHAR2(1) := 'N';
64 g_org_cartonize_mfg_flag       VARCHAR2(1) := 'N';
65 g_org_allocate_serial_flag     VARCHAR2(1) := 'N';
66 g_default_pick_op_plan_id      NUMBER;
67 g_auto_pick_confirm_flag       VARCHAR2(1);
68 g_percent_fill_basis           VARCHAR2(1) :='W';
69 g_autocreate_delivery_flag     VARCHAR2(1);
70 
71 --Bug 2745834 fix
72 g_wms_pack_hist_seq NUMBER := 1;
73 
74   --for device integration
75 subtype mmtt_row is mtl_material_transactions_temp%ROWTYPE;
76 
77  lpns_generated_tb  inv_label.transaction_id_rec_type;
78 
79 
80 FUNCTION get_lpn_alloc_flag(p_temp_id IN NUMBER) RETURN VARCHAR2;
81 
82 PROCEDURE cartonize(
83 		    p_api_version           IN    NUMBER,
84 		    p_init_msg_list         IN    VARCHAR2 :=fnd_api.g_false,
85 		    p_commit                IN    VARCHAR2 :=fnd_api.g_false,
86 		    p_validation_level      IN    NUMBER   :=fnd_api.g_valid_level_full,
87                     x_return_status	    OUT   NOCOPY VARCHAR2,
88 		    x_msg_count       	    OUT   NOCOPY NUMBER,
89 		    x_msg_data        	    OUT   NOCOPY VARCHAR2,
90 		    p_out_bound             IN    VARCHAR2 DEFAULT 'Y',
91                     p_org_id                IN    NUMBER,
92 		    p_move_order_header_id  IN    NUMBER   DEFAULT  0,
93 		    p_disable_cartonization IN    VARCHAR2 DEFAULT 'N',
94 		    p_transaction_header_id IN    NUMBER   DEFAULT  0,
95 		    p_stop_level            IN    NUMBER   DEFAULT  -1,
96 		    p_PACKAGING_mode        IN    NUMBER   DEFAULT  1,
97 		    p_input_for_bulk        IN    WMS_BULK_PICK.bulk_input_rec  DEFAULT null);
98 
99 PROCEDURE UPDATE_MMTT(
100 		      p_transaction_temp_id  	IN  	NUMBER,
101 		      p_primary_quantity        IN      NUMBER,
102 		      p_transaction_quantity    IN      NUMBER,
103                       p_secondary_quantity      IN      NUMBER DEFAULT NULL, --invconv kkillams
104 		      p_LPN_string              IN      VARCHAR2 DEFAULT NULL,
105 		      p_lpn_id                  IN      NUMBER DEFAULT NULL,
106 		      p_container_item_id       IN      NUMBER,
107 		      p_parent_line_id          IN      NUMBER := -99999,
108 		      p_upd_qty_flag            IN      VARCHAR2 DEFAULT 'Y',
109 		      x_return_status	        OUT 	NOCOPY VARCHAR2,
110 		      x_msg_count       	OUT 	NOCOPY NUMBER,
111 		      x_msg_data        	OUT 	NOCOPY VARCHAR2);
112 
113 PROCEDURE INSERT_MMTT(
114 		      p_transaction_temp_id  	IN  	NUMBER,
115 		      p_primary_quantity        IN      NUMBER,
116 		      p_transaction_quantity    IN      NUMBER,
117                       p_secondary_quantity      IN      NUMBER DEFAULT NULL, --invconv kkillams
118 		      p_LPN_string              IN      VARCHAR2 DEFAULT NULL,
119 		      p_lpn_id                  IN      NUMBER DEFAULT NULL,
120 		      p_container_item_id       IN      NUMBER DEFAULT NULL,
121 		      p_new_txn_hdr_id          IN      NUMBER DEFAULT NULL,
122 		      p_new_txn_tmp_id          IN      NUMBER DEFAULT NULL,
123 		      p_clpn_id                 IN      NUMBER DEFAULT NULL,
124 		      p_item_id                 IN      NUMBER DEFAULT NULL,
125 		      x_return_status	        OUT 	NOCOPY VARCHAR2,
126 		      x_msg_count       	OUT 	NOCOPY NUMBER,
127 		      x_msg_data        	OUT 	NOCOPY VARCHAR2);
128 
129 PROCEDURE log_event(p_message	VARCHAR2);
130 
131 PROCEDURE test;
132 
133 FUNCTION get_log_flag RETURN VARCHAR2;
134 
135 FUNCTION do_cartonization( mohdrid NUMBER,trxhdrid number, outbound VARCHAR2, sublvlctrl VARCHAR2, per_fill VARCHAR2) RETURN NUMBER;
136 
137 
138 PROCEDURE ins_wct_rows_into_mmtt(
139 				 p_m_o_h_id           IN       NUMBER,
140 				 p_outbound           IN       VARCHAR2,
141 				 x_return_status      OUT      NOCOPY VARCHAR2,
142 				 x_msg_count          OUT      NOCOPY NUMBER,
143 				 x_msg_data           OUT      NOCOPY VARCHAR2);
144 
145 FUNCTION get_lpn_Itemid(P_lpn_id IN NUMBER) return NUMBER;
146 
147 FUNCTION get_PACKAGE_Itemid(P_PACKAGE_id IN NUMBER) return NUMBER;
148 
149 FUNCTION get_next_package_id RETURN NUMBER;
150 
151 
152 PROCEDURE get_package_attributes(
153 				 p_org_id                  IN  NUMBER,
154 				 p_package_id                IN  NUMBER,
155 				 x_inventory_item_id       OUT NOCOPY NUMBER,
156 				 x_gross_weight            OUT NOCOPY NUMBER,
157 				 x_content_volume          OUT NOCOPY NUMBER,
158 				 x_gross_weight_uom_code   OUT NOCOPY VARCHAR2,
159 				 x_content_volume_uom_code OUT NOCOPY VARCHAR2,
160 				 x_tare_weight             OUT NOCOPY NUMBER,
161 				 x_tare_weight_uom_code    OUT NOCOPY VARCHAR2 );
162 
163 PROCEDURE get_lpn_attributes(
164 			     p_lpn_id                  IN  NUMBER,
165 			     x_inventory_item_id       OUT NOCOPY NUMBER,
166 			     x_gross_weight            OUT NOCOPY NUMBER,
167 			     x_content_volume          OUT NOCOPY NUMBER,
168 			     x_gross_weight_uom_code   OUT NOCOPY VARCHAR2,
169 			     x_content_volume_uom_code OUT NOCOPY VARCHAR2,
170 			     x_tare_weight             OUT NOCOPY NUMBER,
171 			     x_tare_weight_uom_code    OUT NOCOPY VARCHAR2 );
172 
173 
174 --This procedure inserts records into wms_device_requests table for further
175 -- processing by device integration code.This procedure is called from
176 -- WMSCRTNB.pls and WMSTSKUB.pls
177 PROCEDURE insert_device_request_rec(p_mmtt_row IN mmtt_row);
178 
179 END WMS_CARTNZN_PUB;