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 { ...@@ -427,7 +427,7 @@ export default class CashFlowMR extends Component {
<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' }}>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> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div> </div>
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
......
...@@ -255,9 +255,27 @@ export default class ProfitLossMR extends Component { ...@@ -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); 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 { ...@@ -524,17 +542,17 @@ export default class ProfitLossMR extends Component {
"mtd_vs_rb": i[21] "mtd_vs_rb": i[21]
}) })
}) })
// console.log(JSON.stringify(data)); console.log(data);
data.map(i => { 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)) { 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('msk 1');
console.log(i); // console.log(i);
err = true 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)) { } 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 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)) { } 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 err = true
} }
}) })
...@@ -608,7 +626,7 @@ export default class ProfitLossMR extends Component { ...@@ -608,7 +626,7 @@ export default class ProfitLossMR extends Component {
const handleText = (value, tableMeta, type) => { const handleText = (value, tableMeta, type) => {
// dataTable2[tableMeta.rowIndex][type] = value // dataTable2[tableMeta.rowIndex][type] = value
let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = value let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = value
console.log(dataTable2); // console.log(dataTable2);
// console.log(dataTable2[tableMeta.rowIndex]); // console.log(dataTable2[tableMeta.rowIndex]);
} }
const handleChange = (value, tableMeta, type) => { const handleChange = (value, tableMeta, type) => {
...@@ -1602,7 +1620,7 @@ export default class ProfitLossMR extends Component { ...@@ -1602,7 +1620,7 @@ export default class ProfitLossMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={false}
value={tableMeta.rowData[19]} // value={tableMeta.rowData[19]}
defaultValue={tableMeta.rowData[19]} defaultValue={tableMeta.rowData[19]}
inputProps={{ inputProps={{
style: { style: {
...@@ -1670,10 +1688,11 @@ export default class ProfitLossMR extends Component { ...@@ -1670,10 +1688,11 @@ export default class ProfitLossMR extends Component {
handleText(event.target.value, tableMeta, 1) handleText(event.target.value, tableMeta, 1)
}} }}
/> />
</LightTooltipError> : </LightTooltipError>
:
<Input <Input
disableUnderline={true} 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" type="text"
placeholder="" placeholder=""
// disabled={Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? false : true} // disabled={Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? false : true}
...@@ -1681,7 +1700,7 @@ export default class ProfitLossMR extends Component { ...@@ -1681,7 +1700,7 @@ export default class ProfitLossMR extends Component {
defaultValue={tableMeta.rowData[20]} defaultValue={tableMeta.rowData[20]}
inputProps={{ inputProps={{
style: { style: {
color: Number(tableMeta.rowData[14]) < this.state.minValue || Number(tableMeta.rowData[14]) > this.state.maxValue ? "#5198ea" : '#5198ea', color: Number(tableMeta.rowData[16]) < this.state.minValue || Number(tableMeta.rowData[16]) > this.state.maxValue ? "#5198ea" : '#5198ea',
textAlign: 'right' textAlign: 'right'
} }
}} }}
...@@ -1723,10 +1742,11 @@ export default class ProfitLossMR extends Component { ...@@ -1723,10 +1742,11 @@ export default class ProfitLossMR extends Component {
handleText(event.target.value, tableMeta, 2) handleText(event.target.value, tableMeta, 2)
}} }}
/> />
</LightTooltipError> : </LightTooltipError>
:
<Input <Input
disableUnderline={true} 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" type="text"
placeholder="" placeholder=""
// disabled={Number(tableMeta.rowData[18]) < this.state.minValue || Number(tableMeta.rowData[18]) > this.state.maxValue ? false : true} // 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 { ...@@ -1734,7 +1754,7 @@ export default class ProfitLossMR extends Component {
defaultValue={tableMeta.rowData[21]} defaultValue={tableMeta.rowData[21]}
inputProps={{ inputProps={{
style: { 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' 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