Commit 4faf9bbd authored by Deni Rinaldi's avatar Deni Rinaldi

Merge branch 'deni-dev(pc)' into 'master'

PL

See merge request !281
parents 04b283c5 b90c9b5c
...@@ -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) => {
...@@ -864,26 +874,27 @@ export default class ProfitLoss extends Component { ...@@ -864,26 +874,27 @@ export default class ProfitLoss extends Component {
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
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}
control={ control={
<Input <Input
disableUnderline={true} disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
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