15: PROCEDURE MissingLatLongCoordExcptn (plan_idIn NUMBER, userIdIn NUMBER) IS
16: excptnId NUMBER;
17: dummyThreshold NUMBER;
18: BEGIN
19: -- Delete previous occurrences of this exception in mst_exceptions and the details table
20: DELETE FROM mst_exception_details
21: WHERE plan_id = plan_idIn
22: AND exception_type = 704;
23:
20: DELETE FROM mst_exception_details
21: WHERE plan_id = plan_idIn
22: AND exception_type = 704;
23:
24: DELETE FROM mst_exceptions
25: WHERE plan_id = plan_idIn
26: AND exception_type = 704;
27:
28: --check if exception appears in mst_excep_preferences (it does not have a threshold but
34: RETURN;
35: END IF;
36:
37: --Create fresh entry for exception and keep exception_id for updates in details table
38: INSERT INTO mst_exceptions (exception_id, plan_id, exception_group, exception_type, exception_count,
39: created_by, last_updated_by, LAST_UPDATE_LOGIN,LAST_UPDATE_DATE,
40: CREATION_DATE)
41: VALUES (mst_exceptions_s.nextval, plan_idIn, 700, 704, 0, userIdIn,
42: userIdIn,-1,sysdate, sysdate);
37: --Create fresh entry for exception and keep exception_id for updates in details table
38: INSERT INTO mst_exceptions (exception_id, plan_id, exception_group, exception_type, exception_count,
39: created_by, last_updated_by, LAST_UPDATE_LOGIN,LAST_UPDATE_DATE,
40: CREATION_DATE)
41: VALUES (mst_exceptions_s.nextval, plan_idIn, 700, 704, 0, userIdIn,
42: userIdIn,-1,sysdate, sysdate);
43:
44: SELECT exception_id INTO excptnId
45: FROM mst_exceptions
41: VALUES (mst_exceptions_s.nextval, plan_idIn, 700, 704, 0, userIdIn,
42: userIdIn,-1,sysdate, sysdate);
43:
44: SELECT exception_id INTO excptnId
45: FROM mst_exceptions
46: WHERE plan_id = plan_idIn
47: AND exception_type = 704;
48:
49: INSERT INTO mst_exception_details (exception_detail_id, exception_id, plan_id, exception_type,
70: OR param.deconsolidation_allowed = 'Y'
71: OR param.crossdocking_allowed = 'Y')
72: AND ( loc.latitude is null OR loc.longitude is null));
73:
74: --update count of this exception in mst_exceptions
75: UPDATE mst_exceptions
76: SET EXCEPTION_COUNT = ( select count(*)
77: from mst_exception_details det
78: where det.exception_id = excptnId)
71: OR param.crossdocking_allowed = 'Y')
72: AND ( loc.latitude is null OR loc.longitude is null));
73:
74: --update count of this exception in mst_exceptions
75: UPDATE mst_exceptions
76: SET EXCEPTION_COUNT = ( select count(*)
77: from mst_exception_details det
78: where det.exception_id = excptnId)
79: WHERE EXCEPTION_id = excptnId;
77: from mst_exception_details det
78: where det.exception_id = excptnId)
79: WHERE EXCEPTION_id = excptnId;
80:
81: --in case no exception of this type was generate delete entry in mst_exceptions table
82: DELETE FROM mst_exceptions
83: WHERE exception_count = 0 and exception_id = excptnId;
84:
85: COMMIT;
78: where det.exception_id = excptnId)
79: WHERE EXCEPTION_id = excptnId;
80:
81: --in case no exception of this type was generate delete entry in mst_exceptions table
82: DELETE FROM mst_exceptions
83: WHERE exception_count = 0 and exception_id = excptnId;
84:
85: COMMIT;
86: END MissingLatLongCoordExcptn;
92: excptnId NUMBER;
93: dummyThreshold NUMBER;
94: distanceEnginePresent VARCHAR(10);
95: BEGIN
96: -- Delete previous occurrences of this exception in mst_exceptions and the details table
97: DELETE FROM mst_exception_details
98: WHERE plan_id = plan_idIn
99: AND exception_type = 900;
100:
97: DELETE FROM mst_exception_details
98: WHERE plan_id = plan_idIn
99: AND exception_type = 900;
100:
101: DELETE FROM mst_exceptions
102: WHERE plan_id = plan_idIn
103: AND exception_type = 900;
104:
105: --Determine if distance engine is present (if it is not then no exception of this type should be generated)
119: RETURN;
120: END IF;
121:
122: --Create fresh entry for exception and keep exception_id for updates in details table
123: INSERT INTO mst_exceptions (exception_id, plan_id, exception_group, exception_type, exception_count,
124: created_by, last_updated_by, LAST_UPDATE_LOGIN,LAST_UPDATE_DATE,
125: CREATION_DATE)
126: VALUES (mst_exceptions_s.nextval, plan_idIn, 900, 900, 0, userIdIn,
127: userIdIn,-1,sysdate, sysdate);
122: --Create fresh entry for exception and keep exception_id for updates in details table
123: INSERT INTO mst_exceptions (exception_id, plan_id, exception_group, exception_type, exception_count,
124: created_by, last_updated_by, LAST_UPDATE_LOGIN,LAST_UPDATE_DATE,
125: CREATION_DATE)
126: VALUES (mst_exceptions_s.nextval, plan_idIn, 900, 900, 0, userIdIn,
127: userIdIn,-1,sysdate, sysdate);
128:
129: SELECT exception_id INTO excptnId
130: FROM mst_exceptions
126: VALUES (mst_exceptions_s.nextval, plan_idIn, 900, 900, 0, userIdIn,
127: userIdIn,-1,sysdate, sysdate);
128:
129: SELECT exception_id INTO excptnId
130: FROM mst_exceptions
131: WHERE plan_id = plan_idIn
132: AND exception_type = 900;
133:
134:
160: WHERE origReg.region_id = origin_id
161: AND destReg.region_id = destination_id));
162:
163:
164: --update count of this exception in mst_exceptions
165: UPDATE mst_exceptions
166: SET EXCEPTION_COUNT = ( select count(*)
167: from mst_exception_details det
168: where det.exception_id = excptnId)
161: AND destReg.region_id = destination_id));
162:
163:
164: --update count of this exception in mst_exceptions
165: UPDATE mst_exceptions
166: SET EXCEPTION_COUNT = ( select count(*)
167: from mst_exception_details det
168: where det.exception_id = excptnId)
169: WHERE EXCEPTION_id = excptnId;
167: from mst_exception_details det
168: where det.exception_id = excptnId)
169: WHERE EXCEPTION_id = excptnId;
170:
171: --in case no exception of this type was generated delete entry in mst_exceptions table
172: DELETE FROM mst_exceptions
173: WHERE exception_count = 0 and exception_id = excptnId;
174:
175: commit;
168: where det.exception_id = excptnId)
169: WHERE EXCEPTION_id = excptnId;
170:
171: --in case no exception of this type was generated delete entry in mst_exceptions table
172: DELETE FROM mst_exceptions
173: WHERE exception_count = 0 and exception_id = excptnId;
174:
175: commit;
176: END MissingDistanceDataExcptn;
181: PROCEDURE DL_with_zero_values (plan_idIn NUMBER, userIdIn NUMBER) IS
182: excptnId NUMBER;
183: dummyThreshold NUMBER;
184: BEGIN
185: --Delete previous occurrences of this exception in mst_exceptions and the details table
186: DELETE FROM mst_exception_details
187: WHERE plan_id = plan_idIn
188: AND exception_type = 219;
189:
186: DELETE FROM mst_exception_details
187: WHERE plan_id = plan_idIn
188: AND exception_type = 219;
189:
190: DELETE FROM mst_exceptions
191: WHERE plan_id = plan_idIn
192: AND exception_type = 219;
193:
194: --check if exception appears in mst_excep_preferences (it does not have a threshold but
200: RETURN;
201: END IF;
202:
203: --Create fresh entry for exception and keep exception_id for updates in details table
204: INSERT INTO mst_exceptions (exception_id, plan_id, exception_group, exception_type, exception_count,
205: created_by, last_updated_by, LAST_UPDATE_LOGIN,LAST_UPDATE_DATE,
206: CREATION_DATE)
207: VALUES (mst_exceptions_s.nextval, plan_idIn, 200, 219, 0, userIdIn,
208: userIdIn,-1,sysdate, sysdate);
203: --Create fresh entry for exception and keep exception_id for updates in details table
204: INSERT INTO mst_exceptions (exception_id, plan_id, exception_group, exception_type, exception_count,
205: created_by, last_updated_by, LAST_UPDATE_LOGIN,LAST_UPDATE_DATE,
206: CREATION_DATE)
207: VALUES (mst_exceptions_s.nextval, plan_idIn, 200, 219, 0, userIdIn,
208: userIdIn,-1,sysdate, sysdate);
209:
210: SELECT exception_id INTO excptnId
211: FROM mst_exceptions
207: VALUES (mst_exceptions_s.nextval, plan_idIn, 200, 219, 0, userIdIn,
208: userIdIn,-1,sysdate, sysdate);
209:
210: SELECT exception_id INTO excptnId
211: FROM mst_exceptions
212: WHERE plan_id = plan_idIn
213: AND exception_type = 219;
214:
215:
252: AND ( it.unit_volume = 0 OR it.unit_volume IS NULL
253: OR it.unit_weight = 0 OR it.unit_weight IS NULL);
254: */
255:
256: --update count of this exception in mst_exceptions
257: UPDATE mst_exceptions
258: SET EXCEPTION_COUNT = ( select count(*)
259: from mst_exception_details det
260: where det.exception_id = excptnId)
253: OR it.unit_weight = 0 OR it.unit_weight IS NULL);
254: */
255:
256: --update count of this exception in mst_exceptions
257: UPDATE mst_exceptions
258: SET EXCEPTION_COUNT = ( select count(*)
259: from mst_exception_details det
260: where det.exception_id = excptnId)
261: WHERE EXCEPTION_id = excptnId;
259: from mst_exception_details det
260: where det.exception_id = excptnId)
261: WHERE EXCEPTION_id = excptnId;
262:
263: --in case no exception of this type was generated delete entry in mst_exceptions table
264: DELETE FROM mst_exceptions
265: WHERE exception_count = 0 and exception_id = excptnId;
266:
267: commit;
260: where det.exception_id = excptnId)
261: WHERE EXCEPTION_id = excptnId;
262:
263: --in case no exception of this type was generated delete entry in mst_exceptions table
264: DELETE FROM mst_exceptions
265: WHERE exception_count = 0 and exception_id = excptnId;
266:
267: commit;
268: END DL_with_zero_values;
302: DELETE FROM mst_exception_details
303: WHERE plan_id = plan_idIn
304: AND exception_type = 902;
305:
306: DELETE FROM mst_exceptions
307: WHERE plan_id = plan_idIn
308: AND exception_type = 902;
309:
310: --get the threshold from mst_excep_preferences
398: END IF;
399:
400: debug_output('maxDimV='||maxDimV || ', midDimV=' || midDimV || ', minDimV=' || minDimV );
401:
402: --insert entry in mst_exceptions
403: INSERT INTO mst_exceptions (exception_id, plan_id, exception_group, exception_type, exception_count,
404: created_by, last_updated_by, LAST_UPDATE_LOGIN,LAST_UPDATE_DATE,
405: CREATION_DATE)
406: VALUES (mst_exceptions_s.nextval, plan_idIn, 900, 902, 0,userIdIn,
399:
400: debug_output('maxDimV='||maxDimV || ', midDimV=' || midDimV || ', minDimV=' || minDimV );
401:
402: --insert entry in mst_exceptions
403: INSERT INTO mst_exceptions (exception_id, plan_id, exception_group, exception_type, exception_count,
404: created_by, last_updated_by, LAST_UPDATE_LOGIN,LAST_UPDATE_DATE,
405: CREATION_DATE)
406: VALUES (mst_exceptions_s.nextval, plan_idIn, 900, 902, 0,userIdIn,
407: userIdIn,-1,sysdate, sysdate);
402: --insert entry in mst_exceptions
403: INSERT INTO mst_exceptions (exception_id, plan_id, exception_group, exception_type, exception_count,
404: created_by, last_updated_by, LAST_UPDATE_LOGIN,LAST_UPDATE_DATE,
405: CREATION_DATE)
406: VALUES (mst_exceptions_s.nextval, plan_idIn, 900, 902, 0,userIdIn,
407: userIdIn,-1,sysdate, sysdate);
408:
409: SELECT exception_id INTO excptnId
410: FROM mst_exceptions
406: VALUES (mst_exceptions_s.nextval, plan_idIn, 900, 902, 0,userIdIn,
407: userIdIn,-1,sysdate, sysdate);
408:
409: SELECT exception_id INTO excptnId
410: FROM mst_exceptions
411: WHERE plan_id = plan_idIn
412: AND exception_type = 902;
413:
414: FOR c1rec IN c_pieces LOOP
476: END IF;
477: END IF;
478: END LOOP;
479:
480: --update count of this exception in mst_exceptions
481: UPDATE mst_exceptions
482: SET EXCEPTION_COUNT = ( select count(*)
483: from mst_exception_details det
484: where det.exception_id = excptnId)
477: END IF;
478: END LOOP;
479:
480: --update count of this exception in mst_exceptions
481: UPDATE mst_exceptions
482: SET EXCEPTION_COUNT = ( select count(*)
483: from mst_exception_details det
484: where det.exception_id = excptnId)
485: WHERE EXCEPTION_id = excptnId;
483: from mst_exception_details det
484: where det.exception_id = excptnId)
485: WHERE EXCEPTION_id = excptnId;
486:
487: --in case no exception of this type was generated delete entry in mst_exceptions table
488: DELETE FROM mst_exceptions
489: WHERE exception_count = 0 and exception_id = excptnId;
490: END IF;
491:
484: where det.exception_id = excptnId)
485: WHERE EXCEPTION_id = excptnId;
486:
487: --in case no exception of this type was generated delete entry in mst_exceptions table
488: DELETE FROM mst_exceptions
489: WHERE exception_count = 0 and exception_id = excptnId;
490: END IF;
491:
492: COMMIT;
541: DELETE FROM mst_exception_details
542: WHERE plan_id = plan_idIn
543: AND exception_type = 903;
544:
545: DELETE FROM mst_exceptions
546: WHERE plan_id = plan_idIn
547: AND exception_type = 903;
548:
549: --get the threshold from mst_excep_preferences
592:
593: debug_output('maxVolume = ' || maxVolumeV || ' ' || tp_volume_uom || ' (veh id=' || maxVolVehTypeId || ')' );
594: debug_output('maxWeight = ' || maxWeightV || ' ' || tp_weight_uom || ' (veh id=' || maxWgtVehTypeId || ')' );
595:
596: --insert entry in mst_exceptions
597: INSERT INTO mst_exceptions (exception_id, plan_id, exception_group, exception_type, exception_count,
598: created_by, last_updated_by, LAST_UPDATE_LOGIN,LAST_UPDATE_DATE,
599: CREATION_DATE)
600: VALUES (mst_exceptions_s.nextval, plan_idIn, 900, 903, 0, userIdIn,
593: debug_output('maxVolume = ' || maxVolumeV || ' ' || tp_volume_uom || ' (veh id=' || maxVolVehTypeId || ')' );
594: debug_output('maxWeight = ' || maxWeightV || ' ' || tp_weight_uom || ' (veh id=' || maxWgtVehTypeId || ')' );
595:
596: --insert entry in mst_exceptions
597: INSERT INTO mst_exceptions (exception_id, plan_id, exception_group, exception_type, exception_count,
598: created_by, last_updated_by, LAST_UPDATE_LOGIN,LAST_UPDATE_DATE,
599: CREATION_DATE)
600: VALUES (mst_exceptions_s.nextval, plan_idIn, 900, 903, 0, userIdIn,
601: userIdIn,-1,sysdate, sysdate);
596: --insert entry in mst_exceptions
597: INSERT INTO mst_exceptions (exception_id, plan_id, exception_group, exception_type, exception_count,
598: created_by, last_updated_by, LAST_UPDATE_LOGIN,LAST_UPDATE_DATE,
599: CREATION_DATE)
600: VALUES (mst_exceptions_s.nextval, plan_idIn, 900, 903, 0, userIdIn,
601: userIdIn,-1,sysdate, sysdate);
602:
603:
604: SELECT exception_id INTO excptnId
601: userIdIn,-1,sysdate, sysdate);
602:
603:
604: SELECT exception_id INTO excptnId
605: FROM mst_exceptions
606: WHERE plan_id = plan_idIn
607: AND exception_type = 903;
608:
609: FOR piece IN c_pieces(tp_volume_uom,tp_weight_uom) LOOP
641: userIdIn, userIdIn,-1,sysdate, sysdate,3);
642: END IF;
643: END LOOP;
644:
645: --update count of this exception in mst_exceptions
646: UPDATE mst_exceptions
647: SET EXCEPTION_COUNT = ( select count(*)
648: from mst_exception_details det
649: where det.exception_id = excptnId)
642: END IF;
643: END LOOP;
644:
645: --update count of this exception in mst_exceptions
646: UPDATE mst_exceptions
647: SET EXCEPTION_COUNT = ( select count(*)
648: from mst_exception_details det
649: where det.exception_id = excptnId)
650: WHERE EXCEPTION_id = excptnId;
648: from mst_exception_details det
649: where det.exception_id = excptnId)
650: WHERE EXCEPTION_id = excptnId;
651:
652: --in case no exception of this type was generated delete entry in mst_exceptions table
653: DELETE FROM mst_exceptions
654: WHERE exception_count = 0 and exception_id = excptnId;
655:
656: commit;
649: where det.exception_id = excptnId)
650: WHERE EXCEPTION_id = excptnId;
651:
652: --in case no exception of this type was generated delete entry in mst_exceptions table
653: DELETE FROM mst_exceptions
654: WHERE exception_count = 0 and exception_id = excptnId;
655:
656: commit;
657: END WgtVolViolForPieceExcptn;
685: DELETE FROM mst_exception_details
686: WHERE plan_id = plan_idIn
687: AND exception_type = 904;
688:
689: DELETE FROM mst_exceptions
690: WHERE plan_id = plan_idIn
691: AND exception_type = 904;
692:
693: --get the threshold from mst_excep_preferences
761:
762:
763: debug_output('maxVolume = ' || maxVolumeV || ' ' || tp_volume_uom || ', maxWeight = ' || maxWeightV || ' ' || tp_weight_uom);
764:
765: --insert entry in mst_exceptions
766: INSERT INTO mst_exceptions (exception_id, plan_id, exception_group, exception_type, exception_count,
767: created_by, last_updated_by, LAST_UPDATE_LOGIN,LAST_UPDATE_DATE,
768: CREATION_DATE)
769: VALUES (mst_exceptions_s.nextval, plan_idIn, 900, 904, 0, userIdIn,
762:
763: debug_output('maxVolume = ' || maxVolumeV || ' ' || tp_volume_uom || ', maxWeight = ' || maxWeightV || ' ' || tp_weight_uom);
764:
765: --insert entry in mst_exceptions
766: INSERT INTO mst_exceptions (exception_id, plan_id, exception_group, exception_type, exception_count,
767: created_by, last_updated_by, LAST_UPDATE_LOGIN,LAST_UPDATE_DATE,
768: CREATION_DATE)
769: VALUES (mst_exceptions_s.nextval, plan_idIn, 900, 904, 0, userIdIn,
770: userIdIn,-1,sysdate, sysdate);
765: --insert entry in mst_exceptions
766: INSERT INTO mst_exceptions (exception_id, plan_id, exception_group, exception_type, exception_count,
767: created_by, last_updated_by, LAST_UPDATE_LOGIN,LAST_UPDATE_DATE,
768: CREATION_DATE)
769: VALUES (mst_exceptions_s.nextval, plan_idIn, 900, 904, 0, userIdIn,
770: userIdIn,-1,sysdate, sysdate);
771:
772: SELECT exception_id INTO excptnId
773: FROM mst_exceptions
769: VALUES (mst_exceptions_s.nextval, plan_idIn, 900, 904, 0, userIdIn,
770: userIdIn,-1,sysdate, sysdate);
771:
772: SELECT exception_id INTO excptnId
773: FROM mst_exceptions
774: WHERE plan_id = plan_idIn
775: AND exception_type = 904;
776:
777: FOR deliveryLine IN c_DL(tp_volume_uom, tp_weight_uom) LOOP
809: END IF;
810: END LOOP;
811:
812:
813: --update count of this exception in mst_exceptions
814: UPDATE mst_exceptions
815: SET EXCEPTION_COUNT = ( select count(*)
816: from mst_exception_details det
817: where det.exception_id = excptnId)
810: END LOOP;
811:
812:
813: --update count of this exception in mst_exceptions
814: UPDATE mst_exceptions
815: SET EXCEPTION_COUNT = ( select count(*)
816: from mst_exception_details det
817: where det.exception_id = excptnId)
818: WHERE EXCEPTION_id = excptnId;
816: from mst_exception_details det
817: where det.exception_id = excptnId)
818: WHERE EXCEPTION_id = excptnId;
819:
820: --in case no exception of this type was generated delete entry in mst_exceptions table
821: DELETE FROM mst_exceptions
822: WHERE exception_count = 0 and exception_id = excptnId;
823:
824: commit;
817: where det.exception_id = excptnId)
818: WHERE EXCEPTION_id = excptnId;
819:
820: --in case no exception of this type was generated delete entry in mst_exceptions table
821: DELETE FROM mst_exceptions
822: WHERE exception_count = 0 and exception_id = excptnId;
823:
824: commit;
825: END WgtVolViolForDLExcptn;
848: DELETE FROM mst_exception_details
849: WHERE plan_id = plan_idIn
850: AND exception_type = 905;
851:
852: DELETE FROM mst_exceptions
853: WHERE plan_id = plan_idIn
854: AND exception_type = 905;
855:
856: --get the threshold from mst_excep_preferences
898:
899:
900: debug_output('maxVolume = ' || maxVolumeV || ' ' || tp_volume_uom || ', maxWeight = ' || maxWeightV || ' ' || tp_weight_uom);
901:
902: --insert entry in mst_exceptions
903: INSERT INTO mst_exceptions (exception_id, plan_id, exception_group, exception_type, exception_count,
904: created_by, last_updated_by, LAST_UPDATE_LOGIN,LAST_UPDATE_DATE,
905: CREATION_DATE)
906: VALUES (mst_exceptions_s.nextval, plan_idIn, 900, 905, 0, userIdIn,
899:
900: debug_output('maxVolume = ' || maxVolumeV || ' ' || tp_volume_uom || ', maxWeight = ' || maxWeightV || ' ' || tp_weight_uom);
901:
902: --insert entry in mst_exceptions
903: INSERT INTO mst_exceptions (exception_id, plan_id, exception_group, exception_type, exception_count,
904: created_by, last_updated_by, LAST_UPDATE_LOGIN,LAST_UPDATE_DATE,
905: CREATION_DATE)
906: VALUES (mst_exceptions_s.nextval, plan_idIn, 900, 905, 0, userIdIn,
907: userIdIn,-1,sysdate, sysdate);
902: --insert entry in mst_exceptions
903: INSERT INTO mst_exceptions (exception_id, plan_id, exception_group, exception_type, exception_count,
904: created_by, last_updated_by, LAST_UPDATE_LOGIN,LAST_UPDATE_DATE,
905: CREATION_DATE)
906: VALUES (mst_exceptions_s.nextval, plan_idIn, 900, 905, 0, userIdIn,
907: userIdIn,-1,sysdate, sysdate);
908:
909: SELECT exception_id INTO excptnId
910: FROM mst_exceptions
906: VALUES (mst_exceptions_s.nextval, plan_idIn, 900, 905, 0, userIdIn,
907: userIdIn,-1,sysdate, sysdate);
908:
909: SELECT exception_id INTO excptnId
910: FROM mst_exceptions
911: WHERE plan_id = plan_idIn
912: AND exception_type = 905;
913:
914: FOR delivery IN c_firmDel LOOP
946: END IF;
947: END LOOP;
948:
949:
950: --update count of this exception in mst_exceptions
951: UPDATE mst_exceptions
952: SET EXCEPTION_COUNT = ( select count(*)
953: from mst_exception_details det
954: where det.exception_id = excptnId)
947: END LOOP;
948:
949:
950: --update count of this exception in mst_exceptions
951: UPDATE mst_exceptions
952: SET EXCEPTION_COUNT = ( select count(*)
953: from mst_exception_details det
954: where det.exception_id = excptnId)
955: WHERE EXCEPTION_id = excptnId;
953: from mst_exception_details det
954: where det.exception_id = excptnId)
955: WHERE EXCEPTION_id = excptnId;
956:
957: --in case no exception of this type was generated delete entry in mst_exceptions table
958: DELETE FROM mst_exceptions
959: WHERE exception_count = 0 and exception_id = excptnId;
960:
961: commit;
954: where det.exception_id = excptnId)
955: WHERE EXCEPTION_id = excptnId;
956:
957: --in case no exception of this type was generated delete entry in mst_exceptions table
958: DELETE FROM mst_exceptions
959: WHERE exception_count = 0 and exception_id = excptnId;
960:
961: commit;
962: END WgtVolViolForFirmDelivExcptn;
1003: thresholdInHrs NUMBER;
1004: planStartDate DATE;
1005:
1006: BEGIN
1007: --Delete previous occurrences of this exception in mst_exceptions and the details table
1008: DELETE FROM mst_exception_details
1009: WHERE plan_id = plan_idIn
1010: AND exception_type = 104;
1011:
1008: DELETE FROM mst_exception_details
1009: WHERE plan_id = plan_idIn
1010: AND exception_type = 104;
1011:
1012: DELETE FROM mst_exceptions
1013: WHERE plan_id = plan_idIn
1014: AND exception_type = 104;
1015:
1016: --get the threshold from mst_excep_preferences
1028: FROM mst_plans
1029: WHERE plan_id = plan_idIn;
1030:
1031: --Create fresh entry for exception and keep exception_id for updates in details table
1032: INSERT INTO mst_exceptions (exception_id, plan_id, exception_group, exception_type, exception_count,
1033: created_by, last_updated_by, LAST_UPDATE_LOGIN,LAST_UPDATE_DATE,
1034: CREATION_DATE)
1035: VALUES (mst_exceptions_s.nextval, plan_idIn, 100, 104, 0, userIdIn,
1036: userIdIn,-1,sysdate, sysdate);
1031: --Create fresh entry for exception and keep exception_id for updates in details table
1032: INSERT INTO mst_exceptions (exception_id, plan_id, exception_group, exception_type, exception_count,
1033: created_by, last_updated_by, LAST_UPDATE_LOGIN,LAST_UPDATE_DATE,
1034: CREATION_DATE)
1035: VALUES (mst_exceptions_s.nextval, plan_idIn, 100, 104, 0, userIdIn,
1036: userIdIn,-1,sysdate, sysdate);
1037:
1038: SELECT exception_id INTO excptnId
1039: FROM mst_exceptions
1035: VALUES (mst_exceptions_s.nextval, plan_idIn, 100, 104, 0, userIdIn,
1036: userIdIn,-1,sysdate, sysdate);
1037:
1038: SELECT exception_id INTO excptnId
1039: FROM mst_exceptions
1040: WHERE plan_id = plan_idIn
1041: AND exception_type = 104;
1042:
1043: j := 0;
1110: all_details_availTime(k),
1111: userIdIn, userIdIn,-1,sysdate, sysdate, 3);
1112: END IF;
1113:
1114: --update count of this exception in mst_exceptions
1115: UPDATE mst_exceptions
1116: SET EXCEPTION_COUNT = ( select count(*)
1117: from mst_exception_details det
1118: where det.exception_id = excptnId)
1111: userIdIn, userIdIn,-1,sysdate, sysdate, 3);
1112: END IF;
1113:
1114: --update count of this exception in mst_exceptions
1115: UPDATE mst_exceptions
1116: SET EXCEPTION_COUNT = ( select count(*)
1117: from mst_exception_details det
1118: where det.exception_id = excptnId)
1119: WHERE EXCEPTION_id = excptnId;
1117: from mst_exception_details det
1118: where det.exception_id = excptnId)
1119: WHERE EXCEPTION_id = excptnId;
1120:
1121: --in case no exception of this type was generated delete entry in mst_exceptions table
1122: DELETE FROM mst_exceptions
1123: WHERE exception_count = 0 and exception_id = excptnId;
1124: commit;
1125:
1118: where det.exception_id = excptnId)
1119: WHERE EXCEPTION_id = excptnId;
1120:
1121: --in case no exception of this type was generated delete entry in mst_exceptions table
1122: DELETE FROM mst_exceptions
1123: WHERE exception_count = 0 and exception_id = excptnId;
1124: commit;
1125:
1126: END InsufficientIntransitTimeExptn;
1147: AND plan.plan_id = plan_idIn
1148: AND ( (det.latest_acceptable_date + thresholdInHrs/24 < plan.start_date)
1149: OR (det.latest_pickup_date + thresholdInHrs/24 < plan.start_date) );
1150: BEGIN
1151: --Delete previous occurrences of this exception in mst_exceptions and the details table
1152: DELETE FROM mst_exception_details
1153: WHERE plan_id = plan_idIn
1154: AND exception_type = 105;
1155:
1152: DELETE FROM mst_exception_details
1153: WHERE plan_id = plan_idIn
1154: AND exception_type = 105;
1155:
1156: DELETE FROM mst_exceptions
1157: WHERE plan_id = plan_idIn
1158: AND exception_type = 105;
1159:
1160: --get the threshold from mst_excep_preferences
1167: END IF;
1168:
1169:
1170: --Create fresh entry for exception and keep exception_id for updates in details table
1171: INSERT INTO mst_exceptions (exception_id, plan_id, exception_group, exception_type, exception_count,
1172: created_by, last_updated_by, LAST_UPDATE_LOGIN,LAST_UPDATE_DATE,
1173: CREATION_DATE)
1174: VALUES (mst_exceptions_s.nextval, plan_idIn, 100, 105, 0, userIdIn,
1175: userIdIn,-1,sysdate, sysdate);
1170: --Create fresh entry for exception and keep exception_id for updates in details table
1171: INSERT INTO mst_exceptions (exception_id, plan_id, exception_group, exception_type, exception_count,
1172: created_by, last_updated_by, LAST_UPDATE_LOGIN,LAST_UPDATE_DATE,
1173: CREATION_DATE)
1174: VALUES (mst_exceptions_s.nextval, plan_idIn, 100, 105, 0, userIdIn,
1175: userIdIn,-1,sysdate, sysdate);
1176:
1177: SELECT exception_id INTO excptnId
1178: FROM mst_exceptions
1174: VALUES (mst_exceptions_s.nextval, plan_idIn, 100, 105, 0, userIdIn,
1175: userIdIn,-1,sysdate, sysdate);
1176:
1177: SELECT exception_id INTO excptnId
1178: FROM mst_exceptions
1179: WHERE plan_id = plan_idIn
1180: AND exception_type = 105;
1181:
1182:
1203: requiredTransitTimeInHrs, availTransitTimeInHrs,
1204: userIdIn, userIdIn,-1,sysdate, sysdate, 3);
1205: END LOOP;
1206:
1207: --update count of this exception in mst_exceptions
1208: UPDATE mst_exceptions
1209: SET EXCEPTION_COUNT = ( select count(*)
1210: from mst_exception_details det
1211: where det.exception_id = excptnId)
1204: userIdIn, userIdIn,-1,sysdate, sysdate, 3);
1205: END LOOP;
1206:
1207: --update count of this exception in mst_exceptions
1208: UPDATE mst_exceptions
1209: SET EXCEPTION_COUNT = ( select count(*)
1210: from mst_exception_details det
1211: where det.exception_id = excptnId)
1212: WHERE EXCEPTION_id = excptnId;
1210: from mst_exception_details det
1211: where det.exception_id = excptnId)
1212: WHERE EXCEPTION_id = excptnId;
1213:
1214: --in case no exception of this type was generated delete entry in mst_exceptions table
1215: DELETE FROM mst_exceptions
1216: WHERE exception_count = 0 and exception_id = excptnId;
1217: commit;
1218: END PastDueOrdersExptn;
1211: where det.exception_id = excptnId)
1212: WHERE EXCEPTION_id = excptnId;
1213:
1214: --in case no exception of this type was generated delete entry in mst_exceptions table
1215: DELETE FROM mst_exceptions
1216: WHERE exception_count = 0 and exception_id = excptnId;
1217: commit;
1218: END PastDueOrdersExptn;
1219:
1378: DELETE FROM mst_exception_details
1379: WHERE plan_id = plan_idIn
1380: AND exception_type = 404;
1381:
1382: DELETE FROM mst_exceptions
1383: WHERE plan_id = plan_idIn
1384: AND exception_type = 404;
1385:
1386: --get the threshold from mst_excep_preferences
1392: RETURN;
1393: END IF;
1394:
1395:
1396: --insert entry in mst_exceptions
1397: INSERT INTO mst_exceptions (exception_id, plan_id, exception_group, exception_type, exception_count,
1398: created_by, last_updated_by, LAST_UPDATE_LOGIN,LAST_UPDATE_DATE,
1399: CREATION_DATE)
1400: VALUES (mst_exceptions_s.nextval,plan_idIn, 400, 404, 0, userIdIn,
1393: END IF;
1394:
1395:
1396: --insert entry in mst_exceptions
1397: INSERT INTO mst_exceptions (exception_id, plan_id, exception_group, exception_type, exception_count,
1398: created_by, last_updated_by, LAST_UPDATE_LOGIN,LAST_UPDATE_DATE,
1399: CREATION_DATE)
1400: VALUES (mst_exceptions_s.nextval,plan_idIn, 400, 404, 0, userIdIn,
1401: userIdIn,-1,sysdate, sysdate);
1396: --insert entry in mst_exceptions
1397: INSERT INTO mst_exceptions (exception_id, plan_id, exception_group, exception_type, exception_count,
1398: created_by, last_updated_by, LAST_UPDATE_LOGIN,LAST_UPDATE_DATE,
1399: CREATION_DATE)
1400: VALUES (mst_exceptions_s.nextval,plan_idIn, 400, 404, 0, userIdIn,
1401: userIdIn,-1,sysdate, sysdate);
1402:
1403: SELECT exception_id INTO excptnId
1404: FROM mst_exceptions
1400: VALUES (mst_exceptions_s.nextval,plan_idIn, 400, 404, 0, userIdIn,
1401: userIdIn,-1,sysdate, sysdate);
1402:
1403: SELECT exception_id INTO excptnId
1404: FROM mst_exceptions
1405: WHERE plan_id = plan_idIn
1406: AND exception_type = 404;
1407:
1408: --Obtain number of extra days to consider in plan (using snapshot's logic here) (6/6/2003)
1519: END IF;
1520: END LOOP;
1521: CLOSE cursor_DL;
1522:
1523: --update count of this exception in mst_exceptions
1524: UPDATE mst_exceptions
1525: SET EXCEPTION_COUNT = ( select count(*)
1526: from mst_exception_details det
1527: where det.exception_id = excptnId)
1520: END LOOP;
1521: CLOSE cursor_DL;
1522:
1523: --update count of this exception in mst_exceptions
1524: UPDATE mst_exceptions
1525: SET EXCEPTION_COUNT = ( select count(*)
1526: from mst_exception_details det
1527: where det.exception_id = excptnId)
1528: WHERE EXCEPTION_id = excptnId;
1526: from mst_exception_details det
1527: where det.exception_id = excptnId)
1528: WHERE EXCEPTION_id = excptnId;
1529:
1530: --in case no exception of this type was generated delete entry in mst_exceptions table
1531: DELETE FROM mst_exceptions
1532: WHERE exception_count = 0 and exception_id = excptnId;
1533: commit;
1534:
1527: where det.exception_id = excptnId)
1528: WHERE EXCEPTION_id = excptnId;
1529:
1530: --in case no exception of this type was generated delete entry in mst_exceptions table
1531: DELETE FROM mst_exceptions
1532: WHERE exception_count = 0 and exception_id = excptnId;
1533: commit;
1534:
1535: END FacCalViolForPickUpExptn;
1577: DELETE FROM mst_exception_details
1578: WHERE plan_id = plan_idIn
1579: AND exception_type = 405;
1580:
1581: DELETE FROM mst_exceptions
1582: WHERE plan_id = plan_idIn
1583: AND exception_type = 405;
1584:
1585:
1592: RETURN;
1593: END IF;
1594:
1595:
1596: --insert entry in mst_exceptions
1597: INSERT INTO mst_exceptions (exception_id, plan_id, exception_group, exception_type, exception_count,
1598: created_by, last_updated_by, LAST_UPDATE_LOGIN,LAST_UPDATE_DATE,
1599: CREATION_DATE)
1600: VALUES (mst_exceptions_s.nextval, plan_idIn, 400, 405, 0, userIdIn,
1593: END IF;
1594:
1595:
1596: --insert entry in mst_exceptions
1597: INSERT INTO mst_exceptions (exception_id, plan_id, exception_group, exception_type, exception_count,
1598: created_by, last_updated_by, LAST_UPDATE_LOGIN,LAST_UPDATE_DATE,
1599: CREATION_DATE)
1600: VALUES (mst_exceptions_s.nextval, plan_idIn, 400, 405, 0, userIdIn,
1601: userIdIn,-1,sysdate, sysdate);
1596: --insert entry in mst_exceptions
1597: INSERT INTO mst_exceptions (exception_id, plan_id, exception_group, exception_type, exception_count,
1598: created_by, last_updated_by, LAST_UPDATE_LOGIN,LAST_UPDATE_DATE,
1599: CREATION_DATE)
1600: VALUES (mst_exceptions_s.nextval, plan_idIn, 400, 405, 0, userIdIn,
1601: userIdIn,-1,sysdate, sysdate);
1602:
1603: SELECT exception_id INTO excptnId
1604: FROM mst_exceptions
1600: VALUES (mst_exceptions_s.nextval, plan_idIn, 400, 405, 0, userIdIn,
1601: userIdIn,-1,sysdate, sysdate);
1602:
1603: SELECT exception_id INTO excptnId
1604: FROM mst_exceptions
1605: WHERE plan_id = plan_idIn
1606: AND exception_type = 405;
1607:
1608:
1716: END IF;
1717: END LOOP;
1718: CLOSE cursor_DL;
1719:
1720: --update count of this exception in mst_exceptions
1721: UPDATE mst_exceptions
1722: SET EXCEPTION_COUNT = ( select count(*)
1723: from mst_exception_details det
1724: where det.exception_id = excptnId)
1717: END LOOP;
1718: CLOSE cursor_DL;
1719:
1720: --update count of this exception in mst_exceptions
1721: UPDATE mst_exceptions
1722: SET EXCEPTION_COUNT = ( select count(*)
1723: from mst_exception_details det
1724: where det.exception_id = excptnId)
1725: WHERE EXCEPTION_id = excptnId;
1723: from mst_exception_details det
1724: where det.exception_id = excptnId)
1725: WHERE EXCEPTION_id = excptnId;
1726:
1727: --in case no exception of this type was generated delete entry in mst_exceptions table
1728: DELETE FROM mst_exceptions
1729: WHERE exception_count = 0 and exception_id = excptnId;
1730: commit;
1731:
1724: where det.exception_id = excptnId)
1725: WHERE EXCEPTION_id = excptnId;
1726:
1727: --in case no exception of this type was generated delete entry in mst_exceptions table
1728: DELETE FROM mst_exceptions
1729: WHERE exception_count = 0 and exception_id = excptnId;
1730: commit;
1731:
1732: END FacCalViolForDeliveryExptn;