Commit 0e508cb7 authored by Riri Novita's avatar Riri Novita

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

Update Stopper

See merge request !1824
parents 4c00357c ae4c89f8
......@@ -667,7 +667,8 @@ export default class BudgetTahunan extends Component {
"report": 'ratio',
"submissionId": this.state.submissionID,
"periode": this.state.periode.periode,
"companyId": this.state.company.company_id
"companyId": this.state.company.company_id,
"currency_id": this.state.defaultCurrency.id,
}
// console.log(bodyRatioBs);
api.create().triggerRatioMB(bodyRatioBs).then((res) => {
......@@ -725,6 +726,7 @@ export default class BudgetTahunan extends Component {
"revision": Number(this.state.lastRevision),
"periode": this.state.periode.periode,
"company_id": this.state.company.company_id,
"currency_id": this.state.defaultCurrency.id,
"submission_id": this.state.submissionID
}
api.create().getDetailReportCF(payload).then(response => {
......@@ -1350,6 +1352,7 @@ export default class BudgetTahunan extends Component {
"periode": this.state.periode.periode,
"company_id": this.state.company.company_id,
"submission_id": this.state.PLID,
"currency_id": this.state.defaultCurrency.id,
"months": 0,
"quarter": 0,
}
......@@ -1811,6 +1814,7 @@ export default class BudgetTahunan extends Component {
"report_id": 28,
"status": "submitted",
"profit_loss_id": this.state.PLID,
"currency_id": this.state.defaultCurrency.id,
"profit_loss_mb": this.state.dbPL,
"months": 0,
}
......@@ -1857,6 +1861,7 @@ export default class BudgetTahunan extends Component {
"revision": Number(this.state.lastRevision),
"periode": this.state.periode.periode,
"company_id": this.state.company.company_id,
"currency_id": this.state.defaultCurrency.id,
"submission_id": this.state.submissionID,
}
api.create().getHierarkiCreateReportFRMB(payload).then(response => {
......@@ -2068,6 +2073,7 @@ export default class BudgetTahunan extends Component {
"report_id": 29,
"status": "submitted",
"ratio_id": this.state.FRID,
"currency_id": this.state.defaultCurrency.id,
"ratio_mb": this.state.dbFR,
"months": 0,
}
......
......@@ -777,6 +777,7 @@ export default class FixedAssetsMovementMR extends Component {
}
const handleVariance = (tableMeta, dex, type) => {
console.log(tableMeta);
let total = 0
// if (dex === 1) {
// total = Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[9]) == NaN? "0.0" : Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[9])
......
......@@ -737,7 +737,8 @@ export default class MonthlyReport extends Component {
"monthlyReportId": this.state.monthlyReportId,
"periode": this.state.periode.periode,
"companyId": this.state.company.company_id,
"months": this.state.month.month_id
"months": this.state.month.month_id,
"currency_id": this.state.defaultCurrency.id
}
api.create().triggerHistoricalRatio(bodyRatioLocf).then((res) => {
console.log(res)
......@@ -749,7 +750,8 @@ export default class MonthlyReport extends Component {
"monthlyReportId": this.state.monthlyReportId,
"periode": this.state.periode.periode,
"companyId": this.state.company.company_id,
"months": this.state.month.month_id
"months": this.state.month.month_id,
"currency_id": this.state.defaultCurrency.id
}
api.create().triggerRatioFromLOCF(bodyRatioBs).then((res) => {
console.log(res)
......@@ -1537,7 +1539,8 @@ export default class MonthlyReport extends Component {
let PLID = null
let payloadID = {
"periode": this.state.periode.periode,
"company_id": this.state.company.company_id
"company_id": this.state.company.company_id,
"currency_id": this.state.defaultCurrency.id
}
console.log(payloadID);
api.create().getPLID(payloadID).then(response => {
......@@ -1555,7 +1558,8 @@ export default class MonthlyReport extends Component {
"months": this.state.month.month_id,
"quarter": 0,
"report_id": 28,
"submission_id": this.state.PLID
"submission_id": this.state.PLID,
"currency_id": this.state.defaultCurrency.id
}
api.create().getHierarkiCreateReportPLMR(payload).then((response) => {
......@@ -1950,7 +1954,8 @@ export default class MonthlyReport extends Component {
"months": this.state.month.month_id,
"quarter": 0,
"profit_loss_id": this.state.PLID,
"profit_loss_mr": this.state.dbPL
"profit_loss_mr": this.state.dbPL,
"currency_id": this.state.defaultCurrency.id
}
api.create().createReportPLMR(payload).then((res) => {
console.log(res)
......
......@@ -65,8 +65,13 @@ export default class OperatingIndicatorMR extends Component {
templateNull: true,
judulColumn: null,
saveDraft: true,
viewOnly : true,
get_for: 'view'
viewOnly: true,
get_for: 'view',
defaultCurrencyUpload: this.props.defaultCurrency,
visibleAlertSave: false,
alert: false,
tipeAlert: '',
messageAlert: '',
}
this.fileHandler = this.fileHandler.bind(this);
}
......@@ -87,11 +92,11 @@ export default class OperatingIndicatorMR extends Component {
checkStatus = false
}
this.setState({viewOnly: checkCreate && checkEdit && checkStatus})
this.setState({ viewOnly: checkCreate && checkEdit && checkStatus })
}
handleGetFor(type) {
this.setState({get_for: type}, () => {
this.setState({ get_for: type }, () => {
this.getSettingControl()
// this.getLatestUpdate()
})
......@@ -168,14 +173,15 @@ export default class OperatingIndicatorMR extends Component {
let payload = {
"company_id": this.props.data.company.company_id,
"periode": this.props.data.periode,
"months": this.props.months
"months": this.props.months,
"currency_id": this.props.defaultCurrency.id,
}
console.log(payload);
api.create().getMonthlyOI(payload).then(response => {
console.log(response);
if (response) {
if (response.data.data) {
this.setState({ operatingIndIDMonthly: response.data.data.operating_indicator_id } , () => {
this.setState({ operatingIndIDMonthly: response.data.data.operating_indicator_id }, () => {
this.getItemHierarki()
this.getLatestUpdate()
})
......@@ -206,7 +212,8 @@ export default class OperatingIndicatorMR extends Component {
"company_id": this.props.data.company.company_id,
"periode": this.props.data.periode,
"months": this.props.months,
"get_for": this.state.get_for
"get_for": this.state.get_for,
"currency_id": this.props.defaultCurrency.id,
}
console.log(payload);
api.create().getHierarkiMontlyReportOI(payload).then(response => {
......@@ -365,6 +372,7 @@ export default class OperatingIndicatorMR extends Component {
"operating_indicator_id": this.state.operatingIndIDMonthly,
"report_id": this.props.data.report_id,
"company_id": this.props.data.company.company_id,
"currency_id": this.props.defaultCurrency.id,
"periode": this.props.data.periode,
"status": type,
"months": this.props.months,
......@@ -374,7 +382,7 @@ export default class OperatingIndicatorMR extends Component {
// // console.log('=========================')
console.log(JSON.stringify(payload))
this.props.saveMonthlyOI(payload)
this.props.onClickClose()
// this.props.onClickClose()
}
fileHandler = (event) => {
......@@ -418,7 +426,11 @@ export default class OperatingIndicatorMR extends Component {
}
checkUpload() {
api.create().checkUploadMonthlyReportOI(this.state.payload).then(response => {
let payload = {
...this.state.payload,
currency_id: this.state.defaultCurrencyUpload?.id
}
api.create().checkUploadMonthlyReportOI(payload).then(response => {
// console.log(JSON.stringify(this.state.payload));
console.log(response)
if (response.data) {
......@@ -468,7 +480,7 @@ export default class OperatingIndicatorMR extends Component {
]
})
console.log(dataTable);
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, templateNull : total > 0 ? true : false })
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, templateNull: total > 0 ? true : false })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
......@@ -509,6 +521,7 @@ export default class OperatingIndicatorMR extends Component {
report_id: this.props.data.report_id,
status: type,
months: this.props.months,
currency_id: this.props.defaultCurrency.id,
monthly_report: data
}
// console.log(body);
......@@ -520,6 +533,9 @@ export default class OperatingIndicatorMR extends Component {
if (response.data.status === "success") {
this.props.onClickClose()
this.props.getReport()
} else {
if (response.data.message == "Please Set Up Rate Currency First") {
this.setState({ visibleAlertSave: true, loading: false })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
......@@ -530,6 +546,7 @@ export default class OperatingIndicatorMR extends Component {
}
})
}
}
} else {
alert(response.problem)
}
......@@ -573,6 +590,7 @@ export default class OperatingIndicatorMR extends Component {
"periode": this.props.data.periode,
"status": "submitted",
"months": this.props.months,
"currency_id": this.props.defaultCurrency.id,
"monthly_report": data
}
// console.log(JSON.stringify(payload));
......@@ -662,7 +680,7 @@ export default class OperatingIndicatorMR extends Component {
total = R.equals(Number((Number(dataTable2[tableMeta.rowIndex][11]) / Number(dataTable2[tableMeta.rowIndex][8])) * 100), NaN) ? '0' : R.equals(Number((Number(dataTable2[tableMeta.rowIndex][11]) / Number(dataTable2[tableMeta.rowIndex][8])) * 100), Infinity) ? '0' : Number((Number(dataTable2[tableMeta.rowIndex][11]) / Number(dataTable2[tableMeta.rowIndex][8])) * 100 == "-Infinity" ? '0' : (Number(dataTable2[tableMeta.rowIndex][11]) / Number(dataTable2[tableMeta.rowIndex][8])) * 100)
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1)
} else if (dex === 2) {
total = R.equals(Number((Number(dataTable2[tableMeta.rowIndex][13]) / Number(dataTable2[tableMeta.rowIndex][9])) * 100), NaN) ? '0' : R.equals(Number((Number(dataTable2[tableMeta.rowIndex][13]) / Number(dataTable2[tableMeta.rowIndex][9]))* 100), Infinity) ? '0' : Number((Number(dataTable2[tableMeta.rowIndex][13]) / Number(dataTable2[tableMeta.rowIndex][9])) * 100 == "-Infinity" ? '0' : (Number(dataTable2[tableMeta.rowIndex][13]) / Number(dataTable2[tableMeta.rowIndex][9])) * 100)
total = R.equals(Number((Number(dataTable2[tableMeta.rowIndex][13]) / Number(dataTable2[tableMeta.rowIndex][9])) * 100), NaN) ? '0' : R.equals(Number((Number(dataTable2[tableMeta.rowIndex][13]) / Number(dataTable2[tableMeta.rowIndex][9])) * 100), Infinity) ? '0' : Number((Number(dataTable2[tableMeta.rowIndex][13]) / Number(dataTable2[tableMeta.rowIndex][9])) * 100 == "-Infinity" ? '0' : (Number(dataTable2[tableMeta.rowIndex][13]) / Number(dataTable2[tableMeta.rowIndex][9])) * 100)
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1)
}
return total
......@@ -966,7 +984,7 @@ export default class OperatingIndicatorMR extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[8]).toFixed(1) }
value={Number(tableMeta.rowData[8]).toFixed(1)}
decimalScale={1}
/>
:
......@@ -1033,7 +1051,7 @@ export default class OperatingIndicatorMR extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[9]).toFixed(1) }
value={Number(tableMeta.rowData[9]).toFixed(1)}
decimalScale={1}
/>
:
......@@ -1072,7 +1090,7 @@ export default class OperatingIndicatorMR extends Component {
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={ Number(tableMeta.rowData[9]).toFixed(1)}
value={Number(tableMeta.rowData[9]).toFixed(1)}
control={
<NumberFormat
thousandSeparator={true}
......@@ -1080,7 +1098,7 @@ export default class OperatingIndicatorMR extends Component {
type="text"
placeholder=""
disabled={true}
value={ Number(tableMeta.rowData[9]).toFixed(1)}
value={Number(tableMeta.rowData[9]).toFixed(1)}
decimalScale={1}
/>
}
......@@ -1101,7 +1119,7 @@ export default class OperatingIndicatorMR extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(tableMeta.rowData[10]).toFixed(1) }
value={Number(tableMeta.rowData[10]).toFixed(1)}
decimalScale={1}
/>
:
......@@ -1126,7 +1144,7 @@ export default class OperatingIndicatorMR extends Component {
control={
<NumberFormat
thousandSeparator={true}
style={{ color: this.state.get_for == 'view'? "black" : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
style={{ color: this.state.get_for == 'view' ? "black" : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
decimalScale={1}
......@@ -1146,7 +1164,7 @@ export default class OperatingIndicatorMR extends Component {
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={ Number(tableMeta.rowData[8]).toFixed(1)}
value={Number(tableMeta.rowData[8]).toFixed(1)}
control={
<NumberFormat
thousandSeparator={true}
......@@ -1486,11 +1504,11 @@ export default class OperatingIndicatorMR extends Component {
<LightTooltipError title={"MTD Explanation vs MB is Reqiured"} arrow>
<Input
disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', minHeight: 30 , padding: 0 }}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', minHeight: 30, padding: 0 }}
type="text"
placeholder=""
multiline={true}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.isApprover ? true : (this.state.get_for == 'view' ? true : false)}
// value={tableMeta.rowData[15]}
defaultValue={tableMeta.rowData[15]}
inputProps={{
......@@ -1514,7 +1532,7 @@ export default class OperatingIndicatorMR extends Component {
type="text"
placeholder=""
multiline={true}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.isApprover ? true : (this.state.get_for == 'view' ? true : false)}
defaultValue={tableMeta.rowData[15]}
inputProps={{
style: {
......@@ -1566,11 +1584,11 @@ export default class OperatingIndicatorMR extends Component {
<LightTooltipError title={"MTD Explanation vs RB is Reqiured"} arrow>
<Input
disableUnderline={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', minHeight: 30 , padding: 0 }}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'left', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', minHeight: 30, padding: 0 }}
type="text"
placeholder=""
multiline={true}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.isApprover ? true : (this.state.get_for == 'view' ? true : false)}
// value={tableMeta.rowData[16]}
defaultValue={tableMeta.rowData[16]}
inputProps={{
......@@ -1594,7 +1612,7 @@ export default class OperatingIndicatorMR extends Component {
type="text"
placeholder=""
multiline={true}
disabled={this.props.isApprover? true : (this.state.get_for == 'view'? true : false)}
disabled={this.props.isApprover ? true : (this.state.get_for == 'view' ? true : false)}
defaultValue={tableMeta.rowData[16]}
inputProps={{
style: {
......@@ -1672,7 +1690,7 @@ export default class OperatingIndicatorMR extends Component {
this.props.months === 9 ? 'SEP' :
this.props.months === 10 ? 'OCT' :
this.props.months === 11 ? 'NOV' :
this.props.months === 12 ? 'DEC' : "" } {this.props.data.periode}
this.props.months === 12 ? 'DEC' : ""} {this.props.data.periode}
</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div>
......@@ -1778,7 +1796,7 @@ export default class OperatingIndicatorMR extends Component {
{this.state.get_for == 'view' && this.state.viewOnly && <button
type="button"
onClick={() => {
this.setState({loading: true}, () => {
this.setState({ loading: true }, () => {
this.handleGetFor('edit')
})
}}
......@@ -1875,7 +1893,7 @@ export default class OperatingIndicatorMR extends Component {
this.props.months === 9 ? 'SEP' :
this.props.months === 10 ? 'OCT' :
this.props.months === 11 ? 'NOV' :
this.props.months === 12 ? 'DEC' : "" } {this.props.data.periode}
this.props.months === 12 ? 'DEC' : ""} {this.props.data.periode}
</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div>
......@@ -2007,6 +2025,7 @@ export default class OperatingIndicatorMR extends Component {
</button>
</div>
</div>
<div style={{ padding: '25px 30px' }}>
<UploadFile
type={this.state.uploadStatus}
percentage={this.state.percentage}
......@@ -2023,6 +2042,44 @@ export default class OperatingIndicatorMR extends Component {
}}
/>
</div>
<div style={{ padding: '0px 30px 29px', fontSize: 17, color: 'red' }}><b>Warning:</b> Valid currency for uploading data is <b>{this.props.defaultCurrency.id == 1 ? "IDR" : "USD"}</b></div>
</div>
</div>
)}
{this.state.visibleAlertSave && (
<div className="test app-popup-show">
<div className="popup-content border-radius" style={{ background: '#FFF27D', borderRadius: 10, width: 715, height: 238 }}>
<div style={{ margin: 30 }}>
<div style={{ display: 'flex', marginTop: 76, marginBottom: 43 }}>
<div style={{ alignSelf: 'center', marginRight: 25 }}>
<img src={Images.warning} />
</div>
<div style={{ justifyContent: 'center', fontSize: 20, color: '#1D2995', marginTop: 10 }}>
<b>Rate Currency USD</b> pada periode yang dipilih <b>belum</b> diatur.<br /> Silahkan menghubungi Superadmin
</div>
</div>
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
<button
className="button"
type="button"
style={{
background: '#F6F7F9',
cursor: 'pointer',
border: '1px solid #3549609e',
outline: 'none',
marginRight: 20,
borderRadius: 9
}}
onClick={() => this.setState({ visibleAlertSave: false })}
>
<div style={{ backgroundColor: '#fff', width: 105, height: 30, borderRadius: 9, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #3549609e' }}>
<Typography style={{ fontSize: '15px', color: '#354960', textAlign: 'center' }}>Close</Typography>
</div>
</button>
</div>
</div>
</div>
</div>
)}
</div>
......
......@@ -419,6 +419,9 @@ export default class ProfitLossMR extends Component {
} else {
this.props.saveToMonthlyReport()
}
} else {
if (response.data?.message == "Please Set Up Rate Currency First") {
this.setState({ visibleAlertSave: true })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false, handleDoubleClick: 0 }, () => {
document.body.style.overflow = 'unset';
......@@ -431,8 +434,9 @@ export default class ProfitLossMR extends Component {
this.props.saveToMonthlyReport()
})
}
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false, handleDoubleClick: 0 })
this.setState({ alert: true, messageAlert: "Error saving data. Please try again", tipeAlert: 'warning', loading: false, handleDoubleClick: 0 })
}
})
}
......@@ -482,6 +486,7 @@ export default class ProfitLossMR extends Component {
...this.state.payload,
currency_id: this.state.defaultCurrencyUpload?.id
}
console.log(this.props.monthlyReportId);
api.create().checkUploadMonthlyReportPL(payload).then(response => {
// console.log(JSON.stringify(this.state.payload));
console.log(response)
......@@ -594,7 +599,10 @@ export default class ProfitLossMR extends Component {
// this.props.onClickClose()
// this.props.getReport()
} else {
this.setState({ visibleAlertSave: true, alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false, handleDoubleClick: 0 }, () => {
if (response.data?.message == "Please Set Up Rate Currency First") {
this.setState({ visibleAlertSave: true })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false, handleDoubleClick: 0 }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
......@@ -602,6 +610,7 @@ export default class ProfitLossMR extends Component {
}, 1000);
}
})
}
// alert(response.data.status)
}
} else {
......@@ -665,9 +674,9 @@ export default class ProfitLossMR extends Component {
"currency_id": this.props.defaultCurrency.id,
"profit_loss": data
}
// console.log(JSON.stringify(payload));
console.log(JSON.stringify(payload));
api.create().validateSubmitReportPL(payload).then((response) => {
console.log(response.data.data.result)
console.log(response)
console.log(err);
if (response.data) {
if (response.data.status === "success") {
......@@ -2472,7 +2481,7 @@ export default class ProfitLossMR extends Component {
marginRight: 20,
borderRadius: 9
}}
onClick={() => this.setState({ visibleAlertSave: false })}
onClick={() => this.setState({ visibleAlertSave: false, loading: false })}
>
<div style={{ backgroundColor: '#fff', width: 105, height: 30, borderRadius: 9, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #3549609e' }}>
<Typography style={{ fontSize: '15px', color: '#354960', textAlign: 'center' }}>Close</Typography>
......
import React, { Component } from 'react';
import { Typography, Paper, TextField, MenuItem, Select, FormControlLabel, createMuiTheme, withStyles, Checkbox, MuiThemeProvider } from '@material-ui/core';
import { Typography, Paper, TextField, MenuItem, Select, FormControlLabel, createMuiTheme, withStyles, Checkbox, MuiThemeProvider, Snackbar } from '@material-ui/core';
import MUIDataTable from 'mui-datatables';
import Images from '../../assets/Images';
import OperatingIndicatorDetail from './OperatingIndicatorDetail'
......@@ -15,6 +15,7 @@ import OperatingIndicatorMR from '../MonthlyReport/OperatingIndicatorMR';
import OperatingIndicatorRO from '../RollingOutlook/OperatingIndicatorRO';
import { PhotoSizeSelectLargeTwoTone, ThreeSixty } from '@material-ui/icons';
import { startTransition } from 'react';
import { PropagateLoader } from 'react-spinners';
var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable());
......@@ -46,6 +47,7 @@ export default class OperatingIndicator extends Component {
listPeriode: null,
periode: null,
month: null,
loading: false,
quartal: null,
listCompany: null,
company: null,
......@@ -66,7 +68,21 @@ export default class OperatingIndicator extends Component {
isCheckAll: false,
downloadedFileReportId: null,
arrayReport: [],
popupDownload: false
popupDownload: false,
defaultCurrency: null,
dataCurrency: [],
currency: [],
visibleAlertSave: false,
dataCurrency: [
{
"id": 1,
"value": "IDR"
},
{
"id": 2,
"value": "USD",
}
]
}
this.fileHandler = this.fileHandler.bind(this);
}
......@@ -136,6 +152,7 @@ export default class OperatingIndicator extends Component {
"company_id": this.state.company.company_id,
"periode": this.state.periode.periode,
"report_type": "operating indicator",
"currency_id": this.state.defaultCurrency.id
}
console.log(payload);
api.create().getAllOperatingInd(payload).then(response => {
......@@ -243,6 +260,7 @@ export default class OperatingIndicator extends Component {
this.setState({ listCompany: defaultProps, company: arrayBaru.length < 1 ? companyData[0] : arrayBaru[0] }, () => {
this.getLastPeriod()
this.getCurrency(this.state.company.company_id)
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
......@@ -260,6 +278,51 @@ export default class OperatingIndicator extends Component {
})
}
getCurrency(companyID) {
console.log(companyID);
api.create().getDetailPerusahaan(companyID).then(response => {
console.log(response);
if (response.data) {
if (response.ok) {
if (response.data.status === "success") {
let data = response.data.data
let datas = []
if (response.data.data.currency.length > 0) {
response.data.data.currency.map((item) => {
// console.log(item);
datas.push({
id: item.currencyId,
value: item.currencyName
})
})
}
let index = datas.findIndex((val) => val.id == response.data.data.default_currency)
this.setState({
defaultCurrencyID: response.data.data.default_currency,
currency: datas,
defaultCurrency: index == -1 ? null : datas[index]
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
}
})
}
getPeriode() {
api.create().getPeriodeTransaction().then(response => {
let dateNow = new Date
......@@ -316,9 +379,9 @@ export default class OperatingIndicator extends Component {
// console.log(response.data.data)
this.getLatestPeriodSubmit()
if (response.data.data) {
this.setState({ operatingIndID: response.data.data.operating_indicator_id })
this.setState({ operatingIndID: response.data.data.operating_indicator_id, loading: false })
} else {
this.setState({ operatingIndID: null })
this.setState({ operatingIndID: null, loading: false })
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
......@@ -474,8 +537,24 @@ export default class OperatingIndicator extends Component {
saveOperatingInd(payload) {
api.create().createOpetaingInd(payload).then((response) => {
console.log(response);
if (response.data) {
if (response.data.status === "success") {
this.setState({ visibleDetailOpt: false, visibleOperatingIndicator: true, loading: false }, () =>
this.getOperatingID(),
this.getReport()
this.getOperatingID()
)
} else {
if (response.data.message == "Please Set Up Rate Currency First") {
this.setState({ visibleAlertSave: true, loading: false })
} else {
this.setState({alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
}
}
} else {
this.setState({ alert: true, messageAlert: "Error saving data. Please try again", tipeAlert: 'warning', loading: false, handleDoubleClick: 0 })
}
})
}
......@@ -578,7 +657,7 @@ export default class OperatingIndicator extends Component {
// }
async handleGenerateReport(data) {
let { selectReport, operatingIndID, company, periode, downloadedFileReportId } = this.state
let { selectReport, operatingIndID, company, periode, downloadedFileReportId, defaultCurrency } = this.state
if (selectReport.length > 0) {
let result = []
console.log('mulai hit')
......@@ -603,10 +682,10 @@ export default class OperatingIndicator extends Component {
String(report[1]).toLocaleLowerCase().includes('dec') ? 12 : null
if (String(report[1]).toLocaleLowerCase().includes('master budget')) {
let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/operating_indicator/master_budget/export_master_budget?operating_indicator_id=${operatingIndID == null ? "" : operatingIndID}&&report_id=${report[3]}&&company_id=${company.company_id}&&year=${periode.periode}&&download_file_report_id=${downloadedFileReportId}`
let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/operating_indicator/master_budget/export_master_budget?operating_indicator_id=${operatingIndID == null ? "" : operatingIndID}&&report_id=${report[3]}&&company_id=${company.company_id}&&year=${periode.periode}&&download_file_report_id=${downloadedFileReportId}&&currency_id=${defaultCurrency.id}`
console.log(url);
let res = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/operating_indicator/master_budget/export_master_budget?operating_indicator_id=${operatingIndID == null ? "" : operatingIndID}&&report_id=${report[3]}&&company_id=${company.company_id}&&year=${periode.periode}&&download_file_report_id=${downloadedFileReportId}`
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/operating_indicator/master_budget/export_master_budget?operating_indicator_id=${operatingIndID == null ? "" : operatingIndID}&&report_id=${report[3]}&&company_id=${company.company_id}&&year=${periode.periode}&&download_file_report_id=${downloadedFileReportId}&&currency_id=${defaultCurrency.id}`
)
if (res.status === 200) {
......@@ -614,9 +693,9 @@ export default class OperatingIndicator extends Component {
}
} else if (String(report[1]).toLocaleLowerCase().includes('monthly report')) {
let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/operating_indicator/monthly_report/export_monthly_report?operating_indicator_id=${operatingIndID == null ? "" : operatingIndID}&&report_id=${report[3]}&&company_id=${company.company_id}&&year=${periode.periode}&&months=${month}&&download_file_report_id=${downloadedFileReportId}`
let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/operating_indicator/monthly_report/export_monthly_report?operating_indicator_id=${operatingIndID == null ? "" : operatingIndID}&&report_id=${report[3]}&&company_id=${company.company_id}&&year=${periode.periode}&&months=${month}&&download_file_report_id=${downloadedFileReportId}&&currency_id=${defaultCurrency.id}`
let res = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/operating_indicator/monthly_report/export_monthly_report?operating_indicator_id=${operatingIndID === null ? "" : operatingIndID}&&report_id=${report[3]}&&company_id=${company.company_id}&&year=${periode.periode}&&months=${month}&&download_file_report_id=${downloadedFileReportId}`
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/operating_indicator/monthly_report/export_monthly_report?operating_indicator_id=${operatingIndID === null ? "" : operatingIndID}&&report_id=${report[3]}&&company_id=${company.company_id}&&year=${periode.periode}&&months=${month}&&download_file_report_id=${downloadedFileReportId}&&currency_id=${defaultCurrency.id}`
)
if (res.status === 200) {
......@@ -624,9 +703,9 @@ export default class OperatingIndicator extends Component {
}
} else if (String(report[1]).toLocaleLowerCase().includes('rolling outlook')) {
let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/operating_indicator/rolling_outlook/export_rolling_outlook?operating_indicator_id=${operatingIndID == null ? "" : operatingIndID}&&report_id=${report[3]}&&company_id=${company.company_id}&&year=${periode.periode}&&quartal=${quarter}&&download_file_report_id=${downloadedFileReportId}`
let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/operating_indicator/rolling_outlook/export_rolling_outlook?operating_indicator_id=${operatingIndID == null ? "" : operatingIndID}&&report_id=${report[3]}&&company_id=${company.company_id}&&year=${periode.periode}&&quartal=${quarter}&&download_file_report_id=${downloadedFileReportId}&&currency_id=${defaultCurrency.id}`
let res = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/operating_indicator/rolling_outlook/export_rolling_outlook?operating_indicator_id=${operatingIndID === null ? "" : operatingIndID}&&report_id=${report[3]}&&company_id=${company.company_id}&&year=${periode.periode}&&quartal=${quarter}&&download_file_report_id=${downloadedFileReportId}`
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/operating_indicator/rolling_outlook/export_rolling_outlook?operating_indicator_id=${operatingIndID === null ? "" : operatingIndID}&&report_id=${report[3]}&&company_id=${company.company_id}&&year=${periode.periode}&&quartal=${quarter}&&download_file_report_id=${downloadedFileReportId}&&currency_id=${defaultCurrency.id}`
)
if (res.status === 200) {
......@@ -872,8 +951,27 @@ export default class OperatingIndicator extends Component {
{ value: '0', label: '0' },
{ value: '1', label: '1' },
]
const loadingComponent = (
<div style={{ position: 'fixed', zIndex: 110, top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'rgba(255,255,255,0.8)' }}>
<PropagateLoader
// css={override}
size={20}
color={"#274B80"}
loading={this.state.loading}
/>
</div>
);
return (
<div style={{ flex: 1, backgroundColor: '#f8f8f8' }}>
<Snackbar open={this.state.alert} autoHideDuration={6000} onClose={() => this.closeAlert()}>
<Alert onClose={() => this.closeAlert()} severity={this.state.tipeAlert}>
{this.state.messageAlert}
</Alert>
</Snackbar>
{this.state.loading && loadingComponent}
{this.state.visibleOperatingIndicator && (
<div>
<div className={"main-color"} style={{ height: 78, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
......@@ -885,11 +983,11 @@ export default class OperatingIndicator extends Component {
<Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Operating Indicator</Typography>
</div>
<div style={{ padding: 20 }}>
<div>
<div style={{ display: 'flex' }}>
<Autocomplete
{...this.state.listPeriode}
id="periode"
onChange={(event, newInputValue) => this.setState({ periode: newInputValue }, () => {
onChange={(event, newInputValue) => this.setState({ periode: newInputValue, loading: true }, () => {
this.getOperatingID()
// this.getReportAttachment()
})}
......@@ -900,13 +998,28 @@ export default class OperatingIndicator extends Component {
renderInput={(params) => <TextField {...params} label="Period" margin="normal" style={{ marginTop: 7 }} />}
value={this.state.periode}
/>
<Autocomplete
id="tipe"
disableClearable
options={this.state.currency}
getOptionLabel={(option) => option.value}
value={this.state.defaultCurrency}
// onChange={(event, newInputValue) => this.setState({ defaultCurrency: newInputValue })}
onChange={(event, newInputValue) => this.setState({ defaultCurrency: newInputValue, loading: true }, () => {
this.getOperatingID()
})}
style={{ width: 250 }}
renderInput={(params) => <TextField {...params} label="Currency" margin="normal" style={{ marginTop: 7, marginLeft: 20 }} />}
/>
</div>
<div style={{ marginTop: 20 }}>
<Autocomplete
{...this.state.listCompany}
id="company"
onChange={(event, newInputValue) => this.setState({ company: newInputValue }, () => {
onChange={(event, newInputValue) => this.setState({ company: newInputValue, loading: true }, () => {
this.getOperatingID()
this.getCurrency(newInputValue.company_id)
// this.getReportAttachment()
})}
clearOnEscape
......@@ -983,6 +1096,8 @@ export default class OperatingIndicator extends Component {
data={this.state.dataDetail}
height={this.props.height}
width={this.props.width}
defaultCurrency={this.state.defaultCurrency}
currency={this.state.currency}
onClickClose={() => this.setState({ visibleDetailOpt: false, visibleOperatingIndicator: true }, () => {
this.getOperatingID()
this.forceUpdate()
......@@ -1001,6 +1116,8 @@ export default class OperatingIndicator extends Component {
width={this.props.width}
months={this.state.months}
company={this.state.company}
defaultCurrency={this.state.defaultCurrency}
currency={this.state.currency}
onClickClose={() => this.setState({ visibleDetailMonthly: false, visibleOperatingIndicator: true }, () => {
this.getOperatingID()
this.forceUpdate()
......@@ -1020,6 +1137,8 @@ export default class OperatingIndicator extends Component {
width={this.props.width}
quartal={this.state.quartal}
company={this.state.company}
defaultCurrency={this.state.defaultCurrency}
currency={this.state.currency}
onClickClose={() => this.setState({ visibleDetailRolling: false, visibleOperatingIndicator: true }, () => {
this.getOperatingID()
this.forceUpdate()
......@@ -1093,6 +1212,42 @@ export default class OperatingIndicator extends Component {
</div>
</div>
)}
{this.state.visibleAlertSave && (
<div className="test app-popup-show">
<div className="popup-content border-radius" style={{ background: '#FFF27D', borderRadius: 10, width: 715, height: 238 }}>
<div style={{ margin: 30 }}>
<div style={{ display: 'flex', marginTop: 76, marginBottom: 43 }}>
<div style={{ alignSelf: 'center', marginRight: 25 }}>
<img src={Images.warning} />
</div>
<div style={{ justifyContent: 'center', fontSize: 20, color: '#1D2995', marginTop: 10 }}>
<b>Rate Currency USD</b> pada periode yang dipilih <b>belum</b> diatur.<br /> Silahkan menghubungi Superadmin
</div>
</div>
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
<button
className="button"
type="button"
style={{
background: '#F6F7F9',
cursor: 'pointer',
border: '1px solid #3549609e',
outline: 'none',
marginRight: 20,
borderRadius: 9
}}
onClick={() => this.setState({ visibleAlertSave: false})}
>
<div style={{ backgroundColor: '#fff', width: 105, height: 30, borderRadius: 9, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #3549609e' }}>
<Typography style={{ fontSize: '15px', color: '#354960', textAlign: 'center' }}>Close</Typography>
</div>
</button>
</div>
</div>
</div>
</div>
)}
</div >
);
}
......
......@@ -10,12 +10,16 @@ import Images from '../../assets/Images';
import ReactTooltip from 'react-tooltip';
import UploadFile from "../../library/Upload";
import { ExcelRenderer } from 'react-excel-renderer';
import { Alert } from '@material-ui/lab';
// import { Alert } from '@material-ui/lab';
import Constant from '../../library/Constant';
import MuiAlert from '@material-ui/lab/Alert';
var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable3());
const Alert = withStyles({
})((props) => <MuiAlert elevation={6} variant="filled" {...props} />);
const options = ct.customOptionsFixedColumn();
const style = {
position: "sticky",
......@@ -60,7 +64,12 @@ export default class BalanceSheet extends Component {
emptyData: false,
updateBy: [],
notesUpdate: '-',
templateNull: true
templateNull: true,
defaultCurrencyUpload: this.props.defaultCurrency,
visibleAlertSave: false,
alert: false,
tipeAlert: '',
messageAlert: '',
}
this.handleValue = this.handleValue.bind(this)
this.fileHandler = this.fileHandler.bind(this);
......@@ -105,12 +114,13 @@ export default class BalanceSheet extends Component {
}
getDataDetail() {
this.setState({ loading: true })
// this.setState({ loading: true })
let payload = {
"operating_indicator_id": this.props.data.operatingIndID,
"report_id": this.props.data.report_id,
"company_id": this.props.data.company.company_id,
"periode": this.props.data.periode
"periode": this.props.data.periode,
"currency_id": this.props.defaultCurrency.id,
}
console.log(payload)
api.create().getOperatingIndDetail(payload).then(response => {
......@@ -229,6 +239,7 @@ export default class BalanceSheet extends Component {
"report_id": this.props.data.report_id,
"company_id": this.props.data.company.company_id,
"periode": this.props.data.periode,
"currency_id": this.props.defaultCurrency.id,
"status": type,
"master_budget": payloadMB
}
......@@ -236,7 +247,8 @@ export default class BalanceSheet extends Component {
// // console.log('=========================')
// console.log(JSON.stringify(payload))
this.props.saveOperatingInd(payload)
this.props.onClickClose()
this.setState({ loading: false })
// this.props.onClickClose()
}
handleValue(data) {
......@@ -265,42 +277,6 @@ export default class BalanceSheet extends Component {
}
}
backToMasterBudget(type) {
let data = []
this.state.dataTable.map(i => {
data.push({
item_report_id: i[1],
total_actual_before: String(i[6]),
january: String(i[7]),
february: String(i[8]),
march: String(i[9]),
april: String(i[10]),
may: String(i[11]),
june: String(i[12]),
july: String(i[13]),
august: String(i[14]),
september: String(i[15]),
october: String(i[16]),
november: String(i[17]),
december: String(i[18]),
total_current_year: String(i[19]),
total_next_year: String(i[20]),
total_more_year: String(i[21])
})
})
// let payload = {
// "submission_id": this.props.submissionID,
// "company_id": this.props.company.company_id,
// "periode": this.props.periode,
// "report_id": this.props.report_id,
// "status": type,
// "balance_sheet": data
// }
// // // // console.log(data);
// this.props.saveToMasterBudget(payload)
this.props.onClickClose()
}
downloadTemplate = async () => {
let res = await fetch(
......@@ -389,8 +365,12 @@ export default class BalanceSheet extends Component {
}
checkUpload() {
let payload = {
...this.state.payload,
currency_id: this.state.defaultCurrencyUpload?.id
}
// // console.log(JSON.stringify(this.state.payload))
api.create().checkUploadOperatingInd(this.state.payload).then(response => {
api.create().checkUploadOperatingInd(payload).then(response => {
// // // console.log(JSON.stringify(this.state.payload));
// // console.log('===============')
console.log(response)
......@@ -466,20 +446,27 @@ export default class BalanceSheet extends Component {
operating_indicator_id: this.props.data.operatingIndID,
periode: this.props.data.periode,
report_id: this.props.data.report_id,
currency_id: this.props.defaultCurrency.id,
status: type,
master_budget: data
}
// // console.log(data);
// // console.log(JSON.stringify(body))
api.create('UPLOAD').uploadOperatingInd(body).then(response => {
// // console.log(response);
console.log(response);
this.setState({ loading: false })
if (response.data) {
if (response.data.status === "success") {
this.props.onClickClose()
this.props.getReport()
} else {
alert(response.data.status)
console.log(response.data.message);
if (response.data.message == "Please Set Up Rate Currency First") {
this.setState({ visibleAlertSave: true, loading: false })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
}
// alert(response.data.status)
}
} else {
alert(response.problem)
......@@ -1879,8 +1866,8 @@ export default class BalanceSheet extends Component {
)
}
}
},{
name: `31 Dec ${Number(this.props.data.periode)+1}\nTotal`,
}, {
name: `31 Dec ${Number(this.props.data.periode) + 1}\nTotal`,
// name: `31 Dec 2023\nTotal`,
options: {
customHeadRender: (columnMeta) => (
......@@ -1965,8 +1952,8 @@ export default class BalanceSheet extends Component {
)
}
}
},{
name: `31 Dec ${Number(this.props.data.periode)+2}\nTotal`,
}, {
name: `31 Dec ${Number(this.props.data.periode) + 2}\nTotal`,
// name: `31 Dec 2024\nTotal`,
options: {
customHeadRender: (columnMeta) => (
......@@ -2378,6 +2365,7 @@ export default class BalanceSheet extends Component {
</button>
</div>
</div>
<div style={{ padding: '25px 30px' }}>
<UploadFile
type={this.state.uploadStatus}
percentage={this.state.percentage}
......@@ -2394,6 +2382,44 @@ export default class BalanceSheet extends Component {
}}
/>
</div>
<div style={{ padding: '0px 30px 29px', fontSize: 17, color: 'red' }}><b>Warning:</b> Valid currency for uploading data is <b>{this.props.defaultCurrency.id == 1 ? "IDR" : "USD"}</b></div>
</div>
</div>
)}
{this.state.visibleAlertSave && (
<div className="test app-popup-show">
<div className="popup-content border-radius" style={{ background: '#FFF27D', borderRadius: 10, width: 715, height: 238 }}>
<div style={{ margin: 30 }}>
<div style={{ display: 'flex', marginTop: 76, marginBottom: 43 }}>
<div style={{ alignSelf: 'center', marginRight: 25 }}>
<img src={Images.warning} />
</div>
<div style={{ justifyContent: 'center', fontSize: 20, color: '#1D2995', marginTop: 10 }}>
<b>Rate Currency USD</b> pada periode yang dipilih <b>belum</b> diatur.<br /> Silahkan menghubungi Superadmin
</div>
</div>
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
<button
className="button"
type="button"
style={{
background: '#F6F7F9',
cursor: 'pointer',
border: '1px solid #3549609e',
outline: 'none',
marginRight: 20,
borderRadius: 9
}}
onClick={() => this.setState({ visibleAlertSave: false })}
>
<div style={{ backgroundColor: '#fff', width: 105, height: 30, borderRadius: 9, justifyContent: 'center', display: 'flex', alignItems: 'center', border: 'solid 1px #3549609e' }}>
<Typography style={{ fontSize: '15px', color: '#354960', textAlign: 'center' }}>Close</Typography>
</div>
</button>
</div>
</div>
</div>
</div>
)}
</div>
......
......@@ -625,7 +625,8 @@ export default class OutlookPA extends Component {
"report": 'ratio',
"outlookPaId": this.state.outlook_pa_id,
"companyId": this.state.company.company_id,
"periode": this.state.periode.periode
"periode": this.state.periode.periode,
"currency_id": this.state.defaultCurrency.id,
}
api.create().triggerRatioOLPA(bodyRatioOLPA).then((res) => {
console.log(res)
......@@ -993,7 +994,8 @@ export default class OutlookPA extends Component {
let PLID = null
let payloadID = {
"periode": this.state.periode.periode,
"company_id": this.state.company.company_id
"company_id": this.state.company.company_id,
"currency_id": this.state.defaultCurrency.id,
}
console.log(payloadID);
api.create().getPLID(payloadID).then(response => {
......@@ -1010,6 +1012,7 @@ export default class OutlookPA extends Component {
"periode": this.state.periode.periode,
"company_id": this.state.company.company_id,
"outlook_pa_id": this.state.PLID,
"currency_id": this.state.defaultCurrency.id,
}
api.create().getHierarkiDBPLOLPA(payload).then(response => {
// console.log(response);
......@@ -1470,6 +1473,7 @@ export default class OutlookPA extends Component {
"status": "submitted",
"profit_loss_id": this.state.PLID,
"profit_loss_olpa": this.state.dbPL,
"currency_id": this.state.defaultCurrency.id,
}
console.log(this.state.dbPL)
// console.log(JSON.stringify(payload))
......
......@@ -52,7 +52,12 @@ export default class OperatingIndicatorRO extends Component {
judulColumn: null,
saveDraft: true,
viewOnly: true,
get_for: 'view'
get_for: 'view',
defaultCurrencyUpload: this.props.defaultCurrency,
visibleAlertSave: false,
alert: false,
tipeAlert: '',
messageAlert: '',
}
this.handleValue = this.handleValue.bind(this)
this.fileHandler = this.fileHandler.bind(this);
......@@ -152,7 +157,8 @@ export default class OperatingIndicatorRO extends Component {
"company_id": this.props.data.company.company_id,
"periode": this.props.data.periode,
"quartal": this.props.quartal,
"get_for": this.state.get_for
"get_for": this.state.get_for,
"currency_id": this.props.defaultCurrency.id,
}
console.log(payload)
api.create().getHierarkiRollingOI(payload).then(response => {
......@@ -274,6 +280,7 @@ export default class OperatingIndicatorRO extends Component {
"company_id": this.props.data.company.company_id,
"periode": this.props.data.periode,
"quartal": this.props.quartal,
"currency_id": this.props.defaultCurrency.id,
"status": type,
"rolling_outlook": payloadRO
}
......
......@@ -331,7 +331,8 @@ export default class RollingOutlook extends Component {
"company_id": this.state.company.company_id,
"periode": this.state.periode.periode,
"report_type": "Rolling Outlook",
"quartal": this.state.quarter.value
"quartal": this.state.quarter.value,
"currency_id": this.state.defaultCurrency.id
}
let dataHardcode = []
api.create().getRollingOutlookReport(payload).then(response => {
......@@ -659,7 +660,8 @@ export default class RollingOutlook extends Component {
"rollingOutlookId": this.state.rollingOutlookID,
"periode": this.state.periode.periode,
"companyId": this.state.company.company_id,
"quartal": this.state.quarter.value
"quartal": this.state.quarter.value,
"currency_id": this.state.defaultCurrency.id
}
api.create().triggerRatioRO(bodyRatioBs).then((res) => {
console.log(res)
......@@ -1017,7 +1019,8 @@ export default class RollingOutlook extends Component {
let PLID = null
let payloadID = {
"periode": this.state.periode.periode,
"company_id": this.state.company.company_id
"company_id": this.state.company.company_id,
"currency_id": this.state.defaultCurrency.id
}
console.log(payloadID);
api.create().getPLID(payloadID).then(response => {
......@@ -1035,6 +1038,7 @@ export default class RollingOutlook extends Component {
"company_id": this.state.company.company_id,
"quartal": this.state.quarter.value,
"rolling_outlook_id": this.state.PLID,
"currency_id": this.state.defaultCurrency.id
}
api.create().getHierarkiDBPLRO(payload).then(response => {
// console.log(response);
......@@ -1496,6 +1500,7 @@ export default class RollingOutlook extends Component {
"profit_loss_id": this.state.PLID,
"profit_loss_ro": this.state.dbPL,
"quartal": this.state.quarter.value,
"currency_id": this.state.defaultCurrency.id
}
console.log(this.state.dbPL)
// console.log(JSON.stringify(payload))
......
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