Commit 26fadb2f authored by EKSAD's avatar EKSAD

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

parents cd976f5a 0a403cf3
......@@ -215,6 +215,7 @@ const create = (type = "") => {
const createOpetaingInd = (body) => api.post('transaction/operating_indicator/create_submission_report', body)
const checkUploadOperatingInd = (body) => api.post('transaction/operating_indicator/check_import', body)
const uploadOperatingInd = (body) => api.post('transaction/operating_indicator/import_operating_indicator', body)
const getLastestUpdateOI = (body) => api.post('transaction/operating_indicator/get_latest_update', body)
const getDashboard = (body) => api.get('transaction/get_dashboard')
const historyApproval = (body) => api.post('transaction/master_budget/history_approval', body)
......@@ -230,6 +231,7 @@ const create = (type = "") => {
const getLastestUpdateOLPA = (body) => api.post('transaction/outlook_pa/get_latest_update', body)
const createReportOLPA = (body) => api.post('transaction/outlook_pa/create_outlook_report', body)
const checkUploadOLPA = (body) => api.post('transaction/outlook_pa/check_import', body)
const validateSubmitReportOLPA = (body) => api.post('transaction/outlook_pa/validate_save', body)
const uploadOLPA = (body) => api.post('transaction/outlook_pa/import_outlook_pa')
//Template
......@@ -388,6 +390,7 @@ const create = (type = "") => {
getLastPeriod,
getSubmitMasterBudget,
createPeriodeRevision,
getLastestUpdateOI,
getOutlookPAID,
getLastPeriodOLPA,
getCompanySubmittedOLPA,
......@@ -399,7 +402,8 @@ const create = (type = "") => {
getLastestUpdateOLPA,
createReportOLPA,
checkUploadOLPA,
uploadOLPA
uploadOLPA,
validateSubmitReportOLPA
}
}
......
......@@ -5,7 +5,6 @@ import Images from '../assets/Images';
import api from '../api';
import Autocomplete from '@material-ui/lab/Autocomplete';
import { titleCase } from '../library/Utils';
import ProfitLoss from './BudgetTahunan/ProfitLoss';
import TaxPlanning from './BudgetTahunan/TaxPlanning';
import FixedAssetsMovement from './BudgetTahunan/FixedAssetsMovement';
import CorporateAnnualTarget from './BudgetTahunan/CorporateAnnualTarget';
......@@ -13,6 +12,7 @@ import { ExcelRenderer } from 'react-excel-renderer';
import UploadFile from "../library/Upload";
import { format } from 'date-fns';
import BalanceSheetMR from './MonthlyReport/BalanceSheetMR';
import ProfitLossMR from './MonthlyReport/ProfitLossMR';
export default class MonthlyReport extends Component {
constructor(props) {
......@@ -162,6 +162,7 @@ export default class MonthlyReport extends Component {
}
clickDetail(item, id, revision, status) {
console.log(item)
this.setState({
report_id: id,
revisionTable: revision,
......@@ -176,7 +177,7 @@ export default class MonthlyReport extends Component {
visibleFAM: false,
visibleTP: false,
})
} else if (item === 'Profit & Loss') {
} else if (item === 'Profit Loss') {
this.setState({
visibleMonthlyReport: false,
visibleBS: false,
......@@ -550,10 +551,18 @@ export default class MonthlyReport extends Component {
/>
)}
{this.state.visiblePL && (
<ProfitLoss
<ProfitLossMR
open={this.props.open}
report_id={this.state.report_id}
height={this.props.height}
width={this.props.width}
company={this.state.company}
onClickClose={() => this.setState({ visiblePL: false, visibleMonthlyReport: true })}
revision={this.state.revisionTable}
periode={this.state.periode.periode}
submissionID={this.state.submissionID}
// saveToMasterBudget={this.saveToMasterBudget.bind(this)}
onClickClose={() => this.setState({ visiblePL: false, visibleBudgetTahunan: true })}
// getReport={this.getCompanyActive.bind(this)}
/>
)}
......
import { createMuiTheme, MuiThemeProvider, Paper, TableCell, Typography } from '@material-ui/core'
import MUIDataTable from 'mui-datatables';
import React, { Component } from 'react'
import ReactTooltip from 'react-tooltip';
import Images from '../../assets/Images';
var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable3());
const options = ct.customOptionsFixedColumn();
const style = {
position: "sticky",
left: 0,
zIndex: 101,
background: "white",
};
const style2 = {
position: "sticky",
background: "white",
zIndex: 100,
top: 0
};
export default class BalanceSheetMR extends Component {
render() {
let columns = [
{
name: "Account",
options: {
customHeadRender: (columnMeta) => (
<TableCell key={columnMeta.index} style={{ ...style, top: 0, zIndex: 102, backgroundColor: '#1c71b8', width: 300 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'left' }}>{columnMeta.name}</Typography>
</TableCell>
),
setCellProps: () => ({ style }),
customBodyRender: (val, tableMeta) => {
return (
<div style={{ width: 300 }}>
{val}
</div>
)
}
}
},
{
name: "Keterangan",
options: {
customHeadRender: (columnMeta) => (
<TableCell key={columnMeta.index} style={{ ...style, top: 0, zIndex: 102, backgroundColor: '#1c71b8', width: 96}}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'left' }}>{columnMeta.name}</Typography>
</TableCell>
),
setCellProps: () => ({ style }),
customBodyRender: (val, tableMeta) => {
return (
<div style={{ width: 96 }}>
{val}
</div>
)
}
}
},
{
name: "Rolling Outlook (FY2021)",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#07a7d0', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
setCellProps: () => ({ style2 }),
customBodyRender: (val, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right', width: 90 }}>
{val}
</div>
)
}
}
},
{
name: `Month To Date (MTD)`,
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" 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, backgroundColor: '#37b5e6' }}>
<span>{"Actual"}</span>
</div>
</div>
</th>
),
setCellProps: () => ({ style2 }),
customBodyRender: (val, 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>
)
}
}
},{
name: "YTD Actual",
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>
),
setCellProps: () => ({ style2 }),
customBodyRender: (val, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right', width: 90 }}>
{val}
</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>
),
setCellProps: () => ({ style2 }),
customBodyRender: (val, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right', width: 90 }}>
{val}
</div>
)
}
}
},
{
name: `Variance`,
options: {
customHeadRender: (columnMeta) => (
<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 }}>{columnMeta.name}</div>
<div className="grid grid-3x" style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, border: '1px #fff solid', backgroundColor: '#37b5e6' }}>
<div style={{ borderBottom: '1px #fff solid', backgroundColor: '#37b5e6' }}>
<span>{"Act vs Previous Month"}</span>
</div>
<div className="grid grid-2x">
<div className="column-1" style={{ borderRight: '1px #fff solid', backgroundColor: '#37b5e6' }}>
<span>{"Amount"}</span>
</div>
<div className="column-2" style={{ borderLeft: '1px #fff solid', backgroundColor: '#37b5e6' }}>
<span>{"%"}</span>
</div>
</div>
</div>
<div className="column-2" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, border: '1px #fff solid', backgroundColor: '#07a7d0' }}>
<div style={{ borderBottom: '1px #fff solid' }}>
<span>{"Act vs MB"}</span>
</div>
<div className="grid grid-2x">
<div className="column-1" style={{ borderRight: '1px #fff solid' }}>
<span>{"Amount"}</span>
</div>
<div className="column-2" style={{ borderLeft: '1px #fff solid' }}>
<span>{"%"}</span>
</div>
</div>
</div>
<div className="column-3" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, border: '1px #fff solid', backgroundColor: '#07a7d0' }}>
<div style={{ borderBottom: '1px #fff solid' }}>
<span>{"Act vs RB"}</span>
</div>
<div className="grid grid-2x">
<div className="column-1" style={{ borderRight: '1px #fff solid' }}>
<span>{"Amount"}</span>
</div>
<div className="column-2" style={{ borderLeft: '1px #fff solid' }}>
<span>{"%"}</span>
</div>
</div>
</div>
</div>
</th>
),
setCellProps: () => ({ style2 }),
customBodyRender: (val, tableMeta, updateValue) => {
return (
<div>
<div className="grid grid-3x content-center">
<div className="col-1">
<div className="grid grid-2x 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>
</div>
<div className="col-2">
<div className="grid grid-2x content-center">
<div className="col-1">
<div style={{ textAlign: 'right', width: 90 }}>
{val.c}
</div>
</div>
<div className="col-2">
<div style={{ textAlign: 'right', width: 90 }}>
{val.d}
</div>
</div>
</div>
</div>
<div className="col-3">
<div className="grid grid-2x content-center">
<div className="col-1">
<div style={{ textAlign: 'right', width: 90 }}>
{val.e}
</div>
</div>
<div className="col-2">
<div style={{ textAlign: 'right', width: 90 }}>
{val.f}
</div>
</div>
</div>
</div>
</div>
</div>
)
}
}
},
{
name: `MTD Explanation`,
options: {
customHeadRender: (columnMeta) => (
<th style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', 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", textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5 }}>{columnMeta.name}</div>
<div className="grid grid-3x" style={{ ...style2, backgroundColor: '#1c71b8', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid" }}>
<span>{"vs Prev Month"}</span>
</div>
<div className="column-2" style={{ placeSelf: 'center', textAlign: 'center', padding: 5, borderRight: "1px #fff solid" }}>
<span>{"vs MB"}</span>
</div>
<div className="column-3" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
<span>{"vs RB"}</span>
</div>
</div>
</th>
),
setCellProps: () => ({ style2 }),
customBodyRender: (val, 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>
)
}
}
},
]
let data = [
["Total Assets", "0", "1", { a: "2", b: "3", c: "4" }, "4.5", "5", { a: "6", b: "7", c: "8", d: "9", e: "10", f: "11" }, { a: "12", b: "13", c: "14" }],
["Total Assets", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"]
]
return (
<div style={{ height: this.props.height, backgroundColor: '#f8f8f8', marginBottom: 100, minHeight: 1000 }}>
<div className={"main-color"} style={{ height: 78, flex: 1, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
<Typography style={{ fontSize: '16px', color: 'white' }}>Monthly Report</Typography>
</div>
<div style={{ flex: 1, padding: 20, width: '100%' }}>
<Paper style={{ paddingTop: 10, paddingBottom: 20 }}>
<div style={{ borderBottom: 'solid 1px #c4c4c4' }} >
<Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Monthly Report - Profit Loss</Typography>
</div>
<div style={{ padding: 20 }}>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.periode} (rev.{this.props.revision})</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div>
<div style={{ width: '50%' }}>
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download Template'} data-for="template">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
margin: 5
}}
onClick={() => null}
>
<img src={Images.template} />
</button>
</a>
<ReactTooltip border={true} id="template" place="bottom" type="light" effect="solid" />
<a data-tip={'Upload'} data-for="upload">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
margin: 5
}}
onClick={() => null}
>
<img src={Images.upload} />
</button>
</a>
<ReactTooltip border={true} id="upload" place="bottom" type="light" effect="solid" />
<a data-tip={'Download'} data-for="download">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
margin: 5
}}
onClick={() => null}
>
<img src={Images.download} />
</button>
</a>
<ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
</div>
</div>
</div>
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
data={data}
columns={columns}
options={options}
/>
</MuiThemeProvider>
</div>
</div>
</Paper>
</div>
</div>
)
}
}
......@@ -50,9 +50,29 @@ export default class BalanceSheet extends Component {
this.fileHandler = this.fileHandler.bind(this);
}
getLatestUpdate() {
let payload = {
"operating_indicator_id": this.props.data.operatingIndID,
"report_id": this.props.data.report_id,
"company_id": this.props.data.company.company_id,
"periode": this.props.data.periode,
}
api.create().getLastestUpdateOI(payload).then(response => {
console.log(response.data)
if (response.data) {
if (response.data.status === "success") {
this.setState({
updateBy: response.data.data.latest_update === null ? '-' : response.data.data.latest_update
})
}
}
})
}
componentDidMount() {
// this.getItemHierarki()
this.getDataDetail()
this.getLatestUpdate()
console.log(this.props);
}
......@@ -1261,6 +1281,7 @@ export default class BalanceSheet extends Component {
/>
</MuiThemeProvider>
</div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 20 }}>Last Updated by : {this.state.updateBy}</Typography>
</div>
<div className="grid grid-2x">
<div className="col-1">
......
......@@ -113,6 +113,7 @@ export default class BalanceSheetOLPA extends Component {
item.balance_sheet.october,
item.balance_sheet.november,
item.balance_sheet.december,
item.balance_sheet.total_current_year,
item.order,
item.condition_it_should_be,
item.condition_if_wrong
......@@ -147,6 +148,7 @@ export default class BalanceSheetOLPA extends Component {
item.balance_sheet.october,
item.balance_sheet.november,
item.balance_sheet.december,
item.balance_sheet.total_current_year,
item.order,
item.condition_it_should_be,
item.condition_if_wrong
......@@ -183,6 +185,7 @@ export default class BalanceSheetOLPA extends Component {
october: String(Number(i[16]).toFixed(1)),
november: String(Number(i[17]).toFixed(1)),
december: String(Number(i[18]).toFixed(1)),
total_current_year: String(Number(i[19]).toFixed(1)),
})
})
let payload = {
......@@ -245,8 +248,6 @@ export default class BalanceSheetOLPA extends Component {
november: i[13] === undefined ? "0" : reg.test(String(i[13])) === false ? "0" : String(i[13]).trim(),
december: i[14] === undefined ? "0" : reg.test(String(i[14])) === false ? "0" : String(i[14]).trim(),
total_current_year: i[15] === undefined ? "0" : reg.test(String(i[15])) === false ? "0" : String(i[15]).trim(),
total_next_year: i[16] === undefined ? "0" : reg.test(String(i[16])) === false ? "0" : String(i[16]).trim(),
total_more_year: i[17] === undefined ? "0" : reg.test(String(i[17])) === false ? "0" : String(i[17]).trim()
})
}
})
......@@ -290,6 +291,7 @@ export default class BalanceSheetOLPA extends Component {
item.october,
item.november,
item.december,
item.total_current_year,
item.orders,
item.condition_it_should_be,
item.condition_if_wrong,
......@@ -298,7 +300,7 @@ export default class BalanceSheetOLPA extends Component {
})
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true }, () => {
this.state.dataTable.map(item => {
if (item[22].length > 0) {
if (item[23].length > 0) {
console.log('masuk')
this.setState({ buttonError: true, errorPreview: true, editable: true })
}
......@@ -328,6 +330,7 @@ export default class BalanceSheetOLPA extends Component {
october: String(Number(i[16]).toFixed(1)),
november: String(Number(i[17]).toFixed(1)),
december: String(Number(i[18]).toFixed(1)),
total_current_year: String(Number(i[19]).toFixed(1)),
})
})
let body = {
......@@ -391,18 +394,19 @@ export default class BalanceSheetOLPA extends Component {
october: i[0] === 3 && i[16] === "" ? "0" : String(i[16]),
november: i[0] === 3 && i[17] === "" ? "0" : String(i[17]),
december: i[0] === 3 && i[18] === "" ? "0" : String(i[18]),
total_current_year: i[0] === 3 && i[19] === "" ? "0" : String(i[19]),
})
})
// console.log(JSON.stringify(data))
let payload = {
"submission_id": this.props.submissionID,
"outlook_pa_id": this.props.outlook_pa_id,
"company_id": this.props.company.company_id,
"periode": this.props.periode,
"report_id": this.props.report_id,
"balance_sheet": data,
"status": "submitted"
}
api.create().validateSubmitReport(payload).then((response) => {
api.create().validateSubmitReportOLPA(payload).then((response) => {
console.log(response)
if (response.data.data.result) {
this.setState({ loading: false, buttonError: false, editable: false })
......@@ -451,7 +455,7 @@ export default class BalanceSheetOLPA extends Component {
let arrayFormula = tableMeta.rowData[3].match(/[a-zA-Z]+|[0-9]+|[-!$%^&*()_+|~=`{}\[\]:";'<>?,.\/]+(?:\.[0-9]+@|)/g)
let arrayJumlah = []
arrayFormula.map((item, indexs) => {
let index = dataTable2.findIndex((val) => val[19] == item)
let index = dataTable2.findIndex((val) => val[20] == item)
if (index > 0) {
arrayJumlah.push(dataTable2[index][tableMeta.columnIndex])
} else {
......@@ -496,7 +500,7 @@ export default class BalanceSheetOLPA extends Component {
let arrayFormula = tableMeta.rowData[3].match(/[a-zA-Z]+|[0-9]+|[-!$%^&*()_+|~=`{}\[\]:";'<>?,.\/]+(?:\.[0-9]+@|)/g)
let arrayJumlah = []
arrayFormula.map((item, indexs) => {
let index = dataTable2.findIndex((val) => val[19] == item)
let index = dataTable2.findIndex((val) => val[20] == item)
if (index > 0) {
arrayJumlah.push(dataTable2[index][tableMeta.columnIndex])
} else {
......@@ -703,7 +707,7 @@ export default class BalanceSheetOLPA extends Component {
null
:
tableMeta.rowData[0] === 7 ?
Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[20]).toFixed(1) ?
Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[21]).toFixed(1) ?
<NumberFormat
thousandSeparator={true}
style={{
......@@ -719,8 +723,8 @@ export default class BalanceSheetOLPA extends Component {
placeholder=""
disabled={true}
value={Number(handleValidation(value, tableMeta)).toFixed(1)}
/> : tableMeta.rowData[21] === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[20]}`} arrow>
/> : tableMeta.rowData[22] === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
......@@ -738,7 +742,7 @@ export default class BalanceSheetOLPA extends Component {
value={Number(handleValidation(value, tableMeta)).toFixed(1)}
/>
</LightTooltip> :
<LightTooltip title={`Value Should be ${tableMeta.rowData[20]}`} arrow>
<LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
......@@ -846,7 +850,7 @@ export default class BalanceSheetOLPA extends Component {
null
:
tableMeta.rowData[0] === 7 ?
Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[20]).toFixed(1) ?
Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[21]).toFixed(1) ?
<NumberFormat
thousandSeparator={true}
style={{
......@@ -862,8 +866,8 @@ export default class BalanceSheetOLPA extends Component {
placeholder=""
disabled={true}
value={Number(handleValidation(value, tableMeta)).toFixed(1)}
/> : tableMeta.rowData[21] === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[20]}`} arrow>
/> : tableMeta.rowData[22] === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
......@@ -881,7 +885,7 @@ export default class BalanceSheetOLPA extends Component {
value={Number(handleValidation(value, tableMeta)).toFixed(1)}
/>
</LightTooltip> :
<LightTooltip title={`Value Should be ${tableMeta.rowData[20]}`} arrow>
<LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
......@@ -989,7 +993,7 @@ export default class BalanceSheetOLPA extends Component {
null
:
tableMeta.rowData[0] === 7 ?
Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[20]).toFixed(1) ?
Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[21]).toFixed(1) ?
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1005,8 +1009,8 @@ export default class BalanceSheetOLPA extends Component {
placeholder=""
disabled={true}
value={Number(handleValidation(value, tableMeta)).toFixed(1)}
/> : tableMeta.rowData[21] === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[20]}`} arrow>
/> : tableMeta.rowData[22] === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1024,7 +1028,7 @@ export default class BalanceSheetOLPA extends Component {
value={Number(handleValidation(value, tableMeta)).toFixed(1)}
/>
</LightTooltip> :
<LightTooltip title={`Value Should be ${tableMeta.rowData[20]}`} arrow>
<LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1132,7 +1136,7 @@ export default class BalanceSheetOLPA extends Component {
null
:
tableMeta.rowData[0] === 7 ?
Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[20]).toFixed(1) ?
Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[21]).toFixed(1) ?
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1148,8 +1152,8 @@ export default class BalanceSheetOLPA extends Component {
placeholder=""
disabled={true}
value={Number(handleValidation(value, tableMeta)).toFixed(1)}
/> : tableMeta.rowData[21] === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[20]}`} arrow>
/> : tableMeta.rowData[22] === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1167,7 +1171,7 @@ export default class BalanceSheetOLPA extends Component {
value={Number(handleValidation(value, tableMeta)).toFixed(1)}
/>
</LightTooltip> :
<LightTooltip title={`Value Should be ${tableMeta.rowData[20]}`} arrow>
<LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1275,7 +1279,7 @@ export default class BalanceSheetOLPA extends Component {
null
:
tableMeta.rowData[0] === 7 ?
Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[20]).toFixed(1) ?
Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[21]).toFixed(1) ?
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1291,8 +1295,8 @@ export default class BalanceSheetOLPA extends Component {
placeholder=""
disabled={true}
value={Number(handleValidation(value, tableMeta)).toFixed(1)}
/> : tableMeta.rowData[21] === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[20]}`} arrow>
/> : tableMeta.rowData[22] === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1310,7 +1314,7 @@ export default class BalanceSheetOLPA extends Component {
value={Number(handleValidation(value, tableMeta)).toFixed(1)}
/>
</LightTooltip> :
<LightTooltip title={`Value Should be ${tableMeta.rowData[20]}`} arrow>
<LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1418,7 +1422,7 @@ export default class BalanceSheetOLPA extends Component {
null
:
tableMeta.rowData[0] === 7 ?
Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[20]).toFixed(1) ?
Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[21]).toFixed(1) ?
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1434,8 +1438,8 @@ export default class BalanceSheetOLPA extends Component {
placeholder=""
disabled={true}
value={Number(handleValidation(value, tableMeta)).toFixed(1)}
/> : tableMeta.rowData[21] === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[20]}`} arrow>
/> : tableMeta.rowData[22] === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1453,7 +1457,7 @@ export default class BalanceSheetOLPA extends Component {
value={Number(handleValidation(value, tableMeta)).toFixed(1)}
/>
</LightTooltip> :
<LightTooltip title={`Value Should be ${tableMeta.rowData[20]}`} arrow>
<LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1561,7 +1565,7 @@ export default class BalanceSheetOLPA extends Component {
null
:
tableMeta.rowData[0] === 7 ?
Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[20]).toFixed(1) ?
Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[21]).toFixed(1) ?
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1577,8 +1581,8 @@ export default class BalanceSheetOLPA extends Component {
placeholder=""
disabled={true}
value={Number(handleValidation(value, tableMeta)).toFixed(1)}
/> : tableMeta.rowData[21] === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[20]}`} arrow>
/> : tableMeta.rowData[22] === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1596,7 +1600,7 @@ export default class BalanceSheetOLPA extends Component {
value={Number(handleValidation(value, tableMeta)).toFixed(1)}
/>
</LightTooltip> :
<LightTooltip title={`Value Should be ${tableMeta.rowData[20]}`} arrow>
<LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1704,7 +1708,7 @@ export default class BalanceSheetOLPA extends Component {
null
:
tableMeta.rowData[0] === 7 ?
Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[20]).toFixed(1) ?
Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[21]).toFixed(1) ?
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1720,8 +1724,8 @@ export default class BalanceSheetOLPA extends Component {
placeholder=""
disabled={true}
value={Number(handleValidation(value, tableMeta)).toFixed(1)}
/> : tableMeta.rowData[21] === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[20]}`} arrow>
/> : tableMeta.rowData[22] === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1739,7 +1743,7 @@ export default class BalanceSheetOLPA extends Component {
value={Number(handleValidation(value, tableMeta)).toFixed(1)}
/>
</LightTooltip> :
<LightTooltip title={`Value Should be ${tableMeta.rowData[20]}`} arrow>
<LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1847,7 +1851,7 @@ export default class BalanceSheetOLPA extends Component {
null
:
tableMeta.rowData[0] === 7 ?
Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[20]).toFixed(1) ?
Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[21]).toFixed(1) ?
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1863,8 +1867,8 @@ export default class BalanceSheetOLPA extends Component {
placeholder=""
disabled={true}
value={Number(handleValidation(value, tableMeta)).toFixed(1)}
/> : tableMeta.rowData[21] === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[20]}`} arrow>
/> : tableMeta.rowData[22] === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1882,7 +1886,7 @@ export default class BalanceSheetOLPA extends Component {
value={Number(handleValidation(value, tableMeta)).toFixed(1)}
/>
</LightTooltip> :
<LightTooltip title={`Value Should be ${tableMeta.rowData[20]}`} arrow>
<LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
......@@ -1990,7 +1994,7 @@ export default class BalanceSheetOLPA extends Component {
null
:
tableMeta.rowData[0] === 7 ?
Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[20]).toFixed(1) ?
Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[21]).toFixed(1) ?
<NumberFormat
thousandSeparator={true}
style={{
......@@ -2006,8 +2010,8 @@ export default class BalanceSheetOLPA extends Component {
placeholder=""
disabled={true}
value={Number(handleValidation(value, tableMeta)).toFixed(1)}
/> : tableMeta.rowData[21] === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[20]}`} arrow>
/> : tableMeta.rowData[22] === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
......@@ -2025,7 +2029,7 @@ export default class BalanceSheetOLPA extends Component {
value={Number(handleValidation(value, tableMeta)).toFixed(1)}
/>
</LightTooltip> :
<LightTooltip title={`Value Should be ${tableMeta.rowData[20]}`} arrow>
<LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
......@@ -2133,7 +2137,7 @@ export default class BalanceSheetOLPA extends Component {
null
:
tableMeta.rowData[0] === 7 ?
Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[20]).toFixed(1) ?
Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[21]).toFixed(1) ?
<NumberFormat
thousandSeparator={true}
style={{
......@@ -2149,8 +2153,8 @@ export default class BalanceSheetOLPA extends Component {
placeholder=""
disabled={true}
value={Number(handleValidation(value, tableMeta)).toFixed(1)}
/> : tableMeta.rowData[21] === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[20]}`} arrow>
/> : tableMeta.rowData[22] === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
......@@ -2168,7 +2172,7 @@ export default class BalanceSheetOLPA extends Component {
value={Number(handleValidation(value, tableMeta)).toFixed(1)}
/>
</LightTooltip> :
<LightTooltip title={`Value Should be ${tableMeta.rowData[20]}`} arrow>
<LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
......@@ -2276,7 +2280,150 @@ export default class BalanceSheetOLPA extends Component {
null
:
tableMeta.rowData[0] === 7 ?
Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[20]).toFixed(1) ?
Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[21]).toFixed(1) ?
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValidation(value, tableMeta)).toFixed(1)}
/> : tableMeta.rowData[22] === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValidation(value, tableMeta)).toFixed(1)}
/>
</LightTooltip> :
<LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValidation(value, tableMeta)).toFixed(1)}
/>
</LightTooltip>
:
null
}
</div>
)
}
}
}, {
name: "Current Total",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96 }}>
<Typography style={{ color: 'black', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{tableMeta.rowData[0] === 3 ?
<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=""
disabled={this.props.isApprover == true ? 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)}
value={Number(value).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
}}
/>
}
/>
</div> :
tableMeta.rowData[0] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleValue(tableMeta)).toFixed(1)}
/>
</span>
:
tableMeta.rowData[0] === 4 ?
null
:
tableMeta.rowData[0] === 6 ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/>
:
tableMeta.rowData[0] === 5 ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleFormula(value, tableMeta)).toFixed(1)}
/>
:
tableMeta.rowData[0] === 1 ?
// value === "" ?
// null :
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(value)}
// />
null
:
tableMeta.rowData[0] === 7 ?
Number(handleValidation(value, tableMeta)).toFixed(1) === Number(tableMeta.rowData[21]).toFixed(1) ?
<NumberFormat
thousandSeparator={true}
style={{
......@@ -2292,8 +2439,8 @@ export default class BalanceSheetOLPA extends Component {
placeholder=""
disabled={true}
value={Number(handleValidation(value, tableMeta)).toFixed(1)}
/> : tableMeta.rowData[21] === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[20]}`} arrow>
/> : tableMeta.rowData[22] === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
......@@ -2311,7 +2458,7 @@ export default class BalanceSheetOLPA extends Component {
value={Number(handleValidation(value, tableMeta)).toFixed(1)}
/>
</LightTooltip> :
<LightTooltip title={`Value Should be ${tableMeta.rowData[20]}`} arrow>
<LightTooltip title={`Value Should be ${tableMeta.rowData[21]}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
......
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