Commit 8083f146 authored by Riri Novita's avatar Riri Novita

Setting Parameter

parent 8f1ec8c2
...@@ -221,6 +221,7 @@ export default class BalanceSheet extends Component { ...@@ -221,6 +221,7 @@ export default class BalanceSheet extends Component {
} }
} }
}) })
console.log(dataTable);
this.setState({ dataTable, loading: false, buttonError: true, editable: true }) this.setState({ dataTable, loading: false, buttonError: true, editable: true })
} else { } else {
this.setState({ dataTable, loading: false, buttonError: true, editable: true }) this.setState({ dataTable, loading: false, buttonError: true, editable: true })
......
...@@ -565,7 +565,6 @@ export default class FixedAssetsMovement extends Component { ...@@ -565,7 +565,6 @@ export default class FixedAssetsMovement extends Component {
if (Bfr !== undefined) { if (Bfr !== undefined) {
let data = 24 let data = 24
let period = Number(this.props.periode) - 1 let period = Number(this.props.periode) - 1
// console.log(dataTable2[tableMeta.rowIndex][data])
anjay.push(0) anjay.push(0)
let indexID = dataTable2[tableMeta.rowIndex][data].findIndex((val) => val.item_formula == String(`@${item}`) && val.periode == period) let indexID = dataTable2[tableMeta.rowIndex][data].findIndex((val) => val.item_formula == String(`@${item}`) && val.periode == period)
if (indexID !== -1) { if (indexID !== -1) {
...@@ -952,7 +951,8 @@ export default class FixedAssetsMovement extends Component { ...@@ -952,7 +951,8 @@ export default class FixedAssetsMovement extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleBfr(value, tableMeta)).toFixed(1)} value={Number(value).toFixed(1)}
// value={Number(handleBfr(value, tableMeta)).toFixed(1)}
/> />
} }
/> />
......
...@@ -13,6 +13,7 @@ export default class CreateParameter extends Component { ...@@ -13,6 +13,7 @@ export default class CreateParameter extends Component {
super(props) super(props)
this.state = { this.state = {
enableParameter: false, enableParameter: false,
enableReportName: false,
id: '', id: '',
description: '', description: '',
value: '', value: '',
...@@ -27,6 +28,8 @@ export default class CreateParameter extends Component { ...@@ -27,6 +28,8 @@ export default class CreateParameter extends Component {
types: null, types: null,
getTypes: null, getTypes: null,
perusahaan: null, perusahaan: null,
reportName: null,
getReportName: null,
getPerusahaan: null, getPerusahaan: null,
parameter: null, parameter: null,
getParameter: null, getParameter: null,
...@@ -67,6 +70,7 @@ export default class CreateParameter extends Component { ...@@ -67,6 +70,7 @@ export default class CreateParameter extends Component {
}) })
this.getDataGroup() this.getDataGroup()
this.getDataPerusahaan() this.getDataPerusahaan()
this.getDataReportName()
} }
} }
...@@ -109,7 +113,6 @@ export default class CreateParameter extends Component { ...@@ -109,7 +113,6 @@ export default class CreateParameter extends Component {
getAllGroup() { getAllGroup() {
api.create().getAllGroup().then(response => { api.create().getAllGroup().then(response => {
// console.log(response);
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status == 'success') { if (response.data.status == 'success') {
...@@ -265,6 +268,11 @@ export default class CreateParameter extends Component { ...@@ -265,6 +268,11 @@ export default class CreateParameter extends Component {
} }
getParameterByGroup(id) { getParameterByGroup(id) {
if (id === 13) {
this.setState({ enableReportName: true})
} else {
this.setState({ enableReportName: false})
}
api.create().getParameterByGroup(id).then(response => { api.create().getParameterByGroup(id).then(response => {
// console.log(id, response); // console.log(id, response);
if (response.data) { if (response.data) {
...@@ -302,6 +310,85 @@ export default class CreateParameter extends Component { ...@@ -302,6 +310,85 @@ export default class CreateParameter extends Component {
}) })
} }
getDataReportName() {
let reportData = [
{
"report_id": 12,
"report_name": "Master Budget"
},
{
"report_id": 16,
"report_name": "Monthly Report - Jan"
},
{
"report_id": 17,
"report_name": "Monthly Report - Feb"
},
{
"report_id": 18,
"report_name": "Monthly Report - Mar"
},
{
"report_id": 19,
"report_name": "Monthly Report - Apr"
},
{
"report_id": 20,
"report_name": "Monthly Report - May"
},
{
"report_id": 21,
"report_name": "Monthly Report - Jun"
},
{
"report_id": 22,
"report_name": "Monthly Report - Jul"
},
{
"report_id": 23,
"report_name": "Monthly Report - Aug"
},
{
"report_id": 24,
"report_name": "Monthly Report - Sep"
},
{
"report_id": 25,
"report_name": "Monthly Report - Oct"
},
{
"report_id": 26,
"report_name": "Monthly Report - Nov"
},
{
"report_id": 27,
"report_name": "Monthly Report - Dec"
},
{
"report_id": 13,
"report_name": "Rolling Outlook Q1"
},
{
"report_id": 14,
"report_name": "Rolling Outlook Q2"
},
{
"report_id": 16,
"report_name": "Rolling Outlook Q3"
},
{
"report_id": 11,
"report_name": "Operating Indicator"
}
]
let reportProps = {
options: reportData.sort((a, b) => a.report_id - b.report_id),
getOptionLabel: (option) => option.report_name,
};
this.setState({ reportName: reportProps })
}
handleChange(e, type) { handleChange(e, type) {
let data = this.state let data = this.state
let isDate = type !== '' ? true : false let isDate = type !== '' ? true : false
...@@ -1111,7 +1198,7 @@ export default class CreateParameter extends Component { ...@@ -1111,7 +1198,7 @@ export default class CreateParameter extends Component {
{...this.state.types} {...this.state.types}
debug debug
id="tipe" id="tipe"
onChange={(event, newInputValue) => this.setState({ getTypes: newInputValue }, () => newInputValue === null ? this.setState({ enableParameter: false, getParameter: null }, () => this.clearMessage()) : this.getParameterByGroup(newInputValue.setting_group_id), this.clearMessage())} onChange={(event, newInputValue) => this.setState({ getTypes: newInputValue }, () => newInputValue === null ? this.setState({ enableParameter: false, enableReportName: false, getParameter: null }, () => this.clearMessage()) : this.getParameterByGroup(newInputValue.setting_group_id), this.clearMessage())}
renderInput={(params) => renderInput={(params) =>
<TextField <TextField
{...params} {...params}
...@@ -1175,6 +1262,28 @@ export default class CreateParameter extends Component { ...@@ -1175,6 +1262,28 @@ export default class CreateParameter extends Component {
> >
</TextField> </TextField>
</div> </div>
{this.state.enableReportName &&
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<Autocomplete
{...this.state.reportName}
debug
id="report"
onChange={(event, newInputValue) => this.setState({ getReportName: newInputValue }, () => this.clearMessage())}
renderInput={(params) =>
<TextField
{...params}
InputProps={{ ...params.InputProps, style: { fontSize: 11 } }}
InputLabelProps={{ style: { fontSize: 11, color: '#7e8085' } }}
label="Report Name"
// error={this.state.errorPerusahaan}
// helperText={this.state.msgErrorPerusahaan}
/>}
value={this.state.getReportName}
/>
</div>
}
<div style={{ marginTop: '80px', padding: 10, borderRadius: 5 }}> <div style={{ marginTop: '80px', padding: 10, borderRadius: 5 }}>
<TextField <TextField
style={{ width: '100%' }} style={{ width: '100%' }}
......
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