This is a catch :) There is no wrong and no exactly answer.
You must make some calculation using average monthly costs and average monthly output. When you have end of month, you can refill new calculation. There is no better solution by standard.
I know that this is not good and I have addon for this. I write about them in my blog:
community.dynamics.com/.../cost-accounting-in-manufacturing-intro-1-4.aspx
community.dynamics.com/.../cost-accounting-in-manufacturing-calculation-2-4.aspx
community.dynamics.com/.../cost-accounting-in-manufacturing-calculation-3-4.aspx
community.dynamics.com/.../cost-accounting-in-manufacturing-reporting-4-4.aspx
You can try to use my idea, or buy it, or use the standard.