支払いの遅れ (late_payment_ja)

遅れて払われた請求書について、売り手が請求するもの。期日、何日遅れて払われたか、規則がそれに付ける定額と利息。late_payment.kn の日本語の版

kaname 0.56.0 made this page by checking the file above and the files it reads. If the file's digest is no longer what it says here, the page is out of date.

1 function, total. It calls 1 rule and 1 date of koyomi. It builds no transfer. No decision is written in its code.

Decisions in tables

The decisions the module uses are in the files it reads, each checked by its own language: the rules by rulec, the dates by koyomi, the books by chobo. The module carries their answers and joins them.

The dates file 期限

dates/支払期限.cal: it calls the date 期日 on line 20 (遅れの請求).

The rule 請求額

rules/遅延の請求額.rule, called on line 23 (遅れの請求).

Functions

A function's effect puts it in one of three parts. A total function answers every input in the ranges it declares. A function checked when it runs has places the checks could not show: the generated code checks the value there, and when it is outside, fails with the kind of the place (rule and so on). A function that may not stop recurses.

Total

遅れの請求 (claim)

Total: it answers every input in the ranges it declares. Its head writes total, and kaname holds it to that.

期日までに払われていれば none。

fn 遅れの請求(claim)(請求書(invoice): 請求書, 支払日(paid_on): date range >=2026-01-01 <=2029-12-31, 基準金利(reference_rate): rate[step 0.01%] range >=0% <=15%) -> 請求? total
  description "期日までに払われていれば none"
  let 期日 = 期限.期日(請求日: 請求書.請求日)
  let 遅れ = 支払日 - 期日
  if 遅れ >= 1
    let 額 = 請求額(債権額: 請求書.金額, 遅れた日数: 遅れ, 基準金利: 基準金利)
    請求 { 期日: 期日, 遅れた日数: 遅れ, 定額の補償: 額.定額の補償, 利息: 額.利息 }
  else
    none

Checked when they run

None.

May not stop

None.

Decisions in code

The module's decisions are all in tables.

Examples

kaname check runs each line of examples in the reference interpreter, as a host would call the function, and compares the answer with the one written. The reference interpreter answers these.

遅れの請求(請求書: 請求書 { 番号: "inv_1", 請求日: 2026-03-02, 金額: 100_000GBPc }, 支払日: 2026-05-20, 基準金利: 0.5%)
  = 請求 { 期日: 2026-03-31, 遅れた日数: 50, 定額の補償: 70GBP, 利息: 1150GBPc }
遅れの請求(請求書: 請求書 { 番号: "inv_2", 請求日: 2026-03-02, 金額: 100_000GBPc }, 支払日: 2026-03-31, 基準金利: 0.5%)
  = none