Tax on split orders

To enable tax being added to split orders, see image below

How Tax is Handled in Split Orders

This document outlines the process by which the application calculates and applies taxes when an order is split. The primary goal is to ensure that the tax amounts on the new (child) orders accurately reflect a prorated portion of the tax from the original (parent) order.

Overview

The application's approach to tax handling can be summarized in three main steps:

  1. Extraction: Tax data is extracted from the original order's line items that are designated to be moved to a new split order.

  2. Proration & Aggregation: The tax amounts are prorated based on the quantity of items being moved. For multi-item splits, the tax lines from all moved items are collected and then aggregated.

  3. Application: The final, aggregated tax lines are applied to the newly created split order.

Examples

Here are a couple of practical examples to illustrate how tax is calculated and split.

Example 1: Splitting a Single Item into a New Order

Imagine an order with two different items, both subject to the same tax rate.

  • Original Order (#1001)

    • 1x T-Shirt at £20.00

    • 1x Hat at £10.00

    • Subtotal: £30.00

    • Tax (VAT @ 20%): £6.00

    • Total: £36.00

In this case, the tax_lines from Shopify would show that £4.00 of tax is from the T-Shirt and £2.00 is from the Hat.

Split Action: You split the Hat into a new order.

  • Resulting New Order (#1002)

    • 1x Hat at £10.00

    • Subtotal: £10.00

    • Tax (VAT @ 20%): £2.00

    • Total: £12.00

How it works: The app identifies the tax line associated with the Hat (£2.00) and applies it directly to the new order. The original order is then updated to reflect the removal of the Hat and its associated tax.

Example 2: Splitting a Partial Quantity of a Line Item

This example shows how the app prorates tax when you only split some of the items from a single line item.

  • Original Order (#1003)

    • 3x Mugs at £8.00 each (Total price £24.00)

    • Subtotal: £24.00

    • Tax (VAT @ 20%): £4.80

    • Total: £28.80

Split Action: You split 1 Mug into a new order, leaving 2 in the original.

  • Resulting New Order (#1004)

    • 1x Mug at £8.00

    • Subtotal: £8.00

    • Tax (VAT @ 20%): £1.60

    • Total: £9.60

How it works (Proration):

  1. The app calculates the per-item tax for the original line item: £4.80 (total tax) / 3 (quantity) = £1.60 tax per mug.

  2. Since 1 mug is being moved, the tax applied to the new order is 1 * £1.60 = £1.60.

  3. The original order's tax is updated to reflect the tax on the remaining 2 mugs (2 * £1.60 = £3.20).

Last updated