> For the complete documentation index, see [llms.txt](https://docs.docbits.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.docbits.com/chinese/guan-li-yu-she-zhi/settings/document-processing/due-date-calculation.md).

# 到期日计算

<figure><img src="https://1870485400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlPczlNw8zzYNLfjfispX%2Fuploads%2Fgit-blob-d49b49a0273e9988c3668d4fd490e17a9406fc9c%2Fdue_date_calc_overview.png?alt=media" alt="到期日计算设置"><figcaption><p>到期日计算设置</p></figcaption></figure>

**到期日计算**页面（**文档处理 → 到期日计算**）用于控制 DocBits 如何根据发票中的付款条件代码计算发票到期日、折扣（Skonto）到期日和付款条件。

## 显示计算字段

启用**显示计算字段**后，自动计算的发票字段（到期日、折扣到期日、付款条件和 AP 分配代码）会显示在字段设置中，并作为变量供快速搜索和电子邮件模板使用。自定义文档类型不受影响。

## 发票到期日计算

### 周末处理方式

<figure><img src="https://1870485400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlPczlNw8zzYNLfjfispX%2Fuploads%2Fgit-blob-9dfd1a73ef4a919f1358253f03a837599ddee7f9%2Fdue_date_calc_weekend_options.png?alt=media" alt="周末规则选项"><figcaption><p>周末规则选项</p></figcaption></figure>

选择到期日落在星期六或星期日时的调整方式。此设置同时适用于**发票到期日**和**折扣（Skonto）到期日**。

| 规则        | 效果                           |
| --------- | ---------------------------- |
| **无**     | 保留日历日期（不作调整）。                |
| **顺延**    | 将星期六或星期日移至下一个星期一。            |
| **提前**    | 将星期六或星期日移至前一个星期五。            |
| **就近调整**  | 星期六 → 星期五，星期日 → 星期一。         |
| **修改后顺延** | 顺延至下一个星期一；如果跨入下个月，则改为前一个星期五。 |

### AP 分配代码

选择**AP 分配代码字段**，将供应商付款条件映射到 AP 分配代码，以便自动路由发票。

## 折扣条件覆盖

<figure><img src="https://1870485400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlPczlNw8zzYNLfjfispX%2Fuploads%2Fgit-blob-14253b766cb5c5043da93f331b5f985cfa29781d%2Fdue_date_calc_formats.png?alt=media" alt="折扣条件覆盖"><figcaption><p>折扣条件覆盖</p></figcaption></figure>

使用**折扣条件覆盖**将特定前缀映射到折扣百分比和天数。点击\*\*+ 添加映射\*\*，添加包含**前缀**、**百分比**和**天数**的行。

## 支持的格式

<figure><img src="https://1870485400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlPczlNw8zzYNLfjfispX%2Fuploads%2Fgit-blob-14253b766cb5c5043da93f331b5f985cfa29781d%2Fdue_date_calc_formats.png?alt=media" alt="支持的付款条件和折扣格式"><figcaption><p>支持的付款条件和折扣格式</p></figcaption></figure>

DocBits 可识别以下付款条件代码和折扣条件代码。

**支持的付款条件格式**

| 格式       | 示例                | 含义           |
| -------- | ----------------- | ------------ |
| Infor M3 | `N90`、`N30`       | 净额 90 天／30 天 |
| Infor M3 | `NET`             | 收到发票时到期      |
| Infor M3 | `M20`             | 下个月 20 日     |
| Infor M3 | `E15`             | 月末 + 15 天    |
| Infor LN | `030`、`30`        | 净额 30 天      |
| 反向格式     | `14N`、`30N`       | 净额 14 天／30 天 |
| 文本代码     | `REC`、`DUE`、`COD` | 收到发票时到期      |

**折扣条件格式** — 折扣条件使用 3 位代码表示提前付款折扣：首位数字表示折扣百分比，后两位表示付款期限（天数）。

| 代码    | 含义                 |
| ----- | ------------------ |
| `210` | 在 10 天内付款可享受 2% 折扣 |
| `130` | 在 30 天内付款可享受 1% 折扣 |
| `545` | 在 45 天内付款可享受 5% 折扣 |
| `0`   | 无折扣                |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.docbits.com/chinese/guan-li-yu-she-zhi/settings/document-processing/due-date-calculation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
