Commit 8667e757 authored by faisalhamdi's avatar faisalhamdi

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

parents c4748766 c4ca098d
......@@ -364,6 +364,8 @@ const create = (type = "") => {
const createCFOLPA = (body) => api.post ('transaction/cash_flow/outlook_pa/create_outlook_report', body)
const getHierarkiDBPLOLPA = (body) => api.post('transaction/db_profit_loss/outlook_pa/get_report_hierarki', body)
const createDBPLOLPA = (body) => api.post('transaction/db_profit_loss/outlook_pa/create_outlook_report', body)
const getHierarkiDBPLRO = (body) => api.post('transaction/db_profit_loss/rolling_outlook/get_report_hierarki', body)
const createDBPLRO = (body) => api.post('transaction/db_profit_loss/rolling_outlook/create_rolling_outlook', body)
// Monthly
const getMonthlyReport = (body) => api.post('transaction/monthly_report/get_all_report', body)
......@@ -798,7 +800,9 @@ const create = (type = "") => {
getHierarkiCFOLPA,
createCFOLPA,
getHierarkiDBPLOLPA,
createDBPLOLPA
createDBPLOLPA,
getHierarkiDBPLRO,
createDBPLRO
}
}
......
......@@ -71,11 +71,25 @@ class HomePage extends Component {
let userId = localStorage.getItem(Constant.USER)
api.create().getDetailUser(userId).then((response) => {
if (response.data) {
if (response.ok) {
if (response.data.status === 'success') {
this.setState({ userData: response.data.data }, () => {
// console.log(this.state.userData)
this.setState({ userData: response.data.data })
// console.log(response.data.data)
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
}
})
// api.create().checkApprover().then(response => {
......
......@@ -82,8 +82,24 @@ export default class DashboardCAT extends Component {
this.getCompanyActive()
})
}
else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
}
// }
// }
})
}
......
......@@ -104,7 +104,21 @@ export default class DashboardFinancial extends React.Component {
this.getCompanyActive()
})
}
else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
}
})
}
......@@ -132,7 +146,7 @@ export default class DashboardFinancial extends React.Component {
})
let defaultProps = {
options: arrayBaru.sort((a,b) => a.company_name.localeCompare(b.company_name)),
options: arrayBaru.sort((a, b) => a.company_name.localeCompare(b.company_name)),
getOptionLabel: (option) => titleCase(option.company_name),
};
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -851,9 +851,15 @@ export default class ProfitLossMR extends Component {
}
})
if (String(tableMeta.rowData[5]).toLocaleLowerCase() == "sales price") {
let value = Number(dataTable2[tableMeta.rowIndex - 2][11]) / Number(dataTable2[tableMeta.rowIndex - 1][11])
dataTable2[tableMeta.rowIndex][11] = R.equals(value, NaN) ? "0.0" : (R.equals(value, Infinity) ? "0.0" : (value == "-Infinity" ? "0.0" : value))
return R.equals(value, NaN) ? "0.0" : (R.equals(value, Infinity) ? "0.0" : (value == "-Infinity" ? "0.0" : value))
} else {
dataTable2[tableMeta.rowIndex][11] = Number(total).toFixed(1)
return total
}
}
let columns = [
{
......
......@@ -821,7 +821,7 @@ export default class OutlookPA extends Component {
"revision": Number(this.state.lastRevision),
"periode": this.state.periode.periode,
"company_id": this.state.company.company_id,
"submission_id": this.state.PLID,
"outlook_pa_id": this.state.PLID,
}
api.create().getHierarkiDBPLOLPA(payload).then(response => {
// console.log(response);
......@@ -1282,7 +1282,6 @@ export default class OutlookPA extends Component {
"status": "submitted",
"profit_loss_id": this.state.PLID,
"profit_loss_olpa": this.state.dbPL,
"months": 0,
}
console.log(this.state.dbPL)
// console.log(JSON.stringify(payload))
......
This diff is collapsed.
This diff is collapsed.
......@@ -405,7 +405,11 @@ export default class ProfitLossROO extends Component {
console.log(response);
if (response.data) {
if (response.data.status === "success") {
if (type == 'submitted') {
this.props.refresh('PL')
} else {
this.props.refresh()
}
this.props.onClickClose()
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false, handleTekTekTek: 0 }, () => {
......@@ -573,7 +577,11 @@ export default class ProfitLossROO extends Component {
if (response.ok) {
if (response.data.status === "success") {
this.props.onClickClose()
if (type == 'submitted') {
this.props.refresh('PL')
} else {
this.props.refresh()
}
// this.props.onClickClose()
// this.props.getReport()
} else {
......
......@@ -95,7 +95,18 @@ export default class SummaryOfTriputra extends Component {
// this.getRevision()
// }
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
}
})
}
......@@ -129,7 +140,18 @@ export default class SummaryOfTriputra extends Component {
this.getDataTable()
})
console.log(this.state.month)
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
}
})
}
......@@ -211,6 +233,7 @@ export default class SummaryOfTriputra extends Component {
console.log(response);
let dataTable = []
if (response.data) {
if (response.data.status === 'success') {
let res = [response.data.data]
const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[0] === item.company_id)
......@@ -319,6 +342,16 @@ export default class SummaryOfTriputra extends Component {
})
console.log(dataTable)
this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
}
......@@ -329,6 +362,7 @@ export default class SummaryOfTriputra extends Component {
console.log(response);
let dataTable = []
if (response.data) {
if (response.data.status === 'success') {
let res = [response.data.data]
const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[0] === item.company_id)
......@@ -449,6 +483,16 @@ export default class SummaryOfTriputra extends Component {
})
console.log(dataTable)
this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
}
......@@ -459,6 +503,7 @@ export default class SummaryOfTriputra extends Component {
console.log(response);
let dataTable = []
if (response.data) {
if (response.data.status === 'success') {
let res = [response.data.data]
const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[0] === item.company_id)
......@@ -589,6 +634,16 @@ export default class SummaryOfTriputra extends Component {
})
console.log(dataTable);
this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
}
......@@ -599,6 +654,7 @@ export default class SummaryOfTriputra extends Component {
console.log(response);
let dataTable = []
if (response.data) {
if (response.data.status === 'success') {
let res = [response.data.data]
console.log(res)
const handlePushChild = (item) => {
......@@ -776,6 +832,16 @@ export default class SummaryOfTriputra extends Component {
})
console.log()
this.setState({ dataTable, previewTable: true, loading: false, previewDownload: true })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
}
......
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