There are a couple of ways to handle per diems as a contractor. It is basically a cost recovery. If you use accounting software, you would enter all of your travel expenses and enter the per diem as a recovery of those expenses to reduce income. The trick is to prove reasonableness. It also presupposes substantial travel away from your home.
The other way to prove reasonableness is to use the Treasury Board rates instead of actual receipts to prove your expenses and again use that calculation to demonstrate your per diem as reasonable recovery of expense instead of income.
The calculation is based on the number of days away from home.