@things-factory/accounting 10.1.155 → 10.1.157

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.
Files changed (85) hide show
  1. package/dist-client/tsconfig.tsbuildinfo +1 -1
  2. package/dist-server/activities/activity-expenditure.d.ts +186 -0
  3. package/dist-server/activities/activity-expenditure.js +122 -0
  4. package/dist-server/activities/activity-expenditure.js.map +1 -0
  5. package/dist-server/activities/expenditure-activity-names.d.ts +4 -0
  6. package/dist-server/activities/expenditure-activity-names.js +13 -0
  7. package/dist-server/activities/expenditure-activity-names.js.map +1 -0
  8. package/dist-server/activities/index.d.ts +2 -1
  9. package/dist-server/activities/index.js +19 -12
  10. package/dist-server/activities/index.js.map +1 -1
  11. package/dist-server/index.d.ts +1 -0
  12. package/dist-server/index.js +1 -0
  13. package/dist-server/index.js.map +1 -1
  14. package/dist-server/service/account/account-match.d.ts +5 -3
  15. package/dist-server/service/account/account-match.js +7 -3
  16. package/dist-server/service/account/account-match.js.map +1 -1
  17. package/dist-server/service/bank-statement/bank-import.js +9 -3
  18. package/dist-server/service/bank-statement/bank-import.js.map +1 -1
  19. package/dist-server/service/bank-statement/bank-source.js +2 -1
  20. package/dist-server/service/bank-statement/bank-source.js.map +1 -1
  21. package/dist-server/service/counterparty-account/counterparty-account-query.d.ts +6 -0
  22. package/dist-server/service/counterparty-account/counterparty-account-query.js +48 -0
  23. package/dist-server/service/counterparty-account/counterparty-account-query.js.map +1 -0
  24. package/dist-server/service/counterparty-account/counterparty-account-rules.d.ts +46 -0
  25. package/dist-server/service/counterparty-account/counterparty-account-rules.js +76 -0
  26. package/dist-server/service/counterparty-account/counterparty-account-rules.js.map +1 -0
  27. package/dist-server/service/counterparty-account/counterparty-account-service.d.ts +22 -0
  28. package/dist-server/service/counterparty-account/counterparty-account-service.js +66 -0
  29. package/dist-server/service/counterparty-account/counterparty-account-service.js.map +1 -0
  30. package/dist-server/service/counterparty-account/counterparty-account-type.d.ts +9 -0
  31. package/dist-server/service/counterparty-account/counterparty-account-type.js +40 -0
  32. package/dist-server/service/counterparty-account/counterparty-account-type.js.map +1 -0
  33. package/dist-server/service/counterparty-account/index.d.ts +4 -0
  34. package/dist-server/service/counterparty-account/index.js +8 -0
  35. package/dist-server/service/counterparty-account/index.js.map +1 -0
  36. package/dist-server/service/expenditure-request/expenditure-payment-state.d.ts +52 -0
  37. package/dist-server/service/expenditure-request/expenditure-payment-state.js +100 -0
  38. package/dist-server/service/expenditure-request/expenditure-payment-state.js.map +1 -0
  39. package/dist-server/service/expenditure-request/expenditure-request-item.d.ts +41 -0
  40. package/dist-server/service/expenditure-request/expenditure-request-item.js +149 -0
  41. package/dist-server/service/expenditure-request/expenditure-request-item.js.map +1 -0
  42. package/dist-server/service/expenditure-request/expenditure-request-mutation.d.ts +18 -0
  43. package/dist-server/service/expenditure-request/expenditure-request-mutation.js +140 -0
  44. package/dist-server/service/expenditure-request/expenditure-request-mutation.js.map +1 -0
  45. package/dist-server/service/expenditure-request/expenditure-request-query.d.ts +46 -0
  46. package/dist-server/service/expenditure-request/expenditure-request-query.js +365 -0
  47. package/dist-server/service/expenditure-request/expenditure-request-query.js.map +1 -0
  48. package/dist-server/service/expenditure-request/expenditure-request-rules.d.ts +128 -0
  49. package/dist-server/service/expenditure-request/expenditure-request-rules.js +183 -0
  50. package/dist-server/service/expenditure-request/expenditure-request-rules.js.map +1 -0
  51. package/dist-server/service/expenditure-request/expenditure-request-service.d.ts +92 -0
  52. package/dist-server/service/expenditure-request/expenditure-request-service.js +488 -0
  53. package/dist-server/service/expenditure-request/expenditure-request-service.js.map +1 -0
  54. package/dist-server/service/expenditure-request/expenditure-request-type.d.ts +85 -0
  55. package/dist-server/service/expenditure-request/expenditure-request-type.js +312 -0
  56. package/dist-server/service/expenditure-request/expenditure-request-type.js.map +1 -0
  57. package/dist-server/service/expenditure-request/expenditure-request.d.ts +67 -0
  58. package/dist-server/service/expenditure-request/expenditure-request.js +228 -0
  59. package/dist-server/service/expenditure-request/expenditure-request.js.map +1 -0
  60. package/dist-server/service/expenditure-request/expenditure-target.d.ts +1 -0
  61. package/dist-server/service/expenditure-request/expenditure-target.js +55 -0
  62. package/dist-server/service/expenditure-request/expenditure-target.js.map +1 -0
  63. package/dist-server/service/expenditure-request/index.d.ts +8 -0
  64. package/dist-server/service/expenditure-request/index.js +12 -0
  65. package/dist-server/service/expenditure-request/index.js.map +1 -0
  66. package/dist-server/service/index.d.ts +9 -2
  67. package/dist-server/service/index.js +18 -3
  68. package/dist-server/service/index.js.map +1 -1
  69. package/dist-server/tsconfig.tsbuildinfo +1 -1
  70. package/package.json +10 -9
  71. package/translations/en.json +58 -1
  72. package/translations/es.json +17 -1
  73. package/translations/ja.json +17 -1
  74. package/translations/ko.json +58 -1
  75. package/translations/ms.json +17 -1
  76. package/translations/zh.json +17 -1
  77. package/dist-client/activities/activity-expense-edit.d.ts +0 -14
  78. package/dist-client/activities/activity-expense-edit.js +0 -85
  79. package/dist-client/activities/activity-expense-edit.js.map +0 -1
  80. package/dist-client/activities/activity-expense-view.d.ts +0 -14
  81. package/dist-client/activities/activity-expense-view.js +0 -85
  82. package/dist-client/activities/activity-expense-view.js.map +0 -1
  83. package/dist-server/activities/activity-expense.d.ts +0 -58
  84. package/dist-server/activities/activity-expense.js +0 -150
  85. package/dist-server/activities/activity-expense.js.map +0 -1
@@ -0,0 +1,85 @@
1
+ import type { FileUpload } from 'graphql-upload/GraphQLUpload.js';
2
+ import { ObjectRef } from '@things-factory/shell';
3
+ import { ExpenditureKind, ExpenditureRequest } from './expenditure-request';
4
+ import { ExpenditurePaymentMethod } from './expenditure-request-item';
5
+ import { ExpenditurePaymentState } from './expenditure-payment-state';
6
+ export declare class ExpenditureRequestInput {
7
+ id?: string;
8
+ kind?: ExpenditureKind;
9
+ title?: string;
10
+ month?: string;
11
+ dueDate?: string;
12
+ counterparty?: ObjectRef;
13
+ payeeAccount?: ObjectRef;
14
+ notes?: string;
15
+ }
16
+ export declare class ExpenditureRequestItemPatch {
17
+ id?: string;
18
+ spentDate?: string;
19
+ category?: string;
20
+ account?: ObjectRef;
21
+ merchant?: string;
22
+ description?: string;
23
+ amount?: number;
24
+ vatAmount?: number;
25
+ paymentMethod?: ExpenditurePaymentMethod;
26
+ taxInvoice?: ObjectRef;
27
+ cuFlag?: string;
28
+ }
29
+ export declare class NewExpenditureLine {
30
+ spentDate: string;
31
+ month?: string;
32
+ category: string;
33
+ amount: number;
34
+ account?: ObjectRef;
35
+ merchant?: string;
36
+ description?: string;
37
+ vatAmount?: number;
38
+ paymentMethod?: ExpenditurePaymentMethod;
39
+ receipt?: FileUpload;
40
+ }
41
+ export declare class ExpenditurePaymentInput {
42
+ paidDate: string;
43
+ bankAccount?: ObjectRef;
44
+ }
45
+ export declare class ExpenditureRequestList {
46
+ items: ExpenditureRequest[];
47
+ total: number;
48
+ }
49
+ export declare class ExpenditurePayment {
50
+ state: ExpenditurePaymentState;
51
+ payable: number;
52
+ paid: number;
53
+ outstanding: number;
54
+ reconciled: boolean;
55
+ transactionIds: string[];
56
+ }
57
+ export declare class ExpenditureQueueRow {
58
+ request: ExpenditureRequest;
59
+ payment: ExpenditurePayment;
60
+ payeeName?: string;
61
+ payeeAccountDrift?: string;
62
+ }
63
+ export declare class ExpenditureQueue {
64
+ waiting: ExpenditureQueueRow[];
65
+ unreconciled: ExpenditureQueueRow[];
66
+ }
67
+ export declare class ExpenditureSummaryRow {
68
+ month: string;
69
+ requesterId: string;
70
+ requesterName?: string;
71
+ category: string;
72
+ total: number;
73
+ payable: number;
74
+ count: number;
75
+ }
76
+ export declare class ExpenditureStatusCount {
77
+ status: string;
78
+ count: number;
79
+ }
80
+ export declare class ExpenditureSummary {
81
+ rows: ExpenditureSummaryRow[];
82
+ statuses: ExpenditureStatusCount[];
83
+ approvedTotal: number;
84
+ unpaid: number;
85
+ }
@@ -0,0 +1,312 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExpenditureSummary = exports.ExpenditureStatusCount = exports.ExpenditureSummaryRow = exports.ExpenditureQueue = exports.ExpenditureQueueRow = exports.ExpenditurePayment = exports.ExpenditureRequestList = exports.ExpenditurePaymentInput = exports.NewExpenditureLine = exports.ExpenditureRequestItemPatch = exports.ExpenditureRequestInput = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
+ const GraphQLUpload_js_1 = tslib_1.__importDefault(require("graphql-upload/GraphQLUpload.js"));
7
+ const shell_1 = require("@things-factory/shell");
8
+ const expenditure_request_1 = require("./expenditure-request");
9
+ const expenditure_request_item_1 = require("./expenditure-request-item");
10
+ const expenditure_payment_state_1 = require("./expenditure-payment-state");
11
+ let ExpenditureRequestInput = class ExpenditureRequestInput {
12
+ };
13
+ exports.ExpenditureRequestInput = ExpenditureRequestInput;
14
+ tslib_1.__decorate([
15
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true, description: 'Empty for a new request' }),
16
+ tslib_1.__metadata("design:type", String)
17
+ ], ExpenditureRequestInput.prototype, "id", void 0);
18
+ tslib_1.__decorate([
19
+ (0, type_graphql_1.Field)(type => expenditure_request_1.ExpenditureKind, { nullable: true, description: 'Required for a new request; a request keeps its kind' }),
20
+ tslib_1.__metadata("design:type", String)
21
+ ], ExpenditureRequestInput.prototype, "kind", void 0);
22
+ tslib_1.__decorate([
23
+ (0, type_graphql_1.Field)({ nullable: true, description: "Defaults to '<month> 경비', or '<counterparty> 지급'" }),
24
+ tslib_1.__metadata("design:type", String)
25
+ ], ExpenditureRequestInput.prototype, "title", void 0);
26
+ tslib_1.__decorate([
27
+ (0, type_graphql_1.Field)({ nullable: true, description: 'YYYY-MM a reimbursement belongs to' }),
28
+ tslib_1.__metadata("design:type", String)
29
+ ], ExpenditureRequestInput.prototype, "month", void 0);
30
+ tslib_1.__decorate([
31
+ (0, type_graphql_1.Field)({ nullable: true, description: 'YYYY-MM-DD it is to be paid' }),
32
+ tslib_1.__metadata("design:type", String)
33
+ ], ExpenditureRequestInput.prototype, "dueDate", void 0);
34
+ tslib_1.__decorate([
35
+ (0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true, description: 'Who is paid, for a counterparty payment' }),
36
+ tslib_1.__metadata("design:type", shell_1.ObjectRef)
37
+ ], ExpenditureRequestInput.prototype, "counterparty", void 0);
38
+ tslib_1.__decorate([
39
+ (0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true, description: "The counterparty's account to pay into" }),
40
+ tslib_1.__metadata("design:type", shell_1.ObjectRef)
41
+ ], ExpenditureRequestInput.prototype, "payeeAccount", void 0);
42
+ tslib_1.__decorate([
43
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Notes' }),
44
+ tslib_1.__metadata("design:type", String)
45
+ ], ExpenditureRequestInput.prototype, "notes", void 0);
46
+ exports.ExpenditureRequestInput = ExpenditureRequestInput = tslib_1.__decorate([
47
+ (0, type_graphql_1.InputType)({ description: 'The head of an expenditure request - the lines are sent beside it' })
48
+ ], ExpenditureRequestInput);
49
+ let ExpenditureRequestItemPatch = class ExpenditureRequestItemPatch {
50
+ };
51
+ exports.ExpenditureRequestItemPatch = ExpenditureRequestItemPatch;
52
+ tslib_1.__decorate([
53
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true, description: 'The line to change or delete' }),
54
+ tslib_1.__metadata("design:type", String)
55
+ ], ExpenditureRequestItemPatch.prototype, "id", void 0);
56
+ tslib_1.__decorate([
57
+ (0, type_graphql_1.Field)({ nullable: true, description: 'YYYY-MM-DD' }),
58
+ tslib_1.__metadata("design:type", String)
59
+ ], ExpenditureRequestItemPatch.prototype, "spentDate", void 0);
60
+ tslib_1.__decorate([
61
+ (0, type_graphql_1.Field)({ nullable: true, description: "What the requester calls it - '식대', '교통비'" }),
62
+ tslib_1.__metadata("design:type", String)
63
+ ], ExpenditureRequestItemPatch.prototype, "category", void 0);
64
+ tslib_1.__decorate([
65
+ (0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true, description: '계정과목 - found from the category or description when not given' }),
66
+ tslib_1.__metadata("design:type", shell_1.ObjectRef)
67
+ ], ExpenditureRequestItemPatch.prototype, "account", void 0);
68
+ tslib_1.__decorate([
69
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Where - the shop or company on the receipt' }),
70
+ tslib_1.__metadata("design:type", String)
71
+ ], ExpenditureRequestItemPatch.prototype, "merchant", void 0);
72
+ tslib_1.__decorate([
73
+ (0, type_graphql_1.Field)({ nullable: true, description: 'What for' }),
74
+ tslib_1.__metadata("design:type", String)
75
+ ], ExpenditureRequestItemPatch.prototype, "description", void 0);
76
+ tslib_1.__decorate([
77
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true, description: 'Amount, VAT included' }),
78
+ tslib_1.__metadata("design:type", Number)
79
+ ], ExpenditureRequestItemPatch.prototype, "amount", void 0);
80
+ tslib_1.__decorate([
81
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true, description: 'VAT in the amount' }),
82
+ tslib_1.__metadata("design:type", Number)
83
+ ], ExpenditureRequestItemPatch.prototype, "vatAmount", void 0);
84
+ tslib_1.__decorate([
85
+ (0, type_graphql_1.Field)(type => expenditure_request_item_1.ExpenditurePaymentMethod, { nullable: true, description: 'How it was paid' }),
86
+ tslib_1.__metadata("design:type", String)
87
+ ], ExpenditureRequestItemPatch.prototype, "paymentMethod", void 0);
88
+ tslib_1.__decorate([
89
+ (0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true, description: 'The purchase tax invoice this line pays' }),
90
+ tslib_1.__metadata("design:type", shell_1.ObjectRef)
91
+ ], ExpenditureRequestItemPatch.prototype, "taxInvoice", void 0);
92
+ tslib_1.__decorate([
93
+ (0, type_graphql_1.Field)({ nullable: true, description: "Grid batch flag: '+' add, 'M' modify, '-' delete" }),
94
+ tslib_1.__metadata("design:type", String)
95
+ ], ExpenditureRequestItemPatch.prototype, "cuFlag", void 0);
96
+ exports.ExpenditureRequestItemPatch = ExpenditureRequestItemPatch = tslib_1.__decorate([
97
+ (0, type_graphql_1.InputType)({ description: 'A line of an expenditure request to add, change or delete' })
98
+ ], ExpenditureRequestItemPatch);
99
+ let NewExpenditureLine = class NewExpenditureLine {
100
+ };
101
+ exports.NewExpenditureLine = NewExpenditureLine;
102
+ tslib_1.__decorate([
103
+ (0, type_graphql_1.Field)({ description: 'YYYY-MM-DD; the month is taken from it unless month is given' }),
104
+ tslib_1.__metadata("design:type", String)
105
+ ], NewExpenditureLine.prototype, "spentDate", void 0);
106
+ tslib_1.__decorate([
107
+ (0, type_graphql_1.Field)({ nullable: true, description: 'YYYY-MM - to file a late receipt under another month' }),
108
+ tslib_1.__metadata("design:type", String)
109
+ ], NewExpenditureLine.prototype, "month", void 0);
110
+ tslib_1.__decorate([
111
+ (0, type_graphql_1.Field)({ description: "What it was - '식대', '교통비'" }),
112
+ tslib_1.__metadata("design:type", String)
113
+ ], NewExpenditureLine.prototype, "category", void 0);
114
+ tslib_1.__decorate([
115
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { description: 'Amount, VAT included' }),
116
+ tslib_1.__metadata("design:type", Number)
117
+ ], NewExpenditureLine.prototype, "amount", void 0);
118
+ tslib_1.__decorate([
119
+ (0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true, description: '계정과목 - found from the category or description when not given' }),
120
+ tslib_1.__metadata("design:type", shell_1.ObjectRef)
121
+ ], NewExpenditureLine.prototype, "account", void 0);
122
+ tslib_1.__decorate([
123
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Where' }),
124
+ tslib_1.__metadata("design:type", String)
125
+ ], NewExpenditureLine.prototype, "merchant", void 0);
126
+ tslib_1.__decorate([
127
+ (0, type_graphql_1.Field)({ nullable: true, description: 'What for' }),
128
+ tslib_1.__metadata("design:type", String)
129
+ ], NewExpenditureLine.prototype, "description", void 0);
130
+ tslib_1.__decorate([
131
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true, description: 'VAT in the amount' }),
132
+ tslib_1.__metadata("design:type", Number)
133
+ ], NewExpenditureLine.prototype, "vatAmount", void 0);
134
+ tslib_1.__decorate([
135
+ (0, type_graphql_1.Field)(type => expenditure_request_item_1.ExpenditurePaymentMethod, { nullable: true, description: 'How it was paid' }),
136
+ tslib_1.__metadata("design:type", String)
137
+ ], NewExpenditureLine.prototype, "paymentMethod", void 0);
138
+ tslib_1.__decorate([
139
+ (0, type_graphql_1.Field)(type => GraphQLUpload_js_1.default, { nullable: true, description: 'Photo of the receipt' }),
140
+ tslib_1.__metadata("design:type", Object)
141
+ ], NewExpenditureLine.prototype, "receipt", void 0);
142
+ exports.NewExpenditureLine = NewExpenditureLine = tslib_1.__decorate([
143
+ (0, type_graphql_1.InputType)({ description: 'One expense added on the go - it joins the month’s editable reimbursement' })
144
+ ], NewExpenditureLine);
145
+ let ExpenditurePaymentInput = class ExpenditurePaymentInput {
146
+ };
147
+ exports.ExpenditurePaymentInput = ExpenditurePaymentInput;
148
+ tslib_1.__decorate([
149
+ (0, type_graphql_1.Field)({ description: 'YYYY-MM-DD the money went out' }),
150
+ tslib_1.__metadata("design:type", String)
151
+ ], ExpenditurePaymentInput.prototype, "paidDate", void 0);
152
+ tslib_1.__decorate([
153
+ (0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true, description: 'Our account it went out of' }),
154
+ tslib_1.__metadata("design:type", shell_1.ObjectRef)
155
+ ], ExpenditurePaymentInput.prototype, "bankAccount", void 0);
156
+ exports.ExpenditurePaymentInput = ExpenditurePaymentInput = tslib_1.__decorate([
157
+ (0, type_graphql_1.InputType)({ description: 'How approved requests were paid at the bank' })
158
+ ], ExpenditurePaymentInput);
159
+ let ExpenditureRequestList = class ExpenditureRequestList {
160
+ };
161
+ exports.ExpenditureRequestList = ExpenditureRequestList;
162
+ tslib_1.__decorate([
163
+ (0, type_graphql_1.Field)(type => [expenditure_request_1.ExpenditureRequest], { description: 'The requests on this page' }),
164
+ tslib_1.__metadata("design:type", Array)
165
+ ], ExpenditureRequestList.prototype, "items", void 0);
166
+ tslib_1.__decorate([
167
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'How many there are in all' }),
168
+ tslib_1.__metadata("design:type", Number)
169
+ ], ExpenditureRequestList.prototype, "total", void 0);
170
+ exports.ExpenditureRequestList = ExpenditureRequestList = tslib_1.__decorate([
171
+ (0, type_graphql_1.ObjectType)({ description: 'A page of expenditure requests' })
172
+ ], ExpenditureRequestList);
173
+ let ExpenditurePayment = class ExpenditurePayment {
174
+ };
175
+ exports.ExpenditurePayment = ExpenditurePayment;
176
+ tslib_1.__decorate([
177
+ (0, type_graphql_1.Field)(type => expenditure_payment_state_1.ExpenditurePaymentState, { description: 'Nothing to pay, unpaid, partly or fully paid' }),
178
+ tslib_1.__metadata("design:type", String)
179
+ ], ExpenditurePayment.prototype, "state", void 0);
180
+ tslib_1.__decorate([
181
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { description: 'What the company is to pay' }),
182
+ tslib_1.__metadata("design:type", Number)
183
+ ], ExpenditurePayment.prototype, "payable", void 0);
184
+ tslib_1.__decorate([
185
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { description: 'What bank lines paid of it' }),
186
+ tslib_1.__metadata("design:type", Number)
187
+ ], ExpenditurePayment.prototype, "paid", void 0);
188
+ tslib_1.__decorate([
189
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { description: 'What is still to pay' }),
190
+ tslib_1.__metadata("design:type", Number)
191
+ ], ExpenditurePayment.prototype, "outstanding", void 0);
192
+ tslib_1.__decorate([
193
+ (0, type_graphql_1.Field)({ description: 'Every bank line that paid it was matched to the bank statement' }),
194
+ tslib_1.__metadata("design:type", Boolean)
195
+ ], ExpenditurePayment.prototype, "reconciled", void 0);
196
+ tslib_1.__decorate([
197
+ (0, type_graphql_1.Field)(type => [String], { description: 'The bank lines that paid it' }),
198
+ tslib_1.__metadata("design:type", Array)
199
+ ], ExpenditurePayment.prototype, "transactionIds", void 0);
200
+ exports.ExpenditurePayment = ExpenditurePayment = tslib_1.__decorate([
201
+ (0, type_graphql_1.ObjectType)({ description: 'How far an expenditure request is paid, read from the bank lines that paid it' })
202
+ ], ExpenditurePayment);
203
+ let ExpenditureQueueRow = class ExpenditureQueueRow {
204
+ };
205
+ exports.ExpenditureQueueRow = ExpenditureQueueRow;
206
+ tslib_1.__decorate([
207
+ (0, type_graphql_1.Field)(type => expenditure_request_1.ExpenditureRequest, { description: 'The request' }),
208
+ tslib_1.__metadata("design:type", expenditure_request_1.ExpenditureRequest)
209
+ ], ExpenditureQueueRow.prototype, "request", void 0);
210
+ tslib_1.__decorate([
211
+ (0, type_graphql_1.Field)(type => ExpenditurePayment, { description: 'How far it is paid' }),
212
+ tslib_1.__metadata("design:type", ExpenditurePayment)
213
+ ], ExpenditureQueueRow.prototype, "payment", void 0);
214
+ tslib_1.__decorate([
215
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Who is paid - the counterparty, or the employee paid back' }),
216
+ tslib_1.__metadata("design:type", String)
217
+ ], ExpenditureQueueRow.prototype, "payeeName", void 0);
218
+ tslib_1.__decorate([
219
+ (0, type_graphql_1.Field)({
220
+ nullable: true,
221
+ description: "'gone' or 'changed' when the account approvers saw is no longer on file as it was, 'missing' when none was written"
222
+ }),
223
+ tslib_1.__metadata("design:type", String)
224
+ ], ExpenditureQueueRow.prototype, "payeeAccountDrift", void 0);
225
+ exports.ExpenditureQueueRow = ExpenditureQueueRow = tslib_1.__decorate([
226
+ (0, type_graphql_1.ObjectType)({ description: 'An approved request in the payment queue' })
227
+ ], ExpenditureQueueRow);
228
+ let ExpenditureQueue = class ExpenditureQueue {
229
+ };
230
+ exports.ExpenditureQueue = ExpenditureQueue;
231
+ tslib_1.__decorate([
232
+ (0, type_graphql_1.Field)(type => [ExpenditureQueueRow], { description: 'Approved and not fully paid, by the day it is to be paid' }),
233
+ tslib_1.__metadata("design:type", Array)
234
+ ], ExpenditureQueue.prototype, "waiting", void 0);
235
+ tslib_1.__decorate([
236
+ (0, type_graphql_1.Field)(type => [ExpenditureQueueRow], { description: 'Paid, with a bank line not yet matched to a statement' }),
237
+ tslib_1.__metadata("design:type", Array)
238
+ ], ExpenditureQueue.prototype, "unreconciled", void 0);
239
+ exports.ExpenditureQueue = ExpenditureQueue = tslib_1.__decorate([
240
+ (0, type_graphql_1.ObjectType)({ description: 'The payment queue - what is approved and still to pay, and what was paid but not yet matched to the bank' })
241
+ ], ExpenditureQueue);
242
+ let ExpenditureSummaryRow = class ExpenditureSummaryRow {
243
+ };
244
+ exports.ExpenditureSummaryRow = ExpenditureSummaryRow;
245
+ tslib_1.__decorate([
246
+ (0, type_graphql_1.Field)({ description: 'YYYY-MM' }),
247
+ tslib_1.__metadata("design:type", String)
248
+ ], ExpenditureSummaryRow.prototype, "month", void 0);
249
+ tslib_1.__decorate([
250
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Who requested' }),
251
+ tslib_1.__metadata("design:type", String)
252
+ ], ExpenditureSummaryRow.prototype, "requesterId", void 0);
253
+ tslib_1.__decorate([
254
+ (0, type_graphql_1.Field)({ nullable: true, description: "The requester's name" }),
255
+ tslib_1.__metadata("design:type", String)
256
+ ], ExpenditureSummaryRow.prototype, "requesterName", void 0);
257
+ tslib_1.__decorate([
258
+ (0, type_graphql_1.Field)({ description: 'The category or account' }),
259
+ tslib_1.__metadata("design:type", String)
260
+ ], ExpenditureSummaryRow.prototype, "category", void 0);
261
+ tslib_1.__decorate([
262
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { description: 'Total of the lines' }),
263
+ tslib_1.__metadata("design:type", Number)
264
+ ], ExpenditureSummaryRow.prototype, "total", void 0);
265
+ tslib_1.__decorate([
266
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { description: 'What the company pays of it' }),
267
+ tslib_1.__metadata("design:type", Number)
268
+ ], ExpenditureSummaryRow.prototype, "payable", void 0);
269
+ tslib_1.__decorate([
270
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'How many lines' }),
271
+ tslib_1.__metadata("design:type", Number)
272
+ ], ExpenditureSummaryRow.prototype, "count", void 0);
273
+ exports.ExpenditureSummaryRow = ExpenditureSummaryRow = tslib_1.__decorate([
274
+ (0, type_graphql_1.ObjectType)({ description: 'Approved spending of one month, one requester, one category' })
275
+ ], ExpenditureSummaryRow);
276
+ let ExpenditureStatusCount = class ExpenditureStatusCount {
277
+ };
278
+ exports.ExpenditureStatusCount = ExpenditureStatusCount;
279
+ tslib_1.__decorate([
280
+ (0, type_graphql_1.Field)({ description: 'The status' }),
281
+ tslib_1.__metadata("design:type", String)
282
+ ], ExpenditureStatusCount.prototype, "status", void 0);
283
+ tslib_1.__decorate([
284
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'How many' }),
285
+ tslib_1.__metadata("design:type", Number)
286
+ ], ExpenditureStatusCount.prototype, "count", void 0);
287
+ exports.ExpenditureStatusCount = ExpenditureStatusCount = tslib_1.__decorate([
288
+ (0, type_graphql_1.ObjectType)({ description: 'How many requests stand in a status' })
289
+ ], ExpenditureStatusCount);
290
+ let ExpenditureSummary = class ExpenditureSummary {
291
+ };
292
+ exports.ExpenditureSummary = ExpenditureSummary;
293
+ tslib_1.__decorate([
294
+ (0, type_graphql_1.Field)(type => [ExpenditureSummaryRow], { description: 'Approved requests only' }),
295
+ tslib_1.__metadata("design:type", Array)
296
+ ], ExpenditureSummary.prototype, "rows", void 0);
297
+ tslib_1.__decorate([
298
+ (0, type_graphql_1.Field)(type => [ExpenditureStatusCount], { description: 'Every request of the period, by status - drafts and pending ones are counted, not summed' }),
299
+ tslib_1.__metadata("design:type", Array)
300
+ ], ExpenditureSummary.prototype, "statuses", void 0);
301
+ tslib_1.__decorate([
302
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { description: 'Approved in the period' }),
303
+ tslib_1.__metadata("design:type", Number)
304
+ ], ExpenditureSummary.prototype, "approvedTotal", void 0);
305
+ tslib_1.__decorate([
306
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { description: 'Approved but not yet paid' }),
307
+ tslib_1.__metadata("design:type", Number)
308
+ ], ExpenditureSummary.prototype, "unpaid", void 0);
309
+ exports.ExpenditureSummary = ExpenditureSummary = tslib_1.__decorate([
310
+ (0, type_graphql_1.ObjectType)({ description: 'Monthly summary of reimbursements' })
311
+ ], ExpenditureSummary);
312
+ //# sourceMappingURL=expenditure-request-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expenditure-request-type.js","sourceRoot":"","sources":["../../../server/service/expenditure-request/expenditure-request-type.ts"],"names":[],"mappings":";;;;AAAA,+CAA2E;AAG3E,+FAA2D;AAE3D,iDAAiD;AAEjD,+DAA2E;AAC3E,yEAAqE;AACrE,2EAAqE;AAG9D,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;CAwBnC,CAAA;AAxBY,0DAAuB;AAElC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;;mDACnE;AAGX;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,qCAAe,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,sDAAsD,EAAE,CAAC;;qDAClG;AAGtB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,kDAAkD,EAAE,CAAC;;sDAC7E;AAGd;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,oCAAoC,EAAE,CAAC;;sDAC/D;AAGd;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;;wDACtD;AAGhB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EA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AAE,CAAC,CAAC,qBAAqB,CAAC,EAAE,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;;gDACrD;AAG7B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,sBAAsB,CAAC,EAAE,EAAE,WAAW,EAAE,0FAA0F,EAAE,CAAC;;oDACnH;AAGlC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAK,EAAE,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;;yDAC3C;AAGrB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAK,EAAE,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;;kDACrD;6BAXH,kBAAkB;IAD9B,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;GACpD,kBAAkB,CAY9B","sourcesContent":["import { Field, Float, ID, InputType, Int, ObjectType } from 'type-graphql'\n\nimport type { FileUpload } from 'graphql-upload/GraphQLUpload.js'\nimport GraphQLUpload from 'graphql-upload/GraphQLUpload.js'\n\nimport { ObjectRef } from '@things-factory/shell'\n\nimport { ExpenditureKind, ExpenditureRequest } from './expenditure-request'\nimport { ExpenditurePaymentMethod } from './expenditure-request-item'\nimport { ExpenditurePaymentState } from './expenditure-payment-state'\n\n@InputType({ description: 'The head of an expenditure request - the lines are sent beside it' })\nexport class ExpenditureRequestInput {\n @Field(type => ID, { nullable: true, description: 'Empty for a new request' })\n id?: string\n\n @Field(type => ExpenditureKind, { nullable: true, description: 'Required for a new request; a request keeps its kind' })\n kind?: ExpenditureKind\n\n @Field({ nullable: true, description: \"Defaults to '<month> 경비', or '<counterparty> 지급'\" })\n title?: string\n\n @Field({ nullable: true, description: 'YYYY-MM a reimbursement belongs to' })\n month?: string\n\n @Field({ nullable: true, description: 'YYYY-MM-DD it is to be paid' })\n dueDate?: string\n\n @Field(type => ObjectRef, { nullable: true, description: 'Who is paid, for a counterparty payment' })\n counterparty?: ObjectRef\n\n @Field(type => ObjectRef, { nullable: true, description: \"The counterparty's account to pay into\" })\n payeeAccount?: ObjectRef\n\n @Field({ nullable: true, description: 'Notes' })\n notes?: string\n}\n\n@InputType({ description: 'A line of an expenditure request to add, change or delete' })\nexport class ExpenditureRequestItemPatch {\n @Field(type => ID, { nullable: true, description: 'The line to change or delete' })\n id?: string\n\n @Field({ nullable: true, description: 'YYYY-MM-DD' })\n spentDate?: string\n\n @Field({ nullable: true, description: \"What the requester calls it - '식대', '교통비'\" })\n category?: string\n\n @Field(type => ObjectRef, { nullable: true, description: '계정과목 - found from the category or description when not given' })\n account?: ObjectRef\n\n @Field({ nullable: true, description: 'Where - the shop or company on the receipt' })\n merchant?: string\n\n @Field({ nullable: true, description: 'What for' })\n description?: string\n\n @Field(type => Float, { nullable: true, description: 'Amount, VAT included' })\n amount?: number\n\n @Field(type => Float, { nullable: true, description: 'VAT in the amount' })\n vatAmount?: number\n\n @Field(type => ExpenditurePaymentMethod, { nullable: true, description: 'How it was paid' })\n paymentMethod?: ExpenditurePaymentMethod\n\n @Field(type => ObjectRef, { nullable: true, description: 'The purchase tax invoice this line pays' })\n taxInvoice?: ObjectRef\n\n @Field({ nullable: true, description: \"Grid batch flag: '+' add, 'M' modify, '-' delete\" })\n cuFlag?: string\n}\n\n@InputType({ description: 'One expense added on the go - it joins the month’s editable reimbursement' })\nexport class NewExpenditureLine {\n @Field({ description: 'YYYY-MM-DD; the month is taken from it unless month is given' })\n spentDate: string\n\n @Field({ nullable: true, description: 'YYYY-MM - to file a late receipt under another month' })\n month?: string\n\n @Field({ description: \"What it was - '식대', '교통비'\" })\n category: string\n\n @Field(type => Float, { description: 'Amount, VAT included' })\n amount: number\n\n @Field(type => ObjectRef, { nullable: true, description: '계정과목 - found from the category or description when not given' })\n account?: ObjectRef\n\n @Field({ nullable: true, description: 'Where' })\n merchant?: string\n\n @Field({ nullable: true, description: 'What for' })\n description?: string\n\n @Field(type => Float, { nullable: true, description: 'VAT in the amount' })\n vatAmount?: number\n\n @Field(type => ExpenditurePaymentMethod, { nullable: true, description: 'How it was paid' })\n paymentMethod?: ExpenditurePaymentMethod\n\n @Field(type => GraphQLUpload, { nullable: true, description: 'Photo of the receipt' })\n receipt?: FileUpload\n}\n\n@InputType({ description: 'How approved requests were paid at the bank' })\nexport class ExpenditurePaymentInput {\n @Field({ description: 'YYYY-MM-DD the money went out' })\n paidDate: string\n\n @Field(type => ObjectRef, { nullable: true, description: 'Our account it went out of' })\n bankAccount?: ObjectRef\n}\n\n@ObjectType({ description: 'A page of expenditure requests' })\nexport class ExpenditureRequestList {\n @Field(type => [ExpenditureRequest], { description: 'The requests on this page' })\n items: ExpenditureRequest[]\n\n @Field(type => Int, { description: 'How many there are in all' })\n total: number\n}\n\n@ObjectType({ description: 'How far an expenditure request is paid, read from the bank lines that paid it' })\nexport class ExpenditurePayment {\n @Field(type => ExpenditurePaymentState, { description: 'Nothing to pay, unpaid, partly or fully paid' })\n state: ExpenditurePaymentState\n\n @Field(type => Float, { description: 'What the company is to pay' })\n payable: number\n\n @Field(type => Float, { description: 'What bank lines paid of it' })\n paid: number\n\n @Field(type => Float, { description: 'What is still to pay' })\n outstanding: number\n\n @Field({ description: 'Every bank line that paid it was matched to the bank statement' })\n reconciled: boolean\n\n @Field(type => [String], { description: 'The bank lines that paid it' })\n transactionIds: string[]\n}\n\n@ObjectType({ description: 'An approved request in the payment queue' })\nexport class ExpenditureQueueRow {\n @Field(type => ExpenditureRequest, { description: 'The request' })\n request: ExpenditureRequest\n\n @Field(type => ExpenditurePayment, { description: 'How far it is paid' })\n payment: ExpenditurePayment\n\n @Field({ nullable: true, description: 'Who is paid - the counterparty, or the employee paid back' })\n payeeName?: string\n\n @Field({\n nullable: true,\n description: \"'gone' or 'changed' when the account approvers saw is no longer on file as it was, 'missing' when none was written\"\n })\n payeeAccountDrift?: string\n}\n\n@ObjectType({ description: 'The payment queue - what is approved and still to pay, and what was paid but not yet matched to the bank' })\nexport class ExpenditureQueue {\n @Field(type => [ExpenditureQueueRow], { description: 'Approved and not fully paid, by the day it is to be paid' })\n waiting: ExpenditureQueueRow[]\n\n @Field(type => [ExpenditureQueueRow], { description: 'Paid, with a bank line not yet matched to a statement' })\n unreconciled: ExpenditureQueueRow[]\n}\n\n@ObjectType({ description: 'Approved spending of one month, one requester, one category' })\nexport class ExpenditureSummaryRow {\n @Field({ description: 'YYYY-MM' })\n month: string\n\n @Field(type => ID, { description: 'Who requested' })\n requesterId: string\n\n @Field({ nullable: true, description: \"The requester's name\" })\n requesterName?: string\n\n @Field({ description: 'The category or account' })\n category: string\n\n @Field(type => Float, { description: 'Total of the lines' })\n total: number\n\n @Field(type => Float, { description: 'What the company pays of it' })\n payable: number\n\n @Field(type => Int, { description: 'How many lines' })\n count: number\n}\n\n@ObjectType({ description: 'How many requests stand in a status' })\nexport class ExpenditureStatusCount {\n @Field({ description: 'The status' })\n status: string\n\n @Field(type => Int, { description: 'How many' })\n count: number\n}\n\n@ObjectType({ description: 'Monthly summary of reimbursements' })\nexport class ExpenditureSummary {\n @Field(type => [ExpenditureSummaryRow], { description: 'Approved requests only' })\n rows: ExpenditureSummaryRow[]\n\n @Field(type => [ExpenditureStatusCount], { description: 'Every request of the period, by status - drafts and pending ones are counted, not summed' })\n statuses: ExpenditureStatusCount[]\n\n @Field(type => Float, { description: 'Approved in the period' })\n approvedTotal: number\n\n @Field(type => Float, { description: 'Approved but not yet paid' })\n unpaid: number\n}\n"]}
@@ -0,0 +1,67 @@
1
+ import { Domain } from '@things-factory/shell';
2
+ import { User } from '@things-factory/auth-base';
3
+ import { Counterparty, CounterpartyBankAccount } from '@things-factory/biz-base';
4
+ import { Department } from '@things-factory/organization';
5
+ import { ExpenditureRequestItem } from './expenditure-request-item';
6
+ export declare enum ExpenditureKind {
7
+ /** Paying a counterparty - a supplier's invoice, a service, a deposit. */
8
+ VENDOR = "VENDOR",
9
+ /** Paying an employee back what they spent for the company (경비 청구). */
10
+ REIMBURSEMENT = "REIMBURSEMENT"
11
+ }
12
+ export declare enum ExpenditureRequestStatus {
13
+ DRAFT = "DRAFT",
14
+ SUBMITTED = "SUBMITTED",
15
+ APPROVED = "APPROVED",
16
+ REJECTED = "REJECTED",
17
+ WITHDRAWN = "WITHDRAWN"
18
+ }
19
+ /**
20
+ * 지출결의 - money the company is asked to pay out, put up for approval before it leaves (ADR-0135).
21
+ *
22
+ * Two kinds share it: paying a counterparty, and paying an employee back (경비 청구, one claim per employee and
23
+ * month). The requester writes the lines and submits; approvers decide through the worklist approval the submission
24
+ * raises. Once approved, finance pays it from the payment queue.
25
+ *
26
+ * Whether it was paid, and whether that payment was reconciled with the bank, is not stored: it is read from the
27
+ * payments on it (§`expenditure-payment-state.ts`). The account approvers saw is written down at submission, and it
28
+ * is the account paid.
29
+ */
30
+ export declare class ExpenditureRequest {
31
+ readonly id: string;
32
+ domain?: Domain;
33
+ domainId?: string;
34
+ kind: ExpenditureKind;
35
+ requester?: User;
36
+ requesterId?: string;
37
+ department?: Department;
38
+ departmentId?: string;
39
+ counterparty?: Counterparty;
40
+ counterpartyId?: string;
41
+ payeeAccount?: CounterpartyBankAccount;
42
+ payeeAccountId?: string;
43
+ payeeBankName?: string;
44
+ payeeAccountNumber?: string;
45
+ payeeHolderName?: string;
46
+ month?: string;
47
+ dueDate?: string;
48
+ title: string;
49
+ currency: string;
50
+ status: ExpenditureRequestStatus;
51
+ totalAmount: number;
52
+ payableAmount: number;
53
+ items?: ExpenditureRequestItem[];
54
+ activityInstanceId?: string;
55
+ submittedAt?: Date;
56
+ decidedAt?: Date;
57
+ decidedBy?: User;
58
+ decidedById?: string;
59
+ notes?: string;
60
+ createdAt?: Date;
61
+ updatedAt?: Date;
62
+ deletedAt?: Date;
63
+ creator?: User;
64
+ creatorId?: string;
65
+ updater?: User;
66
+ updaterId?: string;
67
+ }