Skip to content

Commit

Permalink
Show endCustomer in facturation modal.
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasHub committed Dec 27, 2024
1 parent 1bc1070 commit e976d35
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions frontend/src/components/hooks/useProjects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export function mapToProjectMonth(confacState: ProjectMonthResolverState, projec
consultant,
client,
partner: project.partner && confacState.clients.find(c => project.partner && c._id === project.partner.clientId),
endCustomer: !!project.endCustomer?.clientId ? confacState.clients.find(c=> c._id === project.endCustomer!.clientId): undefined,
invoice: invoice || confacState.invoices.find(i => i.projectMonth && i.projectMonth.projectMonthId === projectMonth._id),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const ProjectMonthModal = ({onClose, projectMonth}: ProjectMonthModalProp
<ProjectDuration project={fullProjectMonth.project} />

<hr />

<div className="project-client">
{fullProjectMonth.client.name}
<small><ProjectClientTariff projectClient={fullProjectMonth.project.client} /></small>
Expand All @@ -88,6 +88,13 @@ export const ProjectMonthModal = ({onClose, projectMonth}: ProjectMonthModalProp
)}
</div>

{fullProjectMonth.endCustomer &&
<div>
<hr/>
<h5>{fullProjectMonth.endCustomer.name}</h5>
</div>
}

</div>
</Modal>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export class FullProjectMonthModel {
consultant: ConsultantModel;
client: ClientModel;
partner?: ClientModel;
endCustomer?: ClientModel;
invoice?: InvoiceModel;

constructor(json: IFullProjectMonthModel) {
Expand All @@ -28,6 +29,7 @@ export class FullProjectMonthModel {
this.consultant = json.consultant;
this.client = json.client;
this.partner = json.partner;
this.endCustomer = json.endCustomer;
this.invoice = json.invoice;
}
}
Expand All @@ -40,5 +42,6 @@ export interface IFullProjectMonthModel {
consultant: ConsultantModel;
client: ClientModel;
partner?: ClientModel;
endCustomer?: ClientModel;
invoice?: InvoiceModel;
}

0 comments on commit e976d35

Please sign in to comment.