feat: show liability account credit balances as deposits
This commit is contained in:
1 parent
e77650f0c0
commit
20643b366f
19 files changed
+385
-68
No files matched your search
@@ -159,8 +159,8 @@ export class PortfolioController {
|
||||
});
|
||||
if (!p) throw new NotFoundException('项目不存在');
|
||||
if (p.archived) throw new ConflictException('请先恢复归档项目');
|
||||
if (v.amount.startsWith('-') && (p.kind !== 'account' || p.side !== 'asset'))
|
||||
throw new BadRequestException('仅资产账户支持负余额');
|
||||
if (v.amount.startsWith('-') && p.kind !== 'account')
|
||||
throw new BadRequestException('仅账户支持负余额');
|
||||
const lastTransfer = await tx.revision.findFirst({
|
||||
where: { positionId: p.id, reason: { in: pairedReasons } },
|
||||
orderBy: [{ effectiveDate: 'desc' }, { sequence: 'desc' }],
|
||||
@@ -203,8 +203,8 @@ export class PortfolioController {
|
||||
});
|
||||
if (!p) throw new NotFoundException('项目不存在');
|
||||
if (p.archived) throw new ConflictException('请先恢复归档项目');
|
||||
if (v.amount.startsWith('-') && (p.kind !== 'account' || p.side !== 'asset'))
|
||||
throw new BadRequestException('仅资产账户支持负余额');
|
||||
if (v.amount.startsWith('-') && p.kind !== 'account')
|
||||
throw new BadRequestException('仅账户支持负余额');
|
||||
const original = await tx.revision.findFirst({ where: { id: revisionId, positionId: p.id } });
|
||||
if (!original) throw new NotFoundException('历史记录不存在');
|
||||
if (pairedReasons.includes(original.reason))
|
||||
|
||||
Reference in new issue
Block a user