Commit dfb63502 authored by Riri Novita's avatar Riri Novita

Merge branch 'ENV-DEV' into 'ENV-DEPLOYMENT'

Update Stopper

See merge request !1825
parents 2551f744 0e508cb7
...@@ -667,7 +667,8 @@ export default class BudgetTahunan extends Component { ...@@ -667,7 +667,8 @@ export default class BudgetTahunan extends Component {
"report": 'ratio', "report": 'ratio',
"submissionId": this.state.submissionID, "submissionId": this.state.submissionID,
"periode": this.state.periode.periode, "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); // console.log(bodyRatioBs);
api.create().triggerRatioMB(bodyRatioBs).then((res) => { api.create().triggerRatioMB(bodyRatioBs).then((res) => {
...@@ -725,6 +726,7 @@ export default class BudgetTahunan extends Component { ...@@ -725,6 +726,7 @@ export default class BudgetTahunan extends Component {
"revision": Number(this.state.lastRevision), "revision": Number(this.state.lastRevision),
"periode": this.state.periode.periode, "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,
"submission_id": this.state.submissionID "submission_id": this.state.submissionID
} }
api.create().getDetailReportCF(payload).then(response => { api.create().getDetailReportCF(payload).then(response => {
...@@ -1350,6 +1352,7 @@ export default class BudgetTahunan extends Component { ...@@ -1350,6 +1352,7 @@ export default class BudgetTahunan extends Component {
"periode": this.state.periode.periode, "periode": this.state.periode.periode,
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
"submission_id": this.state.PLID, "submission_id": this.state.PLID,
"currency_id": this.state.defaultCurrency.id,
"months": 0, "months": 0,
"quarter": 0, "quarter": 0,
} }
...@@ -1811,6 +1814,7 @@ export default class BudgetTahunan extends Component { ...@@ -1811,6 +1814,7 @@ export default class BudgetTahunan extends Component {
"report_id": 28, "report_id": 28,
"status": "submitted", "status": "submitted",
"profit_loss_id": this.state.PLID, "profit_loss_id": this.state.PLID,
"currency_id": this.state.defaultCurrency.id,
"profit_loss_mb": this.state.dbPL, "profit_loss_mb": this.state.dbPL,
"months": 0, "months": 0,
} }
...@@ -1857,6 +1861,7 @@ export default class BudgetTahunan extends Component { ...@@ -1857,6 +1861,7 @@ export default class BudgetTahunan extends Component {
"revision": Number(this.state.lastRevision), "revision": Number(this.state.lastRevision),
"periode": this.state.periode.periode, "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,
"submission_id": this.state.submissionID, "submission_id": this.state.submissionID,
} }
api.create().getHierarkiCreateReportFRMB(payload).then(response => { api.create().getHierarkiCreateReportFRMB(payload).then(response => {
...@@ -2068,6 +2073,7 @@ export default class BudgetTahunan extends Component { ...@@ -2068,6 +2073,7 @@ export default class BudgetTahunan extends Component {
"report_id": 29, "report_id": 29,
"status": "submitted", "status": "submitted",
"ratio_id": this.state.FRID, "ratio_id": this.state.FRID,
"currency_id": this.state.defaultCurrency.id,
"ratio_mb": this.state.dbFR, "ratio_mb": this.state.dbFR,
"months": 0, "months": 0,
} }
......
...@@ -777,6 +777,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -777,6 +777,7 @@ export default class FixedAssetsMovementMR extends Component {
} }
const handleVariance = (tableMeta, dex, type) => { const handleVariance = (tableMeta, dex, type) => {
console.log(tableMeta);
let total = 0 let total = 0
// if (dex === 1) { // if (dex === 1) {
// total = Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[9]) == NaN? "0.0" : Number(tableMeta.rowData[8]) - Number(tableMeta.rowData[9]) // 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 { ...@@ -737,7 +737,8 @@ export default class MonthlyReport extends Component {
"monthlyReportId": this.state.monthlyReportId, "monthlyReportId": this.state.monthlyReportId,
"periode": this.state.periode.periode, "periode": this.state.periode.periode,
"companyId": this.state.company.company_id, "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) => { api.create().triggerHistoricalRatio(bodyRatioLocf).then((res) => {
console.log(res) console.log(res)
...@@ -749,7 +750,8 @@ export default class MonthlyReport extends Component { ...@@ -749,7 +750,8 @@ export default class MonthlyReport extends Component {
"monthlyReportId": this.state.monthlyReportId, "monthlyReportId": this.state.monthlyReportId,
"periode": this.state.periode.periode, "periode": this.state.periode.periode,
"companyId": this.state.company.company_id, "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) => { api.create().triggerRatioFromLOCF(bodyRatioBs).then((res) => {
console.log(res) console.log(res)
...@@ -1537,7 +1539,8 @@ export default class MonthlyReport extends Component { ...@@ -1537,7 +1539,8 @@ export default class MonthlyReport extends Component {
let PLID = null let PLID = null
let payloadID = { let payloadID = {
"periode": this.state.periode.periode, "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); console.log(payloadID);
api.create().getPLID(payloadID).then(response => { api.create().getPLID(payloadID).then(response => {
...@@ -1555,7 +1558,8 @@ export default class MonthlyReport extends Component { ...@@ -1555,7 +1558,8 @@ export default class MonthlyReport extends Component {
"months": this.state.month.month_id, "months": this.state.month.month_id,
"quarter": 0, "quarter": 0,
"report_id": 28, "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) => { api.create().getHierarkiCreateReportPLMR(payload).then((response) => {
...@@ -1950,7 +1954,8 @@ export default class MonthlyReport extends Component { ...@@ -1950,7 +1954,8 @@ export default class MonthlyReport extends Component {
"months": this.state.month.month_id, "months": this.state.month.month_id,
"quarter": 0, "quarter": 0,
"profit_loss_id": this.state.PLID, "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) => { api.create().createReportPLMR(payload).then((res) => {
console.log(res) console.log(res)
......
...@@ -65,8 +65,13 @@ export default class OperatingIndicatorMR extends Component { ...@@ -65,8 +65,13 @@ export default class OperatingIndicatorMR extends Component {
templateNull: true, templateNull: true,
judulColumn: null, judulColumn: null,
saveDraft: true, saveDraft: true,
viewOnly : true, viewOnly: true,
get_for: 'view' get_for: 'view',
defaultCurrencyUpload: this.props.defaultCurrency,
visibleAlertSave: false,
alert: false,
tipeAlert: '',
messageAlert: '',
} }
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
} }
...@@ -87,11 +92,11 @@ export default class OperatingIndicatorMR extends Component { ...@@ -87,11 +92,11 @@ export default class OperatingIndicatorMR extends Component {
checkStatus = false checkStatus = false
} }
this.setState({viewOnly: checkCreate && checkEdit && checkStatus}) this.setState({ viewOnly: checkCreate && checkEdit && checkStatus })
} }
handleGetFor(type) { handleGetFor(type) {
this.setState({get_for: type}, () => { this.setState({ get_for: type }, () => {
this.getSettingControl() this.getSettingControl()
// this.getLatestUpdate() // this.getLatestUpdate()
}) })
...@@ -168,14 +173,15 @@ export default class OperatingIndicatorMR extends Component { ...@@ -168,14 +173,15 @@ export default class OperatingIndicatorMR extends Component {
let payload = { let payload = {
"company_id": this.props.data.company.company_id, "company_id": this.props.data.company.company_id,
"periode": this.props.data.periode, "periode": this.props.data.periode,
"months": this.props.months "months": this.props.months,
"currency_id": this.props.defaultCurrency.id,
} }
console.log(payload); console.log(payload);
api.create().getMonthlyOI(payload).then(response => { api.create().getMonthlyOI(payload).then(response => {
console.log(response); console.log(response);
if (response) { if (response) {
if (response.data.data) { 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.getItemHierarki()
this.getLatestUpdate() this.getLatestUpdate()
}) })
...@@ -206,7 +212,8 @@ export default class OperatingIndicatorMR extends Component { ...@@ -206,7 +212,8 @@ export default class OperatingIndicatorMR extends Component {
"company_id": this.props.data.company.company_id, "company_id": this.props.data.company.company_id,
"periode": this.props.data.periode, "periode": this.props.data.periode,
"months": this.props.months, "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); console.log(payload);
api.create().getHierarkiMontlyReportOI(payload).then(response => { api.create().getHierarkiMontlyReportOI(payload).then(response => {
...@@ -365,6 +372,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -365,6 +372,7 @@ export default class OperatingIndicatorMR extends Component {
"operating_indicator_id": this.state.operatingIndIDMonthly, "operating_indicator_id": this.state.operatingIndIDMonthly,
"report_id": this.props.data.report_id, "report_id": this.props.data.report_id,
"company_id": this.props.data.company.company_id, "company_id": this.props.data.company.company_id,
"currency_id": this.props.defaultCurrency.id,
"periode": this.props.data.periode, "periode": this.props.data.periode,
"status": type, "status": type,
"months": this.props.months, "months": this.props.months,
...@@ -374,7 +382,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -374,7 +382,7 @@ export default class OperatingIndicatorMR extends Component {
// // console.log('=========================') // // console.log('=========================')
console.log(JSON.stringify(payload)) console.log(JSON.stringify(payload))
this.props.saveMonthlyOI(payload) this.props.saveMonthlyOI(payload)
this.props.onClickClose() // this.props.onClickClose()
} }
fileHandler = (event) => { fileHandler = (event) => {
...@@ -418,7 +426,11 @@ export default class OperatingIndicatorMR extends Component { ...@@ -418,7 +426,11 @@ export default class OperatingIndicatorMR extends Component {
} }
checkUpload() { 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(JSON.stringify(this.state.payload));
console.log(response) console.log(response)
if (response.data) { if (response.data) {
...@@ -468,7 +480,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -468,7 +480,7 @@ export default class OperatingIndicatorMR extends Component {
] ]
}) })
console.log(dataTable); 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 { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => { 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")) { if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
...@@ -509,6 +521,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -509,6 +521,7 @@ export default class OperatingIndicatorMR extends Component {
report_id: this.props.data.report_id, report_id: this.props.data.report_id,
status: type, status: type,
months: this.props.months, months: this.props.months,
currency_id: this.props.defaultCurrency.id,
monthly_report: data monthly_report: data
} }
// console.log(body); // console.log(body);
...@@ -520,6 +533,9 @@ export default class OperatingIndicatorMR extends Component { ...@@ -520,6 +533,9 @@ export default class OperatingIndicatorMR extends Component {
if (response.data.status === "success") { if (response.data.status === "success") {
this.props.onClickClose() this.props.onClickClose()
this.props.getReport() this.props.getReport()
} else {
if (response.data.message == "Please Set Up Rate Currency First") {
this.setState({ visibleAlertSave: true, loading: false })
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => { 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")) { if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
...@@ -530,6 +546,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -530,6 +546,7 @@ export default class OperatingIndicatorMR extends Component {
} }
}) })
} }
}
} else { } else {
alert(response.problem) alert(response.problem)
} }
...@@ -573,6 +590,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -573,6 +590,7 @@ export default class OperatingIndicatorMR extends Component {
"periode": this.props.data.periode, "periode": this.props.data.periode,
"status": "submitted", "status": "submitted",
"months": this.props.months, "months": this.props.months,
"currency_id": this.props.defaultCurrency.id,
"monthly_report": data "monthly_report": data
} }
// console.log(JSON.stringify(payload)); // console.log(JSON.stringify(payload));
...@@ -662,7 +680,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -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) 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) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1)
} else if (dex === 2) { } 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) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex + type] = Number(total).toFixed(1)
} }
return total return total
...@@ -966,7 +984,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -966,7 +984,7 @@ export default class OperatingIndicatorMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[8]).toFixed(1) } value={Number(tableMeta.rowData[8]).toFixed(1)}
decimalScale={1} decimalScale={1}
/> />
: :
...@@ -1033,7 +1051,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1033,7 +1051,7 @@ export default class OperatingIndicatorMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[9]).toFixed(1) } value={Number(tableMeta.rowData[9]).toFixed(1)}
decimalScale={1} decimalScale={1}
/> />
: :
...@@ -1072,7 +1090,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1072,7 +1090,7 @@ export default class OperatingIndicatorMR extends Component {
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={ Number(tableMeta.rowData[9]).toFixed(1)} value={Number(tableMeta.rowData[9]).toFixed(1)}
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
...@@ -1080,7 +1098,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1080,7 +1098,7 @@ export default class OperatingIndicatorMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={ Number(tableMeta.rowData[9]).toFixed(1)} value={Number(tableMeta.rowData[9]).toFixed(1)}
decimalScale={1} decimalScale={1}
/> />
} }
...@@ -1101,7 +1119,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1101,7 +1119,7 @@ export default class OperatingIndicatorMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(tableMeta.rowData[10]).toFixed(1) } value={Number(tableMeta.rowData[10]).toFixed(1)}
decimalScale={1} decimalScale={1}
/> />
: :
...@@ -1126,7 +1144,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1126,7 +1144,7 @@ export default class OperatingIndicatorMR extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} 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" type="text"
placeholder="" placeholder=""
decimalScale={1} decimalScale={1}
...@@ -1146,7 +1164,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1146,7 +1164,7 @@ export default class OperatingIndicatorMR extends Component {
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={ Number(tableMeta.rowData[8]).toFixed(1)} value={Number(tableMeta.rowData[8]).toFixed(1)}
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
...@@ -1486,11 +1504,11 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1486,11 +1504,11 @@ export default class OperatingIndicatorMR extends Component {
<LightTooltipError title={"MTD Explanation vs MB is Reqiured"} arrow> <LightTooltipError title={"MTD Explanation vs MB is Reqiured"} arrow>
<Input <Input
disableUnderline={true} 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" type="text"
placeholder="" placeholder=""
multiline={true} 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]} // value={tableMeta.rowData[15]}
defaultValue={tableMeta.rowData[15]} defaultValue={tableMeta.rowData[15]}
inputProps={{ inputProps={{
...@@ -1514,7 +1532,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1514,7 +1532,7 @@ export default class OperatingIndicatorMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
multiline={true} 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]} defaultValue={tableMeta.rowData[15]}
inputProps={{ inputProps={{
style: { style: {
...@@ -1566,11 +1584,11 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1566,11 +1584,11 @@ export default class OperatingIndicatorMR extends Component {
<LightTooltipError title={"MTD Explanation vs RB is Reqiured"} arrow> <LightTooltipError title={"MTD Explanation vs RB is Reqiured"} arrow>
<Input <Input
disableUnderline={true} 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" type="text"
placeholder="" placeholder=""
multiline={true} 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]} // value={tableMeta.rowData[16]}
defaultValue={tableMeta.rowData[16]} defaultValue={tableMeta.rowData[16]}
inputProps={{ inputProps={{
...@@ -1594,7 +1612,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1594,7 +1612,7 @@ export default class OperatingIndicatorMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
multiline={true} 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]} defaultValue={tableMeta.rowData[16]}
inputProps={{ inputProps={{
style: { style: {
...@@ -1672,7 +1690,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1672,7 +1690,7 @@ export default class OperatingIndicatorMR extends Component {
this.props.months === 9 ? 'SEP' : this.props.months === 9 ? 'SEP' :
this.props.months === 10 ? 'OCT' : this.props.months === 10 ? 'OCT' :
this.props.months === 11 ? 'NOV' : 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>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div> </div>
...@@ -1778,7 +1796,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1778,7 +1796,7 @@ export default class OperatingIndicatorMR extends Component {
{this.state.get_for == 'view' && this.state.viewOnly && <button {this.state.get_for == 'view' && this.state.viewOnly && <button
type="button" type="button"
onClick={() => { onClick={() => {
this.setState({loading: true}, () => { this.setState({ loading: true }, () => {
this.handleGetFor('edit') this.handleGetFor('edit')
}) })
}} }}
...@@ -1875,7 +1893,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1875,7 +1893,7 @@ export default class OperatingIndicatorMR extends Component {
this.props.months === 9 ? 'SEP' : this.props.months === 9 ? 'SEP' :
this.props.months === 10 ? 'OCT' : this.props.months === 10 ? 'OCT' :
this.props.months === 11 ? 'NOV' : 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>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div> </div>
...@@ -2007,6 +2025,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -2007,6 +2025,7 @@ export default class OperatingIndicatorMR extends Component {
</button> </button>
</div> </div>
</div> </div>
<div style={{ padding: '25px 30px' }}>
<UploadFile <UploadFile
type={this.state.uploadStatus} type={this.state.uploadStatus}
percentage={this.state.percentage} percentage={this.state.percentage}
...@@ -2023,6 +2042,44 @@ export default class OperatingIndicatorMR extends Component { ...@@ -2023,6 +2042,44 @@ export default class OperatingIndicatorMR extends Component {
}} }}
/> />
</div> </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>
)} )}
</div> </div>
......
...@@ -419,6 +419,9 @@ export default class ProfitLossMR extends Component { ...@@ -419,6 +419,9 @@ export default class ProfitLossMR extends Component {
} else { } else {
this.props.saveToMonthlyReport() this.props.saveToMonthlyReport()
} }
} else {
if (response.data?.message == "Please Set Up Rate Currency First") {
this.setState({ visibleAlertSave: true })
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false, handleDoubleClick: 0 }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false, handleDoubleClick: 0 }, () => {
document.body.style.overflow = 'unset'; document.body.style.overflow = 'unset';
...@@ -431,8 +434,9 @@ export default class ProfitLossMR extends Component { ...@@ -431,8 +434,9 @@ export default class ProfitLossMR extends Component {
this.props.saveToMonthlyReport() this.props.saveToMonthlyReport()
}) })
} }
}
} else { } 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 { ...@@ -482,6 +486,7 @@ export default class ProfitLossMR extends Component {
...this.state.payload, ...this.state.payload,
currency_id: this.state.defaultCurrencyUpload?.id currency_id: this.state.defaultCurrencyUpload?.id
} }
console.log(this.props.monthlyReportId);
api.create().checkUploadMonthlyReportPL(payload).then(response => { api.create().checkUploadMonthlyReportPL(payload).then(response => {
// console.log(JSON.stringify(this.state.payload)); // console.log(JSON.stringify(this.state.payload));
console.log(response) console.log(response)
...@@ -594,7 +599,10 @@ export default class ProfitLossMR extends Component { ...@@ -594,7 +599,10 @@ export default class ProfitLossMR extends Component {
// this.props.onClickClose() // this.props.onClickClose()
// this.props.getReport() // this.props.getReport()
} else { } 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")) { if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => { setTimeout(() => {
localStorage.removeItem(Constant.TOKEN) localStorage.removeItem(Constant.TOKEN)
...@@ -602,6 +610,7 @@ export default class ProfitLossMR extends Component { ...@@ -602,6 +610,7 @@ export default class ProfitLossMR extends Component {
}, 1000); }, 1000);
} }
}) })
}
// alert(response.data.status) // alert(response.data.status)
} }
} else { } else {
...@@ -665,9 +674,9 @@ export default class ProfitLossMR extends Component { ...@@ -665,9 +674,9 @@ export default class ProfitLossMR extends Component {
"currency_id": this.props.defaultCurrency.id, "currency_id": this.props.defaultCurrency.id,
"profit_loss": data "profit_loss": data
} }
// console.log(JSON.stringify(payload)); console.log(JSON.stringify(payload));
api.create().validateSubmitReportPL(payload).then((response) => { api.create().validateSubmitReportPL(payload).then((response) => {
console.log(response.data.data.result) console.log(response)
console.log(err); console.log(err);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
...@@ -2472,7 +2481,7 @@ export default class ProfitLossMR extends Component { ...@@ -2472,7 +2481,7 @@ export default class ProfitLossMR extends Component {
marginRight: 20, marginRight: 20,
borderRadius: 9 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' }}> <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> <Typography style={{ fontSize: '15px', color: '#354960', textAlign: 'center' }}>Close</Typography>
......
import React, { Component } from 'react'; 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 MUIDataTable from 'mui-datatables';
import Images from '../../assets/Images'; import Images from '../../assets/Images';
import OperatingIndicatorDetail from './OperatingIndicatorDetail' import OperatingIndicatorDetail from './OperatingIndicatorDetail'
...@@ -15,6 +15,7 @@ import OperatingIndicatorMR from '../MonthlyReport/OperatingIndicatorMR'; ...@@ -15,6 +15,7 @@ import OperatingIndicatorMR from '../MonthlyReport/OperatingIndicatorMR';
import OperatingIndicatorRO from '../RollingOutlook/OperatingIndicatorRO'; import OperatingIndicatorRO from '../RollingOutlook/OperatingIndicatorRO';
import { PhotoSizeSelectLargeTwoTone, ThreeSixty } from '@material-ui/icons'; import { PhotoSizeSelectLargeTwoTone, ThreeSixty } from '@material-ui/icons';
import { startTransition } from 'react'; import { startTransition } from 'react';
import { PropagateLoader } from 'react-spinners';
var ct = require("../../library/CustomTable"); var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable()); const getMuiTheme = () => createMuiTheme(ct.customTable());
...@@ -46,6 +47,7 @@ export default class OperatingIndicator extends Component { ...@@ -46,6 +47,7 @@ export default class OperatingIndicator extends Component {
listPeriode: null, listPeriode: null,
periode: null, periode: null,
month: null, month: null,
loading: false,
quartal: null, quartal: null,
listCompany: null, listCompany: null,
company: null, company: null,
...@@ -66,7 +68,21 @@ export default class OperatingIndicator extends Component { ...@@ -66,7 +68,21 @@ export default class OperatingIndicator extends Component {
isCheckAll: false, isCheckAll: false,
downloadedFileReportId: null, downloadedFileReportId: null,
arrayReport: [], 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); this.fileHandler = this.fileHandler.bind(this);
} }
...@@ -136,6 +152,7 @@ export default class OperatingIndicator extends Component { ...@@ -136,6 +152,7 @@ export default class OperatingIndicator extends Component {
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
"periode": this.state.periode.periode, "periode": this.state.periode.periode,
"report_type": "operating indicator", "report_type": "operating indicator",
"currency_id": this.state.defaultCurrency.id
} }
console.log(payload); console.log(payload);
api.create().getAllOperatingInd(payload).then(response => { api.create().getAllOperatingInd(payload).then(response => {
...@@ -243,6 +260,7 @@ export default class OperatingIndicator extends Component { ...@@ -243,6 +260,7 @@ export default class OperatingIndicator extends Component {
this.setState({ listCompany: defaultProps, company: arrayBaru.length < 1 ? companyData[0] : arrayBaru[0] }, () => { this.setState({ listCompany: defaultProps, company: arrayBaru.length < 1 ? companyData[0] : arrayBaru[0] }, () => {
this.getLastPeriod() this.getLastPeriod()
this.getCurrency(this.state.company.company_id)
}) })
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
...@@ -260,6 +278,51 @@ export default class OperatingIndicator extends Component { ...@@ -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() { getPeriode() {
api.create().getPeriodeTransaction().then(response => { api.create().getPeriodeTransaction().then(response => {
let dateNow = new Date let dateNow = new Date
...@@ -316,9 +379,9 @@ export default class OperatingIndicator extends Component { ...@@ -316,9 +379,9 @@ export default class OperatingIndicator extends Component {
// console.log(response.data.data) // console.log(response.data.data)
this.getLatestPeriodSubmit() this.getLatestPeriodSubmit()
if (response.data.data) { 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 { } else {
this.setState({ operatingIndID: null }) this.setState({ operatingIndID: null, loading: false })
} }
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
...@@ -474,8 +537,24 @@ export default class OperatingIndicator extends Component { ...@@ -474,8 +537,24 @@ export default class OperatingIndicator extends Component {
saveOperatingInd(payload) { saveOperatingInd(payload) {
api.create().createOpetaingInd(payload).then((response) => { api.create().createOpetaingInd(payload).then((response) => {
console.log(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.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 { ...@@ -578,7 +657,7 @@ export default class OperatingIndicator extends Component {
// } // }
async handleGenerateReport(data) { async handleGenerateReport(data) {
let { selectReport, operatingIndID, company, periode, downloadedFileReportId } = this.state let { selectReport, operatingIndID, company, periode, downloadedFileReportId, defaultCurrency } = this.state
if (selectReport.length > 0) { if (selectReport.length > 0) {
let result = [] let result = []
console.log('mulai hit') console.log('mulai hit')
...@@ -603,10 +682,10 @@ export default class OperatingIndicator extends Component { ...@@ -603,10 +682,10 @@ export default class OperatingIndicator extends Component {
String(report[1]).toLocaleLowerCase().includes('dec') ? 12 : null String(report[1]).toLocaleLowerCase().includes('dec') ? 12 : null
if (String(report[1]).toLocaleLowerCase().includes('master budget')) { 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); console.log(url);
let res = await fetch( 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) { if (res.status === 200) {
...@@ -614,9 +693,9 @@ export default class OperatingIndicator extends Component { ...@@ -614,9 +693,9 @@ export default class OperatingIndicator extends Component {
} }
} else if (String(report[1]).toLocaleLowerCase().includes('monthly report')) { } 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( 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) { if (res.status === 200) {
...@@ -624,9 +703,9 @@ export default class OperatingIndicator extends Component { ...@@ -624,9 +703,9 @@ export default class OperatingIndicator extends Component {
} }
} else if (String(report[1]).toLocaleLowerCase().includes('rolling outlook')) { } 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( 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) { if (res.status === 200) {
...@@ -872,8 +951,27 @@ export default class OperatingIndicator extends Component { ...@@ -872,8 +951,27 @@ export default class OperatingIndicator extends Component {
{ value: '0', label: '0' }, { value: '0', label: '0' },
{ value: '1', label: '1' }, { 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 ( return (
<div style={{ flex: 1, backgroundColor: '#f8f8f8' }}> <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 && ( {this.state.visibleOperatingIndicator && (
<div> <div>
<div className={"main-color"} style={{ height: 78, display: 'flex', alignItems: 'center', paddingLeft: 20 }}> <div className={"main-color"} style={{ height: 78, display: 'flex', alignItems: 'center', paddingLeft: 20 }}>
...@@ -885,11 +983,11 @@ export default class OperatingIndicator extends Component { ...@@ -885,11 +983,11 @@ export default class OperatingIndicator extends Component {
<Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Operating Indicator</Typography> <Typography style={{ fontSize: '12px', color: '#4b4b4b', margin: 10 }}>Operating Indicator</Typography>
</div> </div>
<div style={{ padding: 20 }}> <div style={{ padding: 20 }}>
<div> <div style={{ display: 'flex' }}>
<Autocomplete <Autocomplete
{...this.state.listPeriode} {...this.state.listPeriode}
id="periode" id="periode"
onChange={(event, newInputValue) => this.setState({ periode: newInputValue }, () => { onChange={(event, newInputValue) => this.setState({ periode: newInputValue, loading: true }, () => {
this.getOperatingID() this.getOperatingID()
// this.getReportAttachment() // this.getReportAttachment()
})} })}
...@@ -900,13 +998,28 @@ export default class OperatingIndicator extends Component { ...@@ -900,13 +998,28 @@ export default class OperatingIndicator extends Component {
renderInput={(params) => <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}
/> />
<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>
<div style={{ marginTop: 20 }}> <div style={{ marginTop: 20 }}>
<Autocomplete <Autocomplete
{...this.state.listCompany} {...this.state.listCompany}
id="company" id="company"
onChange={(event, newInputValue) => this.setState({ company: newInputValue }, () => { onChange={(event, newInputValue) => this.setState({ company: newInputValue, loading: true }, () => {
this.getOperatingID() this.getOperatingID()
this.getCurrency(newInputValue.company_id)
// this.getReportAttachment() // this.getReportAttachment()
})} })}
clearOnEscape clearOnEscape
...@@ -983,6 +1096,8 @@ export default class OperatingIndicator extends Component { ...@@ -983,6 +1096,8 @@ export default class OperatingIndicator extends Component {
data={this.state.dataDetail} data={this.state.dataDetail}
height={this.props.height} height={this.props.height}
width={this.props.width} width={this.props.width}
defaultCurrency={this.state.defaultCurrency}
currency={this.state.currency}
onClickClose={() => this.setState({ visibleDetailOpt: false, visibleOperatingIndicator: true }, () => { onClickClose={() => this.setState({ visibleDetailOpt: false, visibleOperatingIndicator: true }, () => {
this.getOperatingID() this.getOperatingID()
this.forceUpdate() this.forceUpdate()
...@@ -1001,6 +1116,8 @@ export default class OperatingIndicator extends Component { ...@@ -1001,6 +1116,8 @@ export default class OperatingIndicator extends Component {
width={this.props.width} width={this.props.width}
months={this.state.months} months={this.state.months}
company={this.state.company} company={this.state.company}
defaultCurrency={this.state.defaultCurrency}
currency={this.state.currency}
onClickClose={() => this.setState({ visibleDetailMonthly: false, visibleOperatingIndicator: true }, () => { onClickClose={() => this.setState({ visibleDetailMonthly: false, visibleOperatingIndicator: true }, () => {
this.getOperatingID() this.getOperatingID()
this.forceUpdate() this.forceUpdate()
...@@ -1020,6 +1137,8 @@ export default class OperatingIndicator extends Component { ...@@ -1020,6 +1137,8 @@ export default class OperatingIndicator extends Component {
width={this.props.width} width={this.props.width}
quartal={this.state.quartal} quartal={this.state.quartal}
company={this.state.company} company={this.state.company}
defaultCurrency={this.state.defaultCurrency}
currency={this.state.currency}
onClickClose={() => this.setState({ visibleDetailRolling: false, visibleOperatingIndicator: true }, () => { onClickClose={() => this.setState({ visibleDetailRolling: false, visibleOperatingIndicator: true }, () => {
this.getOperatingID() this.getOperatingID()
this.forceUpdate() this.forceUpdate()
...@@ -1093,6 +1212,42 @@ export default class OperatingIndicator extends Component { ...@@ -1093,6 +1212,42 @@ export default class OperatingIndicator extends Component {
</div> </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 > </div >
); );
} }
......
...@@ -10,12 +10,16 @@ import Images from '../../assets/Images'; ...@@ -10,12 +10,16 @@ import Images from '../../assets/Images';
import ReactTooltip from 'react-tooltip'; import ReactTooltip from 'react-tooltip';
import UploadFile from "../../library/Upload"; import UploadFile from "../../library/Upload";
import { ExcelRenderer } from 'react-excel-renderer'; import { ExcelRenderer } from 'react-excel-renderer';
import { Alert } from '@material-ui/lab'; // import { Alert } from '@material-ui/lab';
import Constant from '../../library/Constant'; import Constant from '../../library/Constant';
import MuiAlert from '@material-ui/lab/Alert';
var ct = require("../../library/CustomTable"); var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable3()); const getMuiTheme = () => createMuiTheme(ct.customTable3());
const Alert = withStyles({
})((props) => <MuiAlert elevation={6} variant="filled" {...props} />);
const options = ct.customOptionsFixedColumn(); const options = ct.customOptionsFixedColumn();
const style = { const style = {
position: "sticky", position: "sticky",
...@@ -60,7 +64,12 @@ export default class BalanceSheet extends Component { ...@@ -60,7 +64,12 @@ export default class BalanceSheet extends Component {
emptyData: false, emptyData: false,
updateBy: [], updateBy: [],
notesUpdate: '-', notesUpdate: '-',
templateNull: true templateNull: true,
defaultCurrencyUpload: this.props.defaultCurrency,
visibleAlertSave: false,
alert: false,
tipeAlert: '',
messageAlert: '',
} }
this.handleValue = this.handleValue.bind(this) this.handleValue = this.handleValue.bind(this)
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
...@@ -105,12 +114,13 @@ export default class BalanceSheet extends Component { ...@@ -105,12 +114,13 @@ export default class BalanceSheet extends Component {
} }
getDataDetail() { getDataDetail() {
this.setState({ loading: true }) // this.setState({ loading: true })
let payload = { let payload = {
"operating_indicator_id": this.props.data.operatingIndID, "operating_indicator_id": this.props.data.operatingIndID,
"report_id": this.props.data.report_id, "report_id": this.props.data.report_id,
"company_id": this.props.data.company.company_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) console.log(payload)
api.create().getOperatingIndDetail(payload).then(response => { api.create().getOperatingIndDetail(payload).then(response => {
...@@ -229,6 +239,7 @@ export default class BalanceSheet extends Component { ...@@ -229,6 +239,7 @@ export default class BalanceSheet extends Component {
"report_id": this.props.data.report_id, "report_id": this.props.data.report_id,
"company_id": this.props.data.company.company_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,
"status": type, "status": type,
"master_budget": payloadMB "master_budget": payloadMB
} }
...@@ -236,7 +247,8 @@ export default class BalanceSheet extends Component { ...@@ -236,7 +247,8 @@ export default class BalanceSheet extends Component {
// // console.log('=========================') // // console.log('=========================')
// console.log(JSON.stringify(payload)) // console.log(JSON.stringify(payload))
this.props.saveOperatingInd(payload) this.props.saveOperatingInd(payload)
this.props.onClickClose() this.setState({ loading: false })
// this.props.onClickClose()
} }
handleValue(data) { handleValue(data) {
...@@ -265,42 +277,6 @@ export default class BalanceSheet extends Component { ...@@ -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 () => { downloadTemplate = async () => {
let res = await fetch( let res = await fetch(
...@@ -389,8 +365,12 @@ export default class BalanceSheet extends Component { ...@@ -389,8 +365,12 @@ export default class BalanceSheet extends Component {
} }
checkUpload() { checkUpload() {
let payload = {
...this.state.payload,
currency_id: this.state.defaultCurrencyUpload?.id
}
// // console.log(JSON.stringify(this.state.payload)) // // 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(JSON.stringify(this.state.payload));
// // console.log('===============') // // console.log('===============')
console.log(response) console.log(response)
...@@ -466,20 +446,27 @@ export default class BalanceSheet extends Component { ...@@ -466,20 +446,27 @@ export default class BalanceSheet extends Component {
operating_indicator_id: this.props.data.operatingIndID, operating_indicator_id: this.props.data.operatingIndID,
periode: this.props.data.periode, periode: this.props.data.periode,
report_id: this.props.data.report_id, report_id: this.props.data.report_id,
currency_id: this.props.defaultCurrency.id,
status: type, status: type,
master_budget: data master_budget: data
} }
// // console.log(data); // // console.log(data);
// // console.log(JSON.stringify(body)) // // console.log(JSON.stringify(body))
api.create('UPLOAD').uploadOperatingInd(body).then(response => { api.create('UPLOAD').uploadOperatingInd(body).then(response => {
// // console.log(response); console.log(response);
this.setState({ loading: false }) this.setState({ loading: false })
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.props.onClickClose() this.props.onClickClose()
this.props.getReport() this.props.getReport()
} else { } 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 { } else {
alert(response.problem) alert(response.problem)
...@@ -1879,8 +1866,8 @@ export default class BalanceSheet extends Component { ...@@ -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`, // name: `31 Dec 2023\nTotal`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
...@@ -1965,8 +1952,8 @@ export default class BalanceSheet extends Component { ...@@ -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`, // name: `31 Dec 2024\nTotal`,
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
...@@ -2378,6 +2365,7 @@ export default class BalanceSheet extends Component { ...@@ -2378,6 +2365,7 @@ export default class BalanceSheet extends Component {
</button> </button>
</div> </div>
</div> </div>
<div style={{ padding: '25px 30px' }}>
<UploadFile <UploadFile
type={this.state.uploadStatus} type={this.state.uploadStatus}
percentage={this.state.percentage} percentage={this.state.percentage}
...@@ -2394,6 +2382,44 @@ export default class BalanceSheet extends Component { ...@@ -2394,6 +2382,44 @@ export default class BalanceSheet extends Component {
}} }}
/> />
</div> </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>
)} )}
</div> </div>
......
...@@ -625,7 +625,8 @@ export default class OutlookPA extends Component { ...@@ -625,7 +625,8 @@ export default class OutlookPA extends Component {
"report": 'ratio', "report": 'ratio',
"outlookPaId": this.state.outlook_pa_id, "outlookPaId": this.state.outlook_pa_id,
"companyId": this.state.company.company_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) => { api.create().triggerRatioOLPA(bodyRatioOLPA).then((res) => {
console.log(res) console.log(res)
...@@ -993,7 +994,8 @@ export default class OutlookPA extends Component { ...@@ -993,7 +994,8 @@ export default class OutlookPA extends Component {
let PLID = null let PLID = null
let payloadID = { let payloadID = {
"periode": this.state.periode.periode, "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); console.log(payloadID);
api.create().getPLID(payloadID).then(response => { api.create().getPLID(payloadID).then(response => {
...@@ -1010,6 +1012,7 @@ export default class OutlookPA extends Component { ...@@ -1010,6 +1012,7 @@ export default class OutlookPA extends Component {
"periode": this.state.periode.periode, "periode": this.state.periode.periode,
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
"outlook_pa_id": this.state.PLID, "outlook_pa_id": this.state.PLID,
"currency_id": this.state.defaultCurrency.id,
} }
api.create().getHierarkiDBPLOLPA(payload).then(response => { api.create().getHierarkiDBPLOLPA(payload).then(response => {
// console.log(response); // console.log(response);
...@@ -1470,6 +1473,7 @@ export default class OutlookPA extends Component { ...@@ -1470,6 +1473,7 @@ export default class OutlookPA extends Component {
"status": "submitted", "status": "submitted",
"profit_loss_id": this.state.PLID, "profit_loss_id": this.state.PLID,
"profit_loss_olpa": this.state.dbPL, "profit_loss_olpa": this.state.dbPL,
"currency_id": this.state.defaultCurrency.id,
} }
console.log(this.state.dbPL) console.log(this.state.dbPL)
// console.log(JSON.stringify(payload)) // console.log(JSON.stringify(payload))
......
...@@ -52,7 +52,12 @@ export default class OperatingIndicatorRO extends Component { ...@@ -52,7 +52,12 @@ export default class OperatingIndicatorRO extends Component {
judulColumn: null, judulColumn: null,
saveDraft: true, saveDraft: true,
viewOnly: 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.handleValue = this.handleValue.bind(this)
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
...@@ -152,7 +157,8 @@ export default class OperatingIndicatorRO extends Component { ...@@ -152,7 +157,8 @@ export default class OperatingIndicatorRO extends Component {
"company_id": this.props.data.company.company_id, "company_id": this.props.data.company.company_id,
"periode": this.props.data.periode, "periode": this.props.data.periode,
"quartal": this.props.quartal, "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) console.log(payload)
api.create().getHierarkiRollingOI(payload).then(response => { api.create().getHierarkiRollingOI(payload).then(response => {
...@@ -274,6 +280,7 @@ export default class OperatingIndicatorRO extends Component { ...@@ -274,6 +280,7 @@ export default class OperatingIndicatorRO extends Component {
"company_id": this.props.data.company.company_id, "company_id": this.props.data.company.company_id,
"periode": this.props.data.periode, "periode": this.props.data.periode,
"quartal": this.props.quartal, "quartal": this.props.quartal,
"currency_id": this.props.defaultCurrency.id,
"status": type, "status": type,
"rolling_outlook": payloadRO "rolling_outlook": payloadRO
} }
......
...@@ -331,7 +331,8 @@ export default class RollingOutlook extends Component { ...@@ -331,7 +331,8 @@ export default class RollingOutlook extends Component {
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
"periode": this.state.periode.periode, "periode": this.state.periode.periode,
"report_type": "Rolling Outlook", "report_type": "Rolling Outlook",
"quartal": this.state.quarter.value "quartal": this.state.quarter.value,
"currency_id": this.state.defaultCurrency.id
} }
let dataHardcode = [] let dataHardcode = []
api.create().getRollingOutlookReport(payload).then(response => { api.create().getRollingOutlookReport(payload).then(response => {
...@@ -659,7 +660,8 @@ export default class RollingOutlook extends Component { ...@@ -659,7 +660,8 @@ export default class RollingOutlook extends Component {
"rollingOutlookId": this.state.rollingOutlookID, "rollingOutlookId": this.state.rollingOutlookID,
"periode": this.state.periode.periode, "periode": this.state.periode.periode,
"companyId": this.state.company.company_id, "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) => { api.create().triggerRatioRO(bodyRatioBs).then((res) => {
console.log(res) console.log(res)
...@@ -1017,7 +1019,8 @@ export default class RollingOutlook extends Component { ...@@ -1017,7 +1019,8 @@ export default class RollingOutlook extends Component {
let PLID = null let PLID = null
let payloadID = { let payloadID = {
"periode": this.state.periode.periode, "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); console.log(payloadID);
api.create().getPLID(payloadID).then(response => { api.create().getPLID(payloadID).then(response => {
...@@ -1035,6 +1038,7 @@ export default class RollingOutlook extends Component { ...@@ -1035,6 +1038,7 @@ export default class RollingOutlook extends Component {
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
"quartal": this.state.quarter.value, "quartal": this.state.quarter.value,
"rolling_outlook_id": this.state.PLID, "rolling_outlook_id": this.state.PLID,
"currency_id": this.state.defaultCurrency.id
} }
api.create().getHierarkiDBPLRO(payload).then(response => { api.create().getHierarkiDBPLRO(payload).then(response => {
// console.log(response); // console.log(response);
...@@ -1496,6 +1500,7 @@ export default class RollingOutlook extends Component { ...@@ -1496,6 +1500,7 @@ export default class RollingOutlook extends Component {
"profit_loss_id": this.state.PLID, "profit_loss_id": this.state.PLID,
"profit_loss_ro": this.state.dbPL, "profit_loss_ro": this.state.dbPL,
"quartal": this.state.quarter.value, "quartal": this.state.quarter.value,
"currency_id": this.state.defaultCurrency.id
} }
console.log(this.state.dbPL) console.log(this.state.dbPL)
// console.log(JSON.stringify(payload)) // 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