Need below SQL to include GL Code combination for debit and crdeit of transaction
select DISTINCT B.CREATION_DATE, B.CREATED_BY,B.SUBINVENTORY_CODE,x.TRANSACTION_TYPE_NAME,B.ACTUAL_COST,proj.segment1,B.PROJECT_ID, pt.task_number,B.TASK_ID,B.EXPENDITURE_TYPE
from mtl_material_transactions b, MTL_TRANSACTION_TYPES x, pa_projects_all proj, pa_tasks pt
where B.ORGANIZATION_ID = 248 AND B.PROJECT_ID is NOT NULL
AND x.TRANSACTION_TYPE_ID=b.TRANSACTION_TYPE_ID
AND b.project_id = proj.project_id
AND proj.project_id = pt.project_id
and EXPENditure_type is NOt NULL
it gets accounting at the time the transaction is costed