DOCTYPE Case Statement for Great Plains

cast(case a.DOCTYPE when 1 THEN 'Invoice'
 when 2 THEN 'Finance Charge'
 when 3 THEN 'Misc Charge'
 when 4 THEN 'Return'
 when 5 THEN 'Credit Memo'
 when 6 THEN 'Payment' end as nvarchar(50)) as DocType

Thanks to Victoria Yudin for the source data. https://victoriayudin.com/gp-tables/pm-tables/