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 {
document.body.style.overflow = 'hidden';
})
this.props.selectIndex('Master Budget & CAT')
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.getPermission()
// this.checkApprover()
......@@ -188,10 +189,9 @@ export default class BudgetTahunan extends Component {
checkApprover() {
api.create().checkApprover().then(response => {
// console.log(response.data.data)
console.log(response.data.data)
if (response.data) {
if (response.data.status === "success") {
// // // console.log(response);
if (response.data.data.is_approver === true) {
this.setState({ truelyApprover: true, isApprover: true, permissionhandle: true, checkApprover: true }, () => {
this.getPeriode()
......@@ -452,7 +452,7 @@ export default class BudgetTahunan extends Component {
getLastPeriod() {
this.setState({ loading: false })
api.create().getLastPeriod(this.state.company.company_id).then(response => {
// // console.log(response);
// console.log(response);
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.getPeriode()
......@@ -463,6 +463,7 @@ export default class BudgetTahunan extends Component {
getPeriode() {
api.create().getPeriodeTransaction().then(response => {
console.log(response);
// let dateNow = new Date
// let year = this.state.rawData ? this.state.rawData.periode : format(dateNow, 'yyyy')
let currentYear = new Date().getFullYear()
......@@ -2876,27 +2877,51 @@ export default class BudgetTahunan extends Component {
<Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Master Budget</Typography>
</div>
<div style={{ padding: 20 }}>
<div>
<Autocomplete
{...this.state.listPeriode}
id="periode"
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="Period" margin="normal" style={{ marginTop: 7 }}
/>}
value={this.state.periode}
/>
<div style={{ display: "flex"}}>
<div style={{ marginRight: 50}}>
<Autocomplete
{...this.state.listPeriode}
id="periode"
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="Period" margin="normal" style={{ marginTop: 7 }}
/>}
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 style={{ marginTop: 20 }}>
<Autocomplete
{...this.state.listCompany}
......
......@@ -189,7 +189,8 @@ export default class BalanceSheetRO extends Component {
"rolling_outlook_id": this.props.rollingOutlookID
}
api.create().getRollingOutlookBS(payload).then(response => {
console.log(response);
// console.log(response);
this.props.refresh()
let dataTable = []
if (response.data) {
if (response.data.status == 'success') {
......@@ -507,7 +508,7 @@ export default class BalanceSheetRO extends Component {
checkUpload() {
api.create().checkImportRollingOutlookBS(this.state.payload).then(response => {
// console.log(JSON.stringify(this.state.payload));
this.props.refresh()
console.log(response)
if (response.data) {
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