Bug/year end failure (#575)
* feat: implement findNextPeriod function and integrate into year-end closing logic * feat: add integrity check for PDF documents and enhance user feedback for corrupt files * Refactor year-end service and period creation logic for improved UTC handling and error messaging - Update `validateYearEndReadiness` to assert on stable warning messages without interpolating period names. - Modify `createNextPeriod` to ensure date calculations are performed in UTC, preventing DST-related issues. - Enhance error handling in `validateYearEndReadiness` and `executeYearEndClosing` to avoid exposing database details. - Introduce structured error messages for year-end processes in `structured-errors.ts`. - Add tests for document integrity checks, ensuring proper authentication and error handling. - Implement GUC checks in document versioning to prevent unauthorized modifications and ensure company membership. - Update migration scripts to reflect changes in document immutability enforcement. * fix: add comment to clarify GUC behavior in document supersession logic
This commit is contained in:
@@ -770,6 +770,11 @@ const YEAR_END: Record<string, StructuredErrorEntry> = {
|
||||
message_sv: 'Resultaträkningens debet och kredit balanserar inte. Granska verifikationerna innan bokslut.',
|
||||
message_en: 'Trial balance does not balance.',
|
||||
},
|
||||
YEAR_END_NEXT_PERIOD_HAS_IB: {
|
||||
httpStatus: 400,
|
||||
message_sv: 'Nästa räkenskapsperiod har redan ingående balanser bokförda. Storno dem innan du kör om bokslutet.',
|
||||
message_en: 'Next fiscal period already has opening balances posted; reverse them before re-running year-end.',
|
||||
},
|
||||
}
|
||||
|
||||
const OPENING_BAL: Record<string, StructuredErrorEntry> = {
|
||||
|
||||
Reference in New Issue
Block a user