Bug 494696

Summary: Importing return tickets from Deutsche Bahn only imports ride back
Product: [Applications] KDE Itinerary Reporter: Rose Reed <kde-bugs>
Component: generalAssignee: Volker Krause <vkrause>
Status: RESOLVED FIXED    
Severity: normal CC: kde-bugs
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Arch Linux   
OS: All   
Latest Commit: Version Fixed/Implemented In: 24.12.0
Sentry Crash Report:

Description Rose Reed 2024-10-13 20:13:31 UTC
When adding a return ticket ("there & back") via the "Import" -> "Deutsche Bahn Online Ticket" option, only the trip back is being imported into Itinerary, with no way to import the first trip there. In my case I tried to import a ticket I had booked a trip on October 18 with a return trip on October 19. Only the trip back on October 19 was imported into Itinerary.


STEPS TO REPRODUCE
1. Obtain an order number and last name of a return ticket booked with Deutsche Bahn
2. Import the return ticket via the "Deutsche Bahn Online Ticket" import option

OBSERVED RESULT
Only the trip back gets imported and shown in Itinerary.

EXPECTED RESULT
Both the leaving and return trip are being imported and shown in Itinerary.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:
KDE Itinerary Version: 24.08.2
KDE Plasma Version: 6.2.0
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.3

Android 14:
Fairphone 5 5G
KDE Itinerary Version 24.08.2
KDE Frameworks Version: 6.6.0
The android windowing system
Qt Version: 6.7.2
Comment 1 Volker Krause 2024-10-16 16:15:39 UTC
Would you be able to run a simple Python script (https://invent.kde.org/pim/itinerary/-/blob/master/src/tools/db-online-ticket-dump.py) that dumps the responses from Deutsche Bahn for that specific ticket (call it with --name <your last name> --ref <your ticket number>), and send me its complete output directly (email: vkrause@kde.org)? Note that the output can be full of personal information, so you might want to review/redact that, the important part here is that the general XML structure remains unchanged. Thank you!
Comment 2 Volker Krause 2024-10-21 16:41:34 UTC
Git commit d4257549b63e9b9ad7e358297ab13cdfe1357577 by Volker Krause.
Committed on 21/10/2024 at 16:38.
Pushed by vkrause into branch 'master'.

Download all parts of DB tickets

They apparently can be split over multiple kwid entries, iterate over all
of those.

M  +39   -24   src/app/onlineticketretrievaljob.cpp
M  +3    -1    src/app/onlineticketretrievaljob.h
M  +5    -5    src/tools/db-online-ticket-dump.py

https://invent.kde.org/pim/itinerary/-/commit/d4257549b63e9b9ad7e358297ab13cdfe1357577