Changed calculating of cost update (average material price) for better sync.