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

# Contracts

> Billing a customer for services under an agreement: a guided setup, editable invoices and revenue, amendments, cancellation, and renewal.

A **contract** bills a customer for services on a schedule: one-time fees such as implementation, and recurring charges such as a subscription or a support plan. Alforse plans the invoices and the monthly revenue from the contract's lines, drafts each invoice on its date, and recognizes the revenue month by month.

Contracts live under **Sales → Service Contracts**. Start one with **"Add Contract"** on the list, or with **"Create Contract"** in a sales order's menu ([from a sales order](#from-a-sales-order)).

## Setting up a contract

A new contract opens a five-step setup. **"Next"** on the first step saves it as a draft, and later steps save as you edit. **"Continue Setup"** on a draft's page reopens it.

**Details.** The customer, name, contract type, currency, and the term: **"Start Date"**, **"Duration"** and **"Action on Completion"** ([renewal](#renewal)). Under **More Details**, **"Contract Close Date"** records when the deal was won, today by default.

**Services.** **"Add Services"** adds Service items as recurring lines at a rate of zero. Click a cell to set the **"Revenue Type"**, quantity, rate, discount and dates ([lines](#lines)).

**Invoicing.** **"Bill To"**, **"Invoice Contact"**, **"Invoice Address"**, **"Ship To"** and **"Payment Terms"**, which start from the customer's settings, then the [invoice schedule](#the-invoice-schedule).

**Revenue.** How each line earns its revenue, and the monthly [revenue plan](#revenue).

**Review.** A summary, and a linked list of anything that blocks **"Confirm"**.

## Lifecycle

<details>
  <summary>**Draft**</summary>

  Terms, lines, invoices and the revenue plan are all editable. Nothing is invoiced.
</details>

<details open>
  <summary>**Active**</summary>

  Confirmed: the invoice schedule is fixed, invoices are drafted as they fall due, and revenue is recognized monthly. Changes go through Amend and Cancel.
</details>

<details>
  <summary>**Ended**</summary>

  The end date has passed and every planned invoice has been drafted. Read-only.
</details>

**"Confirm"** checks that the contract has lines, that each is a Service item, and that each recurring line has a rate unit. Each line's invoices must add up to its total, and its revenue must equal what it bills. After that, terms and lines change only through [Amend](#amendments); only **"Contract Type"**, **"Invoicing"** and **"Notes"** stay editable. **"Delete Contract"** is for drafts only.

The daily billing job sets a contract to Ended once its end date has passed and nothing is left to draft. An open-ended contract runs until you cancel it.

## Lines

Each line is a **Service** item, **One-time** or **Recurring**, with a quantity, rate, discount, and its own start and end dates (an empty end runs to the contract's end). **"Edit Details"** opens the full line form.

* **One-time** lines bill their whole amount on the first invoice dated on or after their start date.
* **Recurring** lines bill every billing period at the rate **"Per"** Day, Week, Month, Quarter or Year. The rate unit is independent of how often you invoice: a rate per Day can be invoiced monthly.
* **"Discount Ends On"** ends a recurring line's discount, such as 20% off for the first year. Confirming turns it into an amendment that starts a full-price copy of the line the next day.
* **"Project"** defaults from the contract. It is written as the Project [dimension](/docs/reference/dimensions.md) on the line's revenue.

## The invoice schedule

The contract's invoicing terms cut every recurring line into billing periods:

* **"Frequency"**: Weekly, Monthly, Quarterly or Yearly.
* **"Align to calendar periods"**: off, periods count from the start date. On, they align to the week (from Monday), month, quarter or year, with a shorter first period.
* **"Billing Timing"**: *Advance* invoices a period on its first day, *Arrears* on its last.
* **"First Invoice"**: any invoice that would fall before this date moves onto it.

A period is priced in whole rate units, prorated by day. Months count from the period's start, so a period from 15 March to 14 April is exactly one month, and a calendar period from 15 to 30 November is 16 of 30 days. A rate of \$15 per Day bills \$465 for a 31-day month. Weekly invoices at a monthly, quarterly or yearly rate are the exception: each day is the yearly average, so every week bills the same amount (\$3,650 per Month is \$840.00 a week) and a 365-day year bills exactly twelve months.

Take a contract starting 1 November, invoiced Monthly in Advance: implementation \$48,000 one-time, 12 seats at \$50 per Month with 20% off, and support at \$1,440 per Year. The 1 November invoice is \$48,600 (48,000 + 480 + 120), and every later month is \$600.

While the contract is a draft, the schedule is a grid with one row per invoice and one column per line. Change a date or an amount in place, **"Add Invoice"**, or **"Delete Invoice"** from a row's menu.

NOTE

**Editing never changes what a line bills in total**

Edits only move money between invoices. Three \$16,000 invoices for the \$48,000 fee are fine; invoices that bill \$40,000 of it leave \$8,000 in the **"Left to invoice"** row, and **"Confirm"** waits until it is placed.

Once edited, the schedule stops following the lines: a line you change afterwards leaves an amount to invoice. **"Reset Schedule"** plans it again, discarding your edits.

A fixed-term contract is planned to its end date, an open-ended one through the next billing period, rolled forward daily. **"Billed Through"** (under **Advanced** → **"Migrating from another system?"**) is for a contract moved into Alforse mid-term: periods ending on or before it read **Billed Externally** and are never invoiced.

Alforse screenshot**Contract setup, Invoicing step: the Bill To and Schedule sections above the invoice grid, one row per invoice and a Left to invoice footer**

The Invoicing step of a new contract: who is billed, how often, and every planned invoice.

Alforse screenshot**Draft contract page showing the Summary, the Invoices section with an edited schedule, and the Revenue preview**

A draft contract: the first invoice carries the one-time fee, the rest bill monthly.

## Invoicing

A daily job drafts every planned invoice dated on or before today as one sales invoice per contract, and **"Invoice"** on an active contract does the same on demand. Each line shows its billing period and the contract line's quantity, list price and discount.

What happens next follows the contract's **"Invoicing"** property, or the company default on **Settings → Invoicing** (**"Recurring Invoices"**):

* **Draft only**: the invoice waits for a person to post it.
* **Post**: posted automatically.
* **Post and email**: posted and emailed to the **"Invoice Contact"** with the PDF attached.
* **Post and send via Stripe**: posted and sent through your connected Stripe account with a payment link. The billing customer must be linked to a Stripe customer; when it is not, **"Confirm"** offers an existing Stripe customer with the same email or a new one, and needs permission to create invoices.

An invoice that credits a contract change or re-bills a voided invoice is held for review instead, and so is one with a sales-rule violation or a posting error. Held invoices carry a yellow **Needs Review** badge in the **Sales Invoices** list, which can be filtered on **Needs Review**, and the contract's salesperson (or its creator) gets a daily summary.

Voiding a posted contract invoice returns its periods to the schedule, and the next run bills them again on a held invoice. Deleting a draft contract invoice releases its periods too. Each drafted invoice carries the contract's **"Ship To"** address as its own ship-to.

## Revenue

Each line earns its revenue from its **"Go-Live"** date (else **"Revenue Start"**, else its start) to its **"Revenue End"** (else its end), by one of two revenue methods: **Daily**, the same amount every day, or **Even Period**, the same amount every full calendar month with partial months prorated by days.

The **revenue plan** spreads what each line bills over those dates, one amount per calendar month. While the contract is a draft it is a grid with one row per month and one column per line: change an amount, **"Add Month"**, or **"Delete Month"**. Each line's revenue must equal what its invoices bill, so **"Confirm"** waits for an empty **"Left to recognize"** row.

NOTE

**An edited revenue plan stops following the invoices**

Until you edit it, the plan follows the lines and the invoice schedule. After your first edit, a later change to a line or an invoice leaves an amount to recognize. **"Reset Revenue"** plans it again.

**"Recognize Revenue From"** is for a contract moved into Alforse: earlier months read **Recognized externally**, and each line opens with what was billed less what was recognized elsewhere. Your own opening journal carries that balance.

### How revenue posts

Revenue follows the line, not the invoice. Each line keeps a balance of what it has invoiced less what it has recognized.

* **Billed ahead**: the invoice posts to Deferred Revenue, not to Sales.
* **Earned first**: a month recognized before it is billed builds up Contract Assets. The invoice that bills it clears Contract Assets first and defers only the rest.
* **The monthly run**: the **Revenue Recognition** run (**Accounting → Revenue Recognition**) recognizes every planned month that has started by its period end, out of Deferred Revenue as far as it covers and into Contract Assets for the rest.

A run proposed before a contract month fell due must be recalculated before it posts. In a foreign currency, the rate difference on a cleared balance posts to realized exchange gain or loss, never to revenue. Amendments, cancellation and renewal plan the revenue again from their date; a month already recognized never changes, and the difference lands on the next planned month.

## Amendments

**"Amend"** on an active contract changes, adds, or ends lines from a **"Change Date"**, with a **"Reason"**. **"Takes Effect"** decides how:

* **From the change date**: the old line ends the day before and its replacement starts on the date, prorated by day.
* **From the next billing period**: the change starts with the next billing period, so nothing is prorated.

Each change is an amendment. A period already invoiced past the change gets an **adjustment** on the next invoice: the billed amount times the days after the change, divided by the days billed. Raising the example's 12 seats to 18 on 12 March puts a credit of \$309.68 and a charge of \$464.52 on the 1 April invoice, for March's last 20 days.

The modal previews the adjustments and next invoices before you save. It suggests the **"Contract Type"** from the change in recurring value: up is *Expansion*, down is *Contraction*. The **Amendments** section lists every change, newest first.

## Cancellation

**"Cancel"** picks an **"End Date"**, by default the end of the current billing period, so nothing already invoiced is credited. Open lines end on that date, later planned invoices are removed, and the contract no longer renews.

When the date falls inside a period invoiced in advance, **"Credit unused time"** drafts a credit memo for the days after it. Posting it takes the credit off Deferred Revenue, and off Contract Assets for any part already recognized. It cannot be voided.

A month recognized after the new end date is reversed by a negative month in the next run. **"Revert Cancellation"** restores the previous end dates and renewal, until the end date passes and while that credit memo is still a draft.

## Renewal

**"Duration"** sets the term: 6 months, 1, 2 or 3 years, a custom end date, or open-ended. With **"Action on Completion"** set to **Renew**, the daily job extends the contract by one term on its end date, raising each continuing recurring line's rate by **"Renewal Uplift (%)"**, and records an *Existing* amendment.

## Contract types

Every contract and amendment carries a contract type: **New Sales**, **Existing**, **Expansion**, **Reactivation** or **Contraction**. A new contract is suggested as *Reactivation* when all the customer's earlier contracts have ended, otherwise *New Sales*.

## From a sales order

**"Create Contract"** moves chosen **Service** lines that are not yet invoiced into a new draft contract, copying the customer, bill-to, payment terms, currency and PO number. Each line starts as One-time; switch it to Recurring and choose its rate unit. It is unavailable on a cancelled or closed order.

The order counts those lines as invoiced, so invoicing the order bills only the rest. Deleting the draft contract, or one of its lines, hands them back.

## Related

**Sales orders**

Where a contract can start, and where its lines count as invoiced.

[Open](/docs/reference/sales-orders.md)

**Invoices**

The drafted contract invoices: posting, line discounts, and voiding.

[Open](/docs/reference/invoices.md)

**Rental agreements**

The other recurring document, sharing the same daily billing and invoicing setting.

[Open](/docs/reference/rental-agreements.md)

**Dimensions**

The Project dimension each contract line writes on its revenue.

[Open](/docs/reference/dimensions.md)


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