import React, { Component } from "react";
import { createMuiTheme, FormControlLabel, Input, MuiThemeProvider, TableCell, Typography } from "@material-ui/core";
import MUIDataTable from "mui-datatables";
var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable4());
const options = ct.customOptionsFixedColumnMonitoring();
const style = {
position: "sticky",
left: 0,
zIndex: 101,
background: "white",
};
const style2 = {
position: "sticky",
background: "white",
zIndex: 100,
};
export default class TableProgressReport extends Component {
constructor(props) {
super(props)
this.state = {
}
}
render() {
let dataTable2 = this.props.dataTable;
// console.log(this.props);
const handleValue = (tableMeta, itemName) => {
let value = tableMeta.rowData[1].filter((val) => val.report_name == itemName)
// console.log(itemName)
// console.log(tableMeta.rowData)
// console.log(value)
return value[0].status_report == null || value[0].status_report == '' ? 'N/A' : value[0].status_report
}
const columnMB = [
{
name: "Company",
options: {
customHeadRender: (columnMeta) => (
{columnMeta.name}
),
setCellProps: () => ({ style }),
customBodyRender: (val, tableMeta) => {
return
{val}
;
},
},
},
{
name: `INPUT MASTER BUDGET`,
options: {
customHeadRender: (columnMeta) => (
{columnMeta.name}
{"Profit Loss"}
{"Tax Planning"}
{"Balance Sheet"}
{"Fixed Assets Movement"}
{"Cash Flow"}
{"CAT"}
{"Submission Status"}
{"Operating Indicator"}
|
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
return (
{handleValue(tableMeta, 'Profit Loss')}
{handleValue(tableMeta, 'Tax Planning')}
{handleValue(tableMeta, 'Balance Sheet')}
{handleValue(tableMeta, 'Fixed Assets Movement')}
{handleValue(tableMeta, 'Cash Flow')}
{handleValue(tableMeta, 'CAT')}
{handleValue(tableMeta, 'Submission Status')}
{handleValue(tableMeta, 'Operating Indicator')}
)
},
},
}
];
const columnMR = [
{
name: "Company",
options: {
customHeadRender: (columnMeta) => (
{columnMeta.name}
),
setCellProps: () => ({ style }),
customBodyRender: (val, tableMeta) => {
return {val}
;
},
},
},
{
name: `INPUT MONTHLY REPORT`,
options: {
customHeadRender: (columnMeta) => (
{columnMeta.name}
{"Profit Loss"}
{"Tax Planning"}
{"Balance Sheet"}
{"Fixed Assets Movement"}
{"LOCF"}
{"Cash Flow"}
{"CAT"}
{"Monthly Status"}
{"Operating Indicator"}
|
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
return (
{handleValue(tableMeta, 'Profit Loss')}
{handleValue(tableMeta, 'Profit Loss')}
{handleValue(tableMeta, 'Balance Sheet')}
{handleValue(tableMeta, 'Fixed Assets Movement')}
{handleValue(tableMeta, 'List of Credit Facilities')}
{handleValue(tableMeta, 'Cash Flow')}
{handleValue(tableMeta, 'CAT')}
{handleValue(tableMeta, 'Monthly Status')}
{handleValue(tableMeta, 'Operating Indicator')}
)
},
},
}
];
const columnRO = [
{
name: "Company",
options: {
customHeadRender: (columnMeta) => (
{columnMeta.name}
),
setCellProps: () => ({ style }),
customBodyRender: (val, tableMeta) => {
return {val}
;
},
},
},
{
name: `INPUT ROLLING OUTLOOK`,
options: {
customHeadRender: (columnMeta) => (
{columnMeta.name}
{"Profit Loss"}
{"Tax Planning"}
{"Balance Sheet"}
{"Cash Flow"}
{"CAT"}
{"Rolling Status"}
{"Operating Indicator"}
|
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
return (
{handleValue(tableMeta, 'Profit Loss')}
{handleValue(tableMeta, 'Profit Loss')}
{handleValue(tableMeta, 'Balance Sheet')}
{handleValue(tableMeta, 'Cash Flow')}
{handleValue(tableMeta, 'CAT')}
{handleValue(tableMeta, 'Rolling Status')}
{handleValue(tableMeta, 'Operating Indicator')}
)
},
},
}
];
const columnOLPA = [
{
name: "Company",
options: {
customHeadRender: (columnMeta) => (
{columnMeta.name}
),
setCellProps: () => ({ style }),
customBodyRender: (val, tableMeta) => {
return {val}
;
},
},
},
{
name: `INPUT OUTLOOK PA`,
options: {
customHeadRender: (columnMeta) => (
{columnMeta.name}
{"Profit Loss"}
{"Tax Planning"}
{"Balance Sheet"}
{"Cash Flow"}
{"CAT"}
{"OLPA Status"}
{/*
{"Operating Indicator"}
*/}
|
),
setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => {
return (
{handleValue(tableMeta, 'Profit Loss')}
{handleValue(tableMeta, 'Tax Planning')}
{handleValue(tableMeta, 'Balance Sheet')}
{handleValue(tableMeta, 'Cash Flow')}
{handleValue(tableMeta, 'CAT')}
{handleValue(tableMeta, 'OLPA Status')}
{/*
{handleValue(tableMeta, 'Operating Indicator')}
*/}
)
},
},
}
];
return (
);
}
}