Commit 33d1a35f authored by r.kurnia's avatar r.kurnia

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

parents 735f1791 16378b9f
...@@ -18,6 +18,7 @@ import MuiAlert from '@material-ui/lab/Alert'; ...@@ -18,6 +18,7 @@ import MuiAlert from '@material-ui/lab/Alert';
import Constant from '../library/Constant'; import Constant from '../library/Constant';
import OperatingIndicatorMR from './MonthlyReport/OperatingIndicatorMR'; import OperatingIndicatorMR from './MonthlyReport/OperatingIndicatorMR';
import CorporateAnnualTargetMR from './MonthlyReport/CorporateAnnualTargetMR'; import CorporateAnnualTargetMR from './MonthlyReport/CorporateAnnualTargetMR';
import CashFlowMR from './MonthlyReport/CashFlowMR';
var ct = require("../library/CustomTable"); var ct = require("../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable()); const getMuiTheme = () => createMuiTheme(ct.customTable());
...@@ -45,6 +46,7 @@ export default class MonthlyReport extends Component { ...@@ -45,6 +46,7 @@ export default class MonthlyReport extends Component {
visibleFAM: false, visibleFAM: false,
visibleCAT: false, visibleCAT: false,
visibleOI: false, visibleOI: false,
visibleCF: false,
listAttachment: [], listAttachment: [],
visibleUpload: false, visibleUpload: false,
lastRevision: 0, lastRevision: 0,
...@@ -471,7 +473,7 @@ export default class MonthlyReport extends Component { ...@@ -471,7 +473,7 @@ export default class MonthlyReport extends Component {
}) })
} }
saveToMonthlyReport(){ saveToMonthlyReport() {
this.setState({ this.setState({
visibleMonthlyReport: true, visibleMonthlyReport: true,
visibleBS: false, visibleBS: false,
...@@ -481,7 +483,7 @@ export default class MonthlyReport extends Component { ...@@ -481,7 +483,7 @@ export default class MonthlyReport extends Component {
visibleTP: false, visibleTP: false,
visibleLOCF: false, visibleLOCF: false,
visibleOI: false, visibleOI: false,
}, ()=> { }, () => {
this.getMonthlyReportID() this.getMonthlyReportID()
}) })
} }
...@@ -503,6 +505,7 @@ export default class MonthlyReport extends Component { ...@@ -503,6 +505,7 @@ export default class MonthlyReport extends Component {
visibleTP: false, visibleTP: false,
visibleLOCF: false, visibleLOCF: false,
visibleOI: false, visibleOI: false,
visibleCF: false,
}) })
} else if (item === 'Profit Loss') { } else if (item === 'Profit Loss') {
this.setState({ this.setState({
...@@ -514,6 +517,7 @@ export default class MonthlyReport extends Component { ...@@ -514,6 +517,7 @@ export default class MonthlyReport extends Component {
visibleTP: false, visibleTP: false,
visibleLOCF: false, visibleLOCF: false,
visibleOI: false, visibleOI: false,
visibleCF: false,
}) })
} else if (item === 'Tax Planning') { } else if (item === 'Tax Planning') {
this.setState({ this.setState({
...@@ -525,6 +529,7 @@ export default class MonthlyReport extends Component { ...@@ -525,6 +529,7 @@ export default class MonthlyReport extends Component {
visibleTP: true, visibleTP: true,
visibleLOCF: false, visibleLOCF: false,
visibleOI: false, visibleOI: false,
visibleCF: false,
}) })
} else if (item === 'Fixed Assets Movement') { } else if (item === 'Fixed Assets Movement') {
this.setState({ this.setState({
...@@ -547,6 +552,7 @@ export default class MonthlyReport extends Component { ...@@ -547,6 +552,7 @@ export default class MonthlyReport extends Component {
visibleTP: false, visibleTP: false,
visibleLOCF: false, visibleLOCF: false,
visibleOI: false, visibleOI: false,
visibleCF: false,
}) })
} else if (item === 'List of Credit Facilities') { } else if (item === 'List of Credit Facilities') {
this.setState({ this.setState({
...@@ -558,6 +564,7 @@ export default class MonthlyReport extends Component { ...@@ -558,6 +564,7 @@ export default class MonthlyReport extends Component {
visibleTP: false, visibleTP: false,
visibleLOCF: true, visibleLOCF: true,
visibleOI: false, visibleOI: false,
visibleCF: false,
}) })
} else if (item === 'Operating Indicator') { } else if (item === 'Operating Indicator') {
this.setState({ this.setState({
...@@ -569,6 +576,19 @@ export default class MonthlyReport extends Component { ...@@ -569,6 +576,19 @@ export default class MonthlyReport extends Component {
visibleTP: false, visibleTP: false,
visibleLOCF: false, visibleLOCF: false,
visibleOI: true, visibleOI: true,
visibleCF: false,
})
} else if (item === 'Cash Flow') {
this.setState({
visibleMonthlyReport: false,
visibleBS: false,
visiblePL: false,
visibleCAT: false,
visibleFAM: false,
visibleTP: false,
visibleLOCF: false,
visibleOI: false,
visibleCF: true,
}) })
} }
}) })
...@@ -645,7 +665,7 @@ export default class MonthlyReport extends Component { ...@@ -645,7 +665,7 @@ export default class MonthlyReport extends Component {
`https://tia.eksad.com/tia-reporting-dev/public/transaction/monthly_report/download_attachment?fileName=${fileurl}&&fileType=${fileType}` `https://tia.eksad.com/tia-reporting-dev/public/transaction/monthly_report/download_attachment?fileName=${fileurl}&&fileType=${fileType}`
) )
res = await res.blob() res = await res.blob()
this.setState({ loading: false }, ()=> { this.setState({ loading: false }, () => {
document.body.style.overflow = 'unset'; document.body.style.overflow = 'unset';
}) })
if (res.size > 0) { if (res.size > 0) {
...@@ -1151,6 +1171,21 @@ export default class MonthlyReport extends Component { ...@@ -1151,6 +1171,21 @@ export default class MonthlyReport extends Component {
onClickClose={() => this.setState({ visibleOI: false, visibleMonthlyReport: true })} onClickClose={() => this.setState({ visibleOI: false, visibleMonthlyReport: true })}
/> />
)} )}
{this.state.visibleCF && (
<CashFlowMR
open={this.props.open}
report_id={this.state.report_id}
height={this.props.height}
width={this.props.width}
company={this.state.company}
revision={this.state.revisionTable}
periode={this.state.periode.periode}
monthlyReportId={this.state.monthlyReportId}
month={this.state.month}
onClickClose={() => this.setState({ visibleCF: false, visibleMonthlyReport: true })}
/>
)}
</div > </div >
); );
} }
......
import { createMuiTheme, FormControlLabel, Input, MuiThemeProvider, Paper, TableCell, Tooltip, Typography, withStyles } from '@material-ui/core'
import MUIDataTable from 'mui-datatables';
import React, { Component } from 'react'
import ReactTooltip from 'react-tooltip';
import Images from '../../assets/Images';
import api from '../../api';
import NumberFormat from 'react-number-format';
import * as R from 'ramda';
import { PropagateLoader } from 'react-spinners';
import { ExcelRenderer } from 'react-excel-renderer';
import Constant from '../../library/Constant';
import UploadFile from "../../library/Upload";
const LightTooltip = withStyles((theme) => ({
tooltip: {
backgroundColor: theme.palette.common.white,
color: 'rgba(0, 0, 0, 0.87)',
boxShadow: theme.shadows[1],
fontSize: 11,
},
}))(Tooltip);
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 CashFlowMR extends Component {
constructor(props) {
super(props)
this.state = {
dataTable: [],
loading: false,
visibleCFMR: true,
// valueThreshold: 0,
minValue: 0,
maxValue: 0
}
}
render() {
let dataTable = [
["1", "2", "2", "2", "2", "2", "3"],
["1", "2", "2", "2", "2", "2", "3"],
]
let columns = [
{
name: "",
options: {
display: false
}
},
{
name: "",
options: {
display: false
}
},
{
name: "",
options: {
display: false
}
},
{
name: "",
options: {
display: false
}
},
{
name: "",
options: {
display: false
}
},
{
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 }}>
{tableMeta.rowData[0] === null ?
tableMeta.rowData[4] == 0 ?
<LightTooltip title={"Report Items Not Registered"} arrow>
<span style={{ fontSize: 12, fontWeight: 'bold', color: 'red' }}>{String(val).toUpperCase()}</span>
</LightTooltip> :
<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>
}
</div>
)
}
}
}, {
name: "Actual",
options: {
customHeadRender: (columnMeta) => (
// dataTable2.length > 0 ?
// <TableCell style={{ ...style2, top: 0, zIndex: 102, backgroundColor: '#1c71b8', width: 96 }}>
// <Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
// </TableCell> :
<TableCell style={{ ...style2, top: 0, zIndex: 102, backgroundColor: '#1c71b8', width: 96 }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
setCellProps: () => ({
style: {
position: "sticky",
background: "white",
zIndex: 101,
left: 350
}
}),
customBodyRender: (value, tableMeta, updateValue) => {
return (
<div style={{ textAlign: 'right' }}>
{value}
</div>
)
}
}
}
]
const loadingComponent = (
<div style={{ position: 'fixed', 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={{ height: this.props.height, backgroundColor: '#f8f8f8', marginBottom: 100, minHeight: 1000 }}>
{this.state.loading && loadingComponent}
<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 }}>
<div style={{ borderBottom: 'solid 1px #c4c4c4' }} >
<Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Monthly Report - Cash Flow</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'} data-for="download">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
margin: 5
}}
onClick={() =>
this.setState({ loading: true }, () => {
setTimeout(() => {
// this.downloadAllData()
}, 100);
})}
>
<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) }}>
{!this.state.loading && (
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
data={dataTable}
columns={columns}
options={options}
/>
</MuiThemeProvider>
)}
</div>
{/* {this.props.isApprover === true || this.state.dataTable.length == 0 ? null :
(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') ? */}
<div className="grid grid-2x" style={{ marginTop: 20 }}>
<div className="col-1">
<button
type="button"
onClick={() => this.setState({ loading: true }, () => {
setTimeout(() => {
this.props.onClickClose()
}, 100);
})}
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none'
}}
>
<div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography>
</div>
</button>
</div>
{/* <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button
className="button"
type="button"
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() => {
this.setState({ loading: true }, () => {
setTimeout(() => {
this.setState({ loading: false })
// this.handleValidate()
}, 100);
})
}}
>
<div style={{ backgroundColor: '#fff', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #354960' }}>
<Typography style={{ fontSize: '11px', color: '#354960', textAlign: 'center' }}>Calculate</Typography>
</div>
</button>
<button
className="button"
type="button"
style={{
backgroundColor: 'transparent',
cursor: this.state.saveDraft !== true ? 'pointer' : 'default',
borderColor: 'transparent',
outline: 'none',
marginRight: 20
}}
onClick={() =>
this.state.saveDraft === true ?
null :
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
this.backToMonthlyReport('draft')
})
}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
</div>
</button>
<button
type="button"
// disabled={this.state.buttonError}
onClick={() =>
this.state.buttonError ?
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' })
:
this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1 }, () => {
this.backToMonthlyReport('submitted')
})}
style={{
backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
borderColor: 'transparent',
outline: 'none',
}}
>
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</div>
</button>
</div> */}
</div>
{/* : null
} */}
</div>
</Paper>
</div>
</div>
);
}
}
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