Commit 32127e0e authored by d.arizona's avatar d.arizona

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into GGMAC

parents a8a9582a 88bcedf7
...@@ -167,7 +167,7 @@ export default class ProfitLossMR extends Component { ...@@ -167,7 +167,7 @@ export default class ProfitLossMR extends Component {
}) })
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => { setTimeout(() => {
localStorage.removeItem(Constant.TOKEN) localStorage.removeItem(Constant.TOKEN)
window.location.reload(); window.location.reload();
...@@ -200,7 +200,7 @@ export default class ProfitLossMR extends Component { ...@@ -200,7 +200,7 @@ export default class ProfitLossMR extends Component {
}) })
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => { setTimeout(() => {
localStorage.removeItem(Constant.TOKEN) localStorage.removeItem(Constant.TOKEN)
window.location.reload(); window.location.reload();
...@@ -322,7 +322,7 @@ export default class ProfitLossMR extends Component { ...@@ -322,7 +322,7 @@ export default class ProfitLossMR extends Component {
this.setState({ dataTable, loading: false, buttonError: true, saveDraft: true, refresh: false }) this.setState({ dataTable, loading: false, buttonError: true, saveDraft: true, refresh: false })
} else { } else {
this.setState({ loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => { setTimeout(() => {
localStorage.removeItem(Constant.TOKEN) localStorage.removeItem(Constant.TOKEN)
window.location.reload(); window.location.reload();
...@@ -417,7 +417,7 @@ export default class ProfitLossMR extends Component { ...@@ -417,7 +417,7 @@ export default class ProfitLossMR extends Component {
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false, handleTekTekTek: 0 }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false, handleTekTekTek: 0 }, () => {
document.body.style.overflow = 'unset'; document.body.style.overflow = 'unset';
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => { setTimeout(() => {
localStorage.removeItem(Constant.TOKEN) localStorage.removeItem(Constant.TOKEN)
window.location.reload(); window.location.reload();
...@@ -491,7 +491,7 @@ export default class ProfitLossMR extends Component { ...@@ -491,7 +491,7 @@ export default class ProfitLossMR extends Component {
item.rolling_outlook === null ? "" : item.rolling_outlook === "" ? "" : item.rolling_outlook, item.rolling_outlook === null ? "" : item.rolling_outlook === "" ? "" : item.rolling_outlook,
item.master_budget === "" ? "" : item.master_budget, item.master_budget === "" ? "" : item.master_budget,
item.rolling_budget === "" ? "" : item.rolling_budget, item.rolling_budget === "" ? "" : item.rolling_budget,
item.actual === "" ? "" : item.actual, item.actual === "" ? "" : Number(item.actual).toFixed(1),
0, 0,
item.actual_previous_month === null ? "" : item.actual_previous_month === "" ? "" : item.actual_previous_month, item.actual_previous_month === null ? "" : item.actual_previous_month === "" ? "" : item.actual_previous_month,
// 0, // 0,
...@@ -526,7 +526,7 @@ export default class ProfitLossMR extends Component { ...@@ -526,7 +526,7 @@ export default class ProfitLossMR extends Component {
console.log(dataTable); console.log(dataTable);
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => { setTimeout(() => {
localStorage.removeItem(Constant.TOKEN) localStorage.removeItem(Constant.TOKEN)
window.location.reload(); window.location.reload();
...@@ -585,7 +585,7 @@ export default class ProfitLossMR extends Component { ...@@ -585,7 +585,7 @@ export default class ProfitLossMR extends Component {
// this.props.getReport() // this.props.getReport()
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false, handleTekTekTek: 0 }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false, handleTekTekTek: 0 }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => { setTimeout(() => {
localStorage.removeItem(Constant.TOKEN) localStorage.removeItem(Constant.TOKEN)
window.location.reload(); window.location.reload();
...@@ -667,7 +667,7 @@ export default class ProfitLossMR extends Component { ...@@ -667,7 +667,7 @@ export default class ProfitLossMR extends Component {
} }
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => { setTimeout(() => {
localStorage.removeItem(Constant.TOKEN) localStorage.removeItem(Constant.TOKEN)
window.location.reload(); window.location.reload();
...@@ -2108,7 +2108,8 @@ export default class ProfitLossMR extends Component { ...@@ -2108,7 +2108,8 @@ export default class ProfitLossMR extends Component {
<div className="col-2"> <div className="col-2">
</div> : </div> :
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingRight: 5 }}> <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%', paddingRight: 5 }}>
{this.state.get_for == 'view' && this.state.viewOnly && <button {this.state.get_for == 'view' && this.state.viewOnly &&
<button
className="button" className="button"
type="button" type="button"
style={{ style={{
...@@ -2127,7 +2128,8 @@ export default class ProfitLossMR extends Component { ...@@ -2127,7 +2128,8 @@ export default class ProfitLossMR extends Component {
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}> <div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}>
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Edit</Typography> <Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Edit</Typography>
</div> </div>
</button>} </button>
}
{this.state.get_for == 'edit' && <button {this.state.get_for == 'edit' && <button
className="button" className="button"
type="button" type="button"
......
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