Commit 201b8414 authored by EKSAD's avatar EKSAD

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

parents a368618e f6f26ae6
...@@ -6,6 +6,7 @@ import ReactTooltip from 'react-tooltip'; ...@@ -6,6 +6,7 @@ import ReactTooltip from 'react-tooltip';
import api from '../../api'; import api from '../../api';
import Images from '../../assets/Images'; import Images from '../../assets/Images';
import * as R from 'ramda' import * as R from 'ramda'
import { PropagateLoader } from 'react-spinners';
var ct = require("../../library/CustomTable"); var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable3()); const getMuiTheme = () => createMuiTheme(ct.customTable3());
...@@ -35,7 +36,8 @@ export default class CashFlow extends Component { ...@@ -35,7 +36,8 @@ export default class CashFlow extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
dataTable: [] dataTable: [],
loading: false
} }
} }
...@@ -142,22 +144,19 @@ export default class CashFlow extends Component { ...@@ -142,22 +144,19 @@ export default class CashFlow extends Component {
// console.log(url); // console.log(url);
let resReal = `https://tia.eksad.com/tia-reporting-dev/public/transaction/cash_flow/export_master_budget?submission_id=${this.props.submissionID}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}&&report_id=${this.props.report_id}` let resReal = `https://tia.eksad.com/tia-reporting-dev/public/transaction/cash_flow/export_master_budget?submission_id=${this.props.submissionID}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}&&report_id=${this.props.report_id}`
let resNull = `https://tia.eksad.com/tia-reporting-dev/public/transaction/cash_flow/export_master_budget?submission_id=&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}&&report_id=${this.props.report_id}` let resNull = `https://tia.eksad.com/tia-reporting-dev/public/transaction/cash_flow/export_master_budget?submission_id=&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}&&report_id=${this.props.report_id}`
if (this.props.submissionID == null) {
console.log(resNull)
} else {
console.log(resReal)
}
let res = await fetch( let res = await fetch(
this.props.submissionID == null ? resNull : resReal this.props.submissionID == null ? resNull : resReal
) )
res = await res.blob() res = await res.blob()
this.setState({ loading: false })
if (res.size > 0) { if (res.size > 0) {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
let a = document.createElement('a'); let a = document.createElement('a');
a.href = url; a.href = url;
a.download = 'Master Budget Cash Flow.xlsx'; a.download = 'Master Budget Cash Flow.xlsx';
a.click(); a.click();
this.setState({loading: false})
} else {
this.setState({loading: false})
} }
} }
...@@ -2143,6 +2142,18 @@ export default class CashFlow extends Component { ...@@ -2143,6 +2142,18 @@ export default class CashFlow extends Component {
} }
}, },
] ]
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 ( return (
<div style={{ height: this.props.height, backgroundColor: '#f8f8f8', marginBottom: 100, minHeight: 1000 }}> <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 }}> <div className={"main-color"} style={{ height: 78, flex: 1, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
...@@ -2170,7 +2181,12 @@ export default class CashFlow extends Component { ...@@ -2170,7 +2181,12 @@ export default class CashFlow extends Component {
borderColor: 'transparent', borderColor: 'transparent',
margin: 5 margin: 5
}} }}
onClick={() => this.downloadAllData()} onClick={() => this.setState({ loading: true }, () => {
this.downloadAllData()
// setTimeout(() => {
// this.setState({loading: false})
// }, 500);
})}
> >
<img src={Images.download} /> <img src={Images.download} />
</button> </button>
...@@ -2181,13 +2197,14 @@ export default class CashFlow extends Component { ...@@ -2181,13 +2197,14 @@ export default class CashFlow extends Component {
</div> </div>
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}> <div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
{!this.state.loading && <MuiThemeProvider theme={getMuiTheme()}> {this.state.loading && loadingComponent}
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable <MUIDataTable
data={dataTable2} data={dataTable2}
columns={columns} columns={columns}
options={options} options={options}
/> />
</MuiThemeProvider>} </MuiThemeProvider>
</div> </div>
</div> </div>
</Paper> </Paper>
......
...@@ -90,6 +90,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -90,6 +90,7 @@ export default class CorporateAnnualTarget extends Component {
this.getKPIType() this.getKPIType()
this.getMaxAch() this.getMaxAch()
this.getLatestUpdate() this.getLatestUpdate()
// console.log(this.props.status)
// // console.log(this.props.lastStatus); // // console.log(this.props.lastStatus);
} }
...@@ -1119,7 +1120,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -1119,7 +1120,7 @@ export default class CorporateAnnualTarget extends Component {
setCellProps: () => ({ style }), setCellProps: () => ({ style }),
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
tableMeta.rowData[1] == "" ? handleAction(tableMeta.rowData[2], tableMeta.rowData[0], tableMeta) && (tableMeta.rowData[1] == "" || String(this.props.status).toLocaleLowerCase() == 'draft' || String(this.props.status).toLocaleLowerCase() == 'submitted' || String(this.props.status).toLocaleLowerCase() == 'revision')?
<div style={{ textAlign: 'left', paddingLeft: 20 * Number(tableMeta.rowData[4]) }}> <div style={{ textAlign: 'left', paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
{!this.state.loading && <FormControlLabel {!this.state.loading && <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
......
This diff is collapsed.
...@@ -291,7 +291,6 @@ export default class SubHolding extends Component { ...@@ -291,7 +291,6 @@ export default class SubHolding extends Component {
item.formula, item.formula,
item.level, item.level,
item.description, item.description,
item.profit_loss.notes === "" ? null : item.profit_loss.notes,
item.profit_loss.total_actual_before === null ? "0" : item.profit_loss.total_actual_before === "" ? "0" : item.profit_loss.total_actual_before, item.profit_loss.total_actual_before === null ? "0" : item.profit_loss.total_actual_before === "" ? "0" : item.profit_loss.total_actual_before,
item.profit_loss.january, item.profit_loss.january,
item.profit_loss.february, item.profit_loss.february,
...@@ -327,7 +326,6 @@ export default class SubHolding extends Component { ...@@ -327,7 +326,6 @@ export default class SubHolding extends Component {
item.formula, item.formula,
item.level, item.level,
item.description, item.description,
item.profit_loss.notes === "" ? null : item.profit_loss.notes,
item.profit_loss.total_actual_before === null ? "0" : item.profit_loss.total_actual_before === "" ? "0" : item.profit_loss.total_actual_before, item.profit_loss.total_actual_before === null ? "0" : item.profit_loss.total_actual_before === "" ? "0" : item.profit_loss.total_actual_before,
item.profit_loss.january, item.profit_loss.january,
item.profit_loss.february, item.profit_loss.february,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -13,6 +13,7 @@ import UploadFile from "../library/Upload"; ...@@ -13,6 +13,7 @@ import UploadFile from "../library/Upload";
import { format } from 'date-fns'; import { format } from 'date-fns';
import BalanceSheetMR from './MonthlyReport/BalanceSheetMR'; import BalanceSheetMR from './MonthlyReport/BalanceSheetMR';
import ProfitLossMR from './MonthlyReport/ProfitLossMR'; import ProfitLossMR from './MonthlyReport/ProfitLossMR';
import TaxPlanningMR from './MonthlyReport/TaxPlanningMR';
export default class MonthlyReport extends Component { export default class MonthlyReport extends Component {
constructor(props) { constructor(props) {
...@@ -545,9 +546,18 @@ export default class MonthlyReport extends Component { ...@@ -545,9 +546,18 @@ export default class MonthlyReport extends Component {
)} )}
{this.state.visibleTP && ( {this.state.visibleTP && (
<TaxPlanning <TaxPlanning
open={this.props.open}
report_id={this.state.report_id} report_id={this.state.report_id}
height={this.props.height}
width={this.props.width}
company={this.state.company} company={this.state.company}
onClickClose={() => this.setState({ visibleTP: false, visibleMonthlyReport: true })} revision={this.state.revisionTable}
periode={this.state.periode.periode}
submissionID={this.state.submissionID}
// saveToMasterBudget={this.saveToMasterBudget.bind(this)}
onClickClose={() => this.setState({ visibleTP: false, visibleBudgetTahunan: true })}
// getReport={this.getCompanyActive.bind(this)}
// onClickClose={() => this.setState({ visibleTP: false, visibleMonthlyReport: true })}
/> />
)} )}
{this.state.visibleFAM && ( {this.state.visibleFAM && (
......
...@@ -39,7 +39,7 @@ const style2 = { ...@@ -39,7 +39,7 @@ const style2 = {
top: 0 top: 0
}; };
export default class TaxPlanning extends Component { export default class TaxPlanningMR extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
......
...@@ -1989,7 +1989,7 @@ export default class BalanceSheet extends Component { ...@@ -1989,7 +1989,7 @@ export default class BalanceSheet extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div> </div>
{this.state.dataLoaded && ( {this.state.dataLoaded && (
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150), height: this.props.height - 400 }}> <div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150)}}>
{this.state.loading && loadingComponent} {this.state.loading && loadingComponent}
<MuiThemeProvider theme={getMuiTheme()}> <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable <MUIDataTable
......
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