Recommend way to settle the production cost

Hi

Can anybody give some suggestions about how to settle the production cost?

The problem for now is i can only know the actual production cost by the end of month, but before that the finished product may be already sold base on estimated cost. There maybe be some finished products still left in the inventory.

Why do i have to adjust the cost because the cost of the sold product may have impact on the profit.

many thanks