Commit 6ff6ad19 authored by Deni Rinaldi's avatar Deni Rinaldi

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

parents 6b0778f4 acb0452b
...@@ -227,6 +227,9 @@ const create = (type = "") => { ...@@ -227,6 +227,9 @@ const create = (type = "") => {
const getLastPeriodeOI = (idCompany) => api.post(`transaction/master_budget/get_last_periode/${idCompany}`) const getLastPeriodeOI = (idCompany) => api.post(`transaction/master_budget/get_last_periode/${idCompany}`)
const getReportHierarkiPL = (body) => api.post('transaction/db_report_detail/get_report_hierarki', body) const getReportHierarkiPL = (body) => api.post('transaction/db_report_detail/get_report_hierarki', body)
const getLastestUpdateMR = (body) => api.post('/transaction/monthly_report/get_latest_update', body)
const getLastestUpdateMROI = (body) => api.post('transaction/monthly_report_oi/get_latest_update', body)
//CASH FLOW //CASH FLOW
const getDetailReportCF = (body) => api.post('/transaction/cash_flow/get_report_hierarki', body) const getDetailReportCF = (body) => api.post('/transaction/cash_flow/get_report_hierarki', body)
...@@ -438,6 +441,7 @@ const create = (type = "") => { ...@@ -438,6 +441,7 @@ const create = (type = "") => {
uploadOperatingInd, uploadOperatingInd,
getLastestUpdateMB, getLastestUpdateMB,
getLastestUpdateMR, getLastestUpdateMR,
getLastestUpdateMROI,
countingFormula, countingFormula,
submitMasterBudget, submitMasterBudget,
checkIsSubmit, checkIsSubmit,
......
...@@ -1525,8 +1525,6 @@ export default class BudgetTahunan extends Component { ...@@ -1525,8 +1525,6 @@ export default class BudgetTahunan extends Component {
isApprover={this.state.isApprover} isApprover={this.state.isApprover}
lastStatus={this.state.lastStatus} lastStatus={this.state.lastStatus}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true} prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
btncreate={this.state.btncreate}
loadview={this.state.loadview}
/> />
) )
} }
......
...@@ -73,7 +73,18 @@ export default class FixedAssetsMovement extends Component { ...@@ -73,7 +73,18 @@ export default class FixedAssetsMovement extends Component {
this.setState({ this.setState({
updateBy: response.data.data.latest_update === null ? '-' : response.data.data.latest_update updateBy: response.data.data.latest_update === null ? '-' : response.data.data.latest_update
}) })
} else {
this.setState({ alert: true, messageAlert: response.data.message, typeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
} }
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
} }
}) })
} }
......
...@@ -52,6 +52,38 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -52,6 +52,38 @@ export default class FixedAssetsMovementMR extends Component {
componentDidMount() { componentDidMount() {
this.getItemHierarki() this.getItemHierarki()
this.getLatestUpdate()
}
getLatestUpdate() {
let payload = {
"report_id": this.props.report_id,
"revision": Number(this.props.revision),
"periode": this.props.periode,
"company_id": this.props.company.company_id,
"monthly_report_id": this.props.monthlyReportId,
"months": this.props.month.month_id
}
api.create().getLastestUpdateMR(payload).then(response => {
if (response.data) {
if (response.data.status === "success") {
this.setState({
updateBy: response.data.data.latest_update === null ? '-' : response.data.data.latest_update
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, typeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
}
})
} }
getItemHierarki() { getItemHierarki() {
......
...@@ -51,9 +51,29 @@ export default class OperatingIndicatorMR extends Component { ...@@ -51,9 +51,29 @@ export default class OperatingIndicatorMR extends Component {
} }
} }
getLatestUpdate() {
let payload = {
"operating_indicator_id": this.props.data.operatingIndID,
"report_id": this.props.data.report_id,
"company_id": this.props.data.company.company_id,
"periode": this.props.data.periode,
}
api.create().getLastestUpdateMROI(payload).then(response => {
// console.log(response.data)
if (response.data) {
if (response.data.status === "success") {
this.setState({
updateBy: response.data.data.latest_update === null ? '-' : response.data.data.latest_update
})
}
}
})
}
componentDidMount() { componentDidMount() {
// this.getItemHierarki() // this.getItemHierarki()
this.getSettingControl() this.getSettingControl()
this.getLatestUpdate()
} }
getSettingControl() { getSettingControl() {
......
import { createMuiTheme, FormControlLabel, Input, MuiThemeProvider, Paper, TableCell, Tooltip, Typography, withStyles } from '@material-ui/core' import { createMuiTheme, FormControlLabel, Input, MuiThemeProvider, Paper, Snackbar, TableCell, Tooltip, Typography, withStyles } from '@material-ui/core'
import MUIDataTable from 'mui-datatables'; import MUIDataTable from 'mui-datatables';
import React, { Component } from 'react' import React, { Component } from 'react'
import ReactTooltip from 'react-tooltip'; import ReactTooltip from 'react-tooltip';
...@@ -10,6 +10,7 @@ import { PropagateLoader } from 'react-spinners'; ...@@ -10,6 +10,7 @@ import { PropagateLoader } from 'react-spinners';
import { ExcelRenderer } from 'react-excel-renderer'; import { ExcelRenderer } from 'react-excel-renderer';
import Constant from '../../library/Constant'; import Constant from '../../library/Constant';
import UploadFile from "../../library/Upload"; import UploadFile from "../../library/Upload";
import { Alert } from '@material-ui/lab';
const LightTooltip = withStyles((theme) => ({ const LightTooltip = withStyles((theme) => ({
tooltip: { tooltip: {
...@@ -427,6 +428,10 @@ export default class ProfitLossMR extends Component { ...@@ -427,6 +428,10 @@ export default class ProfitLossMR extends Component {
}) })
} }
closeAlert() {
this.setState({ alert: false })
}
render() { render() {
let dataTable2 = this.state.dataTable let dataTable2 = this.state.dataTable
const handleNotes = (value, tableMeta) => { const handleNotes = (value, tableMeta) => {
...@@ -1637,8 +1642,13 @@ export default class ProfitLossMR extends Component { ...@@ -1637,8 +1642,13 @@ export default class ProfitLossMR extends Component {
<div style={{ height: this.props.height, backgroundColor: '#f8f8f8', marginBottom: 100, minHeight: 1000 }}> <div style={{ height: this.props.height, backgroundColor: '#f8f8f8', marginBottom: 100, minHeight: 1000 }}>
{this.state.loading && loadingComponent} {this.state.loading && loadingComponent}
<div className={"main-color"} style={{ height: 78, flex: 1, display: 'flex', alignItems: 'center', paddingLeft: 20 }}> <div className={"main-color"} style={{ height: 78, flex: 1, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
<Typography style={{ fontSize: '16px', color: 'white' }}>Monthly Report</Typography> <Typography style={{ fontSize: '16px', color: 'white' }}>Monthly Report Submission</Typography>
</div> </div>
<Snackbar open={this.state.alert} autoHideDuration={6000} onClose={() => this.closeAlert()}>
<Alert onClose={() => this.closeAlert()} severity={this.state.tipeAlert}>
{this.state.messageAlert}
</Alert>
</Snackbar>
<div style={{ flex: 1, padding: 20, width: '100%' }}> <div style={{ flex: 1, padding: 20, width: '100%' }}>
{this.state.visiblePLMR ? {this.state.visiblePLMR ?
<Paper style={{ paddingTop: 10 }}> <Paper style={{ paddingTop: 10 }}>
......
...@@ -61,8 +61,7 @@ export default class TaxPlanningMR extends Component { ...@@ -61,8 +61,7 @@ export default class TaxPlanningMR extends Component {
componentDidMount() { componentDidMount() {
this.getSettingControl() this.getSettingControl()
// this.getItemHierarki() // this.getItemHierarki()
// this.getLatestUpdate() this.getLatestUpdate()
console.log(this.props.loadview)
} }
getSettingControl() { getSettingControl() {
...@@ -85,13 +84,15 @@ export default class TaxPlanningMR extends Component { ...@@ -85,13 +84,15 @@ export default class TaxPlanningMR extends Component {
getLatestUpdate() { getLatestUpdate() {
let payload = { let payload = {
"report_id": 5, "report_id": this.props.report_id,
"revision": 0, "revision": Number(this.props.revision),
"periode": 2021, "periode": this.props.periode,
"company_id": 2193390, "company_id": this.props.company.company_id,
"submission_id": 3425765 "monthly_report_id": this.props.monthlyReportId,
"months": this.props.month.month_id
} }
api.create().getLastestUpdateMB(payload).then(response => { api.create().getLastestUpdateMR(payload).then(response => {
console.log(response)
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
...@@ -113,7 +114,7 @@ export default class TaxPlanningMR extends Component { ...@@ -113,7 +114,7 @@ export default class TaxPlanningMR extends Component {
"months": this.props.month.month_id "months": this.props.month.month_id
} }
api.create().getHierarkiMontlyReportTP(payload).then(response => { api.create().getHierarkiMontlyReportTP(payload).then(response => {
console.log(response); // console.log(response);
// console.log(payload); // console.log(payload);
let dataTable = [] let dataTable = []
if (response.data) { if (response.data) {
...@@ -198,7 +199,7 @@ export default class TaxPlanningMR extends Component { ...@@ -198,7 +199,7 @@ export default class TaxPlanningMR extends Component {
} else { } else {
this.setState({ dataTable, loading: false, editable: true }) this.setState({ dataTable, loading: false, editable: true })
} }
console.log(this.state.dataTable) // console.log(this.state.dataTable)
}) })
} }
...@@ -244,8 +245,8 @@ export default class TaxPlanningMR extends Component { ...@@ -244,8 +245,8 @@ export default class TaxPlanningMR extends Component {
} }
api.create('UPLOAD').createMonthlyReportTP(payload).then(response => { api.create('UPLOAD').createMonthlyReportTP(payload).then(response => {
console.log(payload); // console.log(payload);
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.props.saveToMonthlyReport() this.props.saveToMonthlyReport()
...@@ -311,7 +312,7 @@ export default class TaxPlanningMR extends Component { ...@@ -311,7 +312,7 @@ export default class TaxPlanningMR extends Component {
api.create().checkUploadMonthlyReportTP(this.state.payload).then(response => { api.create().checkUploadMonthlyReportTP(this.state.payload).then(response => {
// console.log(JSON.stringify(this.state.payload)); // console.log(JSON.stringify(this.state.payload));
// console.log(this.state.payload) // console.log(this.state.payload)
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
this.setState({ visibleUpload: false, visibleTP: false, loading: true }) this.setState({ visibleUpload: false, visibleTP: false, loading: true })
...@@ -379,7 +380,7 @@ export default class TaxPlanningMR extends Component { ...@@ -379,7 +380,7 @@ export default class TaxPlanningMR extends Component {
api.create('UPLOAD').uploadMonthlyReportTP(body).then(response => { api.create('UPLOAD').uploadMonthlyReportTP(body).then(response => {
// console.log(body); // console.log(body);
// console.log(JSON.stringify(body)); // console.log(JSON.stringify(body));
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.props.saveToMonthlyReport() this.props.saveToMonthlyReport()
...@@ -474,9 +475,6 @@ export default class TaxPlanningMR extends Component { ...@@ -474,9 +475,6 @@ export default class TaxPlanningMR extends Component {
render() { render() {
let dataTable2 = this.state.dataTable let dataTable2 = this.state.dataTable
let dataFormula = []
let id = 0
let double = false
const handleValueFormula = (value, tableMeta, dex, xntd, forecast, periode) => { const handleValueFormula = (value, tableMeta, dex, xntd, forecast, periode) => {
// console.log(xntd) // console.log(xntd)
let form = dex === 1 ? tableMeta.rowData[6].tbc : dex === 2 ? tableMeta.rowData[6].fcp : tableMeta.rowData[6].tbf let form = dex === 1 ? tableMeta.rowData[6].tbc : dex === 2 ? tableMeta.rowData[6].fcp : tableMeta.rowData[6].tbf
......
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