Deductions & credits

See solution by IowaMarc in this topic.