> ## Documentation Index
> Fetch the complete documentation index at: https://docsv4.mile.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Bill

> Record items, quantities, prices, costs and discounts on a task, with a total.

**Bill** records a purchase or a spending on a task: items with a quantity and a unit price, extra costs such as shipping, discounts, and the total. Use it to track what a customer bought on delivery, what a sales visit sold, or what a field worker spent.

A bill keeps its own **master data**: the items it can hold (name and unit price) and the add-ons that change the total (costs and discounts). The field worker picks from this master data instead of typing names and prices.

## How a bill is set up

A bill usually appears twice in a task type:

1. **On the Initial page**: where the bill is filled when the task is created, on the web, in an import or through the API. This is also where you define the master items and add-ons.
2. **On a field app page**: where the field worker works with the bill. This bill reads its data from the Initial page bill with **Use Bill from**, so the field worker starts from what was ordered.

A bill can also sit inside a [Subpage](/pages/workflow/task-type/components/subpage), where each entry gets its own bill. This is available to internal accounts, and a bill inside a subpage cannot use a data source.

## Properties on the Initial page

<div align="center">
  <img src="https://mintcdn.com/mileappv4/Xul_B0hUk35UiMLk/images/v4/workflow/components/bill-initial.png?fit=max&auto=format&n=Xul_B0hUk35UiMLk&q=85&s=18f4e8725a75449e1db434ae0528d70e" alt="Bill on the initial page" width="600" data-path="images/v4/workflow/components/bill-initial.png" />
</div>

1. **Title**: name the bill clearly, for example *Order Bill*. The field app page bill points to it by this name.
2. **Visible**: when off, the bill is hidden on the web and the field app; its data is still kept and exported.
3. **Required**: the task cannot be saved or finished until at least one item is added.
4. **Add New**: on the Initial page this is always on.
5. **Use data source**: take the item list from a [data source](/pages/workflow/data-source/introduction) instead of typing it here. You map which data fields hold the item **quantity**, **name** and **price**; all three are needed.
6. **Items**: the master items. The table lists each **Item name** and **Item price**, with the number of items in the header. In the last row type a name and a price and click **+** (or press Enter) to add one. Each row can be moved up or down, edited with the pencil, or removed with the bin.
7. **Add-ons**: the master costs and discounts. For each one choose the **Add-on type**, write the **Name of discount or surcharge** and the **Price or surcharge**:
   * **Cost** adds to the total, for example *Shipping Cost*.
   * **Discount** takes away from the total, for example *Member Discount*.
8. **Advanced Discount**: replace the simple Discount add-on with discount rules. See [Advanced Discount](/pages/workflow/task-type/components/bill/advanced-discount).

In the example, the items table holds four products from Mineral Water 600ml (5,000) to Rice 5kg (65,000), and the add-ons table a Shipping Cost of 10,000 and a Member Discount of 5,000.

## Properties on a field app page

<div align="center">
  <img src="https://mintcdn.com/mileappv4/Xul_B0hUk35UiMLk/images/v4/workflow/components/bill-page.png?fit=max&auto=format&n=Xul_B0hUk35UiMLk&q=85&s=5565d7df53870ccd9dfce7a242d665ab" alt="Bill on a field app page" width="600" data-path="images/v4/workflow/components/bill-page.png" />
</div>

1. **Use Bill from**: the bill this one reads its items, add-ons and values from, usually the Initial page bill.
2. **Add New**: when on, the field worker can add more items from the master list; when off, they can only work with the items already on the bill.
3. **Quantity Rule**: what the field worker can do with quantities:
   * **Raise or lower**: change them either way.
   * **Only raise**: increase quantities only.
   * **Only lower**: decrease quantities only, for example to record items the customer refused.
4. **Items**: the master items, taken from the bill picked in **Use Bill from**. You can still add, edit or remove rows here.
5. **Add-ons**: the master costs and discounts, taken the same way.

**Title**, **Visible**, **Required** and **Use data source** work as on the Initial page.

## On the field app

Tap **Open** on the bill to work with it. The bill has three tabs.

<div align="center">
  <img src="https://mintcdn.com/mileappv4/Xul_B0hUk35UiMLk/images/v4/workflow/components/bill-picker.png?fit=max&auto=format&n=Xul_B0hUk35UiMLk&q=85&s=5c8ed9e8f1ab71867eea33522b92ca11" alt="Picking a bill item" width="300" data-path="images/v4/workflow/components/bill-picker.png" />
</div>

<p><em>Add Item opens the master items with their unit prices. Search, then tap an item to add it.</em></p>

**Item**: the items on the bill, each with its unit price and a quantity box. Tap the bin to remove an item.

<div align="center">
  <img src="https://mintcdn.com/mileappv4/Xul_B0hUk35UiMLk/images/v4/workflow/components/bill-preview-items.png?fit=max&auto=format&n=Xul_B0hUk35UiMLk&q=85&s=af2bf987d14c13e129213d3d7959c337" alt="Bill items" width="300" data-path="images/v4/workflow/components/bill-preview-items.png" />
</div>

<p><em>Two items: 6 × Mineral Water 600ml at 5,000 and 1 × Rice 5kg at 65,000.</em></p>

**Cost**: the costs and discounts applied. Tap **Add-on** to add one from the master add-ons. This tab appears only when the bill has add-ons.

<div align="center">
  <img src="https://mintcdn.com/mileappv4/Xul_B0hUk35UiMLk/images/v4/workflow/components/bill-preview-cost.png?fit=max&auto=format&n=Xul_B0hUk35UiMLk&q=85&s=d0927a30ba8dfe3aaed40ec0266799ee" alt="Bill costs" width="300" data-path="images/v4/workflow/components/bill-preview-cost.png" />
</div>

**Summary**: the bill as a table, with the subtotals and the total.

<div align="center">
  <img src="https://mintcdn.com/mileappv4/Xul_B0hUk35UiMLk/images/v4/workflow/components/bill-preview-summary.png?fit=max&auto=format&n=Xul_B0hUk35UiMLk&q=85&s=bb260b76449de535929634c0e2c6aaea" alt="Bill summary" width="300" data-path="images/v4/workflow/components/bill-preview-summary.png" />
</div>

| Section | Shows |
| - | - |
| **Item** | Each item's **Name**, **Qty**, **Price** and **Total** (qty × price), then **Subtotal Items** |
| **Cost** | Each cost or discount, then **Subtotal Costs**. Discounts are subtracted |
| **Total Bill** | Subtotal items + subtotal costs − discount, never below zero |

In the example: 30,000 + 65,000 = **95,000** for items, plus **10,000** shipping, gives a **Total Bill of 105,000**.

## Next

* [Creating a Bill](/pages/workflow/task-type/components/bill/creating-a-bill): set up a bill and create tasks with it from a spreadsheet.
* [Advanced Discount](/pages/workflow/task-type/components/bill/advanced-discount)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.