374: IF l_debug = 1 THEN
375: debug('l_tasks_query ' || l_tasks_query,'query_inbound');
376: END IF;
377:
378: l_query_handle := DBMS_SQL.open_cursor;
379: DBMS_SQL.parse(l_query_handle, l_tasks_query, DBMS_SQL.native);
380:
381: /* set the bind variables now */
382: IF l_debug = 1 THEN
375: debug('l_tasks_query ' || l_tasks_query,'query_inbound');
376: END IF;
377:
378: l_query_handle := DBMS_SQL.open_cursor;
379: DBMS_SQL.parse(l_query_handle, l_tasks_query, DBMS_SQL.native);
380:
381: /* set the bind variables now */
382: IF l_debug = 1 THEN
383: debug('setting the bind_variables ','query_inbound');
385: IF wms_plan_tasks_pvt.g_organization_id IS NOT NULL THEN
386: IF l_debug = 1 THEN
387: debug('wms_plan_tasks_pvt.g_organization_id is not null ','query_inbound');
388: END IF;
389: dbms_sql.bind_variable(l_query_handle, 'org_id', wms_plan_tasks_pvt.g_organization_id);
390: END IF;
391:
392: IF wms_plan_tasks_pvt.g_subinventory_code IS NOT NULL THEN
393: IF l_debug = 1 THEN
392: IF wms_plan_tasks_pvt.g_subinventory_code IS NOT NULL THEN
393: IF l_debug = 1 THEN
394: debug('wms_plan_tasks_pvt.g_subinventory_code is not null ','query_inbound');
395: END IF;
396: dbms_sql.bind_variable(l_query_handle, 'sub_code', wms_plan_tasks_pvt.g_subinventory_code);
397: END IF;
398:
399: IF wms_plan_tasks_pvt.g_locator_id IS NOT NULL THEN
400: IF l_debug = 1 THEN
399: IF wms_plan_tasks_pvt.g_locator_id IS NOT NULL THEN
400: IF l_debug = 1 THEN
401: debug('wms_plan_tasks_pvt.g_locator_id is not null ','query_inbound');
402: END IF;
403: dbms_sql.bind_variable(l_query_handle, 'loc_id', wms_plan_tasks_pvt.g_locator_id);
404: END IF;
405:
406: IF wms_plan_tasks_pvt.g_to_subinventory_code IS NOT NULL THEN
407: IF l_debug = 1 THEN
406: IF wms_plan_tasks_pvt.g_to_subinventory_code IS NOT NULL THEN
407: IF l_debug = 1 THEN
408: debug('wms_plan_tasks_pvt.g_to_subinventory_code is not null ','query_inbound');
409: END IF;
410: dbms_sql.bind_variable(l_query_handle, 'to_sub_code', wms_plan_tasks_pvt.g_to_subinventory_code );
411: END IF;
412:
413: IF wms_plan_tasks_pvt.g_to_locator_id IS NOT NULL THEN
414: IF l_debug = 1 THEN
413: IF wms_plan_tasks_pvt.g_to_locator_id IS NOT NULL THEN
414: IF l_debug = 1 THEN
415: debug('wms_plan_tasks_pvt.g_to_locator_id is not null ','query_inbound');
416: END IF;
417: dbms_sql.bind_variable(l_query_handle, 'to_loc_id', wms_plan_tasks_pvt.g_to_locator_id );
418: END IF;
419:
420: IF wms_plan_tasks_pvt.g_category_set_id IS NOT NULL THEN
421: IF l_debug = 1 THEN
420: IF wms_plan_tasks_pvt.g_category_set_id IS NOT NULL THEN
421: IF l_debug = 1 THEN
422: debug('wms_plan_tasks_pvt.g_category_set_id is not null ','query_inbound');
423: END IF;
424: dbms_sql.bind_variable(l_query_handle, 'category_set_id', wms_plan_tasks_pvt.g_category_set_id );
425: END IF;
426:
427: IF wms_plan_tasks_pvt.g_item_category_id IS NOT NULL THEN
428: IF l_debug = 1 THEN
427: IF wms_plan_tasks_pvt.g_item_category_id IS NOT NULL THEN
428: IF l_debug = 1 THEN
429: debug('wms_plan_tasks_pvt.g_item_category_id is not null ','query_inbound');
430: END IF;
431: dbms_sql.bind_variable(l_query_handle, 'item_category_id', wms_plan_tasks_pvt.g_item_category_id );
432: END IF;
433:
434: IF wms_plan_tasks_pvt.g_inventory_item_id IS NOT NULL THEN
435: IF l_debug = 1 THEN
434: IF wms_plan_tasks_pvt.g_inventory_item_id IS NOT NULL THEN
435: IF l_debug = 1 THEN
436: debug('wms_plan_tasks_pvt.g_inventory_item_id is not null ','query_inbound');
437: END IF;
438: dbms_sql.bind_variable(l_query_handle, 'item_id', wms_plan_tasks_pvt.g_inventory_item_id );
439: END IF;
440:
441: IF wms_plan_tasks_pvt.g_person_id IS NOT NULL THEN
442: IF l_debug = 1 THEN
441: IF wms_plan_tasks_pvt.g_person_id IS NOT NULL THEN
442: IF l_debug = 1 THEN
443: debug('wms_plan_tasks_pvt.g_person_id is not null ','query_inbound');
444: END IF;
445: dbms_sql.bind_variable(l_query_handle, 'person_id', wms_plan_tasks_pvt.g_person_id);
446: END IF;
447:
448: IF wms_plan_tasks_pvt.g_person_resource_id IS NOT NULL THEN
449: IF l_debug = 1 THEN
448: IF wms_plan_tasks_pvt.g_person_resource_id IS NOT NULL THEN
449: IF l_debug = 1 THEN
450: debug('wms_plan_tasks_pvt.g_person_resource_id is not null ','query_inbound');
451: END IF;
452: dbms_sql.bind_variable(l_query_handle, 'person_resource_id', wms_plan_tasks_pvt.g_person_resource_id);
453: END IF;
454:
455: IF wms_plan_tasks_pvt.g_equipment_type_id IS NOT NULL THEN
456: IF l_debug = 1 THEN
455: IF wms_plan_tasks_pvt.g_equipment_type_id IS NOT NULL THEN
456: IF l_debug = 1 THEN
457: debug('wms_plan_tasks_pvt.g_equipment_type_id is not null ','query_inbound');
458: END IF;
459: dbms_sql.bind_variable(l_query_handle, 'equipment_type_id', wms_plan_tasks_pvt.g_equipment_type_id);
460: END IF;
461:
462: IF wms_plan_tasks_pvt.g_machine_resource_id IS NOT NULL THEN
463: IF l_debug = 1 THEN
462: IF wms_plan_tasks_pvt.g_machine_resource_id IS NOT NULL THEN
463: IF l_debug = 1 THEN
464: debug('wms_plan_tasks_pvt.g_machine_resource_id is not null ','query_inbound');
465: END IF;
466: dbms_sql.bind_variable(l_query_handle, 'machine_resource_id', wms_plan_tasks_pvt.g_machine_resource_id);
467: END IF;
468:
469: IF wms_plan_tasks_pvt.g_machine_instance IS NOT NULL THEN
470: IF l_debug = 1 THEN
469: IF wms_plan_tasks_pvt.g_machine_instance IS NOT NULL THEN
470: IF l_debug = 1 THEN
471: debug('wms_plan_tasks_pvt.g_machine_instance is not null ','query_inbound');
472: END IF;
473: dbms_sql.bind_variable(l_query_handle, 'machine_instance', wms_plan_tasks_pvt.g_machine_instance);
474: END IF;
475:
476: IF wms_plan_tasks_pvt.g_from_creation_date IS NOT NULL THEN
477: IF l_debug = 1 THEN
476: IF wms_plan_tasks_pvt.g_from_creation_date IS NOT NULL THEN
477: IF l_debug = 1 THEN
478: debug('wms_plan_tasks_pvt.g_from_creation_date is not null ','query_inbound');
479: END IF;
480: dbms_sql.bind_variable(l_query_handle, 'from_creation_date', wms_plan_tasks_pvt.g_from_creation_date);
481: END IF;
482:
483: IF wms_plan_tasks_pvt.g_to_creation_date IS NOT NULL THEN
484: IF l_debug = 1 THEN
483: IF wms_plan_tasks_pvt.g_to_creation_date IS NOT NULL THEN
484: IF l_debug = 1 THEN
485: debug('wms_plan_tasks_pvt.g_to_creation_date is not null ','query_inbound');
486: END IF;
487: dbms_sql.bind_variable(l_query_handle, 'to_creation_date', wms_plan_tasks_pvt.g_to_creation_date);
488: END IF;
489:
490: IF wms_plan_tasks_pvt.g_from_task_quantity IS NOT NULL THEN
491: IF l_debug = 1 THEN
490: IF wms_plan_tasks_pvt.g_from_task_quantity IS NOT NULL THEN
491: IF l_debug = 1 THEN
492: debug('wms_plan_tasks_pvt.g_from_task_quantity is not null ','query_inbound');
493: END IF;
494: dbms_sql.bind_variable(l_query_handle, 'from_task_quantity', wms_plan_tasks_pvt.g_from_task_quantity );
495: END IF;
496:
497: IF wms_plan_tasks_pvt.g_to_task_quantity IS NOT NULL THEN
498: IF l_debug = 1 THEN
497: IF wms_plan_tasks_pvt.g_to_task_quantity IS NOT NULL THEN
498: IF l_debug = 1 THEN
499: debug('wms_plan_tasks_pvt.g_to_task_quantity is not null ','query_inbound');
500: END IF;
501: dbms_sql.bind_variable(l_query_handle, 'to_task_quantity', wms_plan_tasks_pvt.g_to_task_quantity );
502: END IF;
503:
504: IF wms_plan_tasks_pvt.g_from_requisition_header_id IS NOT NULL THEN
505: IF l_debug = 1 THEN
504: IF wms_plan_tasks_pvt.g_from_requisition_header_id IS NOT NULL THEN
505: IF l_debug = 1 THEN
506: debug('wms_plan_tasks_pvt.g_from_requisition_header_id is not null ','query_inbound');
507: END IF;
508: dbms_sql.bind_variable(l_query_handle, 'from_requisition_header_id', wms_plan_tasks_pvt.g_from_requisition_header_id );
509: END IF;
510:
511: IF wms_plan_tasks_pvt.g_to_requisition_header_id IS NOT NULL THEN
512: IF l_debug = 1 THEN
511: IF wms_plan_tasks_pvt.g_to_requisition_header_id IS NOT NULL THEN
512: IF l_debug = 1 THEN
513: debug('wms_plan_tasks_pvt.g_to_requisition_header_id is not null ','query_inbound');
514: END IF;
515: dbms_sql.bind_variable(l_query_handle, 'to_requisition_header_id', wms_plan_tasks_pvt.g_to_requisition_header_id );
516: END IF;
517:
518: IF wms_plan_tasks_pvt.g_from_shipment_number IS NOT NULL THEN
519: IF l_debug = 1 THEN
519: IF l_debug = 1 THEN
520: debug('wms_plan_tasks_pvt.g_from_shipment_number is not null ','query_inbound');
521: END IF;
522: -- Bug #3746810. Modified the bin var g_from_shipment_number to from_shipment_number
523: dbms_sql.bind_variable(l_query_handle, 'from_shipment_number', wms_plan_tasks_pvt.g_from_shipment_number );
524: END IF;
525:
526: IF wms_plan_tasks_pvt.g_to_shipment_number IS NOT NULL THEN
527: IF l_debug = 1 THEN
526: IF wms_plan_tasks_pvt.g_to_shipment_number IS NOT NULL THEN
527: IF l_debug = 1 THEN
528: debug('wms_plan_tasks_pvt.g_to_shipment_number is not null ','query_inbound');
529: END IF;
530: dbms_sql.bind_variable(l_query_handle, 'to_shipment_number', wms_plan_tasks_pvt.g_to_shipment_number );
531: END IF;
532:
533: IF wms_plan_tasks_pvt.g_from_po_header_id IS NOT NULL THEN
534: IF l_debug = 1 THEN
533: IF wms_plan_tasks_pvt.g_from_po_header_id IS NOT NULL THEN
534: IF l_debug = 1 THEN
535: debug('wms_plan_tasks_pvt.g_from_po_header_id is not null ' || wms_plan_tasks_pvt.g_from_po_header_id,'query_inbound');
536: END IF;
537: dbms_sql.bind_variable(l_query_handle, 'from_po_header_id', wms_plan_tasks_pvt.g_from_po_header_id );
538: END IF;
539:
540: IF wms_plan_tasks_pvt.g_to_po_header_id IS NOT NULL THEN
541: IF l_debug = 1 THEN
540: IF wms_plan_tasks_pvt.g_to_po_header_id IS NOT NULL THEN
541: IF l_debug = 1 THEN
542: debug('wms_plan_tasks_pvt.g_to_po_header_id is not null ' || wms_plan_tasks_pvt.g_to_po_header_id,'query_inbound');
543: END IF;
544: dbms_sql.bind_variable(l_query_handle, 'to_po_header_id', wms_plan_tasks_pvt.g_to_po_header_id );
545: END IF;
546:
547: IF wms_plan_tasks_pvt.g_from_rma_header_id IS NOT NULL THEN
548: IF l_debug = 1 THEN
547: IF wms_plan_tasks_pvt.g_from_rma_header_id IS NOT NULL THEN
548: IF l_debug = 1 THEN
549: debug('wms_plan_tasks_pvt.g_from_rma_header_id is not null ','query_inbound');
550: END IF;
551: dbms_sql.bind_variable(l_query_handle, 'from_rma_header_id', wms_plan_tasks_pvt.g_from_rma_header_id );
552: END IF;
553:
554: IF wms_plan_tasks_pvt.g_to_rma_header_id IS NOT NULL THEN
555: IF l_debug = 1 THEN
554: IF wms_plan_tasks_pvt.g_to_rma_header_id IS NOT NULL THEN
555: IF l_debug = 1 THEN
556: debug('wms_plan_tasks_pvt.g_to_rma_header_id is not null ','query_inbound');
557: END IF;
558: dbms_sql.bind_variable(l_query_handle, 'to_rma_header_id', wms_plan_tasks_pvt.g_to_rma_header_id );
559: END IF;
560:
561: IF wms_plan_tasks_pvt.g_op_plan_id IS NOT NULL THEN
562: IF l_debug = 1 THEN
561: IF wms_plan_tasks_pvt.g_op_plan_id IS NOT NULL THEN
562: IF l_debug = 1 THEN
563: debug('wms_plan_tasks_pvt.g_op_plan_id IS NOT NULL ','query_inbound');
564: END IF;
565: dbms_sql.bind_variable(l_query_handle, 'op_plan_id', wms_plan_tasks_pvt.g_op_plan_id );
566: END IF;
567:
568: IF wms_plan_tasks_pvt.g_include_crossdock THEN
569:
593:
594:
595: IF wms_plan_tasks_pvt.g_include_internal_orders AND NOT wms_plan_tasks_pvt.g_include_sales_orders
596: THEN
597: DBMS_SQL.bind_variable (l_query_handle, 'source_type_id', 8);
598: ELSIF NOT wms_plan_tasks_pvt.g_include_internal_orders AND wms_plan_tasks_pvt.g_include_sales_orders
599: THEN
600: DBMS_SQL.bind_variable (l_query_handle, 'source_type_id', 2);
601: END IF;
596: THEN
597: DBMS_SQL.bind_variable (l_query_handle, 'source_type_id', 8);
598: ELSIF NOT wms_plan_tasks_pvt.g_include_internal_orders AND wms_plan_tasks_pvt.g_include_sales_orders
599: THEN
600: DBMS_SQL.bind_variable (l_query_handle, 'source_type_id', 2);
601: END IF;
602:
603: /*added if else for 3455109 since we are changing the query also need to change binds if its for completed task*/
604: IF NOT g_is_completed_task THEN -- Non Completed tasks
604: IF NOT g_is_completed_task THEN -- Non Completed tasks
605:
606: IF wms_plan_tasks_pvt.g_from_sales_order_id IS NOT NULL
607: THEN
608: DBMS_SQL.bind_variable (l_query_handle,'from_sales_order_id',wms_plan_tasks_pvt.g_from_sales_order_id);
609: END IF;
610:
611: IF wms_plan_tasks_pvt.g_to_sales_order_id IS NOT NULL
612: THEN
609: END IF;
610:
611: IF wms_plan_tasks_pvt.g_to_sales_order_id IS NOT NULL
612: THEN
613: DBMS_SQL.bind_variable (l_query_handle,'to_sales_order_id',wms_plan_tasks_pvt.g_to_sales_order_id);
614: END IF;
615: ELSE --completed tasks
616: IF(l_is_range_so) then
617: IF wms_plan_tasks_pvt.g_from_sales_order_id IS NOT NULL THEN
614: END IF;
615: ELSE --completed tasks
616: IF(l_is_range_so) then
617: IF wms_plan_tasks_pvt.g_from_sales_order_id IS NOT NULL THEN
618: --3240261 dbms_sql.bind_variable(l_query_handle, 'from_sales_order_id', p_from_sales_order_id);
619: dbms_sql.bind_variable(l_query_handle,'l_from_tonum_mso_seg1',l_from_tonum_mso_seg1);--added for 3455109
620: dbms_sql.bind_variable(l_query_handle,'l_from_mso_seg2',l_from_mso_seg2);--3455109
621: END IF;
622:
615: ELSE --completed tasks
616: IF(l_is_range_so) then
617: IF wms_plan_tasks_pvt.g_from_sales_order_id IS NOT NULL THEN
618: --3240261 dbms_sql.bind_variable(l_query_handle, 'from_sales_order_id', p_from_sales_order_id);
619: dbms_sql.bind_variable(l_query_handle,'l_from_tonum_mso_seg1',l_from_tonum_mso_seg1);--added for 3455109
620: dbms_sql.bind_variable(l_query_handle,'l_from_mso_seg2',l_from_mso_seg2);--3455109
621: END IF;
622:
623: IF wms_plan_tasks_pvt.g_to_sales_order_id IS NOT NULL THEN
616: IF(l_is_range_so) then
617: IF wms_plan_tasks_pvt.g_from_sales_order_id IS NOT NULL THEN
618: --3240261 dbms_sql.bind_variable(l_query_handle, 'from_sales_order_id', p_from_sales_order_id);
619: dbms_sql.bind_variable(l_query_handle,'l_from_tonum_mso_seg1',l_from_tonum_mso_seg1);--added for 3455109
620: dbms_sql.bind_variable(l_query_handle,'l_from_mso_seg2',l_from_mso_seg2);--3455109
621: END IF;
622:
623: IF wms_plan_tasks_pvt.g_to_sales_order_id IS NOT NULL THEN
624: --3420261 dbms_sql.bind_variable(l_query_handle, 'to_sales_order_id', p_to_sales_order_id);
620: dbms_sql.bind_variable(l_query_handle,'l_from_mso_seg2',l_from_mso_seg2);--3455109
621: END IF;
622:
623: IF wms_plan_tasks_pvt.g_to_sales_order_id IS NOT NULL THEN
624: --3420261 dbms_sql.bind_variable(l_query_handle, 'to_sales_order_id', p_to_sales_order_id);
625: dbms_sql.bind_variable(l_query_handle,'l_to_tonum_mso_seg1',l_to_tonum_mso_seg1);
626: dbms_sql.bind_variable(l_query_handle,'l_to_mso_seg2',l_to_mso_seg2);
627: END IF;
628: ELSE
621: END IF;
622:
623: IF wms_plan_tasks_pvt.g_to_sales_order_id IS NOT NULL THEN
624: --3420261 dbms_sql.bind_variable(l_query_handle, 'to_sales_order_id', p_to_sales_order_id);
625: dbms_sql.bind_variable(l_query_handle,'l_to_tonum_mso_seg1',l_to_tonum_mso_seg1);
626: dbms_sql.bind_variable(l_query_handle,'l_to_mso_seg2',l_to_mso_seg2);
627: END IF;
628: ELSE
629: dbms_sql.bind_variable(l_query_handle,'l_from_mso_seg1',l_from_mso_seg1);
622:
623: IF wms_plan_tasks_pvt.g_to_sales_order_id IS NOT NULL THEN
624: --3420261 dbms_sql.bind_variable(l_query_handle, 'to_sales_order_id', p_to_sales_order_id);
625: dbms_sql.bind_variable(l_query_handle,'l_to_tonum_mso_seg1',l_to_tonum_mso_seg1);
626: dbms_sql.bind_variable(l_query_handle,'l_to_mso_seg2',l_to_mso_seg2);
627: END IF;
628: ELSE
629: dbms_sql.bind_variable(l_query_handle,'l_from_mso_seg1',l_from_mso_seg1);
630: dbms_sql.bind_variable(l_query_handle,'l_from_mso_seg2',l_from_mso_seg2);
625: dbms_sql.bind_variable(l_query_handle,'l_to_tonum_mso_seg1',l_to_tonum_mso_seg1);
626: dbms_sql.bind_variable(l_query_handle,'l_to_mso_seg2',l_to_mso_seg2);
627: END IF;
628: ELSE
629: dbms_sql.bind_variable(l_query_handle,'l_from_mso_seg1',l_from_mso_seg1);
630: dbms_sql.bind_variable(l_query_handle,'l_from_mso_seg2',l_from_mso_seg2);
631: END IF;--end of range or not range so
632:
633: END IF;--end of copleted or not completed task 3455109
626: dbms_sql.bind_variable(l_query_handle,'l_to_mso_seg2',l_to_mso_seg2);
627: END IF;
628: ELSE
629: dbms_sql.bind_variable(l_query_handle,'l_from_mso_seg1',l_from_mso_seg1);
630: dbms_sql.bind_variable(l_query_handle,'l_from_mso_seg2',l_from_mso_seg2);
631: END IF;--end of range or not range so
632:
633: END IF;--end of copleted or not completed task 3455109
634:
633: END IF;--end of copleted or not completed task 3455109
634:
635: IF wms_plan_tasks_pvt.g_from_pick_slip_number IS NOT NULL
636: THEN
637: DBMS_SQL.bind_variable (l_query_handle,'from_pick_slip_number',wms_plan_tasks_pvt.g_from_pick_slip_number);
638: END IF;
639:
640: IF wms_plan_tasks_pvt.g_to_pick_slip_number IS NOT NULL
641: THEN
638: END IF;
639:
640: IF wms_plan_tasks_pvt.g_to_pick_slip_number IS NOT NULL
641: THEN
642: DBMS_SQL.bind_variable (l_query_handle,'to_pick_slip_number',wms_plan_tasks_pvt.g_to_pick_slip_number);
643: END IF;
644:
645: IF wms_plan_tasks_pvt.g_customer_id IS NOT NULL
646: THEN
643: END IF;
644:
645: IF wms_plan_tasks_pvt.g_customer_id IS NOT NULL
646: THEN
647: DBMS_SQL.bind_variable (l_query_handle,'customer_id',wms_plan_tasks_pvt.g_customer_id);
648: END IF;
649:
650: IF wms_plan_tasks_pvt.g_customer_category IS NOT NULL
651: THEN
648: END IF;
649:
650: IF wms_plan_tasks_pvt.g_customer_category IS NOT NULL
651: THEN
652: DBMS_SQL.bind_variable (l_query_handle,'customer_category',wms_plan_tasks_pvt.g_customer_category);
653: END IF;
654:
655: IF wms_plan_tasks_pvt.g_trip_id IS NOT NULL
656: THEN
653: END IF;
654:
655: IF wms_plan_tasks_pvt.g_trip_id IS NOT NULL
656: THEN
657: DBMS_SQL.bind_variable (l_query_handle, 'trip_id', wms_plan_tasks_pvt.g_trip_id);
658: END IF;
659:
660: IF wms_plan_tasks_pvt.g_delivery_id IS NOT NULL
661: THEN
658: END IF;
659:
660: IF wms_plan_tasks_pvt.g_delivery_id IS NOT NULL
661: THEN
662: DBMS_SQL.bind_variable (l_query_handle,'delivery_id',wms_plan_tasks_pvt.g_delivery_id);
663: END IF;
664:
665: IF wms_plan_tasks_pvt.g_carrier_id IS NOT NULL
666: THEN
663: END IF;
664:
665: IF wms_plan_tasks_pvt.g_carrier_id IS NOT NULL
666: THEN
667: DBMS_SQL.bind_variable (l_query_handle,'carrier_id',wms_plan_tasks_pvt.g_carrier_id);
668: END IF;
669:
670: IF wms_plan_tasks_pvt.g_ship_method IS NOT NULL
671: THEN
668: END IF;
669:
670: IF wms_plan_tasks_pvt.g_ship_method IS NOT NULL
671: THEN
672: DBMS_SQL.bind_variable (l_query_handle,'ship_method',wms_plan_tasks_pvt.g_ship_method);
673: END IF;
674:
675: IF wms_plan_tasks_pvt.g_shipment_priority IS NOT NULL
676: THEN
673: END IF;
674:
675: IF wms_plan_tasks_pvt.g_shipment_priority IS NOT NULL
676: THEN
677: DBMS_SQL.bind_variable (l_query_handle,'shipment_priority',wms_plan_tasks_pvt.g_shipment_priority);
678: END IF;
679:
680: IF wms_plan_tasks_pvt.g_from_shipment_date IS NOT NULL
681: THEN
678: END IF;
679:
680: IF wms_plan_tasks_pvt.g_from_shipment_date IS NOT NULL
681: THEN
682: DBMS_SQL.bind_variable (l_query_handle,'from_shipment_date',wms_plan_tasks_pvt.g_from_shipment_date);
683: END IF;
684:
685: IF wms_plan_tasks_pvt.g_to_shipment_date IS NOT NULL
686: THEN
683: END IF;
684:
685: IF wms_plan_tasks_pvt.g_to_shipment_date IS NOT NULL
686: THEN
687: DBMS_SQL.bind_variable (l_query_handle,'to_shipment_date',wms_plan_tasks_pvt.g_to_shipment_date);
688: END IF;
689: /*
690: IF wms_plan_tasks_pvt.g_time_till_shipment IS NOT NULL AND wms_plan_tasks_pvt.g_time_till_shipment_uom_code IS NOT NULL
691: THEN
688: END IF;
689: /*
690: IF wms_plan_tasks_pvt.g_time_till_shipment IS NOT NULL AND wms_plan_tasks_pvt.g_time_till_shipment_uom_code IS NOT NULL
691: THEN
692: DBMS_SQL.bind_variable (l_query_handle,'p_time_till_shipment',wms_plan_tasks_pvt.g_time_till_shipment);
693: END IF;
694: */
695:
696: IF wms_plan_tasks_pvt.g_ship_to_state IS NOT NULL
694: */
695:
696: IF wms_plan_tasks_pvt.g_ship_to_state IS NOT NULL
697: THEN
698: DBMS_SQL.bind_variable (l_query_handle,'ship_to_state',wms_plan_tasks_pvt.g_ship_to_state);
699: END IF;
700:
701: IF wms_plan_tasks_pvt.g_ship_to_country IS NOT NULL
702: THEN
699: END IF;
700:
701: IF wms_plan_tasks_pvt.g_ship_to_country IS NOT NULL
702: THEN
703: DBMS_SQL.bind_variable (l_query_handle,'ship_to_country',wms_plan_tasks_pvt.g_ship_to_country);
704: END IF;
705:
706: IF wms_plan_tasks_pvt.g_ship_to_postal_code IS NOT NULL
707: THEN
704: END IF;
705:
706: IF wms_plan_tasks_pvt.g_ship_to_postal_code IS NOT NULL
707: THEN
708: DBMS_SQL.bind_variable (l_query_handle,'ship_to_postal_code',wms_plan_tasks_pvt.g_ship_to_postal_code);
709: END IF;
710:
711: IF wms_plan_tasks_pvt.g_from_number_of_order_lines IS NOT NULL
712: THEN
709: END IF;
710:
711: IF wms_plan_tasks_pvt.g_from_number_of_order_lines IS NOT NULL
712: THEN
713: DBMS_SQL.bind_variable (l_query_handle,'from_number_of_order_lines',wms_plan_tasks_pvt.g_from_number_of_order_lines);
714: END IF;
715:
716: IF wms_plan_tasks_pvt.g_to_number_of_order_lines IS NOT NULL
717: THEN
714: END IF;
715:
716: IF wms_plan_tasks_pvt.g_to_number_of_order_lines IS NOT NULL
717: THEN
718: DBMS_SQL.bind_variable (l_query_handle,'to_number_of_order_lines',wms_plan_tasks_pvt.g_to_number_of_order_lines);
719: END IF;
720:
721: END IF;
722:
724: IF l_debug = 1 THEN
725: debug('end setting the bind variables ','query_inbound');
726: END IF;
727: IF p_summary_mode = 1 THEN
728: DBMS_SQL.DEFINE_COLUMN(l_query_handle, 1, l_wms_task_type);
729: DBMS_SQL.DEFINE_COLUMN(l_query_handle, 2, l_task_count);
730: END IF;
731:
732: l_query_count := DBMS_SQL.EXECUTE(l_query_handle);
725: debug('end setting the bind variables ','query_inbound');
726: END IF;
727: IF p_summary_mode = 1 THEN
728: DBMS_SQL.DEFINE_COLUMN(l_query_handle, 1, l_wms_task_type);
729: DBMS_SQL.DEFINE_COLUMN(l_query_handle, 2, l_task_count);
730: END IF;
731:
732: l_query_count := DBMS_SQL.EXECUTE(l_query_handle);
733: IF p_summary_mode = 1 THEN
728: DBMS_SQL.DEFINE_COLUMN(l_query_handle, 1, l_wms_task_type);
729: DBMS_SQL.DEFINE_COLUMN(l_query_handle, 2, l_task_count);
730: END IF;
731:
732: l_query_count := DBMS_SQL.EXECUTE(l_query_handle);
733: IF p_summary_mode = 1 THEN
734: LOOP
735: IF DBMS_SQL.FETCH_ROWS(l_query_handle)>0 THEN
736: DBMS_SQL.COLUMN_VALUE(l_query_handle, 1, l_wms_task_type);
731:
732: l_query_count := DBMS_SQL.EXECUTE(l_query_handle);
733: IF p_summary_mode = 1 THEN
734: LOOP
735: IF DBMS_SQL.FETCH_ROWS(l_query_handle)>0 THEN
736: DBMS_SQL.COLUMN_VALUE(l_query_handle, 1, l_wms_task_type);
737: DBMS_SQL.COLUMN_VALUE(l_query_handle, 2, l_task_count);
738: IF l_debug = 1 THEN
739: debug(' l_wms_task_type : ' || l_wms_task_type, 'query_inbound');
732: l_query_count := DBMS_SQL.EXECUTE(l_query_handle);
733: IF p_summary_mode = 1 THEN
734: LOOP
735: IF DBMS_SQL.FETCH_ROWS(l_query_handle)>0 THEN
736: DBMS_SQL.COLUMN_VALUE(l_query_handle, 1, l_wms_task_type);
737: DBMS_SQL.COLUMN_VALUE(l_query_handle, 2, l_task_count);
738: IF l_debug = 1 THEN
739: debug(' l_wms_task_type : ' || l_wms_task_type, 'query_inbound');
740: debug(' l_wms_task_count : ' || l_task_count, 'query_inbound');
733: IF p_summary_mode = 1 THEN
734: LOOP
735: IF DBMS_SQL.FETCH_ROWS(l_query_handle)>0 THEN
736: DBMS_SQL.COLUMN_VALUE(l_query_handle, 1, l_wms_task_type);
737: DBMS_SQL.COLUMN_VALUE(l_query_handle, 2, l_task_count);
738: IF l_debug = 1 THEN
739: debug(' l_wms_task_type : ' || l_wms_task_type, 'query_inbound');
740: debug(' l_wms_task_count : ' || l_task_count, 'query_inbound');
741: END IF;
765: l_plans_query := l_insert_str || l_plans_query_str;
766: IF l_debug = 1 THEN
767: debug('l_plans_query ' || l_plans_query,'query_inbound');
768: END IF;
769: l_query_handle := DBMS_SQL.open_cursor;
770: DBMS_SQL.parse(l_query_handle, l_plans_query, DBMS_SQL.native);
771:
772: /* Set the bind variables now */
773: IF wms_plan_tasks_pvt.g_organization_id IS NOT NULL THEN
766: IF l_debug = 1 THEN
767: debug('l_plans_query ' || l_plans_query,'query_inbound');
768: END IF;
769: l_query_handle := DBMS_SQL.open_cursor;
770: DBMS_SQL.parse(l_query_handle, l_plans_query, DBMS_SQL.native);
771:
772: /* Set the bind variables now */
773: IF wms_plan_tasks_pvt.g_organization_id IS NOT NULL THEN
774: IF l_debug = 1 THEN
773: IF wms_plan_tasks_pvt.g_organization_id IS NOT NULL THEN
774: IF l_debug = 1 THEN
775: debug('wms_plan_tasks_pvt.g_organization_id IS NOT NULL ','query_inbound');
776: END IF;
777: dbms_sql.bind_variable(l_query_handle, 'org_id', wms_plan_tasks_pvt.g_organization_id);
778: END IF;
779: IF wms_plan_tasks_pvt.g_subinventory_code IS NOT NULL THEN
780: IF l_debug = 1 THEN
781: debug('wms_plan_tasks_pvt.g_subinventory_code IS NOT NULL ','query_inbound');
779: IF wms_plan_tasks_pvt.g_subinventory_code IS NOT NULL THEN
780: IF l_debug = 1 THEN
781: debug('wms_plan_tasks_pvt.g_subinventory_code IS NOT NULL ','query_inbound');
782: END IF;
783: dbms_sql.bind_variable(l_query_handle, 'sub_code', wms_plan_tasks_pvt.g_subinventory_code);
784: END IF;
785: IF wms_plan_tasks_pvt.g_locator_id IS NOT NULL THEN
786: IF l_debug = 1 THEN
787: debug('wms_plan_tasks_pvt.g_locator_id IS NOT NULL ','query_inbound');
785: IF wms_plan_tasks_pvt.g_locator_id IS NOT NULL THEN
786: IF l_debug = 1 THEN
787: debug('wms_plan_tasks_pvt.g_locator_id IS NOT NULL ','query_inbound');
788: END IF;
789: dbms_sql.bind_variable(l_query_handle, 'loc_id', wms_plan_tasks_pvt.g_locator_id);
790: END IF;
791: IF wms_plan_tasks_pvt.g_to_subinventory_code IS NOT NULL THEN
792: IF l_debug = 1 THEN
793: debug('wms_plan_tasks_pvt.g_to_subinventory_code IS NOT NULL ','query_inbound');
791: IF wms_plan_tasks_pvt.g_to_subinventory_code IS NOT NULL THEN
792: IF l_debug = 1 THEN
793: debug('wms_plan_tasks_pvt.g_to_subinventory_code IS NOT NULL ','query_inbound');
794: END IF;
795: dbms_sql.bind_variable(l_query_handle, 'to_sub_code', wms_plan_tasks_pvt.g_to_subinventory_code );
796: END IF;
797: IF wms_plan_tasks_pvt.g_to_locator_id IS NOT NULL THEN
798: IF l_debug = 1 THEN
799: debug('wms_plan_tasks_pvt.g_to_locator_id IS NOT NULL ','query_inbound');
797: IF wms_plan_tasks_pvt.g_to_locator_id IS NOT NULL THEN
798: IF l_debug = 1 THEN
799: debug('wms_plan_tasks_pvt.g_to_locator_id IS NOT NULL ','query_inbound');
800: END IF;
801: dbms_sql.bind_variable(l_query_handle, 'to_loc_id', wms_plan_tasks_pvt.g_to_locator_id );
802: END IF;
803: IF wms_plan_tasks_pvt.g_inventory_item_id IS NOT NULL THEN
804: IF l_debug = 1 THEN
805: debug('wms_plan_tasks_pvt.g_inventory_item_id IS NOT NULL ','query_inbound');
803: IF wms_plan_tasks_pvt.g_inventory_item_id IS NOT NULL THEN
804: IF l_debug = 1 THEN
805: debug('wms_plan_tasks_pvt.g_inventory_item_id IS NOT NULL ','query_inbound');
806: END IF;
807: dbms_sql.bind_variable(l_query_handle, 'item_id', wms_plan_tasks_pvt.g_inventory_item_id );
808: END IF;
809: IF wms_plan_tasks_pvt.g_category_set_id IS NOT NULL THEN
810: IF l_debug = 1 THEN
811: debug('wms_plan_tasks_pvt.g_category_set_id IS NOT NULL ','query_inbound');
809: IF wms_plan_tasks_pvt.g_category_set_id IS NOT NULL THEN
810: IF l_debug = 1 THEN
811: debug('wms_plan_tasks_pvt.g_category_set_id IS NOT NULL ','query_inbound');
812: END IF;
813: dbms_sql.bind_variable(l_query_handle, 'category_set_id', wms_plan_tasks_pvt.g_category_set_id );
814: END IF;
815: IF wms_plan_tasks_pvt.g_item_category_id IS NOT NULL THEN
816: IF l_debug = 1 THEN
817: debug('wms_plan_tasks_pvt.g_item_category_id IS NOT NULL ','query_inbound');
815: IF wms_plan_tasks_pvt.g_item_category_id IS NOT NULL THEN
816: IF l_debug = 1 THEN
817: debug('wms_plan_tasks_pvt.g_item_category_id IS NOT NULL ','query_inbound');
818: END IF;
819: dbms_sql.bind_variable(l_query_handle, 'item_category_id', wms_plan_tasks_pvt.g_item_category_id );
820: END IF;
821: IF wms_plan_tasks_pvt.g_user_task_type_id IS NOT NULL THEN
822: IF l_debug = 1 THEN
823: debug('wms_plan_tasks_pvt.g_user_task_type_id IS NOT NULL ','query_inbound');
821: IF wms_plan_tasks_pvt.g_user_task_type_id IS NOT NULL THEN
822: IF l_debug = 1 THEN
823: debug('wms_plan_tasks_pvt.g_user_task_type_id IS NOT NULL ','query_inbound');
824: END IF;
825: dbms_sql.bind_variable(l_query_handle, 'user_task_type_id', wms_plan_tasks_pvt.g_user_task_type_id );
826: END IF;
827: IF wms_plan_tasks_pvt.g_from_task_quantity IS NOT NULL THEN
828: IF l_debug = 1 THEN
829: debug('wms_plan_tasks_pvt.g_from_task_quantity IS NOT NULL ','query_inbound');
827: IF wms_plan_tasks_pvt.g_from_task_quantity IS NOT NULL THEN
828: IF l_debug = 1 THEN
829: debug('wms_plan_tasks_pvt.g_from_task_quantity IS NOT NULL ','query_inbound');
830: END IF;
831: dbms_sql.bind_variable(l_query_handle, 'from_task_quantity', wms_plan_tasks_pvt.g_from_task_quantity );
832: END IF;
833: IF wms_plan_tasks_pvt.g_to_task_quantity IS NOT NULL THEN
834: IF l_debug = 1 THEN
835: debug('wms_plan_tasks_pvt.g_to_task_quantity IS NOT NULL ','query_inbound');
833: IF wms_plan_tasks_pvt.g_to_task_quantity IS NOT NULL THEN
834: IF l_debug = 1 THEN
835: debug('wms_plan_tasks_pvt.g_to_task_quantity IS NOT NULL ','query_inbound');
836: END IF;
837: dbms_sql.bind_variable(l_query_handle, 'to_task_quantity', wms_plan_tasks_pvt.g_to_task_quantity );
838: END IF;
839: IF wms_plan_tasks_pvt.g_from_task_priority IS NOT NULL THEN
840: IF l_debug = 1 THEN
841: debug('wms_plan_tasks_pvt.g_from_task_priority IS NOT NULL ','query_inbound');
839: IF wms_plan_tasks_pvt.g_from_task_priority IS NOT NULL THEN
840: IF l_debug = 1 THEN
841: debug('wms_plan_tasks_pvt.g_from_task_priority IS NOT NULL ','query_inbound');
842: END IF;
843: dbms_sql.bind_variable(l_query_handle, 'from_task_priority', wms_plan_tasks_pvt.g_from_task_priority );
844: END IF;
845:
846: IF wms_plan_tasks_pvt.g_to_task_priority IS NOT NULL THEN
847: IF l_debug = 1 THEN
846: IF wms_plan_tasks_pvt.g_to_task_priority IS NOT NULL THEN
847: IF l_debug = 1 THEN
848: debug('wms_plan_tasks_pvt.g_to_task_priority IS NOT NULL ','query_inbound');
849: END IF;
850: dbms_sql.bind_variable(l_query_handle, 'to_task_priority', wms_plan_tasks_pvt.g_to_task_priority );
851: END IF;
852: IF wms_plan_tasks_pvt.g_from_creation_date IS NOT NULL THEN
853: IF l_debug = 1 THEN
854: debug('wms_plan_tasks_pvt.g_from_creation_date IS NOT NULL ','query_inbound');
852: IF wms_plan_tasks_pvt.g_from_creation_date IS NOT NULL THEN
853: IF l_debug = 1 THEN
854: debug('wms_plan_tasks_pvt.g_from_creation_date IS NOT NULL ','query_inbound');
855: END IF;
856: dbms_sql.bind_variable(l_query_handle, 'from_creation_date', wms_plan_tasks_pvt.g_from_creation_date );
857: END IF;
858: IF wms_plan_tasks_pvt.g_to_creation_date IS NOT NULL THEN
859: IF l_debug = 1 THEN
860: debug('wms_plan_tasks_pvt.g_to_creation_date IS NOT NULL ','query_inbound');
858: IF wms_plan_tasks_pvt.g_to_creation_date IS NOT NULL THEN
859: IF l_debug = 1 THEN
860: debug('wms_plan_tasks_pvt.g_to_creation_date IS NOT NULL ','query_inbound');
861: END IF;
862: dbms_sql.bind_variable(l_query_handle, 'to_creation_date', wms_plan_tasks_pvt.g_to_creation_date );
863: END IF;
864: IF wms_plan_tasks_pvt.g_plan_type_id IS NOT NULL THEN
865: IF l_debug = 1 THEN
866: debug('wms_plan_tasks_pvt.g_plan_type_id IS NOT NULL ','query_inbound');
864: IF wms_plan_tasks_pvt.g_plan_type_id IS NOT NULL THEN
865: IF l_debug = 1 THEN
866: debug('wms_plan_tasks_pvt.g_plan_type_id IS NOT NULL ','query_inbound');
867: END IF;
868: dbms_sql.bind_variable(l_query_handle, 'plan_type_id', wms_plan_tasks_pvt.g_plan_type_id );
869: END IF;
870: IF wms_plan_tasks_pvt.g_op_plan_id IS NOT NULL THEN
871: IF l_debug = 1 THEN
872: debug('wms_plan_tasks_pvt.g_op_plan_id IS NOT NULL ','query_inbound');
870: IF wms_plan_tasks_pvt.g_op_plan_id IS NOT NULL THEN
871: IF l_debug = 1 THEN
872: debug('wms_plan_tasks_pvt.g_op_plan_id IS NOT NULL ','query_inbound');
873: END IF;
874: dbms_sql.bind_variable(l_query_handle, 'op_plan_id', wms_plan_tasks_pvt.g_op_plan_id );
875: END IF;
876: /* end setting the bind variables */
877: IF l_debug = 1 THEN
878: debug('end setting the bind variables for plans query','query_inbound');
876: /* end setting the bind variables */
877: IF l_debug = 1 THEN
878: debug('end setting the bind variables for plans query','query_inbound');
879: END IF;
880: l_query_count := DBMS_SQL.EXECUTE(l_query_handle);
881: IF l_debug = 1 THEN
882: debug('l_query_count after executing the plans query ' || l_query_count ,'query_inbound');
883: END IF;
884: wms_plan_tasks_pvt.g_plans_tasks_record_count :=