Commit 1bb2be44 authored by faisalhamdi's avatar faisalhamdi

issue ro bs #2

parent 56a8fab8
...@@ -46,7 +46,7 @@ export default class BalanceSheetRO extends Component { ...@@ -46,7 +46,7 @@ export default class BalanceSheetRO extends Component {
dataTable: [], dataTable: [],
loading: true, loading: true,
get_for: "view", get_for: "view",
viewOnly : true, viewOnly: true,
updateBy: [], updateBy: [],
editable: false, editable: false,
handleTekTekTek: 0, handleTekTekTek: 0,
...@@ -298,7 +298,7 @@ export default class BalanceSheetRO extends Component { ...@@ -298,7 +298,7 @@ export default class BalanceSheetRO extends Component {
a.click(); a.click();
} }
setTimeout(() => { setTimeout(() => {
this.setState({loading: false}) this.setState({ loading: false })
}, 500); }, 500);
} }
...@@ -318,13 +318,13 @@ export default class BalanceSheetRO extends Component { ...@@ -318,13 +318,13 @@ export default class BalanceSheetRO extends Component {
a.click(); a.click();
} }
setTimeout(() => { setTimeout(() => {
this.setState({loading: false}) this.setState({ loading: false })
}, 500); }, 500);
} }
handleGetFor(type) { handleGetFor(type) {
console.log(type) console.log(type)
this.setState({get_for: type}, () => { this.setState({ get_for: type }, () => {
// this.getSettingControl() // this.getSettingControl()
this.getLatestUpdate() this.getLatestUpdate()
this.getItemHierarki() this.getItemHierarki()
...@@ -391,7 +391,7 @@ export default class BalanceSheetRO extends Component { ...@@ -391,7 +391,7 @@ export default class BalanceSheetRO extends Component {
let editAble = this.state.editAble let editAble = this.state.editAble
let dataTable = this.state.dataTable let dataTable = this.state.dataTable
let kansas = this.state.kansas let kansas = this.state.kansas
console.log(dataTable[dataTable.length-1]) console.log(dataTable[dataTable.length - 1])
// dataTable.map((i, index) => { // dataTable.map((i, index) => {
// if(i[0] === 3) { // if(i[0] === 3) {
// if ( i[18] === "" && (Number(i[14]) < this.state.minValue || Number(i[14]) > this.state.maxValue)) { // if ( i[18] === "" && (Number(i[14]) < this.state.minValue || Number(i[14]) > this.state.maxValue)) {
...@@ -894,7 +894,7 @@ export default class BalanceSheetRO extends Component { ...@@ -894,7 +894,7 @@ export default class BalanceSheetRO extends Component {
} }
} }
}, { }, {
name: `31 Dec ${Number(this.props.periode) - 1 } Actual`, name: `31 Dec ${Number(this.props.periode) - 1} Actual`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
<TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96, borderRight: '1px #fff solid' }}> <TableCell style={{ ...style2, top: 0, zIndex: 99, backgroundColor: '#1c71b8', width: 96, borderRight: '1px #fff solid' }}>
...@@ -1378,12 +1378,12 @@ export default class BalanceSheetRO extends Component { ...@@ -1378,12 +1378,12 @@ export default class BalanceSheetRO extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: this.props.quarter == 'q1'? "#5198ea" : '#555252', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.props.quarter == 'q1' ? "#5198ea" : '#555252', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1'? false : true} disabled={this.props.quarter == 'q1' ? false : true}
value={this.props.quarter == 'q2' || this.props.quarter == 'q3'? (val == ""? "" : Number(val).toFixed(1)) : Number(val).toFixed(1) } value={this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val == "" ? "" : Number(val).toFixed(1)) : Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
}} }}
...@@ -1403,7 +1403,7 @@ export default class BalanceSheetRO extends Component { ...@@ -1403,7 +1403,7 @@ export default class BalanceSheetRO extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.props.quarter == 'q2' || this.props.quarter == 'q3'? (val == ""? "" : Number(handleValueFormula(val, tableMeta)).toFixed(1)) : Number(handleValueFormula(val, tableMeta)).toFixed(1)} value={this.props.quarter == 'q2' || this.props.quarter == 'q3' ? (val == "" ? "" : Number(handleValueFormula(val, tableMeta)).toFixed(1)) : Number(handleValueFormula(val, tableMeta)).toFixed(1)}
/> />
} }
/> />
...@@ -1510,11 +1510,11 @@ export default class BalanceSheetRO extends Component { ...@@ -1510,11 +1510,11 @@ export default class BalanceSheetRO extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: this.props.quarter == 'q1'? "#5198ea" : '#555252', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.props.quarter == 'q1' ? "#5198ea" : '#555252', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1'? false : true} disabled={this.props.quarter == 'q1' ? false : true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1642,11 +1642,11 @@ export default class BalanceSheetRO extends Component { ...@@ -1642,11 +1642,11 @@ export default class BalanceSheetRO extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: this.props.quarter == 'q1'? "#5198ea" : '#555252', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.props.quarter == 'q1' ? "#5198ea" : '#555252', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1'? false : true} disabled={this.props.quarter == 'q1' ? false : true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1774,11 +1774,11 @@ export default class BalanceSheetRO extends Component { ...@@ -1774,11 +1774,11 @@ export default class BalanceSheetRO extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: this.props.quarter == 'q1' || this.props.quarter == 'q2'? "#5198ea" : '#555252', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.props.quarter == 'q1' || this.props.quarter == 'q2' ? "#5198ea" : '#555252', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2'? false : true} disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2' ? false : true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1906,11 +1906,11 @@ export default class BalanceSheetRO extends Component { ...@@ -1906,11 +1906,11 @@ export default class BalanceSheetRO extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: this.props.quarter == 'q1' || this.props.quarter == 'q2'? "#5198ea" : '#555252', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.props.quarter == 'q1' || this.props.quarter == 'q2' ? "#5198ea" : '#555252', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2'? false : true} disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2' ? false : true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -2038,11 +2038,11 @@ export default class BalanceSheetRO extends Component { ...@@ -2038,11 +2038,11 @@ export default class BalanceSheetRO extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: this.props.quarter == 'q1' || this.props.quarter == 'q2'? "#5198ea" : '#555252', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.props.quarter == 'q1' || this.props.quarter == 'q2' ? "#5198ea" : '#555252', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
// disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)} // disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2'? false : true} disabled={this.props.quarter == 'q1' || this.props.quarter == 'q2' ? false : true}
value={Number(val).toFixed(1)} value={Number(val).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -2707,7 +2707,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2707,7 +2707,7 @@ export default class BalanceSheetRO extends Component {
<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%' }}>
{this.props.isApprover === true || this.state.get_for == 'view'? {this.props.isApprover === true || this.state.get_for == 'view' ?
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}> <div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download'} data-for="download"> <a data-tip={'Download'} data-for="download">
<button <button
...@@ -2736,7 +2736,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2736,7 +2736,7 @@ export default class BalanceSheetRO extends Component {
borderColor: 'transparent', borderColor: 'transparent',
margin: 5 margin: 5
}} }}
onClick={() => this.setState({loading: true}, () => { onClick={() => this.setState({ loading: true }, () => {
this.downloadTemplate() this.downloadTemplate()
})} })}
> >
...@@ -2854,7 +2854,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2854,7 +2854,7 @@ export default class BalanceSheetRO extends Component {
// marginRight: 20 // marginRight: 20
}} }}
onClick={() => { onClick={() => {
this.setState({loading: true}, () => { this.setState({ loading: true }, () => {
this.handleGetFor('edit') this.handleGetFor('edit')
}) })
}} }}
...@@ -2947,7 +2947,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2947,7 +2947,7 @@ export default class BalanceSheetRO extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.periode} {String(this.props.quarter).toLocaleUpperCase()} (rev.{this.props.revision})</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.periode} {String(this.props.quarter).toLocaleUpperCase()} (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%' }} />
{/* </div> */} {/* </div> */}
</div> </div>
...@@ -2973,7 +2973,7 @@ export default class BalanceSheetRO extends Component { ...@@ -2973,7 +2973,7 @@ export default class BalanceSheetRO extends Component {
type="button" type="button"
onClick={() => this.setState({ loading: true }, () => { onClick={() => this.setState({ loading: true }, () => {
setTimeout(() => { setTimeout(() => {
this.setState({visibleBSRO: true, visibleUpload: false}, () => { this.setState({ visibleBSRO: true, visibleUpload: false }, () => {
this.handleGetFor('edit') this.handleGetFor('edit')
}) })
}, 100); }, 100);
......
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