Commit 4ba2f286 authored by Volker Krause's avatar Volker Krause
Browse files

Don't fail if the 0080BL vendor block is missing

Can happen with pure ERA FCB tickets.
parent 135759d4
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment