import React from 'react'; import {observer, inject} from 'mobx-react'; import { Card, CardTitle, CardText, Divider, MenuItem, FlatButton, RaisedButton, Table, TableBody, TableHeader, TableHeaderColumn, TableRow, TableRowColumn, TextField, Toolbar, ToolbarGroup, ToolbarSeparator, ToolbarTitle, CardHeader, Dialog, } from 'material-ui'; import {Link} from 'react-router-dom'; import {LINKS} from "../../../routes"; import {DIALOG} from "../../../stores/global_ui"; import AddIcon from 'material-ui/svg-icons/content/add'; import NavigationArrowBack from 'material-ui/svg-icons/navigation/arrow-back'; import moment from "moment"; import get from 'lodash.get'; import DC from 'decimal.js-light'; import NumberFormat from 'react-number-format'; @inject('appstate') @observer export default class OrderDetailAirlinesComponent extends React.Component { constructor(props) { super(props); this.props = props; this.state = { value: 1, searchText: '', slideIndex: 0, tabSelected: 'gi', openModal: false }; this.defaultState = Object.assign({}, this.state); this.http = props.appstate.http; this.authStore = props.appstate.auth; this.globalUI = props.appstate.globalUI; this.order = props.appstate.order; } componentDidMount() { this.order.getAirlineDetail(this.props.match.params.id); } handleUpdateInput = (searchText) => { this.setState({ searchText: searchText, }); }; handleNewRequest = () => { this.setState({ searchText: '', }); }; tabsHandleChange = (value) => { this.setState({ slideIndex: value, }); }; handleChange = (tabSelected) => { this.setState({ tabSelected: tabSelected, }); // this.props.history.push(tabSelected); }; handleCloseModal = () => { this.setState({ openModal: false }) }; handleOpenModal = () => { this.setState({ openModal: true }) } render() { const customer = { name: 'Ridwan Abadi', identity_number: '98261536156313561', email: 'welove6215@einrot.com', address: 'Jalan Pramuka No. 81, Marga Jaya, Bekasi Selatan, Marga Jaya, Bekasi Sel., Kota Bks, Jawa Barat 17141', handphone: '081190876', phone: '0', place_birth: 'Jakarta', birth_date: moment().format('DD MMM YYYY'), gender: 'Male', tax_id: '98261536156313561', martial_status: 'Married' } const order = { id: '467d6b50-ade0-4dd0-98ca-35cd083e16e0', order_id: 'book_461a1df5', package: 'The Exoticsm Of Minang', description: 'Feel the joy of wonderful world of exotic, culture, and outstanding view that will amaze you to the bone. Enjoy your holiday in very nice and peaceful place to clear your mind. With great hotel and profesional tour guide, we ensure you that you will have a unforgetable memories and happiness.\n', registered: moment(), detail_package: [ { name: 'Destination', value: 'Bukittinggi, Minangkabau' }, { name: 'Transport', value: 'Custom' }, { name: 'Duration', value: '4 day 3 night' } ], payment_type: 'Instalment', status: 'active' } const totalPaid = get(this.order.selectedOrder, 'payments', []) .map(pay => pay.amount) .reduce((total, v) => total.add(v), new DC(0)); const priceAfterDisc = get(this.order.selectedOrder, 'price_after_discount', 0); const disc = new DC(get(this.order.selectedOrder, 'price') || 0).minus(priceAfterDisc || 0); const amountDue = new DC(priceAfterDisc || 0).minus(totalPaid); const actionsModals = [ , { this.order.payAirlineTicket().then((airlineTicket) => { this.order.setOrderStatus('ticketed'); this.globalUI.openSnackbar('Payment success'); }); }} />, ]; return (
You will be charged
this.props.history.goBack()} label="Back" primary={true} icon={} />

PNR ID

{this.order.orderAirlineDetail.pnrid}

Booking Code

{this.order.orderAirlineDetail.retrieve.bookingcode}

Status

{this.order.orderAirlineDetail.retrieve.status}

Time Limit

{this.order.orderAirlineDetail.retrieve.timelimit}

} label="Pay" primary={true} onClick={() => this.handleOpenModal()}/>
PASSENGER INFORMATION}/>
No. Title Name Ticket No Date of Birth {this.order.orderAirlineDetail.retrieve.pax.map(pax => { return ( {pax.paxno} {pax.title} {pax.name} {pax.ticketno} {pax.dob} ) })}
PAX CONTACT INFORMATION}/>
First Name Last Name Phone 1 Phone 2 {this.order.orderAirlineDetail.retrieve.paxcontact.firstname} {this.order.orderAirlineDetail.retrieve.paxcontact.lastname} {this.order.orderAirlineDetail.retrieve.paxcontact.phone1} {this.order.orderAirlineDetail.retrieve.paxcontact.phone2}
) } }