diff --git a/src/command/club/protocol/protocolPresenceCommand.ts b/src/command/club/protocol/protocolPresenceCommand.ts index 76c004a..134aeac 100644 --- a/src/command/club/protocol/protocolPresenceCommand.ts +++ b/src/command/club/protocol/protocolPresenceCommand.ts @@ -6,4 +6,5 @@ export interface SynchronizeProtocolPresenceCommand { export interface ProtocolPresenceCommand { memberId: number; absent: boolean; + excused: boolean; } diff --git a/src/command/club/protocol/protocolPresenceCommandHandler.ts b/src/command/club/protocol/protocolPresenceCommandHandler.ts index abdb82b..8d48fe6 100644 --- a/src/command/club/protocol/protocolPresenceCommandHandler.ts +++ b/src/command/club/protocol/protocolPresenceCommandHandler.ts @@ -74,6 +74,7 @@ export default abstract class ProtocolPresenceCommandHandler { .update(protocolPresence) .set({ absent: member.absent, + excused: member.excused, }) .where("memberId = :memberId", { memberId: member.memberId }) .andWhere("protocolId = :protocolId", { protocolId }) diff --git a/src/controller/admin/club/protocolController.ts b/src/controller/admin/club/protocolController.ts index bba8aa0..868715f 100644 --- a/src/controller/admin/club/protocolController.ts +++ b/src/controller/admin/club/protocolController.ts @@ -260,7 +260,9 @@ export async function createProtocolPrintoutById(req: Request, res: Response): P agenda, decisions, presence: presence.filter((p) => !p.absent).map((p) => p.member), - absent: presence.filter((p) => p.absent).map((p) => p.member), + absent: presence.filter((p) => p.absent).map((p) => ({ ...p.member, excused: p.excused })), + excused_absent: presence.filter((p) => p.absent && p.excused).map((p) => p.member), + unexcused_absent: presence.filter((p) => p.absent && !p.excused).map((p) => p.member), votings, }, }); @@ -389,6 +391,7 @@ export async function synchronizeProtocolPrecenseById(req: Request, res: Respons members: presence.map((p) => ({ memberId: p.memberId, absent: p.absent, + excused: p.excused, })), protocolId, }; diff --git a/src/templates/protocol.body.template.html b/src/templates/protocol.body.template.html index c37fa75..5a263ff 100644 --- a/src/templates/protocol.body.template.html +++ b/src/templates/protocol.body.template.html @@ -14,9 +14,19 @@

Anwesenheit ({{presence.length}})

-

{{#each presence}} {{this.firstname}} {{this.lastname}}{{#unless @last}}, {{/unless}} {{/each}}

+

+ {{#each presence}}{{this.firstname}} {{this.lastname}}{{#unless @last}}, {{/unless}}{{/each}}{{#unless + presence.length}}---{{/unless}} +

Abwesenheit ({{absent.length}})

-

{{#each absent}} {{this.firstname}} {{this.lastname}}{{#unless @last}}, {{/unless}} {{/each}}

+

+ entschuldigt: {{#each excused_absent}}{{this.firstname}} {{this.lastname}}{{#unless @last}}, + {{/unless}}{{/each}}{{#unless excused_absent.length}}---{{/unless}} +

+

+ unentschuldigt: {{#each unexcused_absent}}{{this.firstname}} {{this.lastname}}{{#unless @last}}, + {{/unless}}{{/each}}{{#unless unexcused_absent.length}}---{{/unless}} +


Agenda

{{#each agenda}}