Invoice component fixed assign package on select

This commit is contained in:
Jérémy Munsch 2022-08-30 15:05:24 +02:00
parent 46167d600c
commit c65549dde7
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC

View file

@ -290,6 +290,7 @@ export default defineComponent({
},
updateAmount(index: number): void {
const task = this.tasks[index];
task.package = null;
switch (task.type) {
case this.getTaskTypeEnum("web").value:
case this.getTaskTypeEnum("seo").value:
@ -298,6 +299,7 @@ export default defineComponent({
case this.getTaskTypeEnum("forfait").value:
task.amount =
task.days * ((task.packageModel?.amount ?? 0) as number);
task.package = (task.packageModel?.id as number) ?? null;
break;
case this.getTaskTypeEnum("libre").value:
// Do nothing, free input