35 const stdair::BookingRequestStruct& iBookingRequest)
const {
36 stdair::TravelSolutionStruct* oChosenTS_ptr = NULL;
39 const stdair::NbOfSeats_T& lPartySize = iBookingRequest.getPartySize();
42 const stdair::WTP_T& lWTP = iBookingRequest.getWTP();
46 const stdair::ChangeFees_T& lCustomerChangeFees =
47 iBookingRequest.getChangeFees();
50 const stdair::NonRefundable_T& lCustomerNonRefundable =
51 iBookingRequest.getNonRefundable();
54 const stdair::Fare_T& lChangeFeesDisutility =
55 iBookingRequest.getChangeFeeDisutility();
56 const stdair::Fare_T& lNonRefundableDisutility =
57 iBookingRequest.getNonRefundableDisutility();
60 stdair::Fare_T lLowestFare = std::numeric_limits<stdair::Fare_T>::max();
61 for (stdair::TravelSolutionList_T::iterator itTS = ioTSList.begin();
62 itTS != ioTSList.end(); ++itTS) {
63 stdair::TravelSolutionStruct& lTS = *itTS;
66 const stdair::FareOptionList_T& lFOList = lTS.getFareOptionList();
67 for (stdair::FareOptionList_T::const_iterator itFO = lFOList.begin();
68 itFO != lFOList.end(); ++itFO) {
69 const stdair::FareOptionStruct& lFO = *itFO;
70 const stdair::Fare_T& lFOFare = lFO.getFare();
73 stdair::Fare_T lFODisutility = 0;
76 if (lCustomerChangeFees ==
false) {
77 const bool lFOChangeFees = lFO.getChangeFees();
78 if (lFOChangeFees ==
true){
79 lFODisutility += lChangeFeesDisutility;
84 if (lCustomerNonRefundable ==
false) {
85 const bool lFONonRefundable = lFO.getNonRefundable();
86 if (lFONonRefundable ==
true){
87 lFODisutility += lNonRefundableDisutility;
96 const stdair::Availability_T& lFOAvl = lFO.getAvailability();
97 const stdair::Fare_T lFOFareWithinDisutility = lFOFare + lFODisutility;
99 if (lFOFareWithinDisutility < lLowestFare
101 && lFOAvl >= lPartySize) {
116 lLowestFare = lFOFare + lFODisutility;
117 oChosenTS_ptr = &lTS;
118 oChosenTS_ptr->setChosenFareOption (lFO);
136 return oChosenTS_ptr;