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,6DAHE,GACVC,SAnBQ,CACLC,KACAC,cAAsBP,GACtBQ,KACAvF,KACAA,KACAwF,KACAC,IACAC,KACAC,KACAC,KACAC","names":["t","constructor","n","e","i","s","d","r","u","g","Z","this","c","x","y","idfs$","userService","selectContextualizedIdfsObservable","input","isPhoenixUser","isInternalUser","selectedIdf$","subscribe","A","loading","selectedIdf","idf","loadVaccines","loadArchivedCarts","addToCartForm","quantityInput","vaccinationService","pipe","m","ngUnsubscribe$","vaccines","sort","product","name","localeCompare","loadArchivedReservations","archivedCarts","getThisCart","loadSingleCart","selectedCartData","forEach","pzn","content","doctorCount","amount","push","jsonToPdfService","downloadPdf","updateReservationRequest","errorMsg","items","length","updateVaccineRequest","errorCode","showSuccessMessage","matomoService","trackEvent","updateQuantity","srcElement","value","setValue","map","id","Number","ngOnInit","vaccineRestService","getVaccineShopConfig","shopActive","returnObject","isEnabled","backClick","location","back","Date","activeFrom","shopUntil","enabled","ngOnDestroy","next","complete","h","_","O","M","q","selectors","v","path","component","pathMatch","l","imports","p","f","T","C","D","Q","E","J","Y"],"sources":["webpack:///src/app/modules/webshop/components/vaccination/vaccination.component.html","webpack:///src/app/modules/webshop/components/vaccination/vaccination.component.ts","webpack:///src/app/modules/webshop/components/vaccination/vaccination.module.ts"],"sourcesContent":["
\n
\n

Zusatzbestellung COVID-19 Impfstoffe

\n

Bitte wählen Sie Ihre IDF/BGA-Nummer für die Sie Ihre Bestellung abgeben möchten:

\n
\n
\n Loading...\n
\n
\n

Zur Zeit sind keine aktiven Impfstoffe verfügbar. Bitte versuchen Sie es später noch einmal.

\n
\n \n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
PZNInhaltArtikelbezeichnungAnzahl zu beliefernde ArztpraxenBedarfsmenge-
in Vials
{{ vaccine.product.pzn }}{{ vaccine.product.content }}{{ vaccine.product.name }}\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n

\n Hinweis:\n Bitte beachten Sie, dass Ihre Bestellung vorerst nur gespeichert wird - Ihre\n eingegebenen Daten bleiben den ganzen Tag in der Maske bestehen. Über Nacht\n werden die Daten an PHOENIX übermittelt. Sollten Sie im Laufe der Aktion mehrere\n Bestellungen tätigen, werden diese jeweils als zusätzliche Mengen\n berücksichtigt. Die Auslieferung der Sonderbestellung erfolgt Anfang kommende\n Woche. Auslieferung solange der Vorrat reicht.\n

\n
\n
\n \n
\n
\n \n {{errorMsg}}\n \n
\n
\n
\n\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n \n Zur Betrachtung der Bestellungen auf Ihrem PC benötigen Sie einen kostenlosen PDF Viewer, wie zum Beispiel den\n Adobe Reader.\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
BestellungIDF NummerDatumDownload
{{ cart.id }}{{ cart.idf }}{{ cart.end | date: 'shortDate' }}\n \n
\n
\n
\n
\n
\n
\n
\n\n\n
\n","import {Component, Inject, Input, OnDestroy, OnInit} from '@angular/core';\nimport {Router} from '@angular/router';\nimport {MatDialog} from '@angular/material/dialog';\nimport {Location} from '@angular/common';\nimport {Observable, Subject} from 'rxjs';\nimport {FormControl, FormGroup, Validators} from '@angular/forms';\nimport {UserService} from '../../../../core/services/user.service';\nimport {UserRestService} from '../../../../core/services/api/user.rest-service';\nimport {takeUntil} from 'rxjs/operators';\nimport {VaccinationService} from '../../../../core/services/vaccination.service';\nimport {VaccineItem} from '../../../../core/models/shop/vaccine-item.model';\nimport {JsonToPdfService} from '../../../../core/services/json-to-pdf.service';\nimport {MatomoService} from '../../../../core/services/matomo.service';\nimport {VaccineRestService} from '../../../../core/services/api/vaccination-rest-service';\nimport {InternalUserAuthority} from '../../../../core/models/enums/internal-user-authority.model';\n\n@Component({\n selector: 'covid-vaccination',\n templateUrl: './vaccination.component.html',\n styleUrls: ['./vaccination.component.scss'],\n})\nexport class VaccinationComponent implements OnInit, OnDestroy {\n @Input() loading = true;\n public addToCartForm: FormGroup;\n public quantityInput: FormControl = new FormControl();\n public quantity = 0;\n public idfs$: Observable;\n public selectedIdf: string;\n public input = false;\n public mainIdf: string;\n public ngUnsubscribe$ = new Subject();\n public vaccines: VaccineItem[] = [];\n public archivedCarts: any[] = [];\n public selectedCartData: any[] = [];\n public errorMsg = '';\n public showSuccessMessage = false;\n public enabled = false;\n public shopActive: any;\n protected readonly InternalUserAuthority = InternalUserAuthority;\n\n constructor(\n @Inject(UserService) public userService: UserService,\n @Inject(JsonToPdfService) public jsonToPdfService: JsonToPdfService,\n @Inject(VaccinationService) public vaccinationService: VaccinationService,\n @Inject(UserRestService) public userRestService: UserRestService,\n private matomoService: MatomoService,\n public location: Location,\n public dialog: MatDialog,\n public router: Router,\n private vaccineRestService: VaccineRestService\n ) {\n this.idfs$ = this.userService.selectContextualizedIdfsObservable('orders');\n this.input = this.userService.isPhoenixUser() || this.userService.isInternalUser();\n\n this.userService.selectedIdf$.subscribe(idf => {\n this.loading = true;\n if (idf) {\n this.selectedIdf = idf.idf;\n this.loadVaccines(this.selectedIdf);\n this.loadArchivedCarts(this.selectedIdf);\n }\n });\n this.addToCartForm = new FormGroup({\n quantityInput: new FormControl(this.quantityInput, [\n Validators.min(1),\n Validators.max(999),\n ]),\n });\n }\n\n public loadVaccines(idf: string) {\n this.vaccinationService\n .loadVaccines(idf)\n .pipe(takeUntil(this.ngUnsubscribe$))\n .subscribe((items) => {\n this.vaccines = items;\n this.vaccines.sort((a, b) => a.product.name.localeCompare(b.product.name));\n this.loading = false;\n });\n }\n\n public loadArchivedCarts(idf: string) {\n this.vaccinationService\n .loadArchivedReservations(idf)\n .pipe(takeUntil(this.ngUnsubscribe$))\n .subscribe((items) => {\n this.archivedCarts = items;\n this.loading = false;\n });\n }\n\n public getThisCart(idf: string, id: number) {\n this.vaccinationService\n .loadSingleCart(idf, id)\n .pipe(takeUntil(this.ngUnsubscribe$))\n .subscribe((items) => {\n this.selectedCartData = items;\n\n const cols: any[] = [['PZN', 'Inhalt', 'Artikelbezeichnung', 'Anzahl zu beliefernde-\\nArztpraxen', 'Bedarfsmenge-\\n' + 'in Vials']];\n const rows: any[] = [];\n const title = 'Bestellungen ' + idf;\n const fileName = idf;\n\n this.selectedCartData.forEach((element: VaccineItem) => {\n const temp = [element.product.pzn, element.product.content,\n element.product.name, element.doctorCount, element.amount];\n rows.push(temp);\n });\n\n this.jsonToPdfService.downloadPdf(rows, cols, fileName, title);\n });\n }\n\n public updateReservationRequest() {\n this.errorMsg = '';\n const idf = this.selectedIdf;\n const data: any = {\n items: [],\n };\n for (let i = 0; i < this.vaccines.length; i++) {\n if (this.vaccines[i].amount > 0 && !this.vaccines[i].doctorCount) {\n this.errorMsg = `Bitte geben Sie die Anzahl an Arztpraxen an.`;\n return true;\n }\n if (this.vaccines[i].amount === 0 && this.vaccines[i].doctorCount) {\n this.errorMsg = `Bitte geben Sie Ihre Bedarfsmenge in Vials an.`;\n return true;\n }\n data.items.push({\n amount: this.vaccines[i].amount,\n pzn: this.vaccines[i].product.pzn,\n doctorCount: this.vaccines[i].doctorCount,\n });\n }\n this.vaccinationService.updateVaccineRequest(idf, data).subscribe(response => {\n if (response.errorCode === null) {\n this.showSuccessMessage = true;\n } else {\n // show error message\n }\n });\n this.matomoService.trackEvent('Sonderbestellung COVID-19 Impfstoffe', 'Klick auf', 'Bestellen');\n\n }\n\n updateQuantity(e: any, vaccineId: number, type: 'doctor' | 'item'): void {\n if (e.srcElement.value < 0) {\n e.srcElement.value = 0;\n this.quantityInput.setValue(0);\n } else if (e.srcElement.value > 100000) {\n e.srcElement.value = 100000;\n this.quantityInput.setValue(100000);\n }\n\n if (e.srcElement.value >= 0) {\n this.vaccines.map((item: any) => {\n if (item.id === vaccineId) {\n if (type === 'item') {\n item.amount = Number(e.srcElement.value);\n }\n if (type === 'doctor') {\n item.doctorCount = Number(e.srcElement.value);\n }\n }\n });\n }\n }\n\n ngOnInit(): void {\n this.vaccineRestService.getVaccineShopConfig().pipe(takeUntil(this.ngUnsubscribe$))\n .subscribe(data => {\n this.shopActive = data.returnObject;\n this.isEnabled();\n });\n }\n\n /**\n * Used on backlink to restore previous location.\n */\n backClick() {\n this.location.back();\n }\n\n isEnabled() {\n const startDate = new Date(this.shopActive.activeFrom);\n const endDate = new Date(this.shopActive.shopUntil);\n const today = new Date();\n if (startDate < today && today < endDate ) {\n this.enabled = true;\n }\n }\n\n /**\n * Unsubscribe from all subscriptions.\n */\n ngOnDestroy(): void {\n this.ngUnsubscribe$.next();\n this.ngUnsubscribe$.complete();\n }\n}\n","import {NgModule} from '@angular/core';\nimport {OverlayModule} from '@angular/cdk/overlay';\nimport {CommonModule} from '@angular/common';\nimport {RouterModule} from '@angular/router';\nimport {VaccinationComponent} from './vaccination.component';\n\nimport {FormsModule, ReactiveFormsModule} from '@angular/forms';\nimport {MatFormFieldModule} from '@angular/material/form-field';\nimport {MatInputModule} from '@angular/material/input';\nimport {MatTooltipModule} from '@angular/material/tooltip';\nimport {MatSelectModule} from '@angular/material/select';\nimport {MatMenuModule} from '@angular/material/menu';\nimport {NotificationModule} from '../../../shared/notification/notification.module';\n\nexport const routes = [\n {path: '', component: VaccinationComponent, pathMatch: 'full'}\n];\n\n@NgModule({\n imports: [\n CommonModule,\n RouterModule.forChild(routes),\n OverlayModule,\n FormsModule,\n ReactiveFormsModule,\n MatFormFieldModule,\n MatInputModule,\n MatSelectModule,\n MatTooltipModule,\n MatMenuModule,\n NotificationModule\n ],\n declarations: [\n VaccinationComponent\n ],\n entryComponents: [\n ],\n providers: [\n ]\n})\nexport class VaccinationModule {\n static routes = routes;\n}\n"]}