Error calculating cost in admin orders meta box
-
There seems to be an error in calculating the cost (and thus the profit) in the admin orders meta box. It is possible that this error cascades to other parts of the calculations, I have not checked yet.
Basically, the gateway fees are stored as a negative value and WooCommerce correctly adds this negative value to the total amount paid (i.e. subtracts the gateway fees from the amount paid) to calculate the net amount from the payment gateway.
Screen grab: https://prnt.sc/ruCDX5PEmDZi
The problem arises when Cost of Goods tries to calculate the total cost by adding all the costs together (item costs, gateway costs, etc.). In adding the negative gateway cost value the effect is to subtract it from the item costs, which ends up lowering the total costs by the value of the gateway costs, instead of increasing the total costs by the value of the gateway costs.
Screen grab: https://prnt.sc/c0sMOEVnwolD
I am guessing that after this, all order profitability reports would be wrong – unless this only happens in the admin orders meta box.
- The topic ‘Error calculating cost in admin orders meta box’ is closed to new replies.