Commit b90c9b5c authored by Deni Rinaldi's avatar Deni Rinaldi

PL

parent 04b283c5
...@@ -697,7 +697,7 @@ export default class ProfitLoss extends Component { ...@@ -697,7 +697,7 @@ export default class ProfitLoss extends Component {
]) ])
} }
}) })
console.log(dataTable); // console.log(dataTable);
this.setState({ dataTable, loading: false }) this.setState({ dataTable, loading: false })
} }
} else { } else {
...@@ -792,6 +792,16 @@ export default class ProfitLoss extends Component { ...@@ -792,6 +792,16 @@ export default class ProfitLoss extends Component {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(val)
} }
} }
const handleNotes = (value, tableMeta) => {
let indexParent = dataTable2.findIndex((val) => val[1] == dataTable2[tableMeta.rowIndex][2])
if (indexParent > 0) {
// console.log(indexParent)
let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = value
} else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = value
}
}
const handleValue = (data) => { const handleValue = (data) => {
let total = 0 let total = 0
dataTable2.map((item, index) => { dataTable2.map((item, index) => {
...@@ -865,6 +875,7 @@ export default class ProfitLoss extends Component { ...@@ -865,6 +875,7 @@ export default class ProfitLoss extends Component {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
{tableMeta.rowData[4] !== 0 || tableMeta.rowData[4] !== 1 ?
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={value} value={value}
...@@ -877,12 +888,12 @@ export default class ProfitLoss extends Component { ...@@ -877,12 +888,12 @@ export default class ProfitLoss extends Component {
value={value} value={value}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleNotes(event.target.value, tableMeta)
console.log(dataTable2) console.log(dataTable2)
}} }}
/> />
} }
/> /> : null}
</div> </div>
</div> </div>
) )
...@@ -2065,14 +2076,14 @@ export default class ProfitLoss extends Component { ...@@ -2065,14 +2076,14 @@ export default class ProfitLoss extends Component {
<Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Budget Tahunan - Profit & Loss</Typography> <Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Budget Tahunan - Profit & Loss</Typography>
</div> </div>
<div style={{ padding: 20 }}> <div style={{ padding: 20 }}>
<div style={{ display: 'flex', justifyContent: 'space-between'}}> <div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div> <div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Periode : {this.props.periode}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Periode : {this.props.periode}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div> </div>
<div style={{ width: '50%'}}> <div style={{ width: '50%' }}>
<div style={{justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}> <div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download Template'} data-for="template"> <a data-tip={'Download Template'} data-for="template">
<button <button
style={{ style={{
......
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