@ekwo-ai/core 0.13.0 → 0.15.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.
- package/dist/books/analytics.d.ts +32 -0
- package/dist/books/analytics.d.ts.map +1 -0
- package/dist/books/analytics.js +94 -0
- package/dist/books/analytics.js.map +1 -0
- package/dist/books/columns.d.ts.map +1 -1
- package/dist/books/columns.js +5 -0
- package/dist/books/columns.js.map +1 -1
- package/dist/books/contacts.d.ts +43 -0
- package/dist/books/contacts.d.ts.map +1 -1
- package/dist/books/contacts.js +61 -0
- package/dist/books/contacts.js.map +1 -1
- package/dist/books/index.d.ts +3 -0
- package/dist/books/index.d.ts.map +1 -1
- package/dist/books/index.js +3 -0
- package/dist/books/index.js.map +1 -1
- package/dist/books/lines.d.ts +38 -0
- package/dist/books/lines.d.ts.map +1 -0
- package/dist/books/lines.js +73 -0
- package/dist/books/lines.js.map +1 -0
- package/dist/books/matching.d.ts +65 -0
- package/dist/books/matching.d.ts.map +1 -0
- package/dist/books/matching.js +95 -0
- package/dist/books/matching.js.map +1 -0
- package/dist/einvoicing/fiscalisation.d.ts +296 -0
- package/dist/einvoicing/fiscalisation.d.ts.map +1 -0
- package/dist/einvoicing/fiscalisation.js +642 -0
- package/dist/einvoicing/fiscalisation.js.map +1 -0
- package/dist/einvoicing/formats.d.ts +16 -0
- package/dist/einvoicing/formats.d.ts.map +1 -1
- package/dist/einvoicing/formats.js +110 -0
- package/dist/einvoicing/formats.js.map +1 -1
- package/dist/einvoicing/index.d.ts +4 -1
- package/dist/einvoicing/index.d.ts.map +1 -1
- package/dist/einvoicing/index.js +4 -1
- package/dist/einvoicing/index.js.map +1 -1
- package/dist/einvoicing/issue.d.ts +20 -1
- package/dist/einvoicing/issue.d.ts.map +1 -1
- package/dist/einvoicing/issue.js +54 -9
- package/dist/einvoicing/issue.js.map +1 -1
- package/dist/schema.d.ts +1 -1
- package/dist/schema.js +1 -1
- package/dist/types.d.ts +12 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +16 -14
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The analytic plan, and the result of each of its values.
|
|
3
|
+
*
|
|
4
|
+
* `analytic_report()` of the schema reads the posted ledger and gives, for
|
|
5
|
+
* each value of one axis, the income, the expense, the result and the
|
|
6
|
+
* movement of the fixed assets — a parent with the subtotal of the values
|
|
7
|
+
* below it, its own amount in the `direct_` columns — with one more row for
|
|
8
|
+
* the part no share of the axis reaches, and one for the total (decision
|
|
9
|
+
* 0076). This file finds the axis by its code, calls the function, and puts
|
|
10
|
+
* the unassigned and the total rows beside the values rather than among
|
|
11
|
+
* them. It adds nothing up: the subtotals and the total are the database's,
|
|
12
|
+
* and a sum worked out here would be a second answer (decision 0056).
|
|
13
|
+
*/
|
|
14
|
+
import { type Backend } from './backend.js';
|
|
15
|
+
export interface ListAnalyticAxesArgs {
|
|
16
|
+
company_id: string;
|
|
17
|
+
}
|
|
18
|
+
export interface AnalyticReportArgs {
|
|
19
|
+
company_id: string;
|
|
20
|
+
/** The axis, by its code or its id. */
|
|
21
|
+
axis: string;
|
|
22
|
+
from: string;
|
|
23
|
+
to: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The axes of a company, each with its values, in the order of their codes.
|
|
27
|
+
* `required_on` says which lines must carry the axis whole at posting: none,
|
|
28
|
+
* expense, income or result.
|
|
29
|
+
*/
|
|
30
|
+
export declare function listAnalyticAxes(backend: Backend, args: ListAnalyticAxesArgs): Promise<unknown>;
|
|
31
|
+
export declare function analyticReport(backend: Backend, args: AnalyticReportArgs): Promise<unknown>;
|
|
32
|
+
//# sourceMappingURL=analytics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../src/books/analytics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAc,KAAK,OAAO,EAAY,MAAM,cAAc,CAAC;AAgBlE,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC,CAwBrG;AAqBD,wBAAsB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,CAyBjG"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The analytic plan, and the result of each of its values.
|
|
3
|
+
*
|
|
4
|
+
* `analytic_report()` of the schema reads the posted ledger and gives, for
|
|
5
|
+
* each value of one axis, the income, the expense, the result and the
|
|
6
|
+
* movement of the fixed assets — a parent with the subtotal of the values
|
|
7
|
+
* below it, its own amount in the `direct_` columns — with one more row for
|
|
8
|
+
* the part no share of the axis reaches, and one for the total (decision
|
|
9
|
+
* 0076). This file finds the axis by its code, calls the function, and puts
|
|
10
|
+
* the unassigned and the total rows beside the values rather than among
|
|
11
|
+
* them. It adds nothing up: the subtotals and the total are the database's,
|
|
12
|
+
* and a sum worked out here would be a second answer (decision 0056).
|
|
13
|
+
*/
|
|
14
|
+
import { BooksError } from './backend.js';
|
|
15
|
+
import { moneyFields } from './format.js';
|
|
16
|
+
const MONEY = [
|
|
17
|
+
'income',
|
|
18
|
+
'expense',
|
|
19
|
+
'result',
|
|
20
|
+
'fixed_assets',
|
|
21
|
+
'direct_income',
|
|
22
|
+
'direct_expense',
|
|
23
|
+
'direct_result',
|
|
24
|
+
'direct_fixed_assets',
|
|
25
|
+
];
|
|
26
|
+
const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
27
|
+
/**
|
|
28
|
+
* The axes of a company, each with its values, in the order of their codes.
|
|
29
|
+
* `required_on` says which lines must carry the axis whole at posting: none,
|
|
30
|
+
* expense, income or result.
|
|
31
|
+
*/
|
|
32
|
+
export async function listAnalyticAxes(backend, args) {
|
|
33
|
+
const [axes, values] = await Promise.all([
|
|
34
|
+
backend.select({
|
|
35
|
+
table: 'analytic_axes',
|
|
36
|
+
columns: ['id', 'code', 'name', 'active', 'required_on'],
|
|
37
|
+
where: [{ column: 'company_id', op: 'eq', value: args.company_id }],
|
|
38
|
+
order: [{ column: 'code' }],
|
|
39
|
+
}),
|
|
40
|
+
backend.select({
|
|
41
|
+
table: 'analytic_values',
|
|
42
|
+
columns: ['id', 'axis_id', 'code', 'name', 'parent_id', 'active'],
|
|
43
|
+
where: [{ column: 'company_id', op: 'eq', value: args.company_id }],
|
|
44
|
+
order: [{ column: 'code' }],
|
|
45
|
+
}),
|
|
46
|
+
]);
|
|
47
|
+
return {
|
|
48
|
+
axes: axes.map((axis) => ({
|
|
49
|
+
...axis,
|
|
50
|
+
values: values
|
|
51
|
+
.filter((value) => value['axis_id'] === axis['id'])
|
|
52
|
+
.map(({ axis_id: _axis, ...value }) => value),
|
|
53
|
+
})),
|
|
54
|
+
count: axes.length,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/** The axis a caller named, by code or by id, or the refusal that says which exist. */
|
|
58
|
+
async function axisOf(backend, company, axis) {
|
|
59
|
+
const rows = await backend.select({
|
|
60
|
+
table: 'analytic_axes',
|
|
61
|
+
columns: ['id', 'code', 'name'],
|
|
62
|
+
where: [
|
|
63
|
+
{ column: 'company_id', op: 'eq', value: company },
|
|
64
|
+
UUID.test(axis) ? { column: 'id', op: 'eq', value: axis } : { column: 'code', op: 'eq', value: axis },
|
|
65
|
+
],
|
|
66
|
+
});
|
|
67
|
+
const found = rows[0];
|
|
68
|
+
if (found === undefined) {
|
|
69
|
+
throw new BooksError(`unknown_analytic_axis: no analytic axis "${axis}" in this company. list_analytic_axes (ekwo analytic axes) names the ones that exist.`);
|
|
70
|
+
}
|
|
71
|
+
return found;
|
|
72
|
+
}
|
|
73
|
+
export async function analyticReport(backend, args) {
|
|
74
|
+
const axis = await axisOf(backend, args.company_id, args.axis);
|
|
75
|
+
const rows = moneyFields(await backend.rpc('analytic_report', {
|
|
76
|
+
p_company_id: args.company_id,
|
|
77
|
+
p_axis_id: axis['id'],
|
|
78
|
+
p_from: args.from,
|
|
79
|
+
p_to: args.to,
|
|
80
|
+
}), MONEY);
|
|
81
|
+
const only = (kind) => {
|
|
82
|
+
const row = rows.find((r) => r['row_kind'] === kind);
|
|
83
|
+
return row === undefined ? null : Object.fromEntries(MONEY.map((key) => [key, row[key]]));
|
|
84
|
+
};
|
|
85
|
+
return {
|
|
86
|
+
period: { from: args.from, to: args.to },
|
|
87
|
+
axis,
|
|
88
|
+
values: rows.filter((row) => row['row_kind'] === 'value').map(({ row_kind: _kind, ...row }) => row),
|
|
89
|
+
unassigned: only('unassigned'),
|
|
90
|
+
total: only('total'),
|
|
91
|
+
note: 'Read from the posted ledger, closing entry left out, in the company\'s currency: income on the income accounts, expense on the expense accounts, result the difference, and fixed_assets the net movement of the fixed-asset accounts (debit less credit, ordinary entries only), beside the result and never in it. A value with others below it (parent_id, level) holds the subtotal of all of them; its own amount alone is in the direct_ columns. unassigned is the part no share of this axis reaches, and total the whole period: the direct_ amounts of the values and unassigned add up to total, and so do the values of level 0 and unassigned.',
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=analytics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../src/books/analytics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,UAAU,EAA0B,MAAM,cAAc,CAAC;AAClE,OAAO,EAA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
|
@@ -31,6 +31,8 @@ export const COMPANY = [
|
|
|
31
31
|
'share_capital_currency',
|
|
32
32
|
'activity_code',
|
|
33
33
|
'activity_scheme',
|
|
34
|
+
'activity_description',
|
|
35
|
+
'identifiers',
|
|
34
36
|
'document_template',
|
|
35
37
|
'invoice_accent_color',
|
|
36
38
|
'invoice_logo_position',
|
|
@@ -67,8 +69,11 @@ export const CONTACT = [
|
|
|
67
69
|
'name',
|
|
68
70
|
'contact_type',
|
|
69
71
|
'vat_number',
|
|
72
|
+
'registration_number',
|
|
73
|
+
'identifiers',
|
|
70
74
|
'auxiliary_code',
|
|
71
75
|
'email',
|
|
76
|
+
'phone',
|
|
72
77
|
'country',
|
|
73
78
|
'payment_terms_days',
|
|
74
79
|
'receivable_account_id',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columns.js","sourceRoot":"","sources":["../../src/books/columns.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,IAAI;IACJ,MAAM;IACN,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,SAAS;IACT,gBAAgB;IAChB,YAAY;IACZ,qBAAqB;IACrB,eAAe;IACf,eAAe;IACf,aAAa;IACb,MAAM;IACN,SAAS;IACT,QAAQ;IACR,OAAO;IACP,OAAO;IACP,SAAS;IACT,UAAU;IACV,qBAAqB;IACrB,wBAAwB;IACxB,eAAe;IACf,iBAAiB;IACjB,mBAAmB;IACnB,sBAAsB;IACtB,uBAAuB;IACvB,yBAAyB;IACzB,UAAU;IACV,eAAe;IACf,iBAAiB;IACjB,qBAAqB;IACrB,uBAAuB;IACvB,oBAAoB;IACpB,qBAAqB;IACrB,8BAA8B;IAC9B,kBAAkB;IAClB,qBAAqB;IACrB,0BAA0B;CAC3B,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,WAAW,CAA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C;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,aAAa;IACb,mBAAmB;IACnB,SAAS;IACT,SAAS;IACT,gBAAgB;IAChB,oBAAoB;IACpB,qBAAqB;CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI;IACJ,eAAe;IACf,gBAAgB;IAChB,cAAc;IACd,iBAAiB;IACjB,kBAAkB;IAClB,yEAAyE;IACzE,4EAA4E;IAC5E,qEAAqE;IACrE,iCAAiC;IACjC,aAAa;IACb,uBAAuB;CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,mBAAmB;IACnB,UAAU;IACV,UAAU;IACV,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,WAAW;IACX,YAAY;IACZ,WAAW;IACX,QAAQ;IACR,YAAY;IACZ,YAAY;CACb,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,SAAS;IACT,MAAM;IACN,SAAS;IACT,mBAAmB;IACnB,YAAY;IACZ,sBAAsB;IACtB,cAAc;IACd,oBAAoB;IACpB,UAAU;IACV,SAAS;IACT,UAAU;IACV,oBAAoB;CACrB,CAAC"}
|
|
1
|
+
{"version":3,"file":"columns.js","sourceRoot":"","sources":["../../src/books/columns.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,IAAI;IACJ,MAAM;IACN,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,SAAS;IACT,gBAAgB;IAChB,YAAY;IACZ,qBAAqB;IACrB,eAAe;IACf,eAAe;IACf,aAAa;IACb,MAAM;IACN,SAAS;IACT,QAAQ;IACR,OAAO;IACP,OAAO;IACP,SAAS;IACT,UAAU;IACV,qBAAqB;IACrB,wBAAwB;IACxB,eAAe;IACf,iBAAiB;IACjB,sBAAsB;IACtB,aAAa;IACb,mBAAmB;IACnB,sBAAsB;IACtB,uBAAuB;IACv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IACJ,YAAY;IACZ,MAAM;IACN,QAAQ;IACR,cAAc;IACd,YAAY;IACZ,kBAAkB;IAClB,kBAAkB;IAClB,oBAAoB;IACpB,kBAAkB;CACnB,CAAC;AAEF,+EAA+E;AAC/E,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI;IACJ,YAAY;IACZ,aAAa;IACb,cAAc;IACd,YAAY;IACZ,kBAAkB;IAClB,kBAAkB;IAClB,kBAAkB;IAClB,YAAY;IACZ,sBAAsB;CACvB,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,aAAa;IACb,mBAAmB;IACnB,SAAS;IACT,SAAS;IACT,gBAAgB;IAChB,oBAAoB;IACpB,qBAAqB;CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI;IACJ,eAAe;IACf,gBAAgB;IAChB,cAAc;IACd,iBAAiB;IACjB,kBAAkB;IAClB,yEAAyE;IACzE,4EAA4E;IAC5E,qEAAqE;IACrE,iCAAiC;IACjC,aAAa;IACb,uBAAuB;CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,mBAAmB;IACnB,UAAU;IACV,UAAU;IACV,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,WAAW;IACX,YAAY;IACZ,WAAW;IACX,QAAQ;IACR,YAAY;IACZ,YAAY;CACb,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,SAAS;IACT,MAAM;IACN,SAAS;IACT,mBAAmB;IACnB,YAAY;IACZ,sBAAsB;IACtB,cAAc;IACd,oBAAoB;IACpB,UAAU;IACV,SAAS;IACT,UAAU;IACV,oBAAoB;CACrB,CAAC"}
|
package/dist/books/contacts.d.ts
CHANGED
|
@@ -10,7 +10,12 @@ export interface CreateContactArgs {
|
|
|
10
10
|
/** Left out, the database's own default applies. */
|
|
11
11
|
contact_type?: ContactType | undefined;
|
|
12
12
|
vat_number?: string | undefined;
|
|
13
|
+
/** The number of the commercial register of its country. */
|
|
14
|
+
registration_number?: string | undefined;
|
|
15
|
+
/** Every identifier with no column of its own, by the code of its scheme: `{ "<scheme>": "<identifier>" }`. */
|
|
16
|
+
identifiers?: Record<string, string> | undefined;
|
|
13
17
|
email?: string | undefined;
|
|
18
|
+
phone?: string | undefined;
|
|
14
19
|
country?: string | undefined;
|
|
15
20
|
payment_terms_days?: number | undefined;
|
|
16
21
|
auxiliary_code?: string | undefined;
|
|
@@ -40,4 +45,42 @@ export declare function resolveContact(backend: Backend, company: string, wanted
|
|
|
40
45
|
id: string;
|
|
41
46
|
name: string;
|
|
42
47
|
}>;
|
|
48
|
+
export interface MergeContactsArgs {
|
|
49
|
+
/** The contact that stays, and takes the history of the other. */
|
|
50
|
+
keep_contact_id: string;
|
|
51
|
+
/** The contact that is retired once everything naming it names the kept one. */
|
|
52
|
+
absorb_contact_id: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Merges two contacts of one company through `merge_contacts()` (decision
|
|
56
|
+
* 0074): every row naming the absorbed contact — posted lines and issued
|
|
57
|
+
* documents included — names the kept one, the learned motifs are folded, the
|
|
58
|
+
* kept contact's empty fields are filled, and the absorbed contact is retired.
|
|
59
|
+
* What moved and what was filled are the database's answer; the refusals are
|
|
60
|
+
* its own, by name.
|
|
61
|
+
*/
|
|
62
|
+
export declare function mergeContacts(backend: Backend, args: MergeContactsArgs): Promise<unknown>;
|
|
63
|
+
export interface SuggestDuplicateContactsArgs {
|
|
64
|
+
company_id: string;
|
|
65
|
+
}
|
|
66
|
+
/** One probable pair, as `suggest_duplicate_contacts()` answers it, with the two names. */
|
|
67
|
+
export interface DuplicateContactPair {
|
|
68
|
+
keep_id: string;
|
|
69
|
+
keep_name: string;
|
|
70
|
+
absorb_id: string;
|
|
71
|
+
absorb_name: string;
|
|
72
|
+
score: number;
|
|
73
|
+
/** The kinds of evidence, strongest first: `vat_number`, `registration_number`, `account`, `name`. */
|
|
74
|
+
evidence: string[];
|
|
75
|
+
because: string;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The contacts of a company that are probably one party, through
|
|
79
|
+
* `suggest_duplicate_contacts()` (decision 0075): one pair per row, strongest
|
|
80
|
+
* first, with the contact to keep, the score and the evidence. The pairs, the
|
|
81
|
+
* scores and which one to keep are the database's; this puts the two names
|
|
82
|
+
* beside the ids. It writes nothing: `mergeContacts()` joins a pair once a
|
|
83
|
+
* person has chosen it.
|
|
84
|
+
*/
|
|
85
|
+
export declare function suggestDuplicateContacts(backend: Backend, args: SuggestDuplicateContactsArgs): Promise<unknown>;
|
|
43
86
|
//# sourceMappingURL=contacts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contacts.d.ts","sourceRoot":"","sources":["../../src/books/contacts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAc,KAAK,OAAO,EAAyB,MAAM,cAAc,CAAC;AAG/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,eAAO,MAAM,aAAa,gEAAkG,CAAC;AAE7H,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,YAAY,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IACvC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,2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AC,CA2BvC;AAED,MAAM,WAAW,iBAAiB;IAChC,kEAAkE;IAClE,eAAe,EAAE,MAAM,CAAC;IACxB,gFAAgF;IAChF,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,CAyB/F;AAED,MAAM,WAAW,4BAA4B;IAC3C,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,2FAA2F;AAC3F,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,sGAAsG;IACtG,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,wBAAsB,wBAAwB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,4BAA4B,GAAG,OAAO,CAAC,OAAO,CAAC,CAsBrH"}
|
package/dist/books/contacts.js
CHANGED
|
@@ -66,4 +66,65 @@ export async function resolveContact(backend, company, wanted) {
|
|
|
66
66
|
}
|
|
67
67
|
return matches[0];
|
|
68
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Merges two contacts of one company through `merge_contacts()` (decision
|
|
71
|
+
* 0074): every row naming the absorbed contact — posted lines and issued
|
|
72
|
+
* documents included — names the kept one, the learned motifs are folded, the
|
|
73
|
+
* kept contact's empty fields are filled, and the absorbed contact is retired.
|
|
74
|
+
* What moved and what was filled are the database's answer; the refusals are
|
|
75
|
+
* its own, by name.
|
|
76
|
+
*/
|
|
77
|
+
export async function mergeContacts(backend, args) {
|
|
78
|
+
const merge = only(await backend.rpc('merge_contacts', { p_keep: args.keep_contact_id, p_absorb: args.absorb_contact_id }), `contacts ${args.keep_contact_id} and ${args.absorb_contact_id} were not merged`);
|
|
79
|
+
const both = await backend.select({
|
|
80
|
+
table: 'contacts',
|
|
81
|
+
columns: [...columns.CONTACT, 'merged_into'],
|
|
82
|
+
where: [{ column: 'id', op: 'in', value: [args.keep_contact_id, args.absorb_contact_id] }],
|
|
83
|
+
});
|
|
84
|
+
const byId = new Map(both.map((contact) => [String(contact['id']), contact]));
|
|
85
|
+
return {
|
|
86
|
+
merge: {
|
|
87
|
+
id: merge['id'],
|
|
88
|
+
kept_id: merge['kept_id'],
|
|
89
|
+
absorbed_id: merge['absorbed_id'],
|
|
90
|
+
moved: merge['moved'],
|
|
91
|
+
filled: merge['filled'],
|
|
92
|
+
merged_by: merge['merged_by'],
|
|
93
|
+
merged_at: merge['merged_at'],
|
|
94
|
+
},
|
|
95
|
+
kept: byId.get(args.keep_contact_id) ?? null,
|
|
96
|
+
absorbed: byId.get(args.absorb_contact_id) ?? null,
|
|
97
|
+
note: 'Everything that named the absorbed contact names the kept one now, posted lines and issued documents included; the absorbed contact is retired, kept as the record of what was imported, and is named by no row again. There is no unmerge: the audit trail lists every line and document that moved.',
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The contacts of a company that are probably one party, through
|
|
102
|
+
* `suggest_duplicate_contacts()` (decision 0075): one pair per row, strongest
|
|
103
|
+
* first, with the contact to keep, the score and the evidence. The pairs, the
|
|
104
|
+
* scores and which one to keep are the database's; this puts the two names
|
|
105
|
+
* beside the ids. It writes nothing: `mergeContacts()` joins a pair once a
|
|
106
|
+
* person has chosen it.
|
|
107
|
+
*/
|
|
108
|
+
export async function suggestDuplicateContacts(backend, args) {
|
|
109
|
+
const found = await backend.rpc('suggest_duplicate_contacts', { p_company_id: args.company_id });
|
|
110
|
+
const ids = [...new Set(found.flatMap((row) => [String(row['keep_id']), String(row['absorb_id'])]))];
|
|
111
|
+
const named = ids.length === 0
|
|
112
|
+
? []
|
|
113
|
+
: await backend.select({ table: 'contacts', columns: ['id', 'name'], where: [{ column: 'id', op: 'in', value: ids }] });
|
|
114
|
+
const nameOf = new Map(named.map((contact) => [String(contact['id']), String(contact['name'])]));
|
|
115
|
+
const pairs = found.map((row) => ({
|
|
116
|
+
keep_id: String(row['keep_id']),
|
|
117
|
+
keep_name: nameOf.get(String(row['keep_id'])) ?? '',
|
|
118
|
+
absorb_id: String(row['absorb_id']),
|
|
119
|
+
absorb_name: nameOf.get(String(row['absorb_id'])) ?? '',
|
|
120
|
+
score: Number(row['score']),
|
|
121
|
+
evidence: String(row['evidence']).split(','),
|
|
122
|
+
because: String(row['because']),
|
|
123
|
+
}));
|
|
124
|
+
return {
|
|
125
|
+
pairs,
|
|
126
|
+
count: pairs.length,
|
|
127
|
+
note: 'Probable pairs, strongest first; nothing was written. The contact to keep is the one more ledger lines and documents name, then the older. Show the user both contacts and merge a pair only once they confirm it, with the contact they choose to keep.',
|
|
128
|
+
};
|
|
129
|
+
}
|
|
69
130
|
//# sourceMappingURL=contacts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contacts.js","sourceRoot":"","sources":["../../src/books/contacts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAuC,MAAM,cAAc,CAAC;AAC/E,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAGlD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"contacts.js","sourceRoot":"","sources":["../../src/books/contacts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAuC,MAAM,cAAc,CAAC;AAC/E,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MA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,OAAO,CAAC,CAAC;QAC3B,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC;QAC5C,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;KAChC,CAAC,CAAC,CAAC;IACJ,OAAO;QACL,KAAK;QACL,KAAK,EAAE,KAAK,CAAC,MAAM;QACnB,IAAI,EAAE,0PAA0P;KACjQ,CAAC;AACJ,CAAC"}
|
package/dist/books/index.d.ts
CHANGED
|
@@ -16,8 +16,11 @@ export * from './companies.js';
|
|
|
16
16
|
export * from './contacts.js';
|
|
17
17
|
export * from './documents.js';
|
|
18
18
|
export * from './entries.js';
|
|
19
|
+
export * from './lines.js';
|
|
20
|
+
export * from './matching.js';
|
|
19
21
|
export * from './payments.js';
|
|
20
22
|
export * from './imports.js';
|
|
21
23
|
export * from './statements.js';
|
|
24
|
+
export * from './analytics.js';
|
|
22
25
|
export * from './document-pdf.js';
|
|
23
26
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/books/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,cAAc,CAAC;AAC7B,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/books/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,cAAc,CAAC;AAC7B,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC"}
|
package/dist/books/index.js
CHANGED
|
@@ -16,8 +16,11 @@ export * from './companies.js';
|
|
|
16
16
|
export * from './contacts.js';
|
|
17
17
|
export * from './documents.js';
|
|
18
18
|
export * from './entries.js';
|
|
19
|
+
export * from './lines.js';
|
|
20
|
+
export * from './matching.js';
|
|
19
21
|
export * from './payments.js';
|
|
20
22
|
export * from './imports.js';
|
|
21
23
|
export * from './statements.js';
|
|
24
|
+
export * from './analytics.js';
|
|
22
25
|
export * from './document-pdf.js';
|
|
23
26
|
//# sourceMappingURL=index.js.map
|
package/dist/books/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/books/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,cAAc,CAAC;AAC7B,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/books/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,cAAc,CAAC;AAC7B,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ledger lines that name nobody: who they could be, and naming one.
|
|
3
|
+
*
|
|
4
|
+
* Books brought in line by line arrive with open items on the receivable and
|
|
5
|
+
* payable accounts that name no contact. `suggest_line_contacts()` scores
|
|
6
|
+
* them the way a statement line is scored and `set_line_contact()` names one,
|
|
7
|
+
* once, and learns from it (decision 0070). The candidates, the scores and the
|
|
8
|
+
* refusals are the schema's; this file asks for them and puts each line's
|
|
9
|
+
* candidates under it.
|
|
10
|
+
*/
|
|
11
|
+
import type { Backend } from './backend.js';
|
|
12
|
+
export interface SuggestLineContactsArgs {
|
|
13
|
+
company_id: string;
|
|
14
|
+
/** The lines to ask about. Left out: every open third-party line of the company that names nobody. */
|
|
15
|
+
line_ids?: string[] | undefined;
|
|
16
|
+
}
|
|
17
|
+
export interface SetLineContactArgs {
|
|
18
|
+
line_id: string;
|
|
19
|
+
contact_id: string;
|
|
20
|
+
}
|
|
21
|
+
/** One candidate for one line, as `suggest_line_contacts()` answers it. */
|
|
22
|
+
export interface LineContactCandidate {
|
|
23
|
+
contact_id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
score: number;
|
|
26
|
+
method: string;
|
|
27
|
+
because: string;
|
|
28
|
+
alternatives: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The candidates of each line, best first, with the label, the amount and the
|
|
32
|
+
* account of the line beside them so a person can judge. A line nothing points
|
|
33
|
+
* at is not listed.
|
|
34
|
+
*/
|
|
35
|
+
export declare function suggestLineContacts(backend: Backend, args: SuggestLineContactsArgs): Promise<unknown>;
|
|
36
|
+
/** Names the line through `set_line_contact()`, which refuses by name and learns from it. */
|
|
37
|
+
export declare function setLineContact(backend: Backend, args: SetLineContactArgs): Promise<unknown>;
|
|
38
|
+
//# sourceMappingURL=lines.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lines.d.ts","sourceRoot":"","sources":["../../src/books/lines.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAO,MAAM,cAAc,CAAC;AAIjD,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,sGAAsG;IACtG,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CACjC;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,2EAA2E;AAC3E,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,OAAO,CAAC,CAkD3G;AAED,6FAA6F;AAC7F,wBAAsB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,CAYjG"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ledger lines that name nobody: who they could be, and naming one.
|
|
3
|
+
*
|
|
4
|
+
* Books brought in line by line arrive with open items on the receivable and
|
|
5
|
+
* payable accounts that name no contact. `suggest_line_contacts()` scores
|
|
6
|
+
* them the way a statement line is scored and `set_line_contact()` names one,
|
|
7
|
+
* once, and learns from it (decision 0070). The candidates, the scores and the
|
|
8
|
+
* refusals are the schema's; this file asks for them and puts each line's
|
|
9
|
+
* candidates under it.
|
|
10
|
+
*/
|
|
11
|
+
import { money, moneyFields } from './format.js';
|
|
12
|
+
import { only } from './shared.js';
|
|
13
|
+
/**
|
|
14
|
+
* The candidates of each line, best first, with the label, the amount and the
|
|
15
|
+
* account of the line beside them so a person can judge. A line nothing points
|
|
16
|
+
* at is not listed.
|
|
17
|
+
*/
|
|
18
|
+
export async function suggestLineContacts(backend, args) {
|
|
19
|
+
const found = await backend.rpc('suggest_line_contacts', {
|
|
20
|
+
p_company_id: args.company_id,
|
|
21
|
+
...(args.line_ids === undefined ? {} : { p_line_ids: args.line_ids }),
|
|
22
|
+
});
|
|
23
|
+
const byLine = new Map();
|
|
24
|
+
for (const row of found) {
|
|
25
|
+
const id = String(row['line_id']);
|
|
26
|
+
const candidates = byLine.get(id) ?? [];
|
|
27
|
+
candidates.push({
|
|
28
|
+
contact_id: String(row['contact_id']),
|
|
29
|
+
name: String(row['name']),
|
|
30
|
+
score: Number(row['score']),
|
|
31
|
+
method: String(row['method']),
|
|
32
|
+
because: String(row['because']),
|
|
33
|
+
alternatives: Number(row['alternatives']),
|
|
34
|
+
});
|
|
35
|
+
byLine.set(id, candidates);
|
|
36
|
+
}
|
|
37
|
+
const ids = [...byLine.keys()];
|
|
38
|
+
const facts = ids.length === 0
|
|
39
|
+
? []
|
|
40
|
+
: await backend.select({
|
|
41
|
+
table: 'entry_lines',
|
|
42
|
+
columns: ['id', 'name', 'debit', 'credit', 'account_id', 'entry_id'],
|
|
43
|
+
where: [{ column: 'id', op: 'in', value: ids }],
|
|
44
|
+
});
|
|
45
|
+
const factOf = new Map(facts.map((fact) => [String(fact['id']), fact]));
|
|
46
|
+
const lines = ids.map((id) => {
|
|
47
|
+
const fact = factOf.get(id) ?? {};
|
|
48
|
+
const side = Number(fact['debit'] ?? 0) > 0 ? 'debit' : 'credit';
|
|
49
|
+
return {
|
|
50
|
+
line_id: id,
|
|
51
|
+
label: fact['name'] ?? null,
|
|
52
|
+
side,
|
|
53
|
+
amount: money(fact[side]),
|
|
54
|
+
account_id: fact['account_id'] ?? null,
|
|
55
|
+
entry_id: fact['entry_id'] ?? null,
|
|
56
|
+
candidates: byLine.get(id) ?? [],
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
return {
|
|
60
|
+
lines,
|
|
61
|
+
count: lines.length,
|
|
62
|
+
note: 'Nothing is named by a suggestion. A candidate whose alternatives is more than 1 shares its evidence with other contacts and is a question, not an answer. set_line_contact names a line once, after the user has chosen.',
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/** Names the line through `set_line_contact()`, which refuses by name and learns from it. */
|
|
66
|
+
export async function setLineContact(backend, args) {
|
|
67
|
+
const line = only(moneyFields(await backend.rpc('set_line_contact', { p_line_id: args.line_id, p_contact_id: args.contact_id }), ['debit', 'credit', 'balance', 'matched_amount', 'amount_currency', 'box_amount']), `line ${args.line_id} was not named`);
|
|
68
|
+
return {
|
|
69
|
+
entry_line: line,
|
|
70
|
+
note: 'The line names its contact now, and keeps it: a posted counterparty is corrected by reversing the entry. The label was learned as a motif of the contact, and the act is in the audit trail.',
|
|
71
|
+
};
|
|
72
|
+
}
|
|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AAI,IAAI;YACtC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,IAAI;YAClC,UAAU,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE;SACjC,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,OAAO;QACL,KAAK;QACL,KAAK,EAAE,KAAK,CAAC,MAAM;QACnB,IAAI,EAAE,0NAA0N;KACjO,CAAC;AACJ,CAAC;AAED,6FAA6F;AAC7F,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAAgB,EAAE,IAAwB;IAC7E,MAAM,IAAI,GAAG,IAAI,CACf,WAAW,CACT,MAAM,OAAO,CAAC,GAAG,CAAM,kBAAkB,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,EACtG,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,YAAY,CAAC,CAClF,EACD,QAAQ,IAAI,CAAC,OAAO,gBAAgB,CACrC,CAAC;IACF,OAAO;QACL,UAAU,EAAE,IAAI;QAChB,IAAI,EAAE,8LAA8L;KACrM,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Matching open items of one counterparty: what settles what, several lines in
|
|
3
|
+
* one gesture, a small difference booked, and a line left unnamed on purpose.
|
|
4
|
+
*
|
|
5
|
+
* `suggest_item_combinations()` proposes, `reconcile_many()` and
|
|
6
|
+
* `reconcile_with_difference()` match, `leave_line_unnamed()` and its undo
|
|
7
|
+
* record a decision about a line (decisions 0071 and 0072). The search, the
|
|
8
|
+
* accounts a difference is booked on, the tolerance and every refusal are the
|
|
9
|
+
* schema's; this file asks for them and shapes the answer.
|
|
10
|
+
*/
|
|
11
|
+
import type { Backend } from './backend.js';
|
|
12
|
+
export interface SuggestItemCombinationsArgs {
|
|
13
|
+
company_id: string;
|
|
14
|
+
/** One contact (its branches and parent count as one party). Left out: every counterparty of the company. */
|
|
15
|
+
contact_id?: string | undefined;
|
|
16
|
+
}
|
|
17
|
+
export interface MatchLinesArgs {
|
|
18
|
+
/** The lines to match together: at least one debit and one credit. */
|
|
19
|
+
line_ids: string[];
|
|
20
|
+
}
|
|
21
|
+
export interface ReconcileWithDifferenceArgs extends MatchLinesArgs {
|
|
22
|
+
/** A reason `matching_difference_reasons()` lists: `rounding`, `exchange_difference`. */
|
|
23
|
+
reason: string;
|
|
24
|
+
}
|
|
25
|
+
export interface LeaveLineUnnamedArgs {
|
|
26
|
+
line_id: string;
|
|
27
|
+
reason: string;
|
|
28
|
+
}
|
|
29
|
+
/** One proposal, as `suggest_item_combinations()` answers it. */
|
|
30
|
+
export interface ItemProposal {
|
|
31
|
+
proposal_id: string;
|
|
32
|
+
ordinal: number;
|
|
33
|
+
contact_id: string;
|
|
34
|
+
account_id: string;
|
|
35
|
+
line_id: string;
|
|
36
|
+
side: string;
|
|
37
|
+
amount: string | null;
|
|
38
|
+
kind: string;
|
|
39
|
+
line_ids: string[];
|
|
40
|
+
total: string | null;
|
|
41
|
+
difference: string | null;
|
|
42
|
+
because: string;
|
|
43
|
+
alternatives: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* What lines of one counterparty and one account could settle each other, line
|
|
47
|
+
* by line: an exact pair, several lines to the cent, or — when nothing is
|
|
48
|
+
* exact — a pair or several lines within the company's difference tolerance.
|
|
49
|
+
*/
|
|
50
|
+
export declare function suggestItemCombinations(backend: Backend, args: SuggestItemCombinationsArgs): Promise<unknown>;
|
|
51
|
+
/** The reasons a difference may be booked for, with their accounts, and the largest difference the company books. */
|
|
52
|
+
export declare function matchingDifferenceOptions(backend: Backend, args: {
|
|
53
|
+
company_id: string;
|
|
54
|
+
}): Promise<unknown>;
|
|
55
|
+
/** Matches several lines together, their open debits and credits equal to the cent. */
|
|
56
|
+
export declare function reconcileMany(backend: Backend, args: MatchLinesArgs): Promise<unknown>;
|
|
57
|
+
/** Books the difference on the account of the reason and matches everything. */
|
|
58
|
+
export declare function reconcileWithDifference(backend: Backend, args: ReconcileWithDifferenceArgs): Promise<unknown>;
|
|
59
|
+
/** Records that a line names nobody on purpose: it is no longer proposed a contact. */
|
|
60
|
+
export declare function leaveLineUnnamed(backend: Backend, args: LeaveLineUnnamedArgs): Promise<unknown>;
|
|
61
|
+
/** Takes back `leave_line_unnamed()`: the line is proposed a contact again. */
|
|
62
|
+
export declare function undoLeaveLineUnnamed(backend: Backend, args: {
|
|
63
|
+
line_id: string;
|
|
64
|
+
}): Promise<unknown>;
|
|
65
|
+
//# sourceMappingURL=matching.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matching.d.ts","sourceRoot":"","sources":["../../src/books/matching.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAO,MAAM,cAAc,CAAC;AAIjD,MAAM,WAAW,2BAA2B;IAC1C,UAAU,EAAE,MAAM,CAAC;IACnB,6GAA6G;IAC7G,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC;AAED,MAAM,WAAW,cAAc;IAC7B,sEAAsE;IACtE,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,2BAA4B,SAAQ,cAAc;IACjE,yFAAyF;IACzF,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,iEAAiE;AACjE,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,GAAG,IA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