Commit 0e135d8d authored by d.arizona's avatar d.arizona

push dulu

parent d43bf08e
......@@ -97,6 +97,7 @@ export default class CorporateAnnualTargetMR extends Component {
api.create().getParameterByGroupName({
"group_name" : 'ACHIEVEMENT_KPI'
}).then((response) => {
console.log(response.data.data)
if (response.data) {
this.setState({parameterScore: response.data.data})
}
......@@ -160,6 +161,8 @@ export default class CorporateAnnualTargetMR extends Component {
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
if (indexIDzz === -1) {
let parentTrue = item.parent_name == 'INTERNAL BUSINESS PROCESS PERSPECTIVE' || item.parent_name == 'CUSTOMER PERSPECTIVE'
let weight = String(item.corporate_annual_target.weight).substr(0,String(item.corporate_annual_target.weight).length-1)
console.log(weight)
dataTable.push([
item.type_report_id,
item.id,
......@@ -167,7 +170,7 @@ export default class CorporateAnnualTargetMR extends Component {
item.formula,
item.level,
item.description,
item.corporate_annual_target.weight == ""? "0%" : item.corporate_annual_target.weight,
item.corporate_annual_target.weight == ""? Number(0).toFixed(1) : Number(weight).toFixed(1),
parentTrue ? item.corporate_annual_target.uom : item.uom,
parentTrue ? item.corporate_annual_target.jenis_kpi == "" ? null : item.corporate_annual_target.jenis_kpi : item.jenis_kpi == "" ? null : item.kpi_type,
// parentTrue ? item.corporate_annual_target.kpi_type == "" ? null : { value: item.corporate_annual_target.kpi_type } : item.kpi_type == "" ? null : { value: item.kpi_type },
......@@ -201,7 +204,7 @@ export default class CorporateAnnualTargetMR extends Component {
item.formula,
item.level,
item.description,
item.type_report_id == 1 ? `${Number(item.weight) * 100}%` : item.weight,
item.weight == ''? Number(0).toFixed(1) : Number(Number(item.weight) * 100).toFixed(1),
item.uom,
item.kpi_type == "" ? null : item.kpi_type,
// item.kpi_type == "" ? null : { value: item.kpi_type },
......@@ -1044,15 +1047,25 @@ export default class CorporateAnnualTargetMR extends Component {
let parameterAch = String(tableMeta.rowData[9]).includes('%')? `MAX${String(tableMeta.rowData[9]).substr(0,String(tableMeta.rowData[9]).length - 1)}` : String(tableMeta.rowData[9])
let parameterMix = `${parameterKpi}_${parameterAch}`
let listParameterFilter = listParameter.filter((val) => val.setting_type == String(parameterMix).toLocaleUpperCase())
let listParameterFilterCompany = listParameterFilter.filter((val) => val.company_id == this.props.company.company_id)
let totalScore = 0
let achx100 = Number(tableMeta.rowData[13])/100
let achx100 = tableMeta.rowData[9] == '100%'? 1 : Number(tableMeta.rowData[13])/100
if (listParameterFilterCompany.length == 0) {
listParameterFilter.map((item,index) => {
if (Number(achx100) >= Number(item.min_value) && Number(achx100) <= Number(item.max_value)) {
totalScore = Number(item.value)
}
})
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(totalScore).toFixed(1)
return Number(totalScore).toFixed(1)
} else {
listParameterFilterCompany.map((item,index) => {
if (Number(achx100) >= Number(item.min_value) && Number(achx100) <= Number(item.max_value)) {
totalScore = Number(item.value)
}
})
}
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(totalScore).toFixed(0)
return Number(totalScore).toFixed(0)
}
const handleTotal = (tableMeta) => {
......@@ -1196,7 +1209,7 @@ export default class CorporateAnnualTargetMR extends Component {
type="text"
placeholder=""
suffix={"%"}
value={Number(value).toFixed(1)}
value={value}
disabled={true}
// disabled={this.props.isApprover ? true : ((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') ? false : true)}
decimalScale={1}
......@@ -1404,6 +1417,7 @@ export default class CorporateAnnualTargetMR extends Component {
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
suffix={"%"}
value={handleAchiement(tableMeta).toFixed(1)}
decimalScale={1}
disabled={true}
......@@ -1442,7 +1456,7 @@ export default class CorporateAnnualTargetMR extends Component {
:
<FormControlLabel
style={{ margin: 0 }}
value={Number(value).toFixed(1)}
value={Number(value).toFixed(0)}
control={
<NumberFormat
thousandSeparator={true}
......@@ -1450,7 +1464,7 @@ export default class CorporateAnnualTargetMR extends Component {
type="text"
placeholder=""
value={handleScore(tableMeta)}
decimalScale={1}
decimalScale={0}
disabled={true}
// onBlur={(event) => {
// // updateValue(event.target.value)
......@@ -1495,7 +1509,7 @@ export default class CorporateAnnualTargetMR extends Component {
style={{ color: "black", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={handleTotal(tableMeta).toFixed(1)}
value={handleTotal(tableMeta).toFixed(2)}
decimalScale={2}
disabled={true}
/>
......
......@@ -405,42 +405,42 @@ export default class ListOfCreditFacilities extends Component {
payload.push({
"item_report_id": i[1],
"borrower_comp_name": this.props.company.company_name,
"bank_name": i[3],
"type_of_credit": i[4],
"remarks": i[5],
"loan_maturity_date": i[6],
"interest": i[7],
"currency": i[8],
"loan_plafond_amount_ori": i[9],
"loan_plafond_amount_idr": i[10],
"out_loan_ki_amount_ori": i[11],
"out_loan_ki_amount_idr": i[12],
"out_loan_kmk_amount_ori": i[13],
"out_loan_kmk_amount_idr": i[14],
"out_loan_other_type": i[15],
"out_loan_other_amount_ori": i[16],
"out_loan_other_amount_idr": i[17],
"bank_name": i[2],
"type_of_credit": i[3],
"remarks": i[4],
"loan_maturity_date": i[5],
"interest": i[6],
"currency": i[7],
"loan_plafond_amount_ori": i[8],
"loan_plafond_amount_idr": i[9],
"out_loan_ki_amount_ori": i[10],
"out_loan_ki_amount_idr": i[11],
"out_loan_kmk_amount_ori": i[12],
"out_loan_kmk_amount_idr": i[13],
"out_loan_other_type": i[14],
"out_loan_other_amount_ori": i[15],
"out_loan_other_amount_idr": i[16],
// "total_out_loan_ori": i[18],
// "total_out_loan_idr": i[19],
// "remaining_plafond_ori": i[20],
// "remaining_plafond_idr": i[21],
"current_ratio_financial": i[18],
"der_financial": i[19],
"debt_to_ebitda_financial": i[20],
"ebitda_to_interest_financial": i[21],
"other_ratio1_ratio_name": i[22],
"other_ratio1_financial": i[23],
"other_ratio1_current": i[24],
"other_ratio2_ratio_name": i[25],
"other_ratio2_financial": i[27],
"other_ratio2_current": i[28],
"other_ratio3_ratio_name": i[29],
"other_ratio3_financial": i[30],
"other_ratio3_current": i[31],
"other_ratio4_ratio_name": i[32],
"other_ratio4_financial": i[33],
"other_ratio4_current": i[34],
"notes": i[35],
"current_ratio_financial": i[17],
"der_financial": i[18],
"debt_to_ebitda_financial": i[19],
"ebitda_to_interest_financial": i[20],
"other_ratio1_ratio_name": i[21],
"other_ratio1_financial": i[22],
"other_ratio1_current": i[23],
"other_ratio2_ratio_name": i[24],
"other_ratio2_financial": i[25],
"other_ratio2_current": i[26],
"other_ratio3_ratio_name": i[27],
"other_ratio3_financial": i[28],
"other_ratio3_current": i[29],
"other_ratio4_ratio_name": i[30],
"other_ratio4_financial": i[31],
"other_ratio4_current": i[32],
"notes": i[33],
})
}
})
......@@ -874,7 +874,7 @@ export default class ListOfCreditFacilities extends Component {
api.create().getPerBSiMontlyReportLOCF(payload).then((response) => {
console.log(response)
if (response.data.status == "success") {
this.setState({perBS: response.data.data.per_bs == null || response.data.data.per_bs == ''? 0.0 : Number(response.data.data.per_bs).toFixed(1)})
this.setState({perBS: response.data.data.per_bs == null || response.data.data.per_bs == ''? Number(0).toFixed(1) : Number(response.data.data.per_bs).toFixed(1)})
}
})
}
......@@ -3061,22 +3061,25 @@ export default class ListOfCreditFacilities extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 8 || tableMeta.rowData[0] === 9?
null :
<div style={{ flex: 1 }}>
<ThemeProvider theme={theme}>
<Input
disableUnderline={true}
style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }}
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[34]}
fixedDecimalScale={2}
decimalScale={2}
value={Number(tableMeta.rowData[34]).toFixed(2)}
onBlur={(event) => {
// // // console.log(event.target.value)
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 34)
// // // console.log(dataTable2)
handleChange(event.target.value, tableMeta, 31)
}}
/>
</ThemeProvider>
}
/>
</div>
}
</div>
......@@ -3174,22 +3177,25 @@ export default class ListOfCreditFacilities extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 8 || tableMeta.rowData[0] === 9?
null :
<div style={{ flex: 1 }}>
<ThemeProvider theme={theme}>
<Input
disableUnderline={true}
style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }}
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[37]}
fixedDecimalScale={2}
decimalScale={2}
value={Number(tableMeta.rowData[37]).toFixed(2)}
onBlur={(event) => {
// // // console.log(event.target.value)
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 37)
// // // console.log(dataTable2)
}}
/>
</ThemeProvider>
}
/>
</div>
}
</div>
......@@ -3287,22 +3293,25 @@ export default class ListOfCreditFacilities extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 8 || tableMeta.rowData[0] === 9?
null :
<div style={{ flex: 1 }}>
<ThemeProvider theme={theme}>
<Input
disableUnderline={true}
style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }}
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[40]}
fixedDecimalScale={2}
decimalScale={2}
value={Number(tableMeta.rowData[40]).toFixed(2)}
onBlur={(event) => {
// // // console.log(event.target.value)
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 40)
// // // console.log(dataTable2)
}}
/>
</ThemeProvider>
}
/>
</div>
}
</div>
......@@ -3400,22 +3409,25 @@ export default class ListOfCreditFacilities extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 8 || tableMeta.rowData[0] === 9?
null :
<div style={{ flex: 1 }}>
<ThemeProvider theme={theme}>
<Input
disableUnderline={true}
style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'center', borderColor: 'transparent', margin: 0, backgroundColor: 'transparent', marginBottom: -105 }}
<FormControlLabel
style={{ margin: 0 }}
value={val}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={this.state.get_for == 'view'}
defaultValue={tableMeta.rowData[43]}
fixedDecimalScale={2}
decimalScale={2}
value={Number(tableMeta.rowData[43]).toFixed(2)}
onBlur={(event) => {
// // // console.log(event.target.value)
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 43)
// // // console.log(dataTable2)
}}
/>
</ThemeProvider>
}
/>
</div>
}
</div>
......@@ -3457,7 +3469,7 @@ export default class ListOfCreditFacilities extends Component {
name: "Notes",
options: {
customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96, borderRight: '1px #fff solid' }}>
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#37b5e6', width: 96, height: 43, borderRight: '1px #fff solid' }}>
<Typography style={{ color: 'white', fontSize: 12, fontWeight: 'bold', textAlign: 'center' }}>{columnMeta.name}</Typography>
</TableCell>
),
......@@ -3762,7 +3774,7 @@ export default class ListOfCreditFacilities extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Diff</Typography>
</div>
<div style={{borderStyle: 'solid', borderWidth: '0px 1px 1px 1px', padding: 5, minWidth: 200, display: 'flex', justifyContent: 'flex-end'}}>
<Typography style={{ fontSize: '11px', color: Number(this.state.diff) > 0? '#ffac99' :'#4b4b4b' }}>{formatSeparator(this.state.diff)}</Typography>
<Typography style={{ fontSize: '11px', color: Number(this.state.diff) > 0? 'red' :'#4b4b4b' }}>{formatSeparator(this.state.diff)}</Typography>
</div>
</div>
</div>
......@@ -3955,7 +3967,7 @@ export default class ListOfCreditFacilities extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Diff</Typography>
</div>
<div style={{borderStyle: 'solid', borderWidth: '0px 1px 1px 1px', padding: 5, minWidth: 200, display: 'flex', justifyContent: 'flex-end'}}>
<Typography style={{ fontSize: '11px', color: Number(this.state.diff) > 0? '#ffac99' :'#4b4b4b' }}>{formatSeparator(this.state.diff)}</Typography>
<Typography style={{ fontSize: '11px', color: Number(this.state.diff) > 0? 'red' :'#4b4b4b' }}>{formatSeparator(this.state.diff)}</Typography>
</div>
</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