Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KItinerary
Commits
4ba2f286
Commit
4ba2f286
authored
Oct 28, 2022
by
Volker Krause
Browse files
Don't fail if the 0080BL vendor block is missing
Can happen with pure ERA FCB tickets.
parent
135759d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/scripts/deutschebahn.js
View file @
4ba2f286
...
...
@@ -220,17 +220,19 @@ function applyUic9183ToReservation(res, uicCode)
res
.
reservationNumber
=
uicCode
.
pnr
;
res
.
reservationFor
.
provider
=
JsonLd
.
toJson
(
uicCode
.
issuer
);
const
bl
=
uicCode
.
block
(
'
0080BL
'
);
let
sb
=
bl
.
findSubBlock
(
'
009
'
);
if
(
sb
)
{
const
bc
=
sb
.
content
.
match
(
/
\d
+-
\d
+-
(
.*
)
/
)[
1
];
switch
(
bc
)
{
case
"
49
"
:
res
.
programMembershipUsed
.
programName
=
"
BahnCard 25
"
;
break
;
case
"
19
"
:
case
"
78
"
:
res
.
programMembershipUsed
.
programName
=
"
BahnCard 50
"
;
break
;
if
(
bl
)
{
const
sb
=
bl
.
findSubBlock
(
'
009
'
);
if
(
sb
)
{
const
bc
=
sb
.
content
.
match
(
/
\d
+-
\d
+-
(
.*
)
/
)[
1
];
switch
(
bc
)
{
case
"
49
"
:
res
.
programMembershipUsed
.
programName
=
"
BahnCard 25
"
;
break
;
case
"
19
"
:
case
"
78
"
:
res
.
programMembershipUsed
.
programName
=
"
BahnCard 50
"
;
break
;
}
}
}
res
.
reservedTicket
.
name
=
uicCode
.
name
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment