@hed-hog/finance 0.0.251 → 0.0.253
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/dto/reverse-settlement.dto.d.ts +1 -0
- package/dist/dto/reverse-settlement.dto.d.ts.map +1 -1
- package/dist/dto/reverse-settlement.dto.js +5 -0
- package/dist/dto/reverse-settlement.dto.js.map +1 -1
- package/dist/finance-installments.controller.d.ts +40 -2
- package/dist/finance-installments.controller.d.ts.map +1 -1
- package/dist/finance-installments.controller.js +38 -2
- package/dist/finance-installments.controller.js.map +1 -1
- package/dist/finance.service.d.ts +39 -0
- package/dist/finance.service.d.ts.map +1 -1
- package/dist/finance.service.js +476 -219
- package/dist/finance.service.js.map +1 -1
- package/hedhog/data/route.yaml +27 -0
- package/hedhog/frontend/app/accounts-payable/installments/[id]/page.tsx.ejs +457 -142
- package/hedhog/frontend/app/accounts-payable/installments/page.tsx.ejs +100 -5
- package/hedhog/frontend/app/accounts-receivable/installments/[id]/page.tsx.ejs +19 -20
- package/hedhog/frontend/app/page.tsx.ejs +11 -4
- package/hedhog/frontend/messages/en.json +44 -0
- package/hedhog/frontend/messages/pt.json +44 -0
- package/hedhog/query/constraints.sql +3 -1
- package/hedhog/query/settlement-auditability.sql +175 -0
- package/hedhog/table/bank_reconciliation.yaml +11 -0
- package/hedhog/table/settlement.yaml +17 -1
- package/hedhog/table/settlement_allocation.yaml +3 -0
- package/package.json +2 -2
- package/src/dto/reverse-settlement.dto.ts +4 -0
- package/src/finance-installments.controller.ts +45 -12
- package/src/finance.service.ts +498 -114
|
@@ -2,22 +2,24 @@ import { Role, User } from '@hed-hog/api';
|
|
|
2
2
|
import { Locale } from '@hed-hog/api-locale';
|
|
3
3
|
import { Pagination } from '@hed-hog/api-pagination';
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
Body,
|
|
6
|
+
Controller,
|
|
7
|
+
Delete,
|
|
8
|
+
Get,
|
|
9
|
+
Param,
|
|
10
|
+
ParseIntPipe,
|
|
11
|
+
Patch,
|
|
12
|
+
Post,
|
|
13
|
+
Query,
|
|
14
|
+
UploadedFile,
|
|
15
|
+
UseInterceptors,
|
|
15
16
|
} from '@nestjs/common';
|
|
16
17
|
import { FileInterceptor } from '@nestjs/platform-express';
|
|
17
18
|
import { CreateFinanceTagDto } from './dto/create-finance-tag.dto';
|
|
18
19
|
import { CreateFinancialTitleDto } from './dto/create-financial-title.dto';
|
|
19
20
|
import { ExtractFinancialTitleFromFileDto } from './dto/extract-financial-title-from-file.dto';
|
|
20
21
|
import { RejectTitleDto } from './dto/reject-title.dto';
|
|
22
|
+
import { ReverseSettlementDto } from './dto/reverse-settlement.dto';
|
|
21
23
|
import { FinanceService } from './finance.service';
|
|
22
24
|
|
|
23
25
|
import { UpdateInstallmentTagsDto } from './dto/update-installment-tags.dto';
|
|
@@ -45,6 +47,14 @@ export class FinanceInstallmentsController {
|
|
|
45
47
|
return this.financeService.getAccountsPayableInstallment(id, locale);
|
|
46
48
|
}
|
|
47
49
|
|
|
50
|
+
@Get('titles/:id/settlements-history')
|
|
51
|
+
async getTitleSettlementsHistory(
|
|
52
|
+
@Param('id', ParseIntPipe) id: number,
|
|
53
|
+
@Locale() locale: string,
|
|
54
|
+
) {
|
|
55
|
+
return this.financeService.getTitleSettlementsHistory(id, locale);
|
|
56
|
+
}
|
|
57
|
+
|
|
48
58
|
@Post('accounts-payable/installments')
|
|
49
59
|
async createAccountsPayableTitle(
|
|
50
60
|
@Body() data: CreateFinancialTitleDto,
|
|
@@ -131,7 +141,7 @@ export class FinanceInstallmentsController {
|
|
|
131
141
|
async reverseAccountsPayableSettlement(
|
|
132
142
|
@Param('id', ParseIntPipe) id: number,
|
|
133
143
|
@Param('settlementId', ParseIntPipe) settlementId: number,
|
|
134
|
-
@Body() data,
|
|
144
|
+
@Body() data: ReverseSettlementDto,
|
|
135
145
|
@Locale() locale: string,
|
|
136
146
|
@User() user,
|
|
137
147
|
) {
|
|
@@ -144,6 +154,29 @@ export class FinanceInstallmentsController {
|
|
|
144
154
|
);
|
|
145
155
|
}
|
|
146
156
|
|
|
157
|
+
@Post('settlements/:id/reverse')
|
|
158
|
+
async reverseSettlement(
|
|
159
|
+
@Param('id', ParseIntPipe) settlementId: number,
|
|
160
|
+
@Body() data: ReverseSettlementDto,
|
|
161
|
+
@Locale() locale: string,
|
|
162
|
+
@User() user,
|
|
163
|
+
) {
|
|
164
|
+
return this.financeService.reverseSettlementById(
|
|
165
|
+
settlementId,
|
|
166
|
+
data,
|
|
167
|
+
locale,
|
|
168
|
+
user?.id,
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
@Delete('bank-reconciliations/:id')
|
|
173
|
+
async unreconcileBankReconciliation(
|
|
174
|
+
@Param('id', ParseIntPipe) id: number,
|
|
175
|
+
@User() user,
|
|
176
|
+
) {
|
|
177
|
+
return this.financeService.unreconcileBankReconciliation(id, user?.id);
|
|
178
|
+
}
|
|
179
|
+
|
|
147
180
|
@Patch('accounts-payable/installments/:id/tags')
|
|
148
181
|
async updateAccountsPayableInstallmentTags(
|
|
149
182
|
@Param('id', ParseIntPipe) id: number,
|
|
@@ -260,7 +293,7 @@ export class FinanceInstallmentsController {
|
|
|
260
293
|
async reverseAccountsReceivableSettlement(
|
|
261
294
|
@Param('id', ParseIntPipe) id: number,
|
|
262
295
|
@Param('settlementId', ParseIntPipe) settlementId: number,
|
|
263
|
-
@Body() data,
|
|
296
|
+
@Body() data: ReverseSettlementDto,
|
|
264
297
|
@Locale() locale: string,
|
|
265
298
|
@User() user,
|
|
266
299
|
) {
|