Commit 997d9d6b authored by Trisno's avatar Trisno

update order

parent c5203ecc
...@@ -44,9 +44,12 @@ class MenuConfirmation extends React.Component { ...@@ -44,9 +44,12 @@ class MenuConfirmation extends React.Component {
} }
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/transaction/booking', params).then(res => { Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/transaction/booking', params).then(res => {
Alert.alert(res.data.response.msg) Alert.alert(res.data.status, 'Transaksi Berhasil')
// console.log(res.data.data)
}).catch(error => { }).catch(error => {
let response = error.response.data; let response = error.response.data;
// console.log('error')
Alert.alert(response.msg); Alert.alert(response.msg);
}) })
} }
......
...@@ -115,7 +115,7 @@ class ShoppingCart extends React.Component { ...@@ -115,7 +115,7 @@ class ShoppingCart extends React.Component {
checkedBalance: true, checkedBalance: true,
checkedPoint: false, checkedPoint: false,
checkedBalancePoint: false, checkedBalancePoint: false,
balanceused: this.props.order_total, balanceused: this.props.order_total + this.props.grabamount,
pointsused: 0 pointsused: 0
}) })
} else if (val == 'point') { } else if (val == 'point') {
...@@ -123,7 +123,7 @@ class ShoppingCart extends React.Component { ...@@ -123,7 +123,7 @@ class ShoppingCart extends React.Component {
checkedBalance: false, checkedBalance: false,
checkedPoint: true, checkedPoint: true,
checkedBalancePoint: false, checkedBalancePoint: false,
pointsused: this.props.order_total, pointsused: this.props.order_total + this.props.grabamount,
balanceused: 0 balanceused: 0
}) })
} else { } else {
...@@ -134,13 +134,13 @@ class ShoppingCart extends React.Component { ...@@ -134,13 +134,13 @@ class ShoppingCart extends React.Component {
// balanceused : this.props.order_total - this.state.dummyPoint, // balanceused : this.props.order_total - this.state.dummyPoint,
// pointsused : this.props.order_total, // pointsused : this.props.order_total,
}) })
if (this.state.kasproPoint - this.props.order_total >= -1) { if (this.state.kasproPoint - (this.props.order_total + this.props.grabamount) >= -1) {
this.setState({ this.setState({
pointsused: this.props.order_total pointsused: this.props.order_total + this.props.grabamount
}) })
} else { } else {
this.setState({ this.setState({
balanceused: this.props.order_total - this.state.kasproPoint, balanceused: (this.props.order_total + this.props.grabamount) - this.state.kasproPoint,
pointsused: this.state.kasproPoint pointsused: this.state.kasproPoint
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment