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
8a2325f4
Commit
8a2325f4
authored
Jul 13, 2021
by
Volker Krause
Browse files
Fix handling of asymmetric SNCF OUI retour tickets
BUG: 439061
FIXED-IN: 21.08.0
parent
8ccca367
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/scripts/sncf.js
View file @
8a2325f4
...
...
@@ -290,8 +290,10 @@ function parseOuigoSummary(html)
{
// TODO extract passenger names
var
res
=
JsonLd
.
newTrainReservation
();
res
.
reservationFor
.
departureStation
.
name
=
html
.
eval
(
'
//*[@data-select="travel-summary-origin"]
'
)[
0
].
content
;
res
.
reservationFor
.
arrivalStation
.
name
=
html
.
eval
(
'
//*[@data-select="travel-summary-destination"]
'
)[
0
].
content
;
const
origins
=
html
.
eval
(
'
//*[@data-select="travel-summary-origin"]
'
);
res
.
reservationFor
.
departureStation
.
name
=
origins
[
0
].
content
;
const
destinations
=
html
.
eval
(
'
//*[@data-select="travel-summary-destination"]
'
);
res
.
reservationFor
.
arrivalStation
.
name
=
destinations
[
0
].
content
;
res
.
reservationNumber
=
html
.
eval
(
'
//*[@data-select="travel-summary-reference"]
'
)[
0
].
content
;
res
.
reservationFor
.
departureTime
=
parseOuigoSummaryTime
(
html
.
eval
(
'
//*[@data-select="travel-departureDate"]
'
));
...
...
@@ -309,8 +311,8 @@ function parseOuigoSummary(html)
return
res
;
}
var
retour
=
JsonLd
.
newTrainReservation
();
retour
.
reservationFor
.
departureStation
.
name
=
res
.
reservationFor
.
arrivalStation
.
name
;
retour
.
reservationFor
.
arrivalStation
.
name
=
res
.
reservationFor
.
departureStation
.
name
;
retour
.
reservationFor
.
departureStation
.
name
=
origins
[
1
]
?
origins
[
1
].
content
:
res
.
reservationFor
.
arrivalStation
.
name
;
retour
.
reservationFor
.
arrivalStation
.
name
=
destinations
[
1
]
?
destinations
[
1
].
content
:
res
.
reservationFor
.
departureStation
.
name
;
retour
.
reservationFor
.
departureTime
=
parseOuigoSummaryTime
(
retourTime
);
trainNum
=
html
.
eval
(
'
//*[@data-select="passenger-detail-inwardFares"]//*[@class="passenger-detail__equipment"]
'
);
if
(
trainNum
.
length
==
2
||
trainNum
[
1
].
content
==
trainNum
[
3
].
content
)
{
...
...
Write
Preview
Markdown
is supported
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