Commit 922d32d3 authored by Riri Novita's avatar Riri Novita

Update Stopper

parent 8d8eba06
...@@ -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)
......
...@@ -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>
......
...@@ -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