Credit = Subtraction
Debit = Additon
This is standard for financial accounting.
When you receive goods, your inventory/material account is always debited.
In subcontract process, when you do final GR, you will see credit for raw material - there will be debit of same amount in consumption account. Also, you see DEBIT of semi-finished account (addition to stock).
Financial entries can be confusing, you should understand with help of FI consultant.