Why are there refunds for an edited order?
Overall, removed items for an edited order are included as refunds to ensure that the final total (Total Sales/Total Revenue) matches exactly between your Shopify analytics and Profit Calc.
This final amount is inclusive of refunds as they have already been deducted. This is the amount used in the profit calculations.
This is due to how edited orders are included in the synced Shopify order information.
There are two scenarios:
1) If an item is added to the order, it changes the original order total and the item is added to the line items of an order.
2) Whereas if an item is removed from an order it is included under the refunded items in an order. It doesn't remove the original item from the order's line items.
There are also no indicators to show which items were edited in an order.
So to get the final amount included correctly our app will net out the difference between all the line items and the refunded line items to get the correct final Total Revenue/Total Sales for an order.
I apologize for the long explanation there - let me know if that helps to clarify things 😅