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

Setting Parameter

parent 8f1ec8c2
......@@ -221,6 +221,7 @@ export default class BalanceSheet extends Component {
}
}
})
console.log(dataTable);
this.setState({ dataTable, loading: false, buttonError: true, editable: true })
} else {
this.setState({ dataTable, loading: false, buttonError: true, editable: true })
......
......@@ -565,7 +565,6 @@ export default class FixedAssetsMovement extends Component {
if (Bfr !== undefined) {
let data = 24
let period = Number(this.props.periode) - 1
// console.log(dataTable2[tableMeta.rowIndex][data])
anjay.push(0)
let indexID = dataTable2[tableMeta.rowIndex][data].findIndex((val) => val.item_formula == String(`@${item}`) && val.periode == period)
if (indexID !== -1) {
......@@ -952,7 +951,8 @@ export default class FixedAssetsMovement extends Component {
type="text"
placeholder=""
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 {
super(props)
this.state = {
enableParameter: false,
enableReportName: false,
id: '',
description: '',
value: '',
......@@ -27,6 +28,8 @@ export default class CreateParameter extends Component {
types: null,
getTypes: null,
perusahaan: null,
reportName: null,
getReportName: null,
getPerusahaan: null,
parameter: null,
getParameter: null,
......@@ -67,6 +70,7 @@ export default class CreateParameter extends Component {
})
this.getDataGroup()
this.getDataPerusahaan()
this.getDataReportName()
}
}
......@@ -109,7 +113,6 @@ export default class CreateParameter extends Component {
getAllGroup() {
api.create().getAllGroup().then(response => {
// console.log(response);
if (response.data) {
if (response.ok) {
if (response.data.status == 'success') {
......@@ -265,6 +268,11 @@ export default class CreateParameter extends Component {
}
getParameterByGroup(id) {
if (id === 13) {
this.setState({ enableReportName: true})
} else {
this.setState({ enableReportName: false})
}
api.create().getParameterByGroup(id).then(response => {
// console.log(id, response);
if (response.data) {
......@@ -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) {
let data = this.state
let isDate = type !== '' ? true : false
......@@ -1111,7 +1198,7 @@ export default class CreateParameter extends Component {
{...this.state.types}
debug
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) =>
<TextField
{...params}
......@@ -1175,6 +1262,28 @@ export default class CreateParameter extends Component {
>
</TextField>
</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 }}>
<TextField
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