Commit 26f0ff1f authored by ardiansyah's avatar ardiansyah

Merge branch 'ENV-DEV' into 'BACKUP-DEV'

Env dev

See merge request !1946
parents 9a03510b b4f4c049
...@@ -452,7 +452,7 @@ const create = (type = "") => { ...@@ -452,7 +452,7 @@ const create = (type = "") => {
const triggerRatioMB = (body) => api.get(`/transaction/cronjob/create_master_budget_company/${body.report}/${body.submissionId}/${body.companyId}/${body.periode}/${body.currency_id}`) const triggerRatioMB = (body) => api.get(`/transaction/cronjob/create_master_budget_company/${body.report}/${body.submissionId}/${body.companyId}/${body.periode}/${body.currency_id}`)
const triggerRatioRO = (body) => api.get(`/transaction/cronjob/create_rolling_outlook_company/${body.report}/${body.rollingOutlookId}/${body.companyId}/${body.quartal}/${body.periode}/${body.currency_id}`) const triggerRatioRO = (body) => api.get(`/transaction/cronjob/create_rolling_outlook_company/${body.report}/${body.rollingOutlookId}/${body.companyId}/${body.quartal}/${body.periode}/${body.currency_id}`)
const triggerRatioOLPA = (body) => api.get(`/transaction/cronjob/create_outlook_pa_company/${body.report}/${body.outlookPaId}/${body.companyId}/${body.periode}/${body.currency_id}`) const triggerRatioOLPA = (body) => api.get(`/transaction/cronjob/create_outlook_pa_company/${body.report}/${body.outlookPaId}/${body.companyId}/${body.periode}/${body.currency_id}`)
const triggerHistoricalRatio = (body) => api.get(`/transaction/cronjob/create_historical_company/${body.report}/${body.companyId}/${body.periode}/${body.currency_id}`) const triggerHistoricalRatio = (body) => api.get(`/transaction/cronjob/create_historical_company/${body.report}/${body.companyId}/${body.periode}/${body.currency_id}/${body.months}`)
// MonthlyPL // MonthlyPL
// const getHierarkiMontlyReportPL = (body) => api.post('transaction/monthly_report_pl/get_report_hierarki', body) // const getHierarkiMontlyReportPL = (body) => api.post('transaction/monthly_report_pl/get_report_hierarki', body)
......
This diff is collapsed.
...@@ -614,8 +614,7 @@ export default class BudgetTahunan extends Component { ...@@ -614,8 +614,7 @@ export default class BudgetTahunan extends Component {
}) })
} }
getSubmission(type, trigger) { getSubmission(type) {
console.log(trigger);
this.setState({ loading: true }, () => { this.setState({ loading: true }, () => {
document.body.style.overflow = 'hidden'; document.body.style.overflow = 'hidden';
}) })
...@@ -668,22 +667,8 @@ export default class BudgetTahunan extends Component { ...@@ -668,22 +667,8 @@ export default class BudgetTahunan extends Component {
} }
if (type != undefined && type == 'PL') { if (type != undefined && type == 'PL') {
// this.getCashFlow(type) // this.getCashFlow(type)
this.getPL(type, trigger) this.getPL(type)
} else if (type != undefined && type == 'BS') { } else if (type != undefined && type == 'BS') {
if (trigger === 'simulasiBS') {
let bodyRatioBs = {
"report": 'ratio',
"submissionId": this.state.submissionID,
"periode": this.state.periode.periode,
"companyId": this.state.company.company_id,
"currency_id": this.state.defaultCurrency.id,
}
// console.log(bodyRatioBs);
api.create().triggerRatioMBSimulasi(bodyRatioBs).then((res) => {
console.log(res)
this.setState({ loading: false })
})
} else {
let bodyRatioBs = { let bodyRatioBs = {
"report": 'ratio', "report": 'ratio',
"submissionId": this.state.submissionID, "submissionId": this.state.submissionID,
...@@ -696,7 +681,6 @@ export default class BudgetTahunan extends Component { ...@@ -696,7 +681,6 @@ export default class BudgetTahunan extends Component {
console.log(res) console.log(res)
this.setState({ loading: false }) this.setState({ loading: false })
}) })
}
} else { } else {
this.setState({ loading: false }) this.setState({ loading: false })
} }
...@@ -1320,26 +1304,7 @@ export default class BudgetTahunan extends Component { ...@@ -1320,26 +1304,7 @@ export default class BudgetTahunan extends Component {
}) })
} }
createCashFlow(payload, trigger) { createCashFlow(payload) {
console.log(trigger);
if (trigger === "simulasi") {
api.create().createReportCFSimulasi(payload).then((res) => {
console.log(res)
// this.getSubmission()
if (res.data) {
if (res.data.status === "success") {
this.setState({ visibleCF: false, visibleBudgetTahunan: true })
this.getSubmission()
} else {
if (res.data.message == "Please Set Up Rate Currency First") {
this.setState({ visibleAlertSave: true })
} else {
this.setState({ alert: true, messageAlert: res.data.message, tipeAlert: 'warning', loading: false })
}
}
}
})
} else {
api.create().createReportCF(payload).then((res) => { api.create().createReportCF(payload).then((res) => {
console.log(res) console.log(res)
// this.getSubmission() // this.getSubmission()
...@@ -1371,9 +1336,8 @@ export default class BudgetTahunan extends Component { ...@@ -1371,9 +1336,8 @@ export default class BudgetTahunan extends Component {
// } // }
}) })
} }
}
getPL(type, trigger) { getPL(type) {
let PLID = null let PLID = null
let payloadID = { let payloadID = {
"periode": this.state.periode.periode, "periode": this.state.periode.periode,
...@@ -1484,7 +1448,7 @@ export default class BudgetTahunan extends Component { ...@@ -1484,7 +1448,7 @@ export default class BudgetTahunan extends Component {
}) })
// console.log(dataTable) // console.log(dataTable)
this.setState({ dbPL: dataTable }, () => { this.setState({ dbPL: dataTable }, () => {
this.olahDataPL(this.state.dbPL, type, trigger) this.olahDataPL(this.state.dbPL, type)
}) })
} else { } else {
this.setState({ dbPL: [], previewTable: false, previewDownload: false }) this.setState({ dbPL: [], previewTable: false, previewDownload: false })
...@@ -1723,7 +1687,7 @@ export default class BudgetTahunan extends Component { ...@@ -1723,7 +1687,7 @@ export default class BudgetTahunan extends Component {
return total return total
} }
olahDataPL(dbPL, type, trigger) { olahDataPL(dbPL, type) {
dbPL.map((item, index) => { dbPL.map((item, index) => {
if (item[0] == 5 || item[0] == 6 || item[0] == 7) { if (item[0] == 5 || item[0] == 6 || item[0] == 7) {
item[7].value = this.handleValueFormulaDBPL(index, item[7], item, 7) item[7].value = this.handleValueFormulaDBPL(index, item[7], item, 7)
...@@ -1743,11 +1707,11 @@ export default class BudgetTahunan extends Component { ...@@ -1743,11 +1707,11 @@ export default class BudgetTahunan extends Component {
} }
}) })
this.setState({ dbPL }, () => { this.setState({ dbPL }, () => {
this.payloadPL(type, trigger) this.payloadPL(type)
}) })
} }
payloadPL(type, trigger) { payloadPL(type) {
let listPL = [] let listPL = []
// console.log(this.state.dbPL) // console.log(this.state.dbPL)
this.state.dbPL.map((item, index) => { this.state.dbPL.map((item, index) => {
...@@ -1842,14 +1806,13 @@ export default class BudgetTahunan extends Component { ...@@ -1842,14 +1806,13 @@ export default class BudgetTahunan extends Component {
if (type != undefined) { if (type != undefined) {
if (type == 'PL') { if (type == 'PL') {
// console.log('tarik sis') // console.log('tarik sis')
this.createDBPL(trigger) this.createDBPL()
} }
} }
}) })
} }
createDBPL(trigger) { createDBPL() {
console.log(trigger);
let payload = { let payload = {
// "submission_id": this.state.submissionID, // "submission_id": this.state.submissionID,
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
...@@ -1863,12 +1826,6 @@ export default class BudgetTahunan extends Component { ...@@ -1863,12 +1826,6 @@ export default class BudgetTahunan extends Component {
} }
// console.log(this.state.dbCF) // console.log(this.state.dbCF)
// console.log(JSON.stringify(payload)) // console.log(JSON.stringify(payload))
if (trigger === "simulasiPL") {
api.create().createReportPLMBSimulasi(payload).then((res) => {
// console.log(res)
this.setState({ loading: false })
})
} else {
api.create().createReportPLMB(payload).then((res) => { api.create().createReportPLMB(payload).then((res) => {
// console.log(res) // console.log(res)
this.setState({ loading: false }) this.setState({ loading: false })
...@@ -1888,7 +1845,6 @@ export default class BudgetTahunan extends Component { ...@@ -1888,7 +1845,6 @@ export default class BudgetTahunan extends Component {
// } // }
}) })
} }
}
getFR(type) { getFR(type) {
// console.log("get FR"); // console.log("get FR");
......
...@@ -336,7 +336,7 @@ export default class CashFlow extends Component { ...@@ -336,7 +336,7 @@ export default class CashFlow extends Component {
this.setState({ alert: false }) this.setState({ alert: false })
} }
olahDataCashFlow(dataTable2, trigger) { olahDataCashFlow(dataTable2) {
console.log(dataTable2) console.log(dataTable2)
let listCF = [] let listCF = []
dataTable2.map((item, index) => { dataTable2.map((item, index) => {
...@@ -373,10 +373,10 @@ export default class CashFlow extends Component { ...@@ -373,10 +373,10 @@ export default class CashFlow extends Component {
}) })
console.log(listCF) console.log(listCF)
this.createCashFlow(listCF, trigger) this.createCashFlow(listCF)
} }
createCashFlow(dbcf, trigger) { createCashFlow(dbcf) {
let payload = { let payload = {
"submission_id": this.props.submissionID, "submission_id": this.props.submissionID,
"company_id": this.props.company.company_id, "company_id": this.props.company.company_id,
...@@ -388,7 +388,7 @@ export default class CashFlow extends Component { ...@@ -388,7 +388,7 @@ export default class CashFlow extends Component {
} }
console.log(dbcf) console.log(dbcf)
console.log(JSON.stringify(payload)) console.log(JSON.stringify(payload))
this.props.createCashFlow(payload, trigger) this.props.createCashFlow(payload)
// this.props.onClickClose() // this.props.onClickClose()
} }
...@@ -3340,29 +3340,6 @@ export default class CashFlow extends Component { ...@@ -3340,29 +3340,6 @@ export default class CashFlow extends Component {
</button> </button>
</div> </div>
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}> <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button
type="button"
// disabled={this.state.buttonError}
onClick={() =>
// this.state.buttonError ?
// this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' })
// :
this.state.handleDoubleClick == 1 ? null :
this.setState({ handleDoubleClick: 1 }, () => {
this.olahDataCashFlow(dataTable2, "simulasi")
})}
style={{
backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 15
}}
>
<div style={{ backgroundColor: '#cd5c5c', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save Data Simulasi</Typography>
</div>
</button>
{this.props.isApprover === true || dataTable2.length == 0 ? null : {this.props.isApprover === true || dataTable2.length == 0 ? null :
(!this.props.truelyApprover) && (this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? (!this.props.truelyApprover) && (this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ?
<button <button
......
This diff is collapsed.
This diff is collapsed.
...@@ -36,6 +36,7 @@ export default class CreateParameter extends Component { ...@@ -36,6 +36,7 @@ export default class CreateParameter extends Component {
operators: null, operators: null,
getOperators: null, getOperators: null,
tempData: null, tempData: null,
tesValue: null,
errorParameter: false, errorParameter: false,
errorDeskripsi: false, errorDeskripsi: false,
errorReportName: false, errorReportName: false,
...@@ -91,7 +92,8 @@ export default class CreateParameter extends Component { ...@@ -91,7 +92,8 @@ export default class CreateParameter extends Component {
getSettingTypeID: data.setting_type_id, getSettingTypeID: data.setting_type_id,
typeReport: data.setting_type_name, typeReport: data.setting_type_name,
getTypeReportID: data.setting_type_id, getTypeReportID: data.setting_type_id,
enableReportName: data.setting_group === "CURRENCY" ? true : false enableReportName: data.setting_group === "CURRENCY" ? true : false,
tesValue: response.data.data.setting_group === "CURRENCY" ? Number(response.data.data.value)*1000 : response.data.data.value
}, () => { }, () => {
this.getAllGroup() this.getAllGroup()
...@@ -604,9 +606,9 @@ export default class CreateParameter extends Component { ...@@ -604,9 +606,9 @@ export default class CreateParameter extends Component {
} }
updateParameter() { updateParameter() {
let char = this.state.tempData.value // let char = this.state.value
let arrayChar = char.split(''); // let arrayChar = char.split('');
console.log(arrayChar); // console.log(char);
let body = { let body = {
"setting_id": this.state.tempData.setting_id, "setting_id": this.state.tempData.setting_id,
"setting_group_id": this.state.getTypes.setting_group_id, "setting_group_id": this.state.getTypes.setting_group_id,
...@@ -615,9 +617,7 @@ export default class CreateParameter extends Component { ...@@ -615,9 +617,7 @@ export default class CreateParameter extends Component {
"reference_id": this.state.getReportName == null ? null : this.state.getReportName.setting_type_id, "reference_id": this.state.getReportName == null ? null : this.state.getReportName.setting_type_id,
"description": this.state.tempData.description, "description": this.state.tempData.description,
"orders": this.state.tempData.order, "orders": this.state.tempData.order,
// "value": this.state.tempData.value, "value": this.state.tempData.value,
// convert IDR to IDR mn
"value": this.state.enableReportName ? this.state.tempData.value.includes(".") || arrayChar.length == 2 ? this.state.tempData.value : Number((this.state.tempData.value)/1000).toFixed(1) : this.state.tempData.value ,
"max_value": this.state.tempData.max_value, "max_value": this.state.tempData.max_value,
"min_value": this.state.tempData.min_value, "min_value": this.state.tempData.min_value,
"start_date": this.state.tempData.start_date, "start_date": this.state.tempData.start_date,
...@@ -630,7 +630,7 @@ export default class CreateParameter extends Component { ...@@ -630,7 +630,7 @@ export default class CreateParameter extends Component {
createParameter() { createParameter() {
let char = this.state.value let char = this.state.value
let arrayChar = char.split(''); let arrayChar = char.split('');
console.log(arrayChar); // console.log(char);
let body = { let body = {
"setting_group_id": this.state.getTypes.setting_group_id, "setting_group_id": this.state.getTypes.setting_group_id,
"setting_type_id": this.state.getParameter.setting_type_id, "setting_type_id": this.state.getParameter.setting_type_id,
...@@ -638,6 +638,7 @@ export default class CreateParameter extends Component { ...@@ -638,6 +638,7 @@ export default class CreateParameter extends Component {
"reference_id": this.state.getReportName == null ? null : this.state.getReportName.setting_type_id, "reference_id": this.state.getReportName == null ? null : this.state.getReportName.setting_type_id,
"description": this.state.description, "description": this.state.description,
"orders": this.state.order, "orders": this.state.order,
"value": this.state.value,
// convert IDR to IDR mn // convert IDR to IDR mn
"value": this.state.enableReportName ? this.state.value.includes(".") || arrayChar.length == 2 ? this.state.value : Number((this.state.value)/1000).toFixed(1) : this.state.value , "value": this.state.enableReportName ? this.state.value.includes(".") || arrayChar.length == 2 ? this.state.value : Number((this.state.value)/1000).toFixed(1) : this.state.value ,
"max_value": this.state.maxValue, "max_value": this.state.maxValue,
...@@ -851,7 +852,7 @@ export default class CreateParameter extends Component { ...@@ -851,7 +852,7 @@ export default class CreateParameter extends Component {
this.setState({ this.setState({
tempData: { tempData: {
...this.state.tempData, ...this.state.tempData,
value: e.target.value value: this.state.tempData.setting_group === "CURRENCY" ? e.target.value/1000 : e.target.value
} }
}) })
this.clearMessage() this.clearMessage()
......
...@@ -214,7 +214,7 @@ export default class CashFlowMR extends Component { ...@@ -214,7 +214,7 @@ export default class CashFlowMR extends Component {
} }
} }
payloadCF(dataTable2, trigger) { payloadCF(dataTable2) {
let listCF = [] let listCF = []
console.log(dataTable2) console.log(dataTable2)
dataTable2.map((item, index) => { dataTable2.map((item, index) => {
...@@ -232,10 +232,10 @@ export default class CashFlowMR extends Component { ...@@ -232,10 +232,10 @@ export default class CashFlowMR extends Component {
// } // }
}) })
this.createCashFlow(listCF, trigger) this.createCashFlow(listCF)
} }
createCashFlow(listCF, trigger) { createCashFlow(listCF) {
let payload = { let payload = {
"monthly_report_id": this.props.monthlyReportId, "monthly_report_id": this.props.monthlyReportId,
"company_id": this.props.company.company_id, "company_id": this.props.company.company_id,
...@@ -246,7 +246,7 @@ export default class CashFlowMR extends Component { ...@@ -246,7 +246,7 @@ export default class CashFlowMR extends Component {
"currency_id": this.props.defaultCurrency.id, "currency_id": this.props.defaultCurrency.id,
"cash_flow": listCF "cash_flow": listCF
} }
this.props.createCashFlow(payload, trigger) this.props.createCashFlow(payload)
} }
render() { render() {
...@@ -766,29 +766,6 @@ export default class CashFlowMR extends Component { ...@@ -766,29 +766,6 @@ export default class CashFlowMR extends Component {
</button> </button>
</div> </div>
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}> <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button
type="button"
// disabled={this.state.buttonError}
onClick={() =>
// this.state.buttonError ?
// this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' })
// :
this.state.handleDoubleClick == 1 ? null :
this.setState({ handleDoubleClick: 1 }, () => {
this.payloadCF(dataTable2, "simulasi")
})}
style={{
backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer',
borderColor: 'transparent',
outline: 'none',
marginRight: 15
}}
>
<div style={{ backgroundColor: '#cd5c5c', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save Data Simulasi</Typography>
</div>
</button>
{this.state.viewOnly && {this.state.viewOnly &&
<button <button
type="button" type="button"
......
...@@ -685,7 +685,7 @@ export default class MonthlyReport extends Component { ...@@ -685,7 +685,7 @@ export default class MonthlyReport extends Component {
}) })
} }
getMonthlyReportID(type, trigger) { getMonthlyReportID(type) {
this.setState({ selectReport: [], isCheckAll: false }, () => { this.setState({ selectReport: [], isCheckAll: false }, () => {
let payload = { let payload = {
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
...@@ -730,7 +730,7 @@ export default class MonthlyReport extends Component { ...@@ -730,7 +730,7 @@ export default class MonthlyReport extends Component {
} }
// this.getPL(type) // this.getPL(type)
if (type != undefined && type == 'PL') { if (type != undefined && type == 'PL') {
this.getPL(type, trigger) this.getPL(type)
} else if (type != undefined && type == 'LOCF') { } else if (type != undefined && type == 'LOCF') {
let bodyRatioLocf = { let bodyRatioLocf = {
"report": 'ratio', "report": 'ratio',
...@@ -740,17 +740,10 @@ export default class MonthlyReport extends Component { ...@@ -740,17 +740,10 @@ export default class MonthlyReport extends Component {
"months": this.state.month.month_id, "months": this.state.month.month_id,
"currency_id": this.state.defaultCurrency.id "currency_id": this.state.defaultCurrency.id
} }
if (trigger == "simulasiLOCF") {
api.create().triggerHistoricalRatioSimulasi(bodyRatioLocf).then((res) => {
console.log(res)
this.setState({ loading: false })
})
} else {
api.create().triggerHistoricalRatio(bodyRatioLocf).then((res) => { api.create().triggerHistoricalRatio(bodyRatioLocf).then((res) => {
console.log(res) console.log(res)
this.setState({ loading: false }) this.setState({ loading: false })
}) })
}
} else if (type != undefined && type == 'BS') { } else if (type != undefined && type == 'BS') {
let bodyRatioBs = { let bodyRatioBs = {
"report": 'ratio', "report": 'ratio',
...@@ -760,17 +753,10 @@ export default class MonthlyReport extends Component { ...@@ -760,17 +753,10 @@ export default class MonthlyReport extends Component {
"months": this.state.month.month_id, "months": this.state.month.month_id,
"currency_id": this.state.defaultCurrency.id "currency_id": this.state.defaultCurrency.id
} }
if (trigger === 'simulasiBS') {
api.create().triggerRatioFromLOCFSimulasi(bodyRatioBs).then((res) => {
console.log(res)
this.setState({ loading: false })
})
} else {
api.create().triggerRatioFromLOCF(bodyRatioBs).then((res) => { api.create().triggerRatioFromLOCF(bodyRatioBs).then((res) => {
console.log(res) console.log(res)
this.setState({ loading: false }) this.setState({ loading: false })
}) })
}
} else { } else {
this.setState({ loading: false }) this.setState({ loading: false })
} }
...@@ -856,8 +842,7 @@ export default class MonthlyReport extends Component { ...@@ -856,8 +842,7 @@ export default class MonthlyReport extends Component {
}) })
} }
saveToMonthlyReport(type, trigger) { saveToMonthlyReport(type) {
console.log(trigger);
this.setState({ this.setState({
visibleMonthlyReport: true, visibleMonthlyReport: true,
loading: true, loading: true,
...@@ -870,7 +855,7 @@ export default class MonthlyReport extends Component { ...@@ -870,7 +855,7 @@ export default class MonthlyReport extends Component {
visibleLOCF: false, visibleLOCF: false,
visibleOI: false, visibleOI: false,
}, () => { }, () => {
this.getMonthlyReportID(type, trigger) this.getMonthlyReportID(type)
}) })
} }
...@@ -1543,22 +1528,15 @@ export default class MonthlyReport extends Component { ...@@ -1543,22 +1528,15 @@ export default class MonthlyReport extends Component {
}) })
} }
createCashFlow(payload, trigger) { createCashFlow(payload) {
console.log(JSON.stringify(payload)) console.log(JSON.stringify(payload))
if (trigger === "simulasi") {
api.create().uploadSimulasiMRCF(payload).then((res) => {
this.saveToMonthlyReport()
console.log(res)
})
} else {
api.create().createMonthlyReportCF(payload).then((res) => { api.create().createMonthlyReportCF(payload).then((res) => {
this.saveToMonthlyReport() this.saveToMonthlyReport()
console.log(res) console.log(res)
}) })
} }
}
getPL(type, trigger) { getPL(type) {
let PLID = null let PLID = null
let payloadID = { let payloadID = {
"periode": this.state.periode.periode, "periode": this.state.periode.periode,
...@@ -1683,7 +1661,7 @@ export default class MonthlyReport extends Component { ...@@ -1683,7 +1661,7 @@ export default class MonthlyReport extends Component {
console.log(JSON.stringify(dataTable)) console.log(JSON.stringify(dataTable))
console.log(dataTable) console.log(dataTable)
this.setState({ dbPL: dataTable }, () => { this.setState({ dbPL: dataTable }, () => {
this.olahDataPL(this.state.dbPL, type, trigger) this.olahDataPL(this.state.dbPL, type)
}) })
} else { } else {
this.setState({ loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
...@@ -1919,7 +1897,7 @@ export default class MonthlyReport extends Component { ...@@ -1919,7 +1897,7 @@ export default class MonthlyReport extends Component {
} }
olahDataPL(dbPL, type, trigger) { olahDataPL(dbPL, type) {
dbPL.map((item, index) => { dbPL.map((item, index) => {
if (item[0] == 5 || item[0] == 6) { if (item[0] == 5 || item[0] == 6) {
item[6].value = this.handleValueFormulaDBPLMR(item[6], item, 6) item[6].value = this.handleValueFormulaDBPLMR(item[6], item, 6)
...@@ -1928,11 +1906,11 @@ export default class MonthlyReport extends Component { ...@@ -1928,11 +1906,11 @@ export default class MonthlyReport extends Component {
}) })
// console.log(dbPL) // console.log(dbPL)
this.setState({ dbPL }, () => { this.setState({ dbPL }, () => {
this.payloadPL(type, trigger) this.payloadPL(type)
}) })
} }
payloadPL(type, trigger) { payloadPL(type) {
let listPL = [] let listPL = []
this.state.dbPL.map((item, index) => { this.state.dbPL.map((item, index) => {
// if (item[6].value == "" || item[6].value == 0 || item[6].value == "0.0") { // if (item[6].value == "" || item[6].value == 0 || item[6].value == "0.0") {
...@@ -1961,14 +1939,14 @@ export default class MonthlyReport extends Component { ...@@ -1961,14 +1939,14 @@ export default class MonthlyReport extends Component {
// console.log(this.state.dbPL) // console.log(this.state.dbPL)
// this.setState({ loading: false }) // this.setState({ loading: false })
console.log('tarik sis') console.log('tarik sis')
this.createPL(trigger) this.createPL()
} }
} }
}) })
} }
createPL(trigger) { createPL() {
console.log(trigger); console.log();
let payload = { let payload = {
// "monthly_report_id": this.state.monthlyReportId, // "monthly_report_id": this.state.monthlyReportId,
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
...@@ -1981,12 +1959,6 @@ export default class MonthlyReport extends Component { ...@@ -1981,12 +1959,6 @@ export default class MonthlyReport extends Component {
"profit_loss_mr": this.state.dbPL, "profit_loss_mr": this.state.dbPL,
"currency_id": this.state.defaultCurrency.id "currency_id": this.state.defaultCurrency.id
} }
if (trigger === "simulasiPL") {
api.create().createSimulasiReportPLMR(payload).then((res) => {
console.log(res)
this.setState({ loading: false })
})
} else {
api.create().createReportPLMR(payload).then((res) => { api.create().createReportPLMR(payload).then((res) => {
console.log(res) console.log(res)
// console.log(this.state.dbPL) // console.log(this.state.dbPL)
...@@ -2007,7 +1979,6 @@ export default class MonthlyReport extends Component { ...@@ -2007,7 +1979,6 @@ export default class MonthlyReport extends Component {
// } // }
}) })
} }
}
getFR(type) { getFR(type) {
let FRID = null let FRID = null
......
...@@ -1220,7 +1220,6 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1220,7 +1220,6 @@ export default class OperatingIndicatorMR extends Component {
fixedDecimalScale={1} fixedDecimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || this.state.get_for == 'view'} disabled={!this.props.permission.create || !this.props.permission.edit || this.state.get_for == 'view'}
value={Number(tableMeta.rowData[10]).toFixed(1)} value={Number(tableMeta.rowData[10]).toFixed(1)}
decimalScale={1}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
}} }}
...@@ -1243,7 +1242,6 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1243,7 +1242,6 @@ export default class OperatingIndicatorMR extends Component {
disabled={true} disabled={true}
decimalScale={1} decimalScale={1}
value={Number(handleFormula(val, tableMeta, 2)).toFixed(1)} value={Number(handleFormula(val, tableMeta, 2)).toFixed(1)}
decimalScale={1}
/> />
} }
/> />
......
This diff is collapsed.
...@@ -2157,7 +2157,12 @@ export default class BalanceSheet extends Component { ...@@ -2157,7 +2157,12 @@ export default class BalanceSheet extends Component {
<div> <div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.data.company.company_name}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.data.company.company_name}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.data.periode}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.data.periode}</Typography>
{/* <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> */}
{this.props.defaultCurrency.id === 1 ?
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
:
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in USD thousand</Typography>
}
</div> </div>
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}> <div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
...@@ -2335,7 +2340,12 @@ export default class BalanceSheet extends Component { ...@@ -2335,7 +2340,12 @@ export default class BalanceSheet extends Component {
<div> <div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.data.company.company_name}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>{this.props.data.company.company_name}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.data.periode}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>Period : {this.props.data.periode}</Typography>
{/* <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> */}
{this.props.defaultCurrency.id === 1 ?
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
:
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in USD thousand</Typography>
}
</div> </div>
{this.state.dataLoaded && ( {this.state.dataLoaded && (
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}> <div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
......
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