Price Difference for moving average

currently i implement moving average in retail company.

normally posting type price difference for moving average occur if any difference between PO receipt price and PO invoice price and created in debit side.

in my implementation, user create many movement journal for beginning balance then create PO and product receipt. when create product receipt user found that many product receipt enter wrong date consequently user have to cancel product receipt and recreate product receipt. when post second product receipt occur voucher that contain posting type price difference for moving average in credit side.

does anyone know what cause this problem ?

thank you

Fajar