With Settings → Marina → Contracts durations you define the durations your contracts can have (for example "Yearly", "Seasonal", "Transit"). With the Type and duration relations page you decide which durations each Contract types and statuses: the settings can take and the program enforces the choice. You need the permission to edit contracts to change them; whoever can only read sees them but cannot change them.
1. The durations
Open Settings → Marina → Contracts durations. The list shows Name (with the colour), Code, the active Periods, the Duration, the Maximum days, whether it is Enabled and the Sort order; filters by Name and by Enabled. At the top you find the three buttons linking the pages Contract types, Contracts durations and Type and duration relations. New duration creates one, the pencil edits an existing one.
Creating or editing a duration
Identity: Code, Name, Prefix and Color (with the Preview). The duration's code can be used in the contract number format (placeholder {duration}).
Duration
Contract duration in years, months, weeks or days: a number (at least 1) and, next to it, the unit: Years, Months, Weeks or Nights. It is the duration the program uses to calculate the end date and for renewals.
Maximum days: the maximum number of days of a stay that this duration can cover; the program uses it when it chooses the duration by itself, from the dates. Leave 0 to keep this duration out of any automatic choice: it will never be assigned by the public booking form. To accept long stays online enter the real limit (for example 36500 for a hundred years).
Periods: six Yes / No switches, Daily, Weekly, Monthly, Seasonal, Yearly, Transit. They say what kind of period the duration represents and the program reads them, not the name. In particular the Creating a contract with the guided procedure considers a transit a Daily or Transit duration, a yearly one the Yearly one; a Transit-only contract type accepts only durations of that kind.
Options
Contract Due Date: the installment plan proposed automatically for contracts of this duration (“-- No default mooring --” if you do not want one). The menu lists the plans that are enabled and offered to contracts (Contracts in Offered for on the plan's page). On a new contract the plan of the customer wins first, then this one, then the one of the type, finally the one with New contracts ticked in Proposed by default for.
Sort order: lower numbers appear first.
Enabled: a disabled duration is no longer offered in forms.
Create contract duration (or Save contract duration) saves.
Deleting a duration
From the bin icon, with the confirmation “This contract duration will be permanently removed. Continue?” and then “Contract duration deleted.”. If a contract uses it “You can't delete this item, it's used by the application.” appears: disable it instead of deleting it.
Massive Renewal requires every duration to have its number and unit filled in; otherwise the program refuses it and points to this page (see The lists of contracts, quotes and bookings).
2. Type and duration relations
By default every contract type goes with every duration. If in your marina this is not so (for example the "Transit" type only makes sense with daily durations, or the "Yearly" only with the yearly duration), you can say so here: from then on the program accepts only the pairs you have chosen.
Open Type and duration relations with the button at the top of the types list or of the durations list.
The table
The contract types are the rows, the durations the columns: a box for each pair. Next to a box you see the number of real contracts that use that pair today: it is a link that opens them in the list already filtered, in red if the pair is in use but not ticked.
All (first column): ticks or unticks all the type's durations in one go. It is only a shortcut on the row: it is not a separate tick, and a duration created later is not included, it must be ticked like the others.
Fill in from history: ticks all the pairs used by at least one contract, without removing the ticks already there. It is the safest way to start.
Remove every tick: empties the table; saving like this, every type goes with every duration again.
Neither writes anything until you press Save relations. “Relations saved: from now on only the ticked pairs are allowed.” appears or, if there is no tick, “Relations saved: no pair is ticked, so every type goes with every duration.”.
Above the table a note says which state you are in: “No relation: every type goes with every duration.” or “Only the ticked pairs are allowed.”, with the contracts that use an unticked pair, the types without durations and the durations without types.
Whoever does not have the permission to modify contracts sees the table read-only (“You can read the relations but not change them: that takes the permission to modify contracts.”).
The rule
No tick: no constraint.
At least one tick: only the ticked pairs apply. A type or a duration without ticks cannot be used, and this also applies to a newly created type or duration: they must be ticked. In the types (or durations) list a notice tells you which ones have been left without ticks.
Disabled types and durations do not count: their ticks stay stored but do not switch the rule on.
A quote or a reservation follow the type they will become (the type chosen in the Reference price list field), not their phase.
Where it makes itself felt
The program refuses a pair that is not allowed only when a person chooses it:
the contract forms (the durations menu shows only those allowed by the type, and if the type has none, it says so under the field);
the Creating a contract with the guided procedure, which offers only the allowed durations and does not propose the types left without durations;
the order pages, when you plan a berth or link a contract;
turning a quote into a contract (From quote to contract), which offers only the types allowed by the quote's duration.
The messages say why: “The type "{type}" does not take the duration "{duration}". It takes: {durations}.”, or, if the type has no durations, “The type "{type}" does not take any duration yet: tick its durations in the contract settings, in "Type and duration relations".”
Contracts that the program creates by itself are never refused: online bookings, DockBooking, transits from the berths app, renewals, copies, imports. A contract already saved with a pair that is later forbidden keeps saving, and is refused only if you move it to another pair that is not allowed.
Documents outside the relations
When the rule is on, under the table the Out of the saved relations box counts the documents that have a type and a duration that do not go together: open contracts, closed contracts, quotes and reservations, each with a link to the list already filtered. The lists then also show the Type and duration relations filter with Only those out of the relations. Nothing is changed on those documents: open one to give it a pair that works.

