Commit 5925a507 authored by rifkaki's avatar rifkaki

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

parents b6e6d884 985ad23a
...@@ -140,7 +140,7 @@ export default class BalanceSheet extends Component { ...@@ -140,7 +140,7 @@ export default class BalanceSheet extends Component {
"submission_id": this.props.submissionID "submission_id": this.props.submissionID
} }
let response = await api.create().getDetailReportMB(payload) let response = await api.create().getDetailReportMB(payload)
// console.log(response); console.log(response);
let dataTable = [] let dataTable = []
if (response.data) { if (response.data) {
let res = response.data.data let res = response.data.data
...@@ -535,20 +535,36 @@ export default class BalanceSheet extends Component { ...@@ -535,20 +535,36 @@ export default class BalanceSheet extends Component {
let dataTable2 = this.state.dataTable let dataTable2 = this.state.dataTable
const handleChange = (value, tableMeta, type) => { const handleChange = (value, tableMeta, type) => {
let val = String(value).split(",").join("") let val = String(value).split(",").join("")
// console.log('masuk')
if (type === "actual") { if (type === "actual") {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val).toFixed(1) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val).toFixed(1)
} else { } else {
// console.log('masuk2')
let indexParent = dataTable2.findIndex((val) => val[1] === dataTable2[tableMeta.rowIndex][2]) let indexParent = dataTable2.findIndex((val) => val[1] === dataTable2[tableMeta.rowIndex][2])
if (indexParent > 0) { if (indexParent > 0) {
// console.log(indexParent) // console.log(indexParent)
let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val) let a = 0
if (type == 'r/e') {
// console.log('masuk8')
a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].value = Number(val).toFixed(1)
} else {
// console.log('masuk9')
a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val).toFixed(1)
}
let jagain = dataTable2[indexParent][tableMeta.columnIndex] let jagain = dataTable2[indexParent][tableMeta.columnIndex]
a = dataTable2[indexParent][tableMeta.columnIndex] = jagain === undefined ? (0 + Number(val)).toFixed(1) : Number(jagain + Number(val)).toFixed(1) a = dataTable2[indexParent][tableMeta.columnIndex] = jagain === undefined ? (0 + Number(val)).toFixed(1) : Number(jagain + Number(val)).toFixed(1)
} else { } else {
// console.log('masuk3')
if (type == 'r/e') {
// console.log('masuk4')
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].value = Number(val).toFixed(1)
} else {
// console.log('masuk5')
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val).toFixed(1) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val).toFixed(1)
} }
} }
} }
}
const handleTotal = (tableMeta) => { const handleTotal = (tableMeta) => {
let total = dataTable2[tableMeta.rowIndex][19] = dataTable2[tableMeta.rowIndex][18] let total = dataTable2[tableMeta.rowIndex][19] = dataTable2[tableMeta.rowIndex][18]
return total return total
...@@ -577,7 +593,12 @@ export default class BalanceSheet extends Component { ...@@ -577,7 +593,12 @@ export default class BalanceSheet extends Component {
// console.log(tableMeta.rowIndex) // console.log(tableMeta.rowIndex)
// console.log(total) // console.log(total)
// dataTable2[tableMeta.rowIndex][column] = total // dataTable2[tableMeta.rowIndex][column] = total
if (column == 19 && String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)") {
total = tableMeta.rowData[7].value
dataTable2[tableMeta.rowIndex][column] = tableMeta.rowData[7].value
} else {
total = handleValueFormula(dataTable2[tableMeta.rowIndex][column], tableMeta, column, periode, dataTable2[tableMeta.rowIndex][25]) total = handleValueFormula(dataTable2[tableMeta.rowIndex][column], tableMeta, column, periode, dataTable2[tableMeta.rowIndex][25])
}
// console.log(total) // console.log(total)
return total return total
} }
...@@ -969,8 +990,12 @@ export default class BalanceSheet extends Component { ...@@ -969,8 +990,12 @@ export default class BalanceSheet extends Component {
style={{ color: String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" ? '#5198ea' : 'black', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" ? '#5198ea' : 'black', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? 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 : (String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" ? false : true))} disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
value={String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" ? Number(value.value).toFixed(1) : Number(handleValueFormula(value, tableMeta)).toFixed(1)} value={String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" ? Number(value.value).toFixed(1) : Number(handleValueFormula(value, tableMeta)).toFixed(1)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta, 'r/e')
// console.log(dataTable2)
}}
/> />
: :
tableMeta.rowData[0] === 5 ? tableMeta.rowData[0] === 5 ?
...@@ -979,8 +1004,12 @@ export default class BalanceSheet extends Component { ...@@ -979,8 +1004,12 @@ export default class BalanceSheet extends Component {
style={{ color: String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" ? '#5198ea' : 'black', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" ? '#5198ea' : 'black', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={this.props.isApprover == true ? 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 : (String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" ? false : true))} disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
value={String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" ? Number(value.value).toFixed(1) : Number(handleValueFormula(value, tableMeta)).toFixed(1)} value={String(tableMeta.rowData[5]).toLocaleLowerCase() == "r/e (cummulative)" ? Number(value.value).toFixed(1) : Number(handleValueFormula(value, tableMeta)).toFixed(1)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta, 'r/e')
// console.log(dataTable2)
}}
/> />
: :
tableMeta.rowData[0] === 1 ? tableMeta.rowData[0] === 1 ?
......
This diff is collapsed.
This diff is collapsed.
...@@ -38,6 +38,8 @@ export default class SubHolding extends Component { ...@@ -38,6 +38,8 @@ export default class SubHolding extends Component {
{ value: 7, label: 'Balance Sheet - Summary' }, { value: 7, label: 'Balance Sheet - Summary' },
{ value: 8, label: 'Profit Loss - Summary' }, { value: 8, label: 'Profit Loss - Summary' },
{ value: 9, label: 'Financial Ratio - Summary' }, { value: 9, label: 'Financial Ratio - Summary' },
{ value: 10, label: 'CAT Performance Quarterly' },
{ value: 11, label: 'CAT Performance Appraisal' },
], ],
report: null, report: null,
loading: false, loading: false,
...@@ -2378,6 +2380,16 @@ export default class SubHolding extends Component { ...@@ -2378,6 +2380,16 @@ export default class SubHolding extends Component {
}) })
}) })
}) })
} else if (this.state.report.value === 10) {
let dbCatPQ = [
["ABCD", "%", "Rp Bio", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18"]
]
this.setState({ dataTable: dbCatPQ, previewTable: true, loading: false, previewDownload: true })
} else if (this.state.report.value === 11) {
let dbCatPA = [
["ABCD", "%", "Rp Bio", "HIG", "Unlimited", "SUM", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18"]
]
this.setState({ dataTable: dbCatPA, previewTable: true, loading: false, previewDownload: true })
} }
} }
......
This diff is collapsed.
...@@ -2461,7 +2461,7 @@ export default class ListOfCreditFacilities extends Component { ...@@ -2461,7 +2461,7 @@ export default class ListOfCreditFacilities extends Component {
// </div> // </div>
: :
<div style={{ padding: 0, margin: 0 }}> <div style={{ padding: 0, margin: 0 }}>
<textarea disabled={this.state.get_for == 'view'} style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent:'center', padding: 0, margin: 0, color: this.state.get_for == 'view'? "black" : "#5198ea", backgroundColor: 'transparent' }} type="text" defaultValue={tableMeta.rowData[18]} <textarea disabled={this.state.get_for == 'view'? true : tableMeta.rowData[7] == null? true : tableMeta.rowData[7].value == 'Others'? false : true} style={{ borderColor: 'white', width: 96, textAlign: 'center', justifyContent:'center', padding: 0, margin: 0, color: this.state.get_for == 'view'? 'black' : tableMeta.rowData[7] == null? 'black' : tableMeta.rowData[7].value == 'Others'? '#5198ea' : 'black' , backgroundColor: this.state.get_for == 'view'? 'white' : tableMeta.rowData[7] == null? 'white' : (tableMeta.rowData[18] == '' && tableMeta.rowData[7].value == 'Others' ? '#ffac99' : 'white') }} type="text" defaultValue={tableMeta.rowData[18]}
onBlur={(event) => handleChange(event.target.value, tableMeta, 18)} /> onBlur={(event) => handleChange(event.target.value, tableMeta, 18)} />
</div> </div>
} }
......
...@@ -111,7 +111,7 @@ export default class SummaryOfTriputra extends Component { ...@@ -111,7 +111,7 @@ export default class SummaryOfTriputra extends Component {
let data = response.data.data let data = response.data.data
let monthData = data.map((item) => { let monthData = data.map((item) => {
return { return {
month_id: item.month_id, month_id: item.id,
month_name: item.month_name month_name: item.month_name
} }
}) })
......
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