@opencxh/domain 1.290.0 → 1.291.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -78,6 +78,11 @@ export type MatchTarget = {
78
78
  kind: "scheduled_posting";
79
79
  scheduledPostingId: string;
80
80
  }
81
+ /** Straight onto a balance item (a current account): its ledger account, with it as sub-account. */
82
+ | {
83
+ kind: "financing";
84
+ financingItemId: string;
85
+ }
81
86
  /** The other side of a transfer between two own accounts. */
82
87
  | {
83
88
  kind: "transfer";
@@ -1,5 +1,5 @@
1
1
  import { Cents } from '../money/money';
2
- import { AccrualTerms, CurrentAccountTerms, FinancingItem, FixedAssetTerms, LoanTerms, ScheduledPosting } from './types';
2
+ import { AccrualTerms, CurrentAccountRelation, CurrentAccountTerms, FinancingItem, FixedAssetTerms, LoanTerms, ScheduledPosting } from './types';
3
3
  /** `day` plus `months`, on the same day of the month or the last one when it is shorter. */
4
4
  export declare function addMonths(day: string, months: number): string;
5
5
  export interface Installment {
@@ -32,6 +32,8 @@ export declare function interestPeriods(openedOn: string, through: string, caden
32
32
  to: string;
33
33
  }[];
34
34
  export declare const EXCESSIVE_LENDING_THRESHOLD_CENTS = 50000000;
35
+ /** Who a current account is with; anything unknown or missing is the director. */
36
+ export declare const currentAccountRelation: (terms?: Partial<Pick<CurrentAccountTerms, "relation">>) => CurrentAccountRelation;
35
37
  /** Wet excessief lenen: how far the director's debt to the BV is toward the threshold. */
36
38
  export declare function excessiveLending(directorOwesCents: Cents, thresholdCents?: number): {
37
39
  over: boolean;
@@ -18,15 +18,18 @@ export interface LoanTerms {
18
18
  /** Interest expense (received) or income (given). */
19
19
  interestAccountId: string;
20
20
  }
21
+ /** Who the current account is with; absent on items made before it existed: the director. */
22
+ export type CurrentAccountRelation = "director" | "group_company" | "participation" | "other_company";
21
23
  export interface CurrentAccountTerms {
22
24
  kind: "current_account";
25
+ relation?: CurrentAccountRelation;
23
26
  /** A business rate: what the tax authority expects between a BV and its director. */
24
27
  ratePercent: string;
25
28
  cadence: "quarterly" | "yearly";
26
29
  /** Interest income when the director owes, expense when the BV owes. */
27
30
  interestIncomeAccountId: string;
28
31
  interestExpenseAccountId: string;
29
- /** Wet excessief lenen: a signal above this debt of the director. A setting, default € 500.000. */
32
+ /** Wet excessief lenen: a signal above this debt of the director (director only). Default € 500.000. */
30
33
  thresholdCents?: Cents;
31
34
  }
32
35
  export interface ParticipationTerms {