Commit ca756d49 authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'didam' into 'master'

apdet

See merge request !480
parents 42312799 980926ba
......@@ -207,17 +207,18 @@ const create = (type = "") => {
const getLastPeriod = (idCompany) => api.get(`transaction/master_budget/get_last_periode/${idCompany}`)
const getSubmitMasterBudget = (body) => api.post('transaction/master_budget/get_latest_periode_submit', body)
const createPeriodeRevision = (body) => api.post('transaction/master_budget/create_periode_revision', body)
const getIdDeleteFromExcel = (body) => api.post('transaction/master_budget/delete_from_excel', body)
const getOpetratingIndID = (body) => api.post('transaction/get_operating_indicator_id', body)
const getAllOperatingInd = (body) => api.post('transaction/get_all_operating_indicator_report', body)
const getOperatingIndDetail = (body) => api.post('transaction/operating_indicator/get_operating_indicator_report_hierarki', body)
const createOpetaingInd = (body) => api.post('transaction/operating_indicator/create_submission_report', body)
const getDashboard = (body) => api.get('transaction/get_dashboard')
const historyApproval = (body) => api.post('transaction/master_budget/history_approval', body)
const getOpetratingIndID = (body) => api.post('transaction/operating_indicator/get_operating_indicator_id', body)
const getAllOperatingInd = (body) => api.post('transaction/operating_indicator/get_all_report', body)
const getOperatingIndDetail = (body) => api.post('transaction/operating_indicator/get_report_hierarki', body)
const createOpetaingInd = (body) => api.post('transaction/operating_indicator/create_operating_indicator_report', body)
const checkUploadOperatingInd = (body) => api.post('transaction/operating_indicator/check_import', body)
const uploadOperatingInd = (body) => api.post('transaction/operating_indicator/import_operating_indicator', body)
const getLastestUpdateOI = (body) => api.post('transaction/operating_indicator/get_latest_update', body)
const getDashboard = (body) => api.get('transaction/get_dashboard')
const historyApproval = (body) => api.post('transaction/master_budget/history_approval', body)
const getLastPeriodeOI = (idCompany) => api.post(`transaction/master_budget/get_last_periode/${idCompany}`)
//OUTLOOK PA
const getOutlookPAID = (body) => api.post('transaction/outlook_pa/get_outlook_pa_id', body)
......@@ -415,7 +416,8 @@ const create = (type = "") => {
deleteAttOLPA,
getReportOLPA,
approvalSubmissionOLPA,
checkApproverOLPA
checkApproverOLPA,
getLastPeriodeOI
}
}
......
......@@ -878,6 +878,19 @@ export default class BudgetTahunan extends Component {
pagination: false,
search: false
}
const optionsHistory = {
filter: false,
sort: false,
responsive: "scroll",
print: false,
download: false,
selectableRows: false,
viewColumns: false,
pagination: true,
search: false,
rowsPerPage: 5
}
const optionsRevision = {
filter: false,
sort: false,
......@@ -1087,7 +1100,7 @@ export default class BudgetTahunan extends Component {
<MUIDataTable
data={this.state.dataTableHistory}
columns={columnsHistory}
options={options}
options={optionsHistory}
/>
</MuiThemeProvider>
</div>
......
......@@ -209,6 +209,7 @@ export default class OperatingIndicator extends Component {
api.create().getOpetratingIndID(payload).then(response => {
if (response) {
console.log(response.data.data)
this.getLatestPeriodSubmit()
if (response.data.data) {
this.setState({ operatingIndID: response.data.data.operating_indicator_id })
} else {
......@@ -218,6 +219,24 @@ export default class OperatingIndicator extends Component {
})
}
getLatestPeriodSubmit() {
let body = {
"company_id": this.state.company.company_id,
"periode": this.state.periode.periode
}
api.create().getSubmitMasterBudget(body).then(response => {
console.log(response);
if (response.data) {
if (response.data.status === "success") {
this.setState({ isSubmit: response.data.data.is_can_submit }, () => {
// this.getReport()
// this.getOperatingID()
})
}
}
})
}
clickDetail(item, id) {
let index = this.state.dataReport.findIndex((val) => val.report_name == item[1])
if (index !== -1) {
......@@ -269,6 +288,7 @@ export default class OperatingIndicator extends Component {
saveOperatingInd(payload) {
api.create().createOpetaingInd(payload).then((response) => {
this.getReport()
this.getOperatingID()
})
}
......@@ -475,7 +495,10 @@ export default class OperatingIndicator extends Component {
data={this.state.dataDetail}
height={this.props.height}
width={this.props.width}
onClickClose={() => this.setState({ visibleDetailOpt: false, visibleOperatingIndicator: true }, this.forceUpdate())}
onClickClose={() => this.setState({ visibleDetailOpt: false, visibleOperatingIndicator: true }, () => {
this.getOperatingID()
this.forceUpdate()
})}
getReport={() => this.getReport()}
saveOperatingInd={this.saveOperatingInd.bind(this)}
......
import React, { Component } from 'react';
import { Typography, Paper, createMuiTheme, MuiThemeProvider, TableCell, FormControlLabel, TextField, Input } from '@material-ui/core';
import { Typography, Paper, createMuiTheme, MuiThemeProvider, TableCell, FormControlLabel, TextField, Input, Snackbar } from '@material-ui/core';
import MUIDataTable from 'mui-datatables';
import NumberFormat from 'react-number-format';
import api from '../../api';
......@@ -10,6 +10,7 @@ import Images from '../../assets/Images';
import ReactTooltip from 'react-tooltip';
import UploadFile from "../../library/Upload";
import { ExcelRenderer } from 'react-excel-renderer';
import { Alert } from '@material-ui/lab';
var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable3());
......@@ -44,7 +45,9 @@ export default class BalanceSheet extends Component {
// ["Trade Receivables - Third Party", "142,668", "77,480"],
],
visibleOI: true,
disabledSave: true
disabledSave: true,
editable: true,
emptyData: false
}
this.handleValue = this.handleValue.bind(this)
this.fileHandler = this.fileHandler.bind(this);
......@@ -101,6 +104,7 @@ export default class BalanceSheet extends Component {
item.level,
item.description,
item.uom,
item.master_budget.total_actual_before == ""? item.master_budget.total_actual_before : String(item.master_budget.total_actual_before).indexOf(".") == -1? Number(item.master_budget.total_actual_before) : Number(item.master_budget.total_actual_before).toFixed(1),
item.master_budget.january == ""? item.master_budget.january : String(item.master_budget.january).indexOf(".") == -1? Number(item.master_budget.january) : Number(item.master_budget.january).toFixed(1),
item.master_budget.february == ""? item.master_budget.february : String(item.master_budget.february).indexOf(".") == -1? Number(item.master_budget.february) : Number(item.master_budget.february).toFixed(1),
item.master_budget.march == ""? item.master_budget.march : String(item.master_budget.march).indexOf(".") == -1? Number(item.master_budget.march) : Number(item.master_budget.march).toFixed(1),
......@@ -133,6 +137,7 @@ export default class BalanceSheet extends Component {
item.level,
item.description,
item.uom,
item.master_budget.total_actual_before == ""? item.master_budget.total_actual_before : String(item.master_budget.total_actual_before).indexOf(".") == -1? Number(item.master_budget.total_actual_before) : Number(item.master_budget.total_actual_before).toFixed(1),
item.master_budget.january == ""? item.master_budget.january : String(item.master_budget.january).indexOf(".") == -1? Number(item.master_budget.january) : Number(item.master_budget.january).toFixed(1),
item.master_budget.february == ""? item.master_budget.february : String(item.master_budget.february).indexOf(".") == -1? Number(item.master_budget.february) : Number(item.master_budget.february).toFixed(1),
item.master_budget.march == ""? item.master_budget.march : String(item.master_budget.march).indexOf(".") == -1? Number(item.master_budget.march) : Number(item.master_budget.march).toFixed(1),
......@@ -155,7 +160,11 @@ export default class BalanceSheet extends Component {
}
}
})
this.setState({dataTable, loading: false})
this.setState({dataTable, loading: false}, () => {
if(this.state.dataTable.length == 0) {
this.setState({emptyData: true})
}
})
})
}
......@@ -165,20 +174,20 @@ export default class BalanceSheet extends Component {
this.state.dataTable.map((item,index) => {
payloadMB.push({
"item_report_id": item[1],
"total_actual_before": item[7],
"january": item[8],
"february": item[9],
"march": item[10],
"april": item[11],
"may": item[12],
"june": item[13],
"july": item[14],
"august": item[15],
"september": item[16],
"october": item[17],
"november": item[18],
"december": item[19],
"total_current_year": item[20],
"total_actual_before": String(Number(item[7]).toFixed(1)),
"january": String(Number(item[8]).toFixed(1)),
"february": String(Number(item[9]).toFixed(1)),
"march": String(Number(item[10]).toFixed(1)),
"april": String(Number(item[11]).toFixed(1)),
"may": String(Number(item[12]).toFixed(1)),
"june": String(Number(item[13]).toFixed(1)),
"july": String(Number(item[14]).toFixed(1)),
"august": String(Number(item[15]).toFixed(1)),
"september": String(Number(item[16]).toFixed(1)),
"october": String(Number(item[17]).toFixed(1)),
"november": String(Number(item[18]).toFixed(1)),
"december": String(Number(item[19]).toFixed(1)),
"total_current_year": String(Number(item[20]).toFixed(1)),
})
})
let payload = {
......@@ -274,11 +283,11 @@ export default class BalanceSheet extends Component {
}
async downloadAllData() {
console.log('masuk')
// let bram = [this.props.submissionID,this.props.report_id,this.props.company.company_id,this.props.periode,this.props.revision]
// console.log(bram)
// console.log('masuk')
let bram = [this.props.data.operatingIndID,this.props.report_id,this.props.data.company.company_id,this.props.data.periode]
console.log(bram)
let res = await fetch(
`https://tia.eksad.com/tia-reporting-dev/transaction/operating_indicator/export_master_budget?operating_indicator_id=&&report_id=${this.props.data.operatingIndID}&company_id=${this.props.data.company.company_id}&&year=${this.props.data.periode}`
`https://tia.eksad.com/tia-reporting-dev/public/transaction/operating_indicator/export_operating_indicator?operating_indicator_id=${this.props.data.operatingIndID == null? "" : this.props.data.operatingIndID}&&report_id=${this.props.data.report_id}&&company_id=${this.props.data.company.company_id}&&year=${this.props.data.periode}`
)
res = await res.blob()
......@@ -342,8 +351,10 @@ export default class BalanceSheet extends Component {
}
checkUpload() {
console.log(JSON.stringify(this.state.payload))
api.create().checkUploadOperatingInd(this.state.payload).then(response => {
// console.log(JSON.stringify(this.state.payload));
console.log('===============')
console.log(response)
if (response.data) {
if (response.data.status === 'success') {
......@@ -371,8 +382,6 @@ export default class BalanceSheet extends Component {
item.november,
item.december,
item.total_current_year,
item.total_next_year,
item.total_more_year,
item.error
]
})
......@@ -389,24 +398,25 @@ export default class BalanceSheet extends Component {
data.push({
"item_report_id": i[1],
"item_report": String(i[5]),
"total_actual_before": String(i[7]),
"january": String(i[8]),
"february": String(i[9]),
"march": String(i[10]),
"april": String(i[11]),
"may": String(i[12]),
"june": String(i[13]),
"july": String(i[14]),
"august": String(i[15]),
"september": String(i[16]),
"october": String(i[17]),
"november": String(i[18]),
"december": String(i[19]),
"total_current_year": String(i[20])
"total_actual_before": String(Number(i[7] == null? "0": i[7]).toFixed(1)),
"january": String(Number(i[8]).toFixed(1)),
"february": String(Number(i[9]).toFixed(1)),
"march": String(Number(i[10]).toFixed(1)),
"april": String(Number(i[11]).toFixed(1)),
"may": String(Number(i[12]).toFixed(1)),
"june": String(Number(i[13]).toFixed(1)),
"july": String(Number(i[14]).toFixed(1)),
"august": String(Number(i[15]).toFixed(1)),
"september": String(Number(i[16]).toFixed(1)),
"october": String(Number(i[17]).toFixed(1)),
"november": String(Number(i[18]).toFixed(1)),
"december": String(Number(i[19]).toFixed(1)),
"total_current_year": String(Number(i[20]).toFixed(1)),
})
})
let body = {
company_id: this.props.data.company.company_id,
operating_indicator_id: this.props.data.operatingIndID,
periode: this.props.data.periode,
report_id: this.props.data.report_id,
status: type,
......@@ -429,19 +439,23 @@ export default class BalanceSheet extends Component {
})
}
closeAlert() {
this.setState({ alert: false })
}
render() {
let dataTable2 = this.state.dataTable
const handleChange = (value, tableMeta) => {
let val = String(value).split(",").join("")
let total = 0
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
dataTable2[tableMeta.rowIndex].map((item,index) => {
if (index >= 8 && index <= 19) {
let valItem = item == undefined || item == ""? 0 : item
total += Number(valItem)
}
})
dataTable2[tableMeta.rowIndex][20] = total
// dataTable2[tableMeta.rowIndex].map((item,index) => {
// if (index >= 8 && index <= 19) {
// let valItem = item == undefined || item == ""? 0 : item
// total += Number(valItem)
// }
// })
// dataTable2[tableMeta.rowIndex][20] = total
console.log(dataTable2[tableMeta.rowIndex])
}
......@@ -543,9 +557,9 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 ?
null
:
tableMeta.rowData[22] ?
tableMeta.rowData[22].length > 0 ?
tableMeta.rowData[22][0].field === 'item' ?
tableMeta.rowData[21] ?
tableMeta.rowData[21].length > 0 ?
tableMeta.rowData[21][0].field === 'item' ?
tableMeta.rowData[4] == 0 ?
<a data-tip={tableMeta.rowData[22][0].message} data-for="account">
<span style={{ fontSize: 12, fontWeight: 'bold', color: 'red' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
......@@ -608,7 +622,7 @@ export default class BalanceSheet extends Component {
type="text"
placeholder=""
defaultValue={value}
color={"#5198ea"}
// color={"#5198ea"}
value={value}
disabled={true}
// onBlur={(event) => {
......@@ -625,7 +639,7 @@ export default class BalanceSheet extends Component {
}
}
}, {
name: "31 Dec 2020 Actual",
name: `31 Dec ${Number(this.props.data.periode) - 1} Actual`,
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}>
......@@ -636,7 +650,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 ?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1?
null
:
<NumberFormat
......@@ -646,7 +660,7 @@ export default class BalanceSheet extends Component {
placeholder=""
disabled={true}
decimalScale={1}
value={value}
value={Number(value).toFixed(1)}
/>}
</div>
)
......@@ -664,7 +678,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 ?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1?
null
:
<div style={{ flex: 1 }}>
......@@ -677,7 +691,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
value={Number(value).toFixed(1)}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -706,7 +720,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 ?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1?
null
:
<div style={{ flex: 1 }}>
......@@ -719,7 +733,7 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={value}
value={Number(value).toFixed(1)}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -747,7 +761,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 ?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
<div style={{ flex: 1 }}>
......@@ -761,7 +775,7 @@ export default class BalanceSheet extends Component {
type="text"
placeholder=""
decimalScale={1}
value={value}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -788,7 +802,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 ?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1?
null
:
<div style={{ flex: 1 }}>
......@@ -802,7 +816,7 @@ export default class BalanceSheet extends Component {
type="text"
placeholder=""
decimalScale={1}
value={value}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -829,7 +843,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 ?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1?
null
:
<div style={{ flex: 1 }}>
......@@ -843,7 +857,7 @@ export default class BalanceSheet extends Component {
type="text"
placeholder=""
decimalScale={1}
value={value}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -870,7 +884,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 ?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1?
null
:
<div style={{ flex: 1 }}>
......@@ -884,7 +898,7 @@ export default class BalanceSheet extends Component {
type="text"
placeholder=""
decimalScale={1}
value={value}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -911,7 +925,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 ?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1?
null
:
<div style={{ flex: 1 }}>
......@@ -925,7 +939,7 @@ export default class BalanceSheet extends Component {
type="text"
placeholder=""
decimalScale={1}
value={value}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -952,7 +966,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 ?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1?
null
:
<div style={{ flex: 1 }}>
......@@ -966,7 +980,7 @@ export default class BalanceSheet extends Component {
type="text"
placeholder=""
decimalScale={1}
value={value}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -993,7 +1007,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 ?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1?
null
:
<div style={{ flex: 1 }}>
......@@ -1007,7 +1021,7 @@ export default class BalanceSheet extends Component {
type="text"
placeholder=""
decimalScale={1}
value={value}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1034,7 +1048,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 ?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1?
null
:
<div style={{ flex: 1 }}>
......@@ -1048,7 +1062,7 @@ export default class BalanceSheet extends Component {
type="text"
placeholder=""
decimalScale={1}
value={value}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1075,7 +1089,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 ?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1?
null
:
<div style={{ flex: 1 }}>
......@@ -1089,7 +1103,7 @@ export default class BalanceSheet extends Component {
type="text"
placeholder=""
decimalScale={1}
value={value}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1116,7 +1130,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 ?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1?
null
:
<div style={{ flex: 1 }}>
......@@ -1130,7 +1144,7 @@ export default class BalanceSheet extends Component {
type="text"
placeholder=""
decimalScale={1}
value={value}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1157,7 +1171,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 ?
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1?
null
:
<div style={{ flex: 1 }}>
......@@ -1171,7 +1185,7 @@ export default class BalanceSheet extends Component {
type="text"
placeholder=""
decimalScale={1}
value={value}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
......@@ -1210,6 +1224,11 @@ export default class BalanceSheet extends Component {
<div className={"main-color"} style={{ height: 78, flex: 1, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
<Typography style={{ fontSize: '16px', color: 'white' }}>Master Budget Submission</Typography>
</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%' }}>
{this.state.visibleOI === true ?
<Paper style={{ paddingTop: 10, paddingBottom: 20 }}>
......@@ -1217,7 +1236,7 @@ export default class BalanceSheet extends Component {
<Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Master Budget - Operating Indicator</Typography>
</div>
<div style={{ padding: 20 }}>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
{!this.state.emptyData && <div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.data.company.company_name}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.data.periode}</Typography>
......@@ -1269,7 +1288,7 @@ export default class BalanceSheet extends Component {
<ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
</div>
</div>
</div>
</div>}
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
{this.state.loading && loadingComponent}
......@@ -1305,11 +1324,11 @@ export default class BalanceSheet extends Component {
</div>
</button>
</div>
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
{!this.state.emptyData && <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button
type="button"
onClick={() =>
this.setState({ loading: true }, () => {
this.setState({ loading: true, editable: false }, () => {
setTimeout(() => {
this.setState({ loading: false, buttonError: false })
}, 100);
......@@ -1324,10 +1343,10 @@ export default class BalanceSheet extends Component {
<button
className="button"
type="button"
disabled={this.state.buttonError}
disabled={this.state.editable}
style={{
backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
cursor: this.state.editable === true ? 'default' : 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
......@@ -1344,18 +1363,25 @@ export default class BalanceSheet extends Component {
</button>
<button
type="button"
disabled={this.state.buttonError}
disabled={this.state.editable}
onClick={() => this.setState({ loading: true }, () => {
setTimeout(() => {
this.createData("submitted")
}, 100);
})}
style={{
backgroundColor: 'transparent',
cursor: this.state.editable === true ? 'default' : 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</div>
</button>
</div>
</div>}
</div>
</Paper>
:
......@@ -1402,11 +1428,11 @@ export default class BalanceSheet extends Component {
</div>
</button>
</div>
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
{!this.state.emptyData && <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button
type="button"
onClick={() =>
this.setState({ loading: true }, () => {
this.setState({ loading: true, editable: false }, () => {
setTimeout(() => {
this.setState({ loading: false, buttonError: false })
}, 100);
......@@ -1421,10 +1447,10 @@ export default class BalanceSheet extends Component {
<button
className="button"
type="button"
disabled={this.state.buttonError}
disabled={this.state.editable}
style={{
backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
cursor: this.state.editable === true ? 'default' : 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
......@@ -1441,18 +1467,25 @@ export default class BalanceSheet extends Component {
</button>
<button
type="button"
disabled={this.state.buttonError}
disabled={this.state.editable}
onClick={() => this.setState({ loading: true }, () => {
setTimeout(() => {
this.uploadOI("submitted")
}, 100);
})}
style={{
backgroundColor: 'transparent',
cursor: this.state.editable === true ? 'default' : 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</div>
</button>
</div>
</div>}
</div>
</div>
</Paper>}
......@@ -1487,7 +1520,7 @@ export default class BalanceSheet extends Component {
this.setState({ uploadStatus: 'idle', percentage: '0' })
}}
onUpload={() => {
this.state.judul === "OPERATING INDICATOR - MASTER BUDGET" ?
this.state.judul === "MASTER BUDGET - OPERATING INDICATOR" ?
this.checkUpload() :
this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning' })
}}
......
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