Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#23] Append voucher name to supplier name transfers #24

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -474,9 +474,13 @@ class Plugin {
const products = R.call(R.compose(
R.map(optionsGroupedBySupplierId => {
const OptGeneral = R.pathOr({}, [0, 'OptGeneral'], optionsGroupedBySupplierId);
let supplierName = R.path(['SupplierName'], OptGeneral);
if (R.path(['SupplierName'], OptGeneral).toLocaleLowerCase() === 'transfers') {
supplierName = `${R.path(['VoucherName'], OptGeneral)} (${R.path(['SupplierName'], OptGeneral)})`;
}
const supplierData = {
supplierId: R.path(['SupplierId'], OptGeneral),
supplierName: R.path(['SupplierName'], OptGeneral),
supplierName: supplierName,
supplierAddress: `${R.pathOr('', ['Address1'], OptGeneral)}, ${R.pathOr('', ['Address2'], OptGeneral)}, ${R.pathOr('', ['Address3'], OptGeneral)}, ${R.pathOr('', ['Address4'], OptGeneral)}, ${R.pathOr('', ['Address5'], OptGeneral)}`,
serviceTypes: R.uniq(optionsGroupedBySupplierId.map(R.path(['OptGeneral', 'ButtonName']))),
};
Expand Down Expand Up @@ -809,6 +813,20 @@ class Plugin {
console.log('error in searchBooking', err);
reply = { ListBookingsReply: { BookingHeaders: { BookingHeader: [] } } };
}

// {"ListBookingsReply":
// {"BookingHeaders":
// {"BookingHeader":[
// {"AgentRef":"2399181","BookingId":"314164","BookingStatus":"Quotation","BookingType":"F",
// "Consult":null,"Currency":"GBP","EnteredDate":"2024-05-23","IsInternetBooking":"Y",
// "Name":"Mr. Robert Slavonia x2 2399181","QB":"Q","Ref":"ALFI393309","TotalPrice":"583143",
// "TravelDate":"2024-07-09"},{"AgentRef":"666666/1","BookingId":"315357",
// "BookingStatus":"Quotation","BookingType":"F","Consult":null,"Currency":"GBP",
// "EnteredDate":"2024-06-04","IsInternetBooking":"Y","Name":"Robert Guerrerio x3 2413898",
// "QB":"Q","Ref":"ALFI393503","TotalPrice":"2309452","TravelDate":"2024-08-31"
// }
// ]}
// }}
return reply;
})
: [this.callTourplan(listBookingPayload)];
Expand Down
Loading