Commit 2f1d1470 authored by EKSAD's avatar EKSAD

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

parents d5e4ba43 8b8854ef
......@@ -7,7 +7,7 @@ import Constant from './library/Constant';
if (sessionStorage.getItem('reloaded') != null) {
console.log('page was reloaded');
} else {
localStorage.removeItem(Constant.TOKEN)
// localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}
sessionStorage.setItem('reloaded', 'yes');
......
......@@ -210,6 +210,8 @@ const create = (type = "") => {
const getIdDeleteFromExcel = (body) => api.post('transaction/master_budget/delete_from_excel', body)
const getDashboard = (body) => api.get('transaction/get_dashboard')
const historyApproval = (body) => api.post('transaction/master_budget/history_approval', body)
const getDashboardUser = () => api.get('transaction/get_dashboard_sub_co')
const getDashboardMB = (body) => api.get('transaction/get_dashboard_table')
const getOpetratingIndID = (body) => api.post('transaction/operating_indicator/get_operating_indicator_id', body)
const getSubmitOI = (body) => api.post('transaction/operating_indicator/get_latest_periode_submit', body)
......@@ -393,6 +395,7 @@ const create = (type = "") => {
getIdDeleteFromExcel,
getDashboard,
historyApproval,
getDashboardMB,
checkApprover,
approvalSubmission,
getCompanySubmitted,
......@@ -421,7 +424,8 @@ const create = (type = "") => {
checkApproverOLPA,
getLastPeriodeOI,
getSubmitOI,
getLastPeriodOI
getLastPeriodOI,
getDashboardUser
}
}
......
......@@ -372,7 +372,7 @@ export default class BudgetTahunan extends Component {
}
api.create().getSubmission(payload).then(response => {
console.log(response)
if (response) {
if (response.data) {
if (response.data.status === "success") {
this.setState({
submissionID: response.data.data.submission_id,
......@@ -1345,8 +1345,11 @@ export default class BudgetTahunan extends Component {
periode={this.state.periode.periode}
submissionID={this.state.submissionID}
saveToMasterBudget={this.saveToMasterBudget.bind(this)}
onClickClose={() => this.setState({ visibleCF: false, visibleBudgetTahunan: true })}
onClickClose={() => this.setState({ visibleCAT: false, visibleBudgetTahunan: true })}
getReport={this.getSubmission.bind(this)}
isApprover={this.state.isApprover}
status={this.state.status}
lastStatus={this.state.lastStatus}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
/>
)}
......
import { createMuiTheme, MuiThemeProvider, Paper, TableCell, Typography } from '@material-ui/core'
import { createMuiTheme, FormControlLabel, MuiThemeProvider, Paper, TableCell, Tooltip, Typography, withStyles } from '@material-ui/core'
import MUIDataTable from 'mui-datatables';
import React, { Component } from 'react'
import NumberFormat from 'react-number-format';
import ReactTooltip from 'react-tooltip';
import api from '../../api';
import Images from '../../assets/Images';
var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable3());
......@@ -19,21 +21,142 @@ const style2 = {
zIndex: 100
};
const LightTooltip = withStyles((theme) => ({
tooltip: {
backgroundColor: theme.palette.common.white,
color: 'rgba(0, 0, 0, 0.87)',
boxShadow: theme.shadows[1],
fontSize: 11,
},
}))(Tooltip);
export default class CashFlow extends Component {
constructor(props) {
super(props)
this.state = {
dataTable: ["Cashflow", {title: 'MB 2021', data : {3: '3', 4: '4', 5: '5', 6: '6', 7: '7', 8: '8', 9: '9', 10: '10', 11: '11', 12: '12'}}, null, "2022", "2023" ]
dataTable: []
}
}
componentDidMount() {
this.setState({loading: true})
this.getItemHierarki()
}
getItemHierarki() {
this.setState({ loading: true })
let payload = {
"report_id": this.props.report_id,
"revision": Number(this.props.revision),
"periode": this.props.periode,
"company_id": this.props.company.company_id,
"submission_id": this.props.submissionID
}
// console.log(JSON.stringify(payload))
api.create().getDetailReportMB(payload).then(response => {
let dataTable = []
console.log(response)
let res = response.data.data
const handlePushChild = (item) => {
dataTable.push([
item.type_report_id,
item.id,
item.parent,
item.formula,
item.level,
item.description,
item.cash_flow.total_actual_before === null ? "0" : item.cash_flow.total_actual_before === "" ? "0" : item.cash_flow.total_actual_before,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.january, formula: item.cash_flow.january_formula } : item.cash_flow.january,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.february, formula: item.cash_flow.february_formula } : item.cash_flow.february,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.march, formula: item.cash_flow.march_formula } : item.cash_flow.march,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.april, formula: item.cash_flow.april_formula } : item.cash_flow.april,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.may, formula: item.cash_flow.may_formula } : item.cash_flow.may,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.june, formula: item.cash_flow.june_formula } : item.cash_flow.june,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.july, formula: item.cash_flow.july_formula } : item.cash_flow.july,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.august, formula: item.cash_flow.august_formula } : item.cash_flow.august,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.september, formula: item.cash_flow.september_formula } : item.cash_flow.september,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.october, formula: item.cash_flow.october_formula } : item.cash_flow.october,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.november, formula: item.cash_flow.november_formula } : item.cash_flow.november,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.december, formula: item.cash_flow.december_formula } : item.cash_flow.december,
item.cash_flow.total_current_year,
item.type_report_id == 5 || item.type_report_id == 6 ? 0 : item.cash_flow.total_next_year,
item.type_report_id == 5 || item.type_report_id == 6 ? 0 : item.cash_flow.total_more_year,
item.order
])
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items, indexs) => {
handlePushChild(items)
})
}
}
}
res.map((item, index) => {
dataTable.push([
item.type_report_id,
item.id,
item.parent,
item.formula,
item.level,
item.description,
item.cash_flow.total_actual_before === null ? "0" : item.cash_flow.total_actual_before === "" ? "0" : item.cash_flow.total_actual_before,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.january, formula: item.cash_flow.january_formula } : item.cash_flow.january,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.february, formula: item.cash_flow.february_formula } : item.cash_flow.february,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.march, formula: item.cash_flow.march_formula } : item.cash_flow.march,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.april, formula: item.cash_flow.april_formula } : item.cash_flow.april,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.may, formula: item.cash_flow.may_formula } : item.cash_flow.may,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.june, formula: item.cash_flow.june_formula } : item.cash_flow.june,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.july, formula: item.cash_flow.july_formula } : item.cash_flow.july,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.august, formula: item.cash_flow.august_formula } : item.cash_flow.august,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.september, formula: item.cash_flow.september_formula } : item.cash_flow.september,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.october, formula: item.cash_flow.october_formula } : item.cash_flow.october,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.november, formula: item.cash_flow.november_formula } : item.cash_flow.november,
item.type_report_id == 5 || item.type_report_id == 6 ? { value: item.cash_flow.december, formula: item.cash_flow.december_formula } : item.cash_flow.december,
item.cash_flow.total_current_year,
item.type_report_id == 5 || item.type_report_id == 6 ? 0 : item.cash_flow.total_next_year,
item.type_report_id == 5 || item.type_report_id == 6 ? 0 : item.cash_flow.total_more_year,
item.order
])
if (item.children !== null) {
if (item.children.length > 0) {
item.children.map((items, indexs) => {
handlePushChild(items)
})
}
}
})
this.setState({ dataTable, loading: false, dataReal: res, editable: true }, () => console.log(dataTable))
})
}
render() {
let dataTable2 = this.state.dataTable
let columns = [
let columns = [{
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
},
{
name: "(In Rupiah million)",
options: {
......@@ -46,116 +169,238 @@ export default class CashFlow extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ width: 300 }}>
{val}
{tableMeta.rowData[24] ?
tableMeta.rowData[24].length > 0 ?
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
<LightTooltip title={"Report Items Not Registered"} arrow>
<span style={{ fontSize: 12, color: 'red' }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
</LightTooltip>
</div>
:
tableMeta.rowData[4] == 0 ?
<span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
:
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
<span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
</div>
:
tableMeta.rowData[4] == 0 ?
<span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
:
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
<span style={{ fontSize: 12 }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
</div>
}
</div>
)
}
}
},
// {
// name: `MB 2021`,
// options: {
// customHeadRender: (columnMeta) => (
// <th style={{ ...style2, color: '#fff', backgroundColor: '#07a7d0', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)", padding: 0 }} >
// {/* <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
// <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
// </TableCell> */}
// <div style={{ borderBottom: "1px #fff solid", backgroundColor: '#1c71b8', textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5 }}>{columnMeta.name}</div>
// <div className="grid grid-3x" style={{ ...style2, color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
// <div className="column-1 grid grid-4x" style={{ placeSelf: 'center', textAlign: 'center', backgroundColor: '#07a7d0' }}>
// <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
// <span>{"1"}</span>
// </div>
// <div className="column-2" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
// <span>{"2"}</span>
// </div>
// <div className="column-3" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
// <span>{"3"}</span>
// </div>
// <div className="column-4" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
// <span>{"4"}</span>
// </div>
// </div>
// <div className="column-2 grid grid-4x" style={{ placeSelf: 'center', textAlign: 'center', backgroundColor: '#07a7d0' }}>
// <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
// <span>{"5"}</span>
// </div>
// <div className="column-2" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
// <span>{"6"}</span>
// </div>
// <div className="column-3" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
// <span>{"7"}</span>
// </div>
// <div className="column-4" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
// <span>{"8"}</span>
// </div>
// </div>
// <div className="column-3 grid grid-4x" style={{ placeSelf: 'center', textAlign: 'center', backgroundColor: '#07a7d0' }}>
// <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
// <span>{"9"}</span>
// </div>
// <div className="column-2" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
// <span>{"10"}</span>
// </div>
// <div className="column-3" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
// <span>{"11"}</span>
// </div>
// <div className="column-4" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, backgroundColor: '#07a7d0' }}>
// <span>{"12"}</span>
// </div>
// </div>
// </div>
// </th>
// ),
// setCellProps: () => ({ style2 }),
// customBodyRender: (val, tableMeta, updateValue) => {
// return (
// <div>
// <div className="grid grid-3x content-center">
// <div className="grid grid-4x content-center">
// <div className="col-1">
// <div style={{ textAlign: 'right', width: 90 }}>
// {/* {val.a} */}
// </div>
// </div>
// <div className="col-2">
// <div style={{ textAlign: 'right', width: 90 }}>
// {/* {val.b} */}
// </div>
// </div>
// <div className="col-3">
// <div style={{ textAlign: 'right', width: 90 }}>
// {/* {val.c} */}
// </div>
// </div>
// <div className="col-4">
// <div style={{ textAlign: 'right', width: 90 }}>
// {/* {val.c} */}
// </div>
// </div>
// </div>
// <div className="grid grid-4x content-center">
// <div className="col-1">
// <div style={{ textAlign: 'right', width: 90 }}>
// {/* {val.a} */}
// </div>
// </div>
// <div className="col-2">
// <div style={{ textAlign: 'right', width: 90 }}>
// {/* {val.b} */}
// </div>
// </div>
// <div className="col-3">
// <div style={{ textAlign: 'right', width: 90 }}>
// {/* {val.c} */}
// </div>
// </div>
// <div className="col-4">
// <div style={{ textAlign: 'right', width: 90 }}>
// {/* {val.c} */}
// </div>
// </div>
// </div>
// <div className="grid grid-4x content-center">
// <div className="col-1">
// <div style={{ textAlign: 'right', width: 90 }}>
// {/* {val.a} */}
// </div>
// </div>
// <div className="col-2">
// <div style={{ textAlign: 'right', width: 90 }}>
// {/* {val.b} */}
// </div>
// </div>
// <div className="col-3">
// <div style={{ textAlign: 'right', width: 90 }}>
// {/* {val.c} */}
// </div>
// </div>
// <div className="col-4">
// <div style={{ textAlign: 'right', width: 90 }}>
// {/* {val.c} */}
// </div>
// </div>
// </div>
// </div>
// </div>
// )
// }
// }
// },
{
name: `MB 2021`,
name: `${Number(this.props.periode) + 1}`,
options: {
customHeadRender: (columnMeta) => (
<th style={{ ...style2, color: '#fff', backgroundColor: '#07a7d0', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)", padding: 0 }} >
<th style={{ ...style2, color: '#fff', backgroundColor: '#07a7d0', top: 0, zIndex: 102, fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)", padding: 0 }} >
{/* <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> */}
<div style={{ borderBottom: "1px #fff solid", backgroundColor: '#1c71b8', textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5 }}>{columnMeta.name}</div>
<div className="grid grid-10x" style={{ ...style2, color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
<span>{"Master Budget (MB)"}</span>
</div>
<div className="column-2" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
<span>{"Rolling Budget (RB)"}</span>
</div>
<div className="column-3" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
<span>{"Rolling Budget (RB)"}</span>
</div>
<div className="column-4" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
<span>{"Rolling Budget (RB)"}</span>
</div>
<div className="column-5" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
<span>{"Rolling Budget (RB)"}</span>
</div>
<div className="column-6" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
<span>{"Rolling Budget (RB)"}</span>
</div>
<div className="column-7" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
<span>{"Rolling Budget (RB)"}</span>
</div>
<div className="column-8" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
<span>{"Rolling Budget (RB)"}</span>
</div>
<div className="column-9" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
<span>{"Rolling Budget (RB)"}</span>
</div>
<div className="column-10" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid", backgroundColor: '#07a7d0' }}>
<span>{"Rolling Budget (RB)"}</span>
<div className="grid grid-1x" style={{ ...style2, color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, backgroundColor: '#07a7d0' }}>
<span>{"ForeCast"}</span>
</div>
</div>
</th>
),
setCellProps: () => ({ style2 }),
customBodyRender: (val, tableMeta, updateValue) => {
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div>
<div className="grid grid-3x content-center">
<div className="col-1">
<div style={{ textAlign: 'right', width: 90 }}>
{/* {val.a} */}
</div>
</div>
<div className="col-2">
<div style={{ textAlign: 'right', width: 90 }}>
{/* {val.b} */}
</div>
</div>
<div className="col-3">
<div style={{ textAlign: 'right', width: 90 }}>
{/* {val.c} */}
</div>
</div>
</div>
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(tableMeta[22]).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
// handleChange(event.target.value, tableMeta)
console.log(dataTable2)
}}
/>
}
/>
</div>}
</div>
)
}
}
},
{
name: "YTD Actual",
name: `${Number(this.props.periode) + 2}`,
options: {
customHeadRender: (columnMeta) => (
<th style={{ ...style2, color: '#fff', backgroundColor: '#07a7d0', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)", padding: 0 }} >
<th style={{ ...style2, color: '#fff', backgroundColor: '#07a7d0', fontSize: 13, top: 0, zIndex: 102, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)", padding: 0 }} >
{/* <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> */}
<div style={{ borderBottom: "1px #fff solid", backgroundColor: '#1c71b8', textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5 }}>{columnMeta.name}</div>
<div style={{ borderBottom: "1px #fff solid", backgroundColor: '#1c71b8', textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5 }}>{columnMeta.name}</div>
</th>
),
setCellProps: () => ({ style2 }),
customBodyRender: (val, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right', width: 90 }}>
{val}
<div className="grid grid-1x" style={{ ...style2, color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, backgroundColor: '#07a7d0' }}>
<span>{"ForeCast"}</span>
</div>
</div>
)
}
}
},
{
name: "Actual Previous Month",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
</th>
),
setCellProps: () => ({ style2 }),
customBodyRender: (val, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right', width: 90 }}>
{val}
<div>
{/* {val} */}
</div>
)
}
......
......@@ -78,7 +78,9 @@ export default class CorporateAnnualTarget extends Component {
buttonDraft: true,
updateBy: '',
handleTekTekTek: 0,
editable: false
editable: false,
dataCustomerPrs: [],
dataInternalBsn: []
}
this.fileHandler = this.fileHandler.bind(this);
......@@ -88,7 +90,7 @@ export default class CorporateAnnualTarget extends Component {
this.getKPIType()
this.getMaxAch()
this.getLatestUpdate()
// console.log(this.props.lastStatus);
// // console.log(this.props.lastStatus);
}
......@@ -101,15 +103,38 @@ export default class CorporateAnnualTarget extends Component {
"company_id": this.props.company.company_id,
"submission_id": this.props.submissionID
}
// console.log(JSON.stringify(payload))
// // console.log(JSON.stringify(payload))
api.create().getDetailReportMB(payload).then(response => {
let dataTable = []
// console.log(response)
let dataCustomerPrs = []
let dataInternalBsn = []
// // console.log(response)
let res = response.data.data
const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
if (indexIDzz === -1) {
let parentTrue = item.parent_name == 'INTERNAL BUSINESS PROCESS PERSPECTIVE' || item.parent_name == 'CUSTOMER PERSPECTIVE'
if (item.parent_name == 'INTERNAL BUSINESS PROCESS PERSPECTIVE') {
if (item.type_report_id !== 4) {
dataInternalBsn.push({
id: item.id,
name: item.description,
check: false
})
}
}
if (item.parent_name == 'CUSTOMER PERSPECTIVE') {
if (item.type_report_id !== 4) {
dataCustomerPrs.push({
id: item.id,
name: item.description,
check: false
})
}
}
dataTable.push([
item.type_report_id,
item.id,
......@@ -192,7 +217,9 @@ export default class CorporateAnnualTarget extends Component {
}
}
})
this.setState({ dataTable, loading: false, dataReal: res, editable: true })
this.setState({ dataTable, loading: false, dataReal: res, editable: true, dataCustomerPrs, dataInternalBsn }, () => {
// console.log(dataCustomerPrs)
})
})
}
......@@ -201,7 +228,7 @@ export default class CorporateAnnualTarget extends Component {
`https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}`
)
res = await res.blob()
// console.log(res)
// // console.log(res)
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
......@@ -212,16 +239,16 @@ export default class CorporateAnnualTarget extends Component {
}
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]
// console.log(bram)
// // console.log(bram)
let resReal = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=${this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
let resNull = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
let res = await fetch(
this.props.submissionID == null ? resNull : resReal
)
res = await res.blob()
// console.log(res)
// // console.log(res)
this.setState({ loading: false })
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
......@@ -235,13 +262,13 @@ export default class CorporateAnnualTarget extends Component {
fileHandler = (event) => {
let fileObj = event
ExcelRenderer(fileObj, (err, resp) => {
// // console.log(resp)
// // // console.log(resp)
if (err) {
// console.log(err);
// // console.log(err);
}
else {
let isi = resp.rows.slice(3)
// console.log(isi);
// // console.log(isi);
let payload = []
let reg = /^[-+]?(?:[0-9]+,)*[0-9]+(?:\.[0-9]+)?$/;
isi.map((i, index) => {
......@@ -263,8 +290,8 @@ export default class CorporateAnnualTarget extends Component {
}
nilaiTotal = i[6] == 'SUM' ? total : i[6] == 'AVG' ? total / 12 : lastValz
}
// console.log(nilaiTotal)
// // console.log(i[2] === undefined ? "" : String(Number(i[2]*100)).length > 3? String(Number(i[2]*100).toFixed(0) + '%') : String(Number(i[2]*100)) + '%')
// // console.log(nilaiTotal)
// // // console.log(i[2] === undefined ? "" : String(Number(i[2]*100)).length > 3? String(Number(i[2]*100).toFixed(0) + '%') : String(Number(i[2]*100)) + '%')
payload.push({
item_report_id: i[0] === undefined ? 0 : reg.test(String(i[0])) === false ? 0 : String(i[0]).trim(),
item_report: i[1] === undefined ? "" : String(i[1]).trim(),
......@@ -301,7 +328,7 @@ export default class CorporateAnnualTarget extends Component {
status: '',
cat: payload
}
// console.log(body)
// // console.log(body)
this.setState({ payload: body, judul: resp.rows[1][0] })
}
});
......@@ -312,7 +339,7 @@ export default class CorporateAnnualTarget extends Component {
let dataDelete = this.state.dataDelete
api.create().getIdDeleteFromExcel(this.state.payload).then((response) => {
if (response.data) {
// // console.log(response.data)
// // // console.log(response.data)
let idDelete = response.data.data.item_report_id
if (idDelete.length > 0) {
idDelete.map((item, index) => {
......@@ -322,16 +349,40 @@ export default class CorporateAnnualTarget extends Component {
}
}
})
console.log(JSON.stringify(this.state.payload))
// console.log(JSON.stringify(this.state.payload))
api.create().checkUploadMB(this.state.payload).then(response => {
// // console.log(JSON.stringify(this.state.payload));
// // // console.log(JSON.stringify(this.state.payload));
// console.log(response)
if (response.data) {
if (response.data.status === 'success') {
// this.setState({ visibleUpload: false, visibleCAT: false })
this.setState({ visibleUpload: false, visibleCAT: false })
let dataTable = response.data.data.map((item, index) => {
return [
let dataTable = []
let custoId = 0
let bisnsId = 0
let dataDelete = this.state.dataDelete
response.data.data.map((item, index) => {
if (item.item_report == 'CUSTOMER PERSPECTIVE') {
custoId = item.item_report_id
}
if (item.item_report == 'INTERNAL BUSINESS PROCESS PERSPECTIVE') {
bisnsId = item.item_report_id
}
if (item.type_report_id !== 4 && item.parent !== null && (item.parent == custoId || item.parent == bisnsId)) {
let indexCust = this.state.dataCustomerPrs.findIndex((val) => val.name == item.item_report)
let indexBisn = this.state.dataInternalBsn.findIndex((val) => val.name == item.item_report)
if (indexCust !== -1 && item.item_report_id == 0) {
dataDelete.push(this.state.dataCustomerPrs[indexCust].id)
}
if (indexBisn !== -1 && item.item_report_id == 0) {
dataDelete.push(this.state.dataInternalBsn[indexBisn].id)
}
}
dataTable.push([
item.type_report_id,
item.item_report_id,
item.parent,
......@@ -363,18 +414,18 @@ export default class CorporateAnnualTarget extends Component {
item.strategic,
item.pic,
item.error
]
])
})
// console.log(dataTable)
// console.log(this.state.buttonError)
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true }, () => {
// // console.log(this.state.buttonError)
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true, dataDelete }, () => {
this.state.dataTable.map(item => {
if (item[30].length > 0) {
// console.log('masuk')
// // console.log('masuk')
this.setState({ buttonError: true, errorPreview: true, editable: true })
}
})
// // console.log(this.state.dataTable);
// // // console.log(this.state.dataTable);
})
}
}
......@@ -382,8 +433,9 @@ export default class CorporateAnnualTarget extends Component {
}
uploadCAT(type) {
// let dataDelete = this.state.dataDelete
// // console.log(dataDelete)
let payload = { "item_report_id": this.state.dataDelete }
if (this.state.dataDelete.length > 0) {
api.create().deleteAllItemReport(payload).then((response) => {
this.functionUpload(type)
......@@ -396,7 +448,7 @@ export default class CorporateAnnualTarget extends Component {
functionUpload(type) {
let data = []
// console.log(this.state.dataTable)
// // console.log(this.state.dataTable)
this.state.dataTable.map(i => {
data.push({
"item_report_id": i[1] == "" || i[1] == null ? 0 : i[1],
......@@ -435,10 +487,10 @@ export default class CorporateAnnualTarget extends Component {
"status": type,
"cat": data
}
// console.log(data);
// // console.log(data);
// console.log(JSON.stringify(body))
api.create('UPLOAD').uploadMasterBudget(body).then(response => {
// console.log(response);
// // console.log(response);
if (response.data) {
if (response.data.status === "success") {
this.props.onClickClose()
......@@ -454,7 +506,7 @@ export default class CorporateAnnualTarget extends Component {
handleValidate() {
let data = []
// console.log(this.state.dataTable)
// // console.log(this.state.dataTable)
let totalWeight = 0
let dataTableBaru = this.state.dataTable
let dataTampung = []
......@@ -475,14 +527,14 @@ export default class CorporateAnnualTarget extends Component {
if (i[2] !== null) {
let indexID = this.state.dataTable.findIndex((val) => val[1] == i[2])
// console.log(indexID)
// console.log(i[2])
// // console.log(indexID)
// // console.log(i[2])
if (indexID !== -1) {
// console.log(dataTableBaru[indexID][6])
// // console.log(dataTableBaru[indexID][6])
if (dataTableBaru[indexID][6] == 'INTERNAL BUSINESS PROCESS PERSPECTIVE' || dataTableBaru[indexID][6] == 'CUSTOMER PERSPECTIVE') {
if (i[6] == "" || i[7] == "" || i[9] == null || i[10] == null || i[11] == null) {
handleKosongKPIMAXYTD = true
// console.log(handleKosongKPIMAXYTD)
// // console.log(handleKosongKPIMAXYTD)
}
}
}
......@@ -491,7 +543,7 @@ export default class CorporateAnnualTarget extends Component {
// if (i[0] == null && i[2] == null) {
// if (i[6] == "" || i[7] == "" || i[9] == null || i[10] == null || i[11] == null) {
// handleKosongKPIMAXYTD = true
// // console.log(handleKosongKPIMAXYTD)
// // // console.log(handleKosongKPIMAXYTD)
// }
// }
......@@ -511,9 +563,9 @@ export default class CorporateAnnualTarget extends Component {
weightReal = i[7]
dataTampung[indexID].valChild = dataTampung[indexID].valChild + Number(i[7] == "" || i[7] == undefined ? 0 : i[7].replace('%', ''))
}
// console.log(weightReal)
// console.log(dataTableBaru[index][7])
// console.log(dataTampung[indexID].valChild)
// // console.log(weightReal)
// // console.log(dataTableBaru[index][7])
// // console.log(dataTampung[indexID].valChild)
}
}
......@@ -547,8 +599,8 @@ export default class CorporateAnnualTarget extends Component {
})
})
// console.log(dataTableBaru)
// console.log(JSON.stringify(data))
// // console.log(dataTableBaru)
// // console.log(JSON.stringify(data))
let payload = {
"submission_id": this.props.submissionID,
"company_id": this.props.company.company_id,
......@@ -557,7 +609,7 @@ export default class CorporateAnnualTarget extends Component {
"status": "submitted",
"cat": data
}
// console.log(totalWeight)
// // console.log(totalWeight)
// this.setState({dataTable: dataTampung})
if (handleKosongKPIMAXYTD) {
this.setState({ alert: true, messageAlert: 'KPI / Weight / KPI Type / Max Ach / Formula YTD / Cannot be Empty', tipeAlert: 'warning', loading: false, editable: true})
......@@ -565,7 +617,7 @@ export default class CorporateAnnualTarget extends Component {
this.setState({ alert: true, messageAlert: 'Total weight less than 100%', tipeAlert: 'warning', loading: false, editable: true})
} else {
api.create().validateSubmitReport(payload).then((response) => {
// console.log(response)
// // console.log(response)
if (response.data.data.result) {
this.setState({ loading: false, buttonError: false, editable: false, buttonDraft: false })
} else {
......@@ -581,9 +633,9 @@ export default class CorporateAnnualTarget extends Component {
backToMasterBudget(type) {
let data = []
// console.log(this.state.dataTable)
// // console.log(this.state.dataTable)
this.state.dataTable.map(i => {
// // console.log(i[9] == null? "" : i[9].value)
// // // console.log(i[9] == null? "" : i[9].value)
data.push({
"item_report_id": i[1] == "" || i[1] == null? 0 : i[1],
"item_name": String(i[6]),
......@@ -613,7 +665,7 @@ export default class CorporateAnnualTarget extends Component {
"pic": String(i[29])
})
})
// console.log(JSON.stringify(data))
// // console.log(JSON.stringify(data))
let payload = {
"submission_id": this.props.submissionID,
"company_id": this.props.company.company_id,
......@@ -622,7 +674,7 @@ export default class CorporateAnnualTarget extends Component {
"status": type,
"cat": data
}
// console.log(JSON.stringify(payload));
// // console.log(JSON.stringify(payload));
this.deleteReport(payload)
}
......@@ -631,10 +683,10 @@ export default class CorporateAnnualTarget extends Component {
if (this.state.dataDelete.length > 0) {
api.create().deleteAllItemReport(payload).then((response) => {
// console.log(response)
// // console.log(response)
// api.create().validateSubmitReport(payloadBro).then((response) => {
// // console.log(response)
// // // console.log(response)
// if (response.data.data.result) {
this.props.saveToMasterBudget(payloadBro)
this.props.onClickClose()
......@@ -644,9 +696,9 @@ export default class CorporateAnnualTarget extends Component {
// })
})
} else {
// // console.log('sini jing')
// // // console.log('sini jing')
// api.create().validateSubmitReport(payloadBro).then((response) => {
// // console.log(response)
// // // console.log(response)
// if (response.data.data.result) {
this.props.saveToMasterBudget(payloadBro)
this.props.onClickClose()
......@@ -665,12 +717,12 @@ export default class CorporateAnnualTarget extends Component {
type: 'KPI_TYPE'
}
api.create().getAllSettingByType(body).then(response => {
// // console.log(response)
// // // console.log(response)
if (response.data) {
if (response.ok) {
if (response.data.status === 'success') {
let data = response.data.data
// console.log(data)
// // console.log(data)
let inputKPI = []
data.map((item) => {
......@@ -682,7 +734,7 @@ export default class CorporateAnnualTarget extends Component {
options: inputKPI,
getOptionLabel: (option) => titleCase(option.value),
};
// console.log(defaultProps)
// // console.log(defaultProps)
this.setState({ kpiTypeList: defaultProps })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
......@@ -786,7 +838,7 @@ export default class CorporateAnnualTarget extends Component {
// })
// let valz = dataTable2[tableMeta.rowIndex][11] == null ? 'SUM' : dataTable2[tableMeta.rowIndex][11].value
// dataTable2[tableMeta.rowIndex][25] = (valz == 'SUM' ? total : (valz == 'AVG' ? (total / 12) : lastValz))
// // console.log(dataTable2[tableMeta.rowIndex])
// // // console.log(dataTable2[tableMeta.rowIndex])
}
const handleChangeDropdown = (value, tableMeta) => {
......@@ -815,9 +867,9 @@ export default class CorporateAnnualTarget extends Component {
} else {
index = data.findIndex((val) => val.value == value.value)
}
// console.log(value)
// console.log(data)
// console.log(index)
// // console.log(value)
// // console.log(data)
// // console.log(index)
if (index == -1) {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = null
return null
......@@ -838,7 +890,7 @@ export default class CorporateAnnualTarget extends Component {
// dataTable2.map((item, index) => {
// if (item[2] == dataTable2[indexParentDatatable][1] && item[1] !== tableMeta.rowData[1]) {
// let weightItem = item[7] == "" ? 0 : item[7].replace('%', '')
// // console.log(weightItem)
// // // console.log(weightItem)
// valChild += Number(weightItem)
// }
// })
......@@ -846,45 +898,54 @@ export default class CorporateAnnualTarget extends Component {
// let endVal = ''
// if ((Number(valueReal) + Number(valChild)) > Number(valParent.replace('%', ''))) {
// endVal = `${Number(valParent.replace('%', '')) - (Number(valChild))}%`
// // console.log(endVal)
// // // console.log(endVal)
// } else {
// endVal = `${Number(valueReal)}%`
// // console.log(endVal)
// // // console.log(endVal)
// }
// // // console.log(endVal)
// // // // console.log(endVal)
// dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = endVal
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = value
}
const handleChangeText = (value, tableMeta) => {
// console.log(value)
// // console.log(value)
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = value
// this.setState({dataTable: dataTable2})
}
const handleAction = (idParent, typeReport, tableMeta) => {
if (idParent !== null) {
let indexsss = dataTable2.findIndex((val) => val[1] == idParent)
if (dataTable2[indexsss][6] == 'CUSTOMER PERSPECTIVE' || dataTable2[indexsss][6] == 'INTERNAL BUSINESS PROCESS PERSPECTIVE') {
return true
} else {
return false
}
if (this.props.isApprover) {
return false
} else {
if (typeReport == null || typeReport == 3) {
return true
} else if (tableMeta !== undefined && tableMeta.rowData[0] == 1) {
let indexID = dataTable2.findIndex((val) => val[2] == tableMeta.rowData[1])
if (indexID !== -1) {
return false
if ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted')) {
if (idParent !== null) {
let indexsss = dataTable2.findIndex((val) => val[1] == idParent)
if (dataTable2[indexsss][6] == 'CUSTOMER PERSPECTIVE' || dataTable2[indexsss][6] == 'INTERNAL BUSINESS PROCESS PERSPECTIVE') {
return true
} else {
return false
}
} else {
return true
if (typeReport == null || typeReport == 3) {
return true
} else if (tableMeta !== undefined && tableMeta.rowData[0] == 1) {
let indexID = dataTable2.findIndex((val) => val[2] == tableMeta.rowData[1])
if (indexID !== -1) {
return false
} else {
return true
}
} else {
return false
}
}
} else {
return false
}
}
}
const handleTambah = (data, rowIndex) => {
......@@ -932,6 +993,7 @@ export default class CorporateAnnualTarget extends Component {
this.setState({ dataTable: dataTable2 }, () => {
setTimeout(() => {
this.setState({ loading: false })
// console.log(dataTable2)
}, 500)
})
}
......@@ -995,7 +1057,7 @@ export default class CorporateAnnualTarget extends Component {
name: "",
options: {
filter: false,
display: this.props.isApprover ? false : true,
display: this.props.isApprover ? false : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? true : false),
customHeadRender: (columnMeta) => (
<TableCell key={columnMeta.index} style={{ ...style, top: 0, zIndex: 102, backgroundColor: '#dbdbdb' }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'left' }}>{columnMeta.name}</Typography>
......@@ -1014,7 +1076,7 @@ export default class CorporateAnnualTarget extends Component {
cursor: 'pointer',
borderColor: 'transparent',
}}
// onClick={() => // console.log(tableMeta.rowData[1])}
// onClick={() => // // console.log(tableMeta.rowData[1])}
onClick={() => {
this.setState({ loading: true })
handleTambah(tableMeta.rowData[1], tableMeta.rowIndex)
......@@ -1059,7 +1121,7 @@ export default class CorporateAnnualTarget extends Component {
return (
tableMeta.rowData[1] == "" ?
<div style={{ textAlign: 'left', paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
<FormControlLabel
{!this.state.loading && <FormControlLabel
style={{ margin: 0 }}
control={
<Input
......@@ -1070,13 +1132,13 @@ export default class CorporateAnnualTarget extends Component {
defaultValue={val}
// disabled={!handleAction(tableMeta.rowData[2])}
onBlur={(event) => {
// console.log(event.target.value)
// // console.log(event.target.value)
handleChangeText(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
/>
/>}
</div>
:
<div style={{ width: 300 }}>
......@@ -1187,10 +1249,10 @@ export default class CorporateAnnualTarget extends Component {
color={"#5198ea"}
disabled={true}
onBlur={(event) => {
// console.log(event.target.value)
// // console.log(event.target.value)
// updateValue(event.target.value)
handleChangeText(event.target.value, tableMeta)
// console.log(dataTable2)
// // console.log(dataTable2)
}}
/> :
<ThemeProvider theme={theme}>
......@@ -1203,10 +1265,10 @@ export default class CorporateAnnualTarget extends Component {
color={"#5198ea"}
// disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false ? false : !handleAction(tableMeta.rowData[2]))}
onBlur={(event) => {
// console.log(event.target.value)
// // console.log(event.target.value)
// updateValue(event.target.value)
handleChangeText(event.target.value, tableMeta)
// console.log(dataTable2)
// // console.log(dataTable2)
}}
/>
</ThemeProvider>
......@@ -1353,7 +1415,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
// // console.log(dataTable2)
}}
/>
}
......@@ -1373,9 +1435,10 @@ export default class CorporateAnnualTarget extends Component {
</TableCell>
),
customBodyRender: (value, tableMeta) => {
// // console.log(tableMeta.rowData[0])
return (
<div style={{ width: 96 }}>
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2 || tableMeta.rowData[0] === 4 ?
{tableMeta.rowData[0] === 1 || tableMeta.rowData[0] === 2|| tableMeta.rowData[0] === 4 ?
null
:
<div style={{ flex: 1 }}>
......@@ -1394,7 +1457,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
// // console.log(tableMeta.rowData[0])
}}
/>
}
......@@ -1435,7 +1498,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
// // console.log(dataTable2)
}}
/>
}
......@@ -1476,7 +1539,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
// // console.log(dataTable2)
}}
/>
}
......@@ -1517,7 +1580,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
// // console.log(dataTable2)
}}
/>
}
......@@ -1558,7 +1621,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
// // console.log(dataTable2)
}}
/>
}
......@@ -1599,7 +1662,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
// // console.log(dataTable2)
}}
/>
}
......@@ -1640,7 +1703,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
// // console.log(dataTable2)
}}
/>
}
......@@ -1681,7 +1744,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
// // console.log(dataTable2)
}}
/>
}
......@@ -1722,7 +1785,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
// // console.log(dataTable2)
}}
/>
}
......@@ -1763,7 +1826,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
// // console.log(dataTable2)
}}
/>
}
......@@ -1804,7 +1867,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
// // console.log(dataTable2)
}}
/>
}
......@@ -1845,7 +1908,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
// // console.log(dataTable2)
}}
/>
}
......@@ -1884,7 +1947,7 @@ export default class CorporateAnnualTarget extends Component {
// onBlur={(event) => {
// // updateValue(event.target.value)
// handleChange(event.target.value, tableMeta)
// // console.log(dataTable2)
// // // console.log(dataTable2)
// }}
/>
}
......@@ -1924,7 +1987,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
// // console.log(dataTable2)
}}
/>
}
......@@ -1965,7 +2028,7 @@ export default class CorporateAnnualTarget extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
// // console.log(dataTable2)
}}
/>
}
......@@ -2001,9 +2064,9 @@ export default class CorporateAnnualTarget extends Component {
disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
defaultValue={value}
onBlur={(event) => {
// console.log(event.target.value)
// // console.log(event.target.value)
handleChangeText(event.target.value, tableMeta)
// console.log(dataTable2)
// // console.log(dataTable2)
}}
/>
</ThemeProvider>
......@@ -2041,10 +2104,10 @@ export default class CorporateAnnualTarget extends Component {
disabled={this.props.isApprover ? true : ((this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
defaultValue={value}
onBlur={(event) => {
// console.log(event.target.value)
// // console.log(event.target.value)
// updateValue(event.target.value)
handleChangeText(event.target.value, tableMeta)
// console.log(dataTable2)
// // console.log(dataTable2)
}}
/>
</ThemeProvider>
......
......@@ -394,10 +394,12 @@ export default class FixedAssetsMovement extends Component {
}
async downloadAllData() {
let url = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=${this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
console.log(url);
// let url = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=${this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
// console.log(url);
let resReal = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=${this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
let resNull = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
let res = await fetch(
`https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
this.props.submissionID == null ? resNull : resReal
)
res = await res.blob()
this.setState({ loading: false })
......@@ -512,10 +514,15 @@ export default class FixedAssetsMovement extends Component {
} else {
// console.log(item)
let indexID = dataTable2.findIndex((val) => val[22] == item)
// console.log(dataTable2[indexID][tableMeta.columnIndex])
// console.log(dataTable2[indexID])
if (indexID !== -1) {
let valuezz = dataTable2[indexID][tableMeta.columnIndex].value == undefined ? dataTable2[indexID][tableMeta.columnIndex] : dataTable2[indexID][tableMeta.columnIndex].value
anjay.push(valuezz == "" ? 0 : valuezz)
} else {
if (item === '(-1)') {
anjay.push(-1)
}
// console.log(item);
}
}
}
......@@ -551,8 +558,8 @@ export default class FixedAssetsMovement extends Component {
// console.log(dataTable2[tableMeta.rowIndex][22])
// console.log(tableMeta.rowData[5])
// if (tableMeta.rowData[5] == 'Beginning Balance') {
// console.log(baru)
// console.log(anjay)
// console.log(baru)
// console.log(anjay)
// console.log(total)
// }
......
......@@ -6209,17 +6209,14 @@ export default class TaxPlanning extends Component {
name: `${this.props.periode}`,
options: {
customHeadRender: (columnMeta) => (
<div style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} >
{/* <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell> */}
<th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 13, fontWeight: 1, width: 150, borderRight: "1px solid rgb(255, 255, 255)" }} >
<div style={{ borderBottom: "1px #fff solid", textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5, paddingTop: 8 }}>{columnMeta.name}</div>
<div style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky", paddingBottom: 20 }}>
<div style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
<div className="" style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky", paddingBottom: 20 }}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
<span>{"Trial Balance (Fiscal)"}</span>
</div>
</div>
</div>
</th>
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
......
......@@ -6,6 +6,7 @@ import DonutChart from 'react-d3-donut';
import Constant from '../library/Constant';
import api from '../api';
import { Link } from 'react-router-dom';
import { PropagateLoader } from 'react-spinners';
var ct = require("../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable());
......@@ -22,11 +23,17 @@ class HomePage extends Component {
{ nama: 'Dharma Group', status: 'overdue' },
{ nama: 'Daya Group', status: 'open' },
],
isApprover: true
isApprover: true,
listSubcoMB: [],
valueSubmit: 0,
listdmb: [],
dataTableMB: [],
loading: false
}
}
componentDidMount() {
this.setState({ loading: true })
let userId = localStorage.getItem(Constant.USER)
api.create().getDetailUser(userId).then((response) => {
if (response.data) {
......@@ -47,6 +54,9 @@ class HomePage extends Component {
// }
// })
this.getApprMat()
this.getListUserSubco()
this.getDashboardMB()
this.getDashboard()
}
componentDidUpdate() {
......@@ -56,6 +66,27 @@ class HomePage extends Component {
}
}
getListUserSubco() {
api.create().getDashboardUser().then(response => {
console.log(response);
let valueSubmit = 0
if (response.data) {
if (response.data.status === "success") {
response.data.data.map((item, index) => {
if (item.is_submit === true) {
valueSubmit += 1
}
})
this.setState({
listSubcoMB: response.data.data,
valueSubmit,
loading: false
})
}
}
})
}
getDashboard() {
let listDashboard = []
api.create().getDashboard().then((response) => {
......@@ -71,25 +102,46 @@ class HomePage extends Component {
}
getApprMat() {
this.setState({loading: true})
api.create().getAM().then((response) => {
console.log(response);
let actAM = response.data.data.map((item, index) => {
if(String(item.status).toLocaleLowerCase() == 'active'){
if (String(item.status).toLocaleLowerCase() == 'active') {
return item
}
})
let userId = localStorage.getItem(Constant.USER)
let indexId = actAM.findIndex((val) => val.user_id == userId)
if (indexId === -1){
if (indexId === -1) {
this.setState({ isApprover: false })
this.getListUserSubco()
}
this.getDashboardMB()
console.log(actAM)
this.setState({loading: false})
})
}
getDashboardMB() {
api.create().getDashboardMB().then((response) => {
console.log(response)
if (String(response.data.status).toLocaleLowerCase() == 'success') {
let data = response.data.data
let listdmb = data.sort((a, b) => a.company_id - b.company_id).map((item, index) => {
return [
item.company_name,
item.master_budget,
item.operating_indicator
]
})
this.setState({ dataTableMB: listdmb, loading: false })
}
})
}
render() {
const columns = ["#", "ID", "Nama Perusahaan", "Jenis Report", "Revisi", "Status", {
const columns = ["#", "ID", "Company", "Report Type", "Revision", "Status", {
name: "Action",
options: {
customBodyRender: (val, tableMeta) => {
......@@ -138,6 +190,9 @@ class HomePage extends Component {
rowsPerPage: 5,
search: false
}
const columnsMB = ["Company", "Master Budget & CAT", "Operating Indicator"]
const dataChart = [{
count: 90,
color: '#5198ea',
......@@ -165,8 +220,19 @@ class HomePage extends Component {
color: '#f65a4c',
name: 'name',
}]
const loadingComponent = (
<div style={{ position: 'absolute', zIndex: 110, top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'rgba(255,255,255,0.8)' }}>
<PropagateLoader
// css={override}
size={20}
color={"#274B80"}
loading={this.state.loading}
/>
</div>
);
return (
<div style={{ flex: 1, backgroundColor: '#f8f8f8' }}>
{this.state.loading && loadingComponent}
{this.state.isApprover === true ?
<div>
<div className={"main-color"} style={{ height: 78, flex: 1, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
......@@ -189,6 +255,18 @@ class HomePage extends Component {
</MuiThemeProvider>
</div>
<div style={{ marginTop: 20 }}>
<Typography style={{ color: '#656565', fontSize: '16px', fontWeight: 'bold' }}>Master Budget & CAT</Typography>
<div style={{ marginTop: 10, width: '100%' }}>
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
data={this.state.dataTableMB}
columns={columnsMB}
options={options}
/>
</MuiThemeProvider>
</div>
</div>
{/* <div style={{ marginTop: 20 }}>
<Typography style={{ color: '#656565', fontSize: '16px', fontWeight: 'bold' }}>Status Laporan</Typography>
<div style={{ marginTop: 10, display: 'flex' }}>
<div style={{ width: 280, height: 400, padding: 20, backgroundColor: 'white', borderRadius: 6, border: 'solid 1px #c4c4c4', marginRight: 25 }}>
......@@ -315,7 +393,7 @@ class HomePage extends Component {
</div>
</div>
</div>
</div>
</div> */}
</div>
</div>
:
......@@ -329,16 +407,33 @@ class HomePage extends Component {
</div>
</div>
<div style={{ flex: 1, padding: 20, width: '100%' }}>
<Paper style={{ width: 400, padding: 20, borderRadius: 10 }}>
<Typography style={{ fontWeight: 'bold', textDecorationLine: 'underline' }}>Master Budget - Oct 2020 (1/4)</Typography>
{this.state.listMasterBudget.map((item, index) => {
<Paper style={{ width: 450, padding: 20, borderRadius: 10 }}>
<Typography style={{ fontWeight: 'bold', textDecorationLine: 'underline' }}>{`Master Budget ${this.state.valueSubmit}/${this.state.listSubcoMB.length}`}</Typography>
{this.state.listSubcoMB.map((item, index) => {
return (
<div style={{ display: 'flex', justifyContent: 'space-between', marginTop: 10, paddingLeft: 10 }}>
<div style={{ display: 'flex' }}>
<img src={item.status === "overdue" ? Images.dotOverdue : item.status === "open" ? Images.dotOpen : Images.dotDone} />
<Typography style={{ marginLeft: 10, color: '#5198ea', fontSize: 13 }}>{item.nama}</Typography>
<img src={item.is_submit === true ? Images.dotDone : item.is_overdue === true ? Images.dotOverdue : Images.dotOpen} />
<Link to={{
pathname: `/home/master-budget/`,
state: {
userType: 'user',
rawData: item
}
}}>
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
margin: 5,
outline: 'none'
}}>
<Typography style={{ marginLeft: 10, color: '#5198ea', fontSize: 13 }}>{item.company_name}</Typography>
</button>
</Link>
</div>
{item.status === 'overdue' && (
{item.is_overdue && (
<div style={{ backgroundColor: '#f65a4c', paddingRight: 5, paddingLeft: 5, borderRadius: 5, alignSelf: 'center' }}>
<Typography style={{ fontSize: 11, color: '#fff' }}>Overdue</Typography>
</div>
......@@ -352,6 +447,7 @@ class HomePage extends Component {
}
</div>
);
}
}
......
......@@ -61,7 +61,7 @@ export default class BalanceSheet extends Component {
"periode": this.props.data.periode,
}
api.create().getLastestUpdateOI(payload).then(response => {
console.log(response.data)
// console.log(response.data)
if (response.data) {
if (response.data.status === "success") {
this.setState({
......@@ -76,7 +76,7 @@ export default class BalanceSheet extends Component {
// this.getItemHierarki()
this.getDataDetail()
this.getLatestUpdate()
console.log(this.props);
// console.log(this.props);
}
getDataDetail() {
......@@ -87,12 +87,12 @@ export default class BalanceSheet extends Component {
"company_id": this.props.data.company.company_id,
"periode": this.props.data.periode
}
console.log(payload)
// console.log(payload)
api.create().getOperatingIndDetail(payload).then(response => {
console.log(response)
// console.log(response)
let dataTable = []
let res = response.data.data
// console.log(res)
// // console.log(res)
const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
if (indexIDzz === -1) {
......@@ -118,6 +118,7 @@ export default class BalanceSheet extends Component {
item.master_budget.november == "" ? item.master_budget.november : String(item.master_budget.november).indexOf(".") == -1 ? Number(item.master_budget.november) : Number(item.master_budget.november).toFixed(1),
item.master_budget.december == "" ? item.master_budget.december : String(item.master_budget.december).indexOf(".") == -1 ? Number(item.master_budget.december) : Number(item.master_budget.december).toFixed(1),
item.master_budget.total_current_year == "" ? item.master_budget.total_current_year : String(item.master_budget.total_current_year).indexOf(".") == -1 ? Number(item.master_budget.total_current_year) : Number(item.master_budget.total_current_year).toFixed(1),
item.order
])
}
if (item.children !== null) {
......@@ -151,6 +152,7 @@ export default class BalanceSheet extends Component {
item.master_budget.november == "" ? item.master_budget.november : String(item.master_budget.november).indexOf(".") == -1 ? Number(item.master_budget.november) : Number(item.master_budget.november).toFixed(1),
item.master_budget.december == "" ? item.master_budget.december : String(item.master_budget.december).indexOf(".") == -1 ? Number(item.master_budget.december) : Number(item.master_budget.december).toFixed(1),
item.master_budget.total_current_year == "" ? item.master_budget.total_current_year : String(item.master_budget.total_current_year).indexOf(".") == -1 ? Number(item.master_budget.total_current_year) : Number(item.master_budget.total_current_year).toFixed(1),
item.order
])
if (item.children !== null) {
if (item.children.length > 0) {
......@@ -198,8 +200,8 @@ export default class BalanceSheet extends Component {
"status": type,
"master_budget": payloadMB
}
console.log('=========================')
console.log(JSON.stringify(payload))
// console.log('=========================')
// console.log(JSON.stringify(payload))
this.props.saveOperatingInd(payload)
this.props.onClickClose()
}
......@@ -213,7 +215,7 @@ export default class BalanceSheet extends Component {
})
let indexParent = this.state.dataTable.findIndex((val) => val[1] == this.state.dataTable[data.rowIndex][2])
let a = this.state.dataTable[data.rowIndex][data.columnIndex] = total
// console.log(indexParent);
// // console.log(indexParent);
return a
}
......@@ -262,7 +264,7 @@ export default class BalanceSheet extends Component {
// "status": type,
// "balance_sheet": data
// }
// // console.log(data);
// // // console.log(data);
// this.props.saveToMasterBudget(payload)
this.props.onClickClose()
}
......@@ -272,7 +274,7 @@ export default class BalanceSheet extends Component {
`https://tia.eksad.com/tia-reporting-dev/public/transaction/operating_indicator/download_template?report_id=${this.props.data.report_id}&&company_id=${this.props.data.company.company_id}&&year=${this.props.data.periode}`
)
res = await res.blob()
console.log(res)
// console.log(res)
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
......@@ -283,15 +285,15 @@ export default class BalanceSheet extends Component {
}
async downloadAllData() {
// console.log('masuk')
// // 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)
// console.log(bram)
let res = await fetch(
`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()
console.log(res)
// console.log(res)
this.setState({ loading: false })
if (res.size > 0) {
let url = window.URL.createObjectURL(res);
......@@ -305,13 +307,13 @@ export default class BalanceSheet extends Component {
fileHandler = (event) => {
let fileObj = event
ExcelRenderer(fileObj, (err, resp) => {
// console.log(resp)
// // console.log(resp)
if (err) {
console.log(err);
// console.log(err);
}
else {
let isi = resp.rows.slice(3)
console.log(isi);
// console.log(isi);
let payload = []
let reg = /^[-+]?(?:[0-9]+,)*[0-9]+(?:\.[0-9]+)?$/;
isi.map((i, index) => {
......@@ -344,18 +346,18 @@ export default class BalanceSheet extends Component {
report_id: this.props.data.report_id,
master_budget: payload
}
console.log(resp.rows[1][0])
// console.log(resp.rows[1][0])
this.setState({ payload: body, buttonError: false, judul: resp.rows[1][0] })
}
});
}
checkUpload() {
console.log(JSON.stringify(this.state.payload))
// 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)
// // console.log(JSON.stringify(this.state.payload));
// console.log('===============')
// console.log(response)
if (response.data) {
if (response.data.status === 'success') {
this.setState({ visibleUpload: false, visibleOI: false, loading: true })
......@@ -382,6 +384,7 @@ export default class BalanceSheet extends Component {
item.november,
item.december,
item.total_current_year,
item.order,
item.error
]
})
......@@ -393,7 +396,7 @@ export default class BalanceSheet extends Component {
uploadOI(type) {
let data = []
console.log(this.state.dataTable)
// console.log(this.state.dataTable)
this.state.dataTable.map(i => {
data.push({
"item_report_id": i[1],
......@@ -422,10 +425,10 @@ export default class BalanceSheet extends Component {
status: type,
master_budget: data
}
console.log(data);
console.log(JSON.stringify(body))
// console.log(data);
// console.log(JSON.stringify(body))
api.create('UPLOAD').uploadOperatingInd(body).then(response => {
console.log(response);
// console.log(response);
this.setState({loading: false})
if (response.data) {
if (response.data.status === "success") {
......@@ -457,7 +460,7 @@ export default class BalanceSheet extends Component {
// }
// })
// dataTable2[tableMeta.rowIndex][20] = total
console.log(dataTable2[tableMeta.rowIndex])
// console.log(dataTable2[tableMeta.rowIndex])
}
const handleValue = (value, tableMeta) => {
......@@ -474,21 +477,41 @@ export default class BalanceSheet extends Component {
return total
}
const handleFormula = (data, tableMeta) => {
const handleParent = (tableMeta) => {
// console.log(tableMeta)
let total = 0
dataTable2.map((item, index) => {
if (item[2] == tableMeta.rowData[1]) {
// console.log(total)
// console.log(item[tableMeta.columnIndex])
total += Number(item[tableMeta.columnIndex])
}
})
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = total
return total
}
const handleFormula = (tableMeta) => {
let arrayFormula = tableMeta.rowData[3].match(/[a-zA-Z]+|[0-9]+|[-!$%^&*()_+|~=`{}\[\]:";'<>?,.\/]+(?:\.[0-9]+@|)/g)
let arrayJumlah = []
let arrayFormulaConvert = []
// // console.log(arrayFormula)
arrayFormula.map((item, indexs) => {
let index = dataTable2.findIndex((val) => val[1] == item)
if (index > 0) {
arrayJumlah.push(dataTable2[index][tableMeta.columnIndex])
if (item == '-' || item == '+' || item == '/' || item == '*') {
arrayFormulaConvert.push(item)
} else {
arrayJumlah.push(item)
let indexID = dataTable2.findIndex((val) => val[21] == item)
if (indexID !== -1) {
let valuezz = dataTable2[indexID][tableMeta.columnIndex]
// // console.log(dataTable2[indexID])
arrayFormulaConvert.push(valuezz == "" ? 0 : valuezz)
}
}
// if (indexs % 2 !== 0) {
// operator.push(item)
// }
})
let array = arrayJumlah
// // console.log(arrayFormula)
// // console.log(arrayFormulaConvert)
let array = arrayFormulaConvert
let total = 0
let opt = ""
array.map((item, index) => {
......@@ -558,9 +581,9 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 ?
null
:
tableMeta.rowData[21] ?
tableMeta.rowData[21].length > 0 ?
tableMeta.rowData[21][0].field === 'item' ?
tableMeta.rowData[22] ?
tableMeta.rowData[22].length > 0 ?
tableMeta.rowData[22][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>
......@@ -627,10 +650,10 @@ export default class BalanceSheet extends Component {
value={value}
disabled={true}
// onBlur={(event) => {
// console.log(event.target.value)
// // console.log(event.target.value)
// // updateValue(event.target.value)
// handleChangeText(event.target.value, tableMeta)
// console.log(dataTable2)
// // console.log(dataTable2)
// }}
/>
}
......@@ -682,6 +705,49 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] == 2?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
/>
}
/>
</div>
:
(tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
}}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -698,12 +764,12 @@ export default class BalanceSheet extends Component {
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
/>
</div>
</div>)
}
</div>
)
......@@ -725,6 +791,49 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] == 2?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
/>
}
/>
</div>
:
(tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
}}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -736,17 +845,17 @@ export default class BalanceSheet extends Component {
type="text"
placeholder=""
value={Number(value).toFixed(1)}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
/>
</div>
</div>)
}
</div>
)
......@@ -767,6 +876,7 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] == 2?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -774,21 +884,63 @@ export default class BalanceSheet extends Component {
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
value={Number(handleParent(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
/>
}
/>
</div>
:
(tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
}}
/>
}
/>
</div>)
}
</div>
)
......@@ -809,6 +961,7 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] == 2?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -816,21 +969,63 @@ export default class BalanceSheet extends Component {
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
value={Number(handleParent(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
/>
}
/>
</div>
:
(tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
}}
/>
}
/>
</div>)
}
</div>
)
......@@ -851,6 +1046,49 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] == 2?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
/>
}
/>
</div>
:
(tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
}}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -861,18 +1099,18 @@ 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={Number(value).toFixed(1)}
decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
/>
</div>
</div>)
}
</div>
)
......@@ -893,6 +1131,7 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] == 2?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -900,21 +1139,63 @@ export default class BalanceSheet extends Component {
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
value={Number(handleParent(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
/>
}
/>
</div>
:
(tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
}}
/>
}
/>
</div>)
}
</div>
)
......@@ -935,6 +1216,49 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] == 2?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
/>
}
/>
</div>
:
(tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
}}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -945,18 +1269,18 @@ 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={Number(value).toFixed(1)}
decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
/>
</div>
</div>)
}
</div>
)
......@@ -977,6 +1301,49 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] == 2?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
/>
}
/>
</div>
:
(tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
}}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -987,18 +1354,18 @@ 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={Number(value).toFixed(1)}
decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
/>
</div>
</div>)
}
</div>
)
......@@ -1019,6 +1386,49 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] == 2?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
/>
}
/>
</div>
:
(tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
}}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -1029,18 +1439,18 @@ 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={Number(value).toFixed(1)}
decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
/>
</div>
</div>)
}
</div>
)
......@@ -1061,6 +1471,49 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] == 2?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
/>
}
/>
</div>
:
(tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
}}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -1071,18 +1524,18 @@ 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={Number(value).toFixed(1)}
decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
/>
</div>
</div>)
}
</div>
)
......@@ -1103,6 +1556,49 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] == 2?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
/>
}
/>
</div>
:
(tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
}}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -1113,18 +1609,18 @@ 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={Number(value).toFixed(1)}
decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
/>
</div>
</div>)
}
</div>
)
......@@ -1145,6 +1641,49 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] == 2?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
/>
}
/>
</div>
:
(tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
}}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -1155,18 +1694,18 @@ 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={Number(value).toFixed(1)}
decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
// console.log(dataTable2)
}}
/>
}
/>
</div>
</div>)
}
</div>
)
......@@ -1187,6 +1726,7 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null
:
tableMeta.rowData[0] == 2?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
......@@ -1194,21 +1734,63 @@ export default class BalanceSheet extends Component {
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleParent(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
}}
/>
}
/>
</div>
:
(tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
}}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
// console.log(dataTable2)
}}
/>
}
/>
</div>)
}
</div>
)
......
......@@ -26,6 +26,7 @@ import Constant from "../library/Constant";
// work properly.
export default function BasicExample() {
return (
<Router basename={"/tia-web-dev"}>
<Switch>
......@@ -57,7 +58,15 @@ export default function BasicExample() {
}
function PrivateRoute({ children, ...rest }) {
// React.useEffect(() => {
// token()
// })
const logged = localStorage.getItem(Constant.TOKEN) !== null? true : false
// const token = async() => {
// let a = await localStorage.getItem(Constant.TOKEN)
// alert(a)
// }
return (
<Route
{...rest}
......
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