2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00
books/docs/utilities/number-series.md

25 lines
815 B
Markdown
Raw Normal View History

2018-02-22 07:36:28 +00:00
# Number Series
A number series is used to maintain a series for numbering documents (like invoices)
Properties:
- `name`: Prefix of the series example `INV-`
- `current`: Its current (or starting) value. This will be auto updated everytime the series is updated.
### API
You can get the next number in the series by using the utiltiy function
```js
const model = require("frappejs/model")
let nextValue = model.getSeriesNext("INV-");
```
### Setting naming series in a document
To setup a number series for a DocType:
- It must have its own "Settings" [single document](../models/singles.md. For example (InvoiceSettings for Invoice).
- The settings document must be set via the `settings` property in the DocType
- The settings document must have a `numberSeries` property with value of the number series