SELECT
	id,
	receiving_id,
	receiving_sub_code as seq_number,
	credit_type_id + 1 as credit_type_code,
	receiving_amount as amount,
	bank_id,
	bill_date,
	bill_number,
	NULL as note,
	NOW() as created_at,
	NOW() as updated_at
FROM receiving_details
INTO OUTFILE "/tmp/receiving_details.csv" FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"';