Skip to content
GitLab
Menu
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
19053cce
Commit
19053cce
authored
Jul 31, 2021
by
Volker Krause
Browse files
Extract CartaFRECCIA details from Trenitalia barcodes
parent
e6335453
Pipeline
#72774
passed with stage
in 12 minutes and 29 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/lib/scripts/trenitalia.js
View file @
19053cce
...
...
@@ -53,12 +53,16 @@ function parsePdf(pdf) {
}
// see https://community.kde.org/KDE_PIM/KItinerary/Trenitalia_Barcode
var
ssb
=
Barcode
.
decodeEraSsbTicket
(
barcode
)
const
ssb
=
Barcode
.
decodeEraSsbTicket
(
barcode
)
personalRes
.
reservationFor
.
departureStation
.
identifier
=
"
uic:
"
+
(
ssb
.
departureStationNum
%
10000000
)
if
(
ssb
.
departureStationNum
!=
ssb
.
arrivalStationNum
)
{
personalRes
.
reservationFor
.
arrivalStation
.
identifier
=
"
uic:
"
+
(
ssb
.
arrivalStationNum
%
10000000
)
}
personalRes
.
reservationFor
.
provider
.
identifier
=
"
uic:
"
+
ssb
.
issuerCode
;
if
(
ssb
.
customerNumber
>
0
)
{
personalRes
.
programMembershipUsed
.
membershipNumber
=
ssb
.
customerNumber
;
personalRes
.
programMembershipUsed
.
programName
=
"
CartaFRECCIA
"
;
}
var
bitArray
=
Barcode
.
toBitArray
(
barcode
);
var
seatNum
=
bitArray
.
readNumberMSB
(
31
*
8
+
2
,
7
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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