Fix monthly actuals: allow negative values and fix save/reconcile error
- Remove min={0} from NumberInput to allow negative actuals (refunds/corrections)
- Fix post() in journal-entries service: use id param directly instead of
RETURNING result which returns [rows, count] in TypeORM QueryRunner
- Handle negative amounts in saveActuals(): negative expense credits the
expense account, negative income debits the income account
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -140,11 +140,11 @@ export class JournalEntriesService {
|
||||
);
|
||||
}
|
||||
|
||||
const result = await this.tenant.query(
|
||||
`UPDATE journal_entries SET is_posted = true, posted_by = $1, posted_at = NOW() WHERE id = $2 RETURNING *`,
|
||||
await this.tenant.query(
|
||||
`UPDATE journal_entries SET is_posted = true, posted_by = $1, posted_at = NOW() WHERE id = $2`,
|
||||
[userId, id],
|
||||
);
|
||||
return this.findOne(result[0].id);
|
||||
return this.findOne(id);
|
||||
}
|
||||
|
||||
async void(id: string, userId: string, reason: string) {
|
||||
|
||||
Reference in New Issue
Block a user