Commit 0e5d1f9b authored by Riri Novita's avatar Riri Novita

Merge branch 'riri' into 'master'

dah lanjut besok

See merge request !838
parents 355bb086 a0a7d1f0
......@@ -427,7 +427,7 @@ export default class CashFlowMR extends Component {
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.company.company_name}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.periode} (rev.{this.props.revision})</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.month.month_value} {this.props.periode} (rev.{this.props.revision})</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div>
<div style={{ width: '50%' }}>
......
......@@ -255,9 +255,27 @@ export default class ProfitLossMR extends Component {
}
}
})
this.setState({ dataTable, loading: false, buttonError: true, saveDraft: true })
this.setState({ dataTable, loading: false, buttonError: true, saveDraft: true, bebas: true })
}
console.log(dataTable);
let err = false
dataTable.map((item, index) => {
if (item[19] == "" && Number(item[14]) < this.state.minValue || Number(item[14]) > this.state.maxValue) {
err = true
}
if (item[20] == "" && Number(item[16]) < this.state.minValue || Number(item[16]) > this.state.maxValue) {
err = true
}
if (item[21] == "" && Number(item[18]) < this.state.minValue || Number(item[18]) > this.state.maxValue) {
err = true
}
})
if (err === true) {
this.setState({ bebas: true })
}
})
}
......@@ -524,17 +542,17 @@ export default class ProfitLossMR extends Component {
"mtd_vs_rb": i[21]
})
})
// console.log(JSON.stringify(data));
console.log(data);
data.map(i => {
if (i.mtd_vs_previous_month === "" && (Number(i.percent_act_vs_previous_month) < this.state.minValue || Number(i.percent_act_vs_previous_month) > this.state.maxValue)) {
console.log('msk 1');
console.log(i);
// console.log('msk 1');
// console.log(i);
err = true
} else if (i.mtd_vs_mb === "" && (Number(i.percent_act_vs_mb) < this.state.minValue || Number(i.percent_act_vs_mb) > this.state.maxValue)) {
console.log('msk 2');
// console.log('msk 2');
err = true
} else if (i.mtd_vs_rb === "" && (Number(i.percent_act_vs_rb) < this.state.minValue || Number(i.percent_act_vs_rb) > this.state.maxValue)) {
console.log('msk 3');
// console.log('msk 3');
err = true
}
})
......@@ -608,7 +626,7 @@ export default class ProfitLossMR extends Component {
const handleText = (value, tableMeta, type) => {
// dataTable2[tableMeta.rowIndex][type] = value
let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = value
console.log(dataTable2);
// console.log(dataTable2);
// console.log(dataTable2[tableMeta.rowIndex]);
}
const handleChange = (value, tableMeta, type) => {
......@@ -1602,7 +1620,7 @@ export default class ProfitLossMR extends Component {
type="text"
placeholder=""
disabled={false}
value={tableMeta.rowData[19]}
// value={tableMeta.rowData[19]}
defaultValue={tableMeta.rowData[19]}
inputProps={{
style: {
......@@ -1670,25 +1688,26 @@ export default class ProfitLossMR extends Component {
handleText(event.target.value, tableMeta, 1)
}}
/>
</LightTooltipError> :
<Input
disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
// disabled={Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? false : true}
// value={tableMeta.rowData[20]}
defaultValue={tableMeta.rowData[20]}
inputProps={{
style: {
color: Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? "#5198ea" : '#5198ea',
textAlign: 'right'
}
}}
onBlur={(event) => {
handleText(event.target.value, tableMeta, 1)
}}
/>
</LightTooltipError>
:
<Input
disableUnderline={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
// disabled={Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? false : true}
// value={tableMeta.rowData[20]}
defaultValue={tableMeta.rowData[20]}
inputProps={{
style: {
color: Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? "#5198ea" : '#5198ea',
textAlign: 'right'
}
}}
onBlur={(event) => {
handleText(event.target.value, tableMeta, 1)
}}
/>
}
/>}
</div>
......@@ -1715,18 +1734,19 @@ export default class ProfitLossMR extends Component {
inputProps={{
style: {
color: "#5198ea",
textAlign: 'right',
backgroundColor: '#ffac99'
textAlign: 'right',
backgroundColor: '#ffac99'
}
}}
onBlur={(event) => {
handleText(event.target.value, tableMeta, 2)
}}
/>
</LightTooltipError> :
</LightTooltipError>
:
<Input
disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
// disabled={Number(tableMeta.rowData[18]) < this.state.minValue || Number(tableMeta.rowData[18]) > this.state.maxValue ? false : true}
......@@ -1734,7 +1754,7 @@ export default class ProfitLossMR extends Component {
defaultValue={tableMeta.rowData[21]}
inputProps={{
style: {
color: Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? "#5198ea" : '#5198ea',
color: Number(tableMeta.rowData[18]) < this.state.minValue || Number(tableMeta.rowData[18]) > this.state.maxValue ? "#5198ea" : '#5198ea',
textAlign: 'right'
}
}}
......
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