2024-07-29 16:00:36.494950
SELECT l.loc_code, l.location_name, l.inactive
                FROM 0_locations l 
                    LEFT JOIN 0_locations pl ON 
                            l.loc_code = pl.reservation_loc_code 
                WHERE pl.loc_code IS NULL ORDER BY l.location_name

2024-07-29 16:00:36.503995
SELECT project_id, project_code, value_name, description, project_name  
            FROM 0_projects_master pm 
                    INNER JOIN 0_user_data_access_groups udag ON
                            pm.dag_id = udag.dag_id  
                    LEFT JOIN 0_list_values lv ON 
                            pm.department_id = lv.id 
            WHERE pm.inactive = 0 AND udag.user_id =215 AND (pm.project_id='') ORDER BY value_name,pm.description

2024-07-29 16:00:36.508602
SELECT id, real_name, inactive  FROM 0_users ORDER BY real_name

2024-07-29 16:00:36.513591
SELECT COUNT(DISTINCT pr.pr_no) FROM 0_purchase_requisitions as pr, 
                0_projects_master as p, 
                0_locations l,
                0_users as u
	  WHERE (pr.project_id = p.project_id AND 
                l.loc_code = pr.location AND 
                pr.created_by = u.id  AND pr.created_on >= '2024-06-29' AND pr.created_on <= '2024-07-30')

2024-07-29 16:00:36.534065
SELECT 
                pr.pr_no, 
                pr.reference,  
                l.location_name location,
                p.description, 
                pr.pr_date,
                u.real_name originator_name,
                pr.created_on,
                pr.approval_status,
                pr.pr_complete 
	 FROM 0_purchase_requisitions as pr, 
                0_projects_master as p, 
                0_locations l,
                0_users as u
	  WHERE (pr.project_id = p.project_id AND 
                l.loc_code = pr.location AND 
                pr.created_by = u.id  AND pr.created_on >= '2024-06-29' AND pr.created_on <= '2024-07-30') GROUP BY pr.pr_no LIMIT 0, 10

2024-07-29 16:00:37.710364
SELECT l.loc_code, l.location_name, l.inactive
                FROM 0_locations l 
                    LEFT JOIN 0_locations pl ON 
                            l.loc_code = pl.reservation_loc_code 
                WHERE pl.loc_code IS NULL ORDER BY l.location_name

2024-07-29 16:00:37.712472
SELECT project_id, project_code, value_name, description, project_name  
            FROM 0_projects_master pm 
                    INNER JOIN 0_user_data_access_groups udag ON
                            pm.dag_id = udag.dag_id  
                    LEFT JOIN 0_list_values lv ON 
                            pm.department_id = lv.id 
            WHERE pm.inactive = 0 AND udag.user_id =215 AND (pm.project_id='') ORDER BY value_name,pm.description

2024-07-29 16:00:37.715020
SELECT id, real_name, inactive  FROM 0_users ORDER BY real_name

2024-07-29 16:00:37.718640
SELECT 
                pr.pr_no, 
                pr.reference,  
                l.location_name location,
                p.description, 
                pr.pr_date,
                u.real_name originator_name,
                pr.created_on,
                pr.approval_status,
                pr.pr_complete 
	 FROM 0_purchase_requisitions as pr, 
                0_projects_master as p, 
                0_locations l,
                0_users as u
	  WHERE (pr.project_id = p.project_id AND 
                l.loc_code = pr.location AND 
                pr.created_by = u.id  AND pr.created_on >= '2024-06-29' AND pr.created_on <= '2024-07-30') GROUP BY pr.pr_no LIMIT 20, 10

2024-07-29 16:00:40.739459
SELECT pr.*,
                l.location_name,
                pm.description project,
                u.real_name originator_name 
            FROM 0_purchase_requisitions pr
                LEFT JOIN 0_locations l ON l.loc_code = pr.location  
                LEFT JOIN 0_projects_master pm ON pm.project_id =pr.project_id                 
                LEFT JOIN 0_users u ON pr.created_by = u.id 
            WHERE 
                pr.pr_no = 2228

2024-07-29 16:00:40.741592
SELECT project_id  
            FROM 0_projects_master pm 
                    INNER JOIN 0_user_data_access_groups udag ON
                            pm.dag_id = udag.dag_id  
            WHERE pm.project_id = '39' AND 
                    udag.user_id ='215'

2024-07-29 16:00:40.744805
SELECT prd.*,
                sm.description, 
                sm.stock_control_method,
                sm.material_cost + sm.labour_cost + sm.overhead_cost AS standard_cost,
                sm.mb_flag,
                pt.description task_description,
                ps.description project_site_description,
                ru.name req_unit_name 
            FROM 0_purchase_requisition_details prd 
                INNER JOIN 0_stock_master sm ON 
                        prd.item_code = sm.stock_id     
                INNER JOIN 0_item_units ru ON 
                        prd.requested_unit = ru.abbr      
                LEFT JOIN 0_project_tasks pt ON 
                        prd.task_id = pt.task_id 
                LEFT JOIN 0_project_sites ps ON 
                        prd.project_site_id = ps.id                 
            WHERE 
                prd.requisition_id = '2228' 

2024-07-29 16:00:40.766382
SELECT SUM(grni.qty_recd) total_base_unit_qty 
            FROM 0_purchase_requisition_details prd  
                JOIN 0_pr_po_details pr_po 
                    ON prd.id = pr_po.pr_line_id 
                JOIN 0_purch_order_details pod 
                    ON pod.po_detail_item = pr_po.po_line_id 
                JOIN 0_grn_items grni 
                    ON grni.po_detail_item = pod.po_detail_item 
            WHERE prd.id = '7791'

2024-07-29 16:00:40.776220
SELECT pr_po.id allocation_id
            FROM 0_pr_po_details pr_po 
            WHERE 
                pr_po.pr_line_id = 7791

2024-07-29 16:00:40.777803
SELECT
                    pri.pri_no,
                    pri.reference,  
                    pri.source_pr_no,                 
                    l.location_name location,
                    pri.created_on,
                    u.real_name originator_name,                   
                    pri.po_no                    

		FROM  0_purchase_requisition_issues as pri,                     
                        0_locations l,
                        0_users as u
                    
		WHERE l.loc_code = pri.issuing_location AND                      
                        pri.created_by = u.id AND 
                        pri.source_pr_no = '2228' 

2024-07-29 16:00:40.785194
SELECT
                    pri.prr_no,
                    pri.reference,  
                    pri.pr_no,                 
                    l.location_name location,
                    pri.created_on,
                    u.real_name originator_name,                   
                    pri.cn_no                    

		FROM  0_purchase_requisition_returns as pri,                     
                        0_locations l,
                        0_users as u
                    
		WHERE l.loc_code = pri.location AND                      
                        pri.created_by = u.id AND 
                        pri.pr_no = '2228' 

2024-07-29 16:00:40.794358
SELECT DISTINCT * FROM 0_attachments WHERE type_no='18' AND trans_no='2228'

2024-07-29 16:00:40.795716
SELECT * FROM 0_attachments WHERE type_no='18' AND trans_no='2228' ORDER BY trans_no

2024-07-29 16:00:48.223928
SELECT name, value FROM 0_sys_prefs

2024-07-29 16:00:49.386603
SELECT name, value FROM 0_sys_prefs

2024-07-29 16:00:51.68801
SELECT * FROM 0_lists  
		WHERE 
              list_code= 'DEPARTMENTS'

2024-07-29 16:00:51.94477
SELECT id, value_name, list_code, value_code,  value_description  FROM 0_list_values WHERE inactive = 0 AND list_code = 'DEPARTMENTS' ORDER BY display_order,value_name

2024-07-29 16:00:51.103746
SELECT project_id, project_code, value_name, description, project_name  
            FROM 0_projects_master pm 
                    INNER JOIN 0_user_data_access_groups udag ON
                            pm.dag_id = udag.dag_id  
                    LEFT JOIN 0_list_values lv ON 
                            pm.department_id = lv.id 
            WHERE pm.inactive = 0 AND udag.user_id =215 AND (pm.project_id='') ORDER BY value_name,pm.description

2024-07-29 16:00:51.199584
SELECT id, real_name  FROM 0_users WHERE inactive = 0  ORDER BY real_name

2024-07-29 16:00:51.369744
SELECT  
                    pr.pr_no, 
                    pr.location pr_loc_code, 
                    pr.created_on,
                    pr.project_id,
                    prd.task_id,
                    ic.item_code, 
                    ic.description, 
                    ppd.order_quantity,
                    ppd.supplier_id,
                    ppd.line_loc_code,
                    ppd.order_unit,
                    ppd.order_unit_qty,
                    ppd.order_unit_price,
                    ppd.order_unit_price_discount,
                    ppd.id pr_po_line_id,
                    prd.id pr_line_id,
                    prd.line_comment, 
                    prd.quantity, 
                    prd.units,
                    prd.estimate_price, 
                    prd.required_date, 
                    pm.description project_description,
                    prd.requested_unit,
                    prd.requested_unit_qty,
                    prd.item_pr_description,
                    prd.req_unit_conv_factor,
                    sup.supp_name supplier_name,
                    ppd.item_description pr_po_item_description,
                    ppd.po_line_id,
                    origi.real_name originator_name,
                    p_offic.real_name created_pofficer_name,
                    p_offiu.real_name updated_pofficer_name,
                    pod.delivery_date po_line_delivery_date  
                FROM 
                    0_item_codes ic 
                    INNER JOIN 0_purchase_requisition_details prd ON ic.item_code = prd.item_code
                    INNER JOIN 0_purchase_requisitions pr ON prd.requisition_id = pr.pr_no
                    INNER JOIN 0_projects_master pm ON pr.project_id = pm.project_id 
                    INNER JOIN 0_users origi ON pr.created_by = origi.id   
                    LEFT JOIN 0_pr_po_details ppd ON prd.id = ppd.pr_line_id 
                    LEFT JOIN 0_suppliers sup ON ppd.supplier_id = sup.supplier_id  
                    LEFT JOIN 0_users p_offic ON ppd.created_by = p_offic.id
                    LEFT JOIN 0_users p_offiu ON ppd.updated_by = p_offiu.id 
                    LEFT JOIN 0_purch_order_details pod ON ppd.po_line_id = pod.po_detail_item  
                WHERE  ((prd.line_complete = 0) OR  
                        (prd.line_complete = 1 AND ppd.po_line_id = 0)) AND 
                        (pr.approval_status = 30 OR pr.approval_status = 60 OR pr.approval_status = 100)  AND pr.project_id = 'dddddddddddddddddd' ORDER BY pr.pr_no, prd.id

2024-07-29 16:00:51.872199
SELECT * FROM 0_lists  
		WHERE 
              list_code= 'DEPARTMENTS'

2024-07-29 16:00:51.873823
SELECT id, value_name, list_code, value_code,  value_description  FROM 0_list_values WHERE inactive = 0 AND list_code = 'DEPARTMENTS' ORDER BY display_order,value_name

2024-07-29 16:00:51.876283
SELECT project_id, project_code, value_name, description, project_name  
            FROM 0_projects_master pm 
                    INNER JOIN 0_user_data_access_groups udag ON
                            pm.dag_id = udag.dag_id  
                    LEFT JOIN 0_list_values lv ON 
                            pm.department_id = lv.id 
            WHERE pm.inactive = 0 AND udag.user_id =215 AND (pm.project_id='') ORDER BY value_name,pm.description

2024-07-29 16:00:51.886039
SELECT id, real_name  FROM 0_users WHERE inactive = 0  ORDER BY real_name

2024-07-29 16:00:51.889945
SELECT  
                    pr.pr_no, 
                    pr.location pr_loc_code, 
                    pr.created_on,
                    pr.project_id,
                    prd.task_id,
                    ic.item_code, 
                    ic.description, 
                    ppd.order_quantity,
                    ppd.supplier_id,
                    ppd.line_loc_code,
                    ppd.order_unit,
                    ppd.order_unit_qty,
                    ppd.order_unit_price,
                    ppd.order_unit_price_discount,
                    ppd.id pr_po_line_id,
                    prd.id pr_line_id,
                    prd.line_comment, 
                    prd.quantity, 
                    prd.units,
                    prd.estimate_price, 
                    prd.required_date, 
                    pm.description project_description,
                    prd.requested_unit,
                    prd.requested_unit_qty,
                    prd.item_pr_description,
                    prd.req_unit_conv_factor,
                    sup.supp_name supplier_name,
                    ppd.item_description pr_po_item_description,
                    ppd.po_line_id,
                    origi.real_name originator_name,
                    p_offic.real_name created_pofficer_name,
                    p_offiu.real_name updated_pofficer_name,
                    pod.delivery_date po_line_delivery_date  
                FROM 
                    0_item_codes ic 
                    INNER JOIN 0_purchase_requisition_details prd ON ic.item_code = prd.item_code
                    INNER JOIN 0_purchase_requisitions pr ON prd.requisition_id = pr.pr_no
                    INNER JOIN 0_projects_master pm ON pr.project_id = pm.project_id 
                    INNER JOIN 0_users origi ON pr.created_by = origi.id   
                    LEFT JOIN 0_pr_po_details ppd ON prd.id = ppd.pr_line_id 
                    LEFT JOIN 0_suppliers sup ON ppd.supplier_id = sup.supplier_id  
                    LEFT JOIN 0_users p_offic ON ppd.created_by = p_offic.id
                    LEFT JOIN 0_users p_offiu ON ppd.updated_by = p_offiu.id 
                    LEFT JOIN 0_purch_order_details pod ON ppd.po_line_id = pod.po_detail_item  
                WHERE  ((prd.line_complete = 0) OR  
                        (prd.line_complete = 1 AND ppd.po_line_id = 0)) AND 
                        (pr.approval_status = 30 OR pr.approval_status = 60 OR pr.approval_status = 100)  AND pr.project_id = 'dddddddddddddddddd' ORDER BY pr.pr_no, prd.id

