Commit 0b262a12 authored by Deni Rinaldi's avatar Deni Rinaldi

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

dah

See merge request !481
parents ca756d49 5b11b9d7
...@@ -79,7 +79,7 @@ export default class BudgetTahunan extends Component { ...@@ -79,7 +79,7 @@ export default class BudgetTahunan extends Component {
this.props.selectIndex('Master Budget & CAT') this.props.selectIndex('Master Budget & CAT')
if (this.props.location.state !== undefined) { if (this.props.location.state !== undefined) {
console.log(this.props); console.log(this.props);
this.setState({ userType: this.props.location.state.userType, intent: 'Home', lastPeriod: this.props.location.state.rawData.periode, rawData: this.props.location.state.rawData }, () => { this.setState({ userType: this.props.location.state.userType, intent: 'Home', latestPeriode: this.props.location.state.rawData.periode, rawData: this.props.location.state.rawData }, () => {
this.checkApprover() this.checkApprover()
}) })
} else { } else {
...@@ -318,9 +318,10 @@ export default class BudgetTahunan extends Component { ...@@ -318,9 +318,10 @@ export default class BudgetTahunan extends Component {
options: periodeData, options: periodeData,
getOptionLabel: (option) => option.periode, getOptionLabel: (option) => option.periode,
}; };
let index = data.sort((a, b) => a - b).findIndex((val) => val === (this.state.latestPeriode == "" ? String(Number(currentYear) + 1) : this.state.latestPeriode)) let periode = (this.state.latestPeriode == "" ? String(Number(currentYear) + 1) : this.state.latestPeriode)
let index = data.sort((a, b) => a - b).findIndex((val) => val === periode)
// console.log(data) // console.log(data)
console.log(this.state.lastPeriod) console.log(this.state.latestPeriode)
// console.log(periodeData) // console.log(periodeData)
// console.log(index) // console.log(index)
this.setState({ listPeriode: defaultProps, periode: index === -1 ? periodeData[0] : periodeData[index] }, () => { this.setState({ listPeriode: defaultProps, periode: index === -1 ? periodeData[0] : periodeData[index] }, () => {
...@@ -662,7 +663,7 @@ export default class BudgetTahunan extends Component { ...@@ -662,7 +663,7 @@ export default class BudgetTahunan extends Component {
validateRevision() { validateRevision() {
let arrayRevisi = this.state.detailRevisiCheck let arrayRevisi = this.state.detailRevisiCheck
let remarksKosong = 0 let remarksKosong = 0
arrayRevisi.map((item,index) => { arrayRevisi.map((item, index) => {
if (item.remarks == "") { if (item.remarks == "") {
remarksKosong += 1 remarksKosong += 1
} }
...@@ -677,7 +678,7 @@ export default class BudgetTahunan extends Component { ...@@ -677,7 +678,7 @@ export default class BudgetTahunan extends Component {
render() { render() {
const handleMaxDate = () => { const handleMaxDate = () => {
let handleDate = Number(moment(this.state.maxDateRevision).format('YYYYMMDD')) - Number(moment(this.state.minDateRevision).format('YYYYMMDD')) let handleDate = Number(moment(this.state.maxDateRevision).format('YYYYMMDD')) - Number(moment(this.state.minDateRevision).format('YYYYMMDD'))
return handleDate < 0? moment(this.state.minDateRevision).format('YYYY/MM/DD') : moment(this.state.maxDateRevision).format('YYYY/MM/DD') return handleDate < 0 ? moment(this.state.minDateRevision).format('YYYY/MM/DD') : moment(this.state.maxDateRevision).format('YYYY/MM/DD')
} }
const columns = ["#", "Report Type", const columns = ["#", "Report Type",
{ {
...@@ -1075,6 +1076,9 @@ export default class BudgetTahunan extends Component { ...@@ -1075,6 +1076,9 @@ export default class BudgetTahunan extends Component {
</div> : this.state.lastStatus === 'WAITING FOR YOUR APPROVAL' ? </div> : this.state.lastStatus === 'WAITING FOR YOUR APPROVAL' ?
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}> <div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<span>{this.state.lastStatus}</span> <span>{this.state.lastStatus}</span>
</div> : this.state.lastStatus === 'WAITING FOR APPROVAL' ?
<div style={{ width: '100%', padding: '10px 20px', backgroundColor: 'yellow', textAlign: 'center', marginTop: 20 }}>
<span>{`${this.state.lastStatus} - ${this.state.pic}`}</span>
</div> : null </div> : null
: :
this.state.lastStatus === 'SUBMITTED' ? this.state.lastStatus === 'SUBMITTED' ?
...@@ -1246,7 +1250,7 @@ export default class BudgetTahunan extends Component { ...@@ -1246,7 +1250,7 @@ export default class BudgetTahunan extends Component {
getReport={this.getSubmission.bind(this)} getReport={this.getSubmission.bind(this)}
isApprover={this.state.isApprover} isApprover={this.state.isApprover}
lastStatus={this.state.lastStatus} lastStatus={this.state.lastStatus}
prevRevision={this.state.isSubmit? this.state.prevRevision : true} prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
status={this.state.status} status={this.state.status}
/> />
)} )}
...@@ -1266,7 +1270,7 @@ export default class BudgetTahunan extends Component { ...@@ -1266,7 +1270,7 @@ export default class BudgetTahunan extends Component {
status={this.state.status} status={this.state.status}
isApprover={this.state.isApprover} isApprover={this.state.isApprover}
lastStatus={this.state.lastStatus} lastStatus={this.state.lastStatus}
prevRevision={this.state.isSubmit? this.state.prevRevision : true} prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
/> />
)} )}
{this.state.visibleTP && ( {this.state.visibleTP && (
...@@ -1285,7 +1289,7 @@ export default class BudgetTahunan extends Component { ...@@ -1285,7 +1289,7 @@ export default class BudgetTahunan extends Component {
status={this.state.status} status={this.state.status}
isApprover={this.state.isApprover} isApprover={this.state.isApprover}
lastStatus={this.state.lastStatus} lastStatus={this.state.lastStatus}
prevRevision={this.state.isSubmit? this.state.prevRevision : true} prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
/> />
)} )}
{this.state.visibleFAM && ( {this.state.visibleFAM && (
...@@ -1304,7 +1308,7 @@ export default class BudgetTahunan extends Component { ...@@ -1304,7 +1308,7 @@ export default class BudgetTahunan extends Component {
status={this.state.status} status={this.state.status}
isApprover={this.state.isApprover} isApprover={this.state.isApprover}
lastStatus={this.state.lastStatus} lastStatus={this.state.lastStatus}
prevRevision={this.state.isSubmit? this.state.prevRevision : true} prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
/> />
)} )}
{this.state.visibleCAT && ( {this.state.visibleCAT && (
...@@ -1323,7 +1327,7 @@ export default class BudgetTahunan extends Component { ...@@ -1323,7 +1327,7 @@ export default class BudgetTahunan extends Component {
isApprover={this.state.isApprover} isApprover={this.state.isApprover}
status={this.state.status} status={this.state.status}
lastStatus={this.state.lastStatus} lastStatus={this.state.lastStatus}
prevRevision={this.state.isSubmit? this.state.prevRevision : true} prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
/> />
)} )}
{this.state.visibleCF && ( {this.state.visibleCF && (
...@@ -1339,7 +1343,7 @@ export default class BudgetTahunan extends Component { ...@@ -1339,7 +1343,7 @@ export default class BudgetTahunan extends Component {
saveToMasterBudget={this.saveToMasterBudget.bind(this)} saveToMasterBudget={this.saveToMasterBudget.bind(this)}
onClickClose={() => this.setState({ visibleCF: false, visibleBudgetTahunan: true })} onClickClose={() => this.setState({ visibleCF: false, visibleBudgetTahunan: true })}
getReport={this.getSubmission.bind(this)} getReport={this.getSubmission.bind(this)}
prevRevision={this.state.isSubmit? this.state.prevRevision : true} prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
/> />
)} )}
...@@ -1382,7 +1386,7 @@ export default class BudgetTahunan extends Component { ...@@ -1382,7 +1386,7 @@ export default class BudgetTahunan extends Component {
id="startDate" id="startDate"
label="Valid From" label="Valid From"
format="dd-MM-yyyy" format="dd-MM-yyyy"
onChange={(e) => this.setState({minDateRevision: moment(e).format('YYYY/MM/DD')}, () => this.setState({maxDateRevision: handleMaxDate()}))} onChange={(e) => this.setState({ minDateRevision: moment(e).format('YYYY/MM/DD') }, () => this.setState({ maxDateRevision: handleMaxDate() }))}
value={moment(this.state.minDateRevision).format('YYYY/MM/DD')} value={moment(this.state.minDateRevision).format('YYYY/MM/DD')}
KeyboardButtonProps={{ KeyboardButtonProps={{
'aria-label': 'change date', 'aria-label': 'change date',
...@@ -1409,7 +1413,7 @@ export default class BudgetTahunan extends Component { ...@@ -1409,7 +1413,7 @@ export default class BudgetTahunan extends Component {
id="startDate" id="startDate"
label="Valid To" label="Valid To"
format="dd-MM-yyyy" format="dd-MM-yyyy"
onChange={(e) => this.setState({maxDateRevision: moment(e).format('YYYY/MM/DD')})} onChange={(e) => this.setState({ maxDateRevision: moment(e).format('YYYY/MM/DD') })}
minDate={moment(this.state.minDateRevision).format('YYYY/MM/DD')} minDate={moment(this.state.minDateRevision).format('YYYY/MM/DD')}
value={moment(this.state.maxDateRevision).format('YYYY/MM/DD')} value={moment(this.state.maxDateRevision).format('YYYY/MM/DD')}
KeyboardButtonProps={{ KeyboardButtonProps={{
......
...@@ -2880,7 +2880,28 @@ export default class BalanceSheet extends Component { ...@@ -2880,7 +2880,28 @@ export default class BalanceSheet 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.dataTable.length == 0 ? null : {this.state.dataTable.length == 0 ? null : this.props.isApprover == true ?
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download'} data-for="download">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
margin: 5
}}
onClick={() =>
this.setState({ loading: true }, () => {
setTimeout(() => {
this.downloadAllData()
}, 100);
})}
>
<img src={Images.download} />
</button>
</a>
<ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
</div> :
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}> <div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
{((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted')) && ( {((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted')) && (
<div> <div>
......
This diff is collapsed.
This diff is collapsed.
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