feat(ssr): previous calendar year period + external register filters

- P&L period dropdown: replace "Calendar year (YYYY)" with
  "Previous Calendar Year (YYYY-1)" pulling the full prior year
- External register: title now reads "External Register"; add
  Source, External Id, and Location filters

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-30 07:22:31 -07:00
parent e2ccfc8d2c
commit ebb48a0de4
3 changed files with 51 additions and 4 deletions

View File

@@ -268,6 +268,21 @@ const calendarYearPeriod = (date) => {
return {end: formatDateMMDDYYYY(end), start: formatDateMMDDYYYY(start)};
}
const previousCalendarYearPeriod = (date) => {
if (!date) {
date= new Date()
} else {
date = parseMMDDYYYY(date)
}
const priorYear = date.getFullYear() - 1;
// Jan 1 - Dec 31 of the previous calendar year
const start = new Date(priorYear, 0, 1);
const end = new Date(priorYear, 11, 31);
return {end: formatDateMMDDYYYY(end), start: formatDateMMDDYYYY(start)};
}
const getLastMonthPeriods = (date) => {
if (!date) {
date = new Date();