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 = "") => {
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 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
// const getHierarkiMontlyReportPL = (body) => api.post('transaction/monthly_report_pl/get_report_hierarki', body)
......
This diff is collapsed.
......@@ -336,7 +336,7 @@ export default class CashFlow extends Component {
this.setState({ alert: false })
}
olahDataCashFlow(dataTable2, trigger) {
olahDataCashFlow(dataTable2) {
console.log(dataTable2)
let listCF = []
dataTable2.map((item, index) => {
......@@ -373,10 +373,10 @@ export default class CashFlow extends Component {
})
console.log(listCF)
this.createCashFlow(listCF, trigger)
this.createCashFlow(listCF)
}
createCashFlow(dbcf, trigger) {
createCashFlow(dbcf) {
let payload = {
"submission_id": this.props.submissionID,
"company_id": this.props.company.company_id,
......@@ -388,7 +388,7 @@ export default class CashFlow extends Component {
}
console.log(dbcf)
console.log(JSON.stringify(payload))
this.props.createCashFlow(payload, trigger)
this.props.createCashFlow(payload)
// this.props.onClickClose()
}
......@@ -3340,29 +3340,6 @@ export default class CashFlow extends Component {
</button>
</div>
<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.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
......
This diff is collapsed.
This diff is collapsed.
......@@ -36,6 +36,7 @@ export default class CreateParameter extends Component {
operators: null,
getOperators: null,
tempData: null,
tesValue: null,
errorParameter: false,
errorDeskripsi: false,
errorReportName: false,
......@@ -91,7 +92,8 @@ export default class CreateParameter extends Component {
getSettingTypeID: data.setting_type_id,
typeReport: data.setting_type_name,
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()
......@@ -604,9 +606,9 @@ export default class CreateParameter extends Component {
}
updateParameter() {
let char = this.state.tempData.value
let arrayChar = char.split('');
console.log(arrayChar);
// let char = this.state.value
// let arrayChar = char.split('');
// console.log(char);
let body = {
"setting_id": this.state.tempData.setting_id,
"setting_group_id": this.state.getTypes.setting_group_id,
......@@ -615,9 +617,7 @@ export default class CreateParameter extends Component {
"reference_id": this.state.getReportName == null ? null : this.state.getReportName.setting_type_id,
"description": this.state.tempData.description,
"orders": this.state.tempData.order,
// "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 ,
"value": this.state.tempData.value,
"max_value": this.state.tempData.max_value,
"min_value": this.state.tempData.min_value,
"start_date": this.state.tempData.start_date,
......@@ -630,7 +630,7 @@ export default class CreateParameter extends Component {
createParameter() {
let char = this.state.value
let arrayChar = char.split('');
console.log(arrayChar);
// console.log(char);
let body = {
"setting_group_id": this.state.getTypes.setting_group_id,
"setting_type_id": this.state.getParameter.setting_type_id,
......@@ -638,6 +638,7 @@ export default class CreateParameter extends Component {
"reference_id": this.state.getReportName == null ? null : this.state.getReportName.setting_type_id,
"description": this.state.description,
"orders": this.state.order,
"value": this.state.value,
// 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 ,
"max_value": this.state.maxValue,
......@@ -851,7 +852,7 @@ export default class CreateParameter extends Component {
this.setState({
tempData: {
...this.state.tempData,
value: e.target.value
value: this.state.tempData.setting_group === "CURRENCY" ? e.target.value/1000 : e.target.value
}
})
this.clearMessage()
......
......@@ -214,7 +214,7 @@ export default class CashFlowMR extends Component {
}
}
payloadCF(dataTable2, trigger) {
payloadCF(dataTable2) {
let listCF = []
console.log(dataTable2)
dataTable2.map((item, index) => {
......@@ -232,10 +232,10 @@ export default class CashFlowMR extends Component {
// }
})
this.createCashFlow(listCF, trigger)
this.createCashFlow(listCF)
}
createCashFlow(listCF, trigger) {
createCashFlow(listCF) {
let payload = {
"monthly_report_id": this.props.monthlyReportId,
"company_id": this.props.company.company_id,
......@@ -246,7 +246,7 @@ export default class CashFlowMR extends Component {
"currency_id": this.props.defaultCurrency.id,
"cash_flow": listCF
}
this.props.createCashFlow(payload, trigger)
this.props.createCashFlow(payload)
}
render() {
......@@ -766,29 +766,6 @@ export default class CashFlowMR extends Component {
</button>
</div>
<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 &&
<button
type="button"
......
......@@ -685,7 +685,7 @@ export default class MonthlyReport extends Component {
})
}
getMonthlyReportID(type, trigger) {
getMonthlyReportID(type) {
this.setState({ selectReport: [], isCheckAll: false }, () => {
let payload = {
"company_id": this.state.company.company_id,
......@@ -730,7 +730,7 @@ export default class MonthlyReport extends Component {
}
// this.getPL(type)
if (type != undefined && type == 'PL') {
this.getPL(type, trigger)
this.getPL(type)
} else if (type != undefined && type == 'LOCF') {
let bodyRatioLocf = {
"report": 'ratio',
......@@ -740,17 +740,10 @@ export default class MonthlyReport extends Component {
"months": this.state.month.month_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) => {
console.log(res)
this.setState({ loading: false })
})
}
api.create().triggerHistoricalRatio(bodyRatioLocf).then((res) => {
console.log(res)
this.setState({ loading: false })
})
} else if (type != undefined && type == 'BS') {
let bodyRatioBs = {
"report": 'ratio',
......@@ -760,17 +753,10 @@ export default class MonthlyReport extends Component {
"months": this.state.month.month_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) => {
console.log(res)
this.setState({ loading: false })
})
}
api.create().triggerRatioFromLOCF(bodyRatioBs).then((res) => {
console.log(res)
this.setState({ loading: false })
})
} else {
this.setState({ loading: false })
}
......@@ -856,8 +842,7 @@ export default class MonthlyReport extends Component {
})
}
saveToMonthlyReport(type, trigger) {
console.log(trigger);
saveToMonthlyReport(type) {
this.setState({
visibleMonthlyReport: true,
loading: true,
......@@ -870,7 +855,7 @@ export default class MonthlyReport extends Component {
visibleLOCF: false,
visibleOI: false,
}, () => {
this.getMonthlyReportID(type, trigger)
this.getMonthlyReportID(type)
})
}
......@@ -1543,22 +1528,15 @@ export default class MonthlyReport extends Component {
})
}
createCashFlow(payload, trigger) {
createCashFlow(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) => {
this.saveToMonthlyReport()
console.log(res)
})
}
api.create().createMonthlyReportCF(payload).then((res) => {
this.saveToMonthlyReport()
console.log(res)
})
}
getPL(type, trigger) {
getPL(type) {
let PLID = null
let payloadID = {
"periode": this.state.periode.periode,
......@@ -1683,7 +1661,7 @@ export default class MonthlyReport extends Component {
console.log(JSON.stringify(dataTable))
console.log(dataTable)
this.setState({ dbPL: dataTable }, () => {
this.olahDataPL(this.state.dbPL, type, trigger)
this.olahDataPL(this.state.dbPL, type)
})
} else {
this.setState({ loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
......@@ -1919,7 +1897,7 @@ export default class MonthlyReport extends Component {
}
olahDataPL(dbPL, type, trigger) {
olahDataPL(dbPL, type) {
dbPL.map((item, index) => {
if (item[0] == 5 || item[0] == 6) {
item[6].value = this.handleValueFormulaDBPLMR(item[6], item, 6)
......@@ -1928,11 +1906,11 @@ export default class MonthlyReport extends Component {
})
// console.log(dbPL)
this.setState({ dbPL }, () => {
this.payloadPL(type, trigger)
this.payloadPL(type)
})
}
payloadPL(type, trigger) {
payloadPL(type) {
let listPL = []
this.state.dbPL.map((item, index) => {
// if (item[6].value == "" || item[6].value == 0 || item[6].value == "0.0") {
......@@ -1961,14 +1939,14 @@ export default class MonthlyReport extends Component {
// console.log(this.state.dbPL)
// this.setState({ loading: false })
console.log('tarik sis')
this.createPL(trigger)
this.createPL()
}
}
})
}
createPL(trigger) {
console.log(trigger);
createPL() {
console.log();
let payload = {
// "monthly_report_id": this.state.monthlyReportId,
"company_id": this.state.company.company_id,
......@@ -1981,32 +1959,25 @@ export default class MonthlyReport extends Component {
"profit_loss_mr": this.state.dbPL,
"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) => {
console.log(res)
// console.log(this.state.dbPL)
this.setState({ loading: false })
// if (response.data) {
// if (response.data.status === "success") {
// this.props.saveToMonthlyReport()
// } else {
// this.setState({ loading: false }, () => {
// this.props.saveToMonthlyReport()
// })
// }
// } else {
// this.setState({ loading: false }, () => {
// // this.getSubmission()
// document.body.style.overflow = 'unset';
// })
// }
})
}
api.create().createReportPLMR(payload).then((res) => {
console.log(res)
// console.log(this.state.dbPL)
this.setState({ loading: false })
// if (response.data) {
// if (response.data.status === "success") {
// this.props.saveToMonthlyReport()
// } else {
// this.setState({ loading: false }, () => {
// this.props.saveToMonthlyReport()
// })
// }
// } else {
// this.setState({ loading: false }, () => {
// // this.getSubmission()
// document.body.style.overflow = 'unset';
// })
// }
})
}
getFR(type) {
......
......@@ -1220,7 +1220,6 @@ export default class OperatingIndicatorMR extends Component {
fixedDecimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || this.state.get_for == 'view'}
value={Number(tableMeta.rowData[10]).toFixed(1)}
decimalScale={1}
onBlur={(event) => {
handleChange(event.target.value, tableMeta)
}}
......@@ -1243,7 +1242,6 @@ export default class OperatingIndicatorMR extends Component {
disabled={true}
decimalScale={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 {
<div>
<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' }}>in IDR mn</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 USD thousand</Typography>
}
</div>
<div style={{ width: '50%' }}>
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
......@@ -2335,7 +2340,12 @@ export default class BalanceSheet extends Component {
<div>
<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' }}>in IDR mn</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 USD thousand</Typography>
}
</div>
{this.state.dataLoaded && (
<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