We were calculating subtotal to display slightly differently then we would have calculated subtotal in the cart. This was affecting subtotal value in invoices and in order confirmation screen.
This patch updates how we calculate subtotal to display such that we calculate in same way.
We added a trait to move shared logic betweem Orders and Cart. This commit refactors Order class to use that shared logic.
Also adds a test for a failing case.
`WC_Abstract_Order` and `WC_Cart_Totals` have their own logic to calculate totals. This means that we would have to fix in two places. This commit adds a trait which can be used to place shared logic between above two classes.