Commit 1d44506a authored by Riri Novita's avatar Riri Novita

Merge branch 'dev/riri' into 'ENV-DEV'

Fixing Issue Prod (Angka RE Berubah)

See merge request !1792
parents 96579f3f 2f6783e7
...@@ -109,8 +109,9 @@ export default class BudgetTahunan extends Component { ...@@ -109,8 +109,9 @@ export default class BudgetTahunan extends Component {
document.body.style.overflow = 'hidden'; document.body.style.overflow = 'hidden';
}) })
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', lastPeriod: this.props.location.state.rawData.periode, rawData: this.props.location.state.rawData }, () => {
this.getPermission() this.getPermission()
// this.checkApprover() // this.checkApprover()
...@@ -188,10 +189,9 @@ export default class BudgetTahunan extends Component { ...@@ -188,10 +189,9 @@ export default class BudgetTahunan extends Component {
checkApprover() { checkApprover() {
api.create().checkApprover().then(response => { api.create().checkApprover().then(response => {
// console.log(response.data.data) console.log(response.data.data)
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
// // // console.log(response);
if (response.data.data.is_approver === true) { if (response.data.data.is_approver === true) {
this.setState({ truelyApprover: true, isApprover: true, permissionhandle: true, checkApprover: true }, () => { this.setState({ truelyApprover: true, isApprover: true, permissionhandle: true, checkApprover: true }, () => {
this.getPeriode() this.getPeriode()
...@@ -452,7 +452,7 @@ export default class BudgetTahunan extends Component { ...@@ -452,7 +452,7 @@ export default class BudgetTahunan extends Component {
getLastPeriod() { getLastPeriod() {
this.setState({ loading: false }) this.setState({ loading: false })
api.create().getLastPeriod(this.state.company.company_id).then(response => { api.create().getLastPeriod(this.state.company.company_id).then(response => {
// // console.log(response); // console.log(response);
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ lastPeriod: this.state.userType !== '' ? this.state.lastPeriod : response.data.data.last_periode, latestPeriode: response.data.data.latest_periode }, () => { this.setState({ lastPeriod: this.state.userType !== '' ? this.state.lastPeriod : response.data.data.last_periode, latestPeriode: response.data.data.latest_periode }, () => {
this.getPeriode() this.getPeriode()
...@@ -463,6 +463,7 @@ export default class BudgetTahunan extends Component { ...@@ -463,6 +463,7 @@ export default class BudgetTahunan extends Component {
getPeriode() { getPeriode() {
api.create().getPeriodeTransaction().then(response => { api.create().getPeriodeTransaction().then(response => {
console.log(response);
// let dateNow = new Date // let dateNow = new Date
// let year = this.state.rawData ? this.state.rawData.periode : format(dateNow, 'yyyy') // let year = this.state.rawData ? this.state.rawData.periode : format(dateNow, 'yyyy')
let currentYear = new Date().getFullYear() let currentYear = new Date().getFullYear()
...@@ -2876,27 +2877,51 @@ export default class BudgetTahunan extends Component { ...@@ -2876,27 +2877,51 @@ export default class BudgetTahunan extends Component {
<Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Master Budget</Typography> <Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Master Budget</Typography>
</div> </div>
<div style={{ padding: 20 }}> <div style={{ padding: 20 }}>
<div> <div style={{ display: "flex"}}>
<Autocomplete <div style={{ marginRight: 50}}>
{...this.state.listPeriode} <Autocomplete
id="periode" {...this.state.listPeriode}
onChange={(event, newInputValue) => this.setState({ periode: newInputValue }, () => { id="periode"
if (this.state.isApprover === true) { onChange={(event, newInputValue) => this.setState({ periode: newInputValue }, () => {
this.getCompanySubmitted() if (this.state.isApprover === true) {
} else { this.getCompanySubmitted()
this.setState({ visibleTableHistory: false }) } else {
this.getRevision() this.setState({ visibleTableHistory: false })
} this.getRevision()
})} }
disabled={this.state.intent === 'Home' ? true : false} })}
disableClearable disabled={this.state.intent === 'Home' ? true : false}
style={{ width: 250 }} disableClearable
renderInput={(params) => style={{ width: 250 }}
<TextField {...params} label="Period" margin="normal" style={{ marginTop: 7 }} renderInput={(params) =>
/>} <TextField {...params} label="Period" margin="normal" style={{ marginTop: 7 }}
value={this.state.periode} />}
/> value={this.state.periode}
/>
</div>
{/* <div>
<Autocomplete
{...this.state.listPeriode}
id="currency"
onChange={(event, newInputValue) => this.setState({ periode: newInputValue }, () => {
if (this.state.isApprover === true) {
this.getCompanySubmitted()
} else {
this.setState({ visibleTableHistory: false })
this.getRevision()
}
})}
disabled={this.state.intent === 'Home' ? true : false}
disableClearable
style={{ width: 250 }}
renderInput={(params) =>
<TextField {...params} label="Currency" margin="normal" style={{ marginTop: 7 }}
/>}
value={this.state.periode}
/>
</div> */}
</div> </div>
<div style={{ marginTop: 20 }}> <div style={{ marginTop: 20 }}>
<Autocomplete <Autocomplete
{...this.state.listCompany} {...this.state.listCompany}
......
...@@ -189,7 +189,8 @@ export default class BalanceSheetRO extends Component { ...@@ -189,7 +189,8 @@ export default class BalanceSheetRO extends Component {
"rolling_outlook_id": this.props.rollingOutlookID "rolling_outlook_id": this.props.rollingOutlookID
} }
api.create().getRollingOutlookBS(payload).then(response => { api.create().getRollingOutlookBS(payload).then(response => {
console.log(response); // console.log(response);
this.props.refresh()
let dataTable = [] let dataTable = []
if (response.data) { if (response.data) {
if (response.data.status == 'success') { if (response.data.status == 'success') {
...@@ -507,7 +508,7 @@ export default class BalanceSheetRO extends Component { ...@@ -507,7 +508,7 @@ export default class BalanceSheetRO extends Component {
checkUpload() { checkUpload() {
api.create().checkImportRollingOutlookBS(this.state.payload).then(response => { api.create().checkImportRollingOutlookBS(this.state.payload).then(response => {
// console.log(JSON.stringify(this.state.payload)); this.props.refresh()
console.log(response) console.log(response)
if (response.data) { if (response.data) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
......
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