Commit 980926ba authored by d.arizona's avatar d.arizona

apdet

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