Commit d55db148 authored by Hardiansyah's avatar Hardiansyah

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

tambah master report type id create monthly

See merge request !2415
parents 278eb5d9 62cc0a9a
......@@ -604,7 +604,8 @@ export default class BalanceSheetMR extends Component {
"currency_id": this.props.defaultCurrency.id,
"status": type,
"months": this.props.month.month_id,
"balance_sheet": data
"balance_sheet": data,
"master_report_type_id": this.props?.master_report_type_id
}
api.create('UPLOAD').createMonthlyReportBS(payload).then(response => {
console.log(payload);
......
......@@ -701,7 +701,8 @@ export default class CorporateAnnualTargetMR extends Component {
"currency_id": this.props.defaultCurrency.id,
"corporate_annual_target": data,
"total_score": this.state.totalScore,
"performance": this.state.perfomanceScore
"performance": this.state.perfomanceScore,
"master_report_type_id": this.props?.master_report_type_id
}
// console.log(JSON.stringify(payload));
console.log(payload);
......
......@@ -473,7 +473,8 @@ export default class FixedAssetsMovementMR extends Component {
"currency_id": this.props.defaultCurrency.id,
"status": type,
"months": this.props.month.month_id,
"fixed_asset_movement": data
"fixed_asset_movement": data,
"master_report_type_id": this.props?.master_report_type_id
}
// console.log(JSON.stringify(payload));
......
......@@ -418,7 +418,8 @@ export default class ListOfCreditFacilities extends Component {
"locf": data,
"per_bs": this.state.perBSLOCF,
"diff": this.state.diffLOCF,
"total_loan": this.state.totalLoanLOCF
"total_loan": this.state.totalLoanLOCF,
"master_report_type_id": this.props?.master_report_type_id
}
console.log(body);
console.log(error);
......
......@@ -2603,6 +2603,13 @@ export default class MonthlyReport extends Component {
return tableKey === 'CAT' ? lastStatusCat : lastStatus
}
getActiveMasterReportTypeId = () => {
const { tableKey, rowDataFinance, rowDataCAT } = this.state
const mstIdFinance = rowDataFinance?.length > 0 && rowDataFinance[0]?.master_report_type_id
const mstIdCAT = rowDataCAT?.length > 0 && rowDataCAT[0]?.master_report_type_id
return tableKey === 'CAT' ? mstIdCAT : mstIdFinance
}
getSubmissionObj = (tableKeyParam) => {
const {
tableKey,
......@@ -3415,8 +3422,6 @@ export default class MonthlyReport extends Component {
const mstIdFinance = this.state?.rowDataFinance?.length > 0 && this.state.rowDataFinance[0]?.master_report_type_id
const mstIdCAT = this.state?.rowDataCAT?.length > 0 && this.state.rowDataCAT[0]?.master_report_type_id
console.log(((this.state.checkApprover && this.state.isApproverCAT) || this.state.submitterCAT), '1')
console.log(this.state.checkApprover, this.state.isApproverCAT, this.state.submitterCAT, '2')
return (
<div style={{ flex: 1, backgroundColor: '#f8f8f8', overflow: 'scroll' }}>
<Snackbar open={this.state.alert} autoHideDuration={6000} onClose={() => this.closeAlert()}>
......@@ -3599,6 +3604,7 @@ export default class MonthlyReport extends Component {
isApprover={this.state.isApprover}
status={this.state.status}
lastStatus={this.getLastStatus()}
master_report_type_id={this.getActiveMasterReportTypeId()}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
createCF={this.createCashFlow.bind(this)}
// getReport={this.getCompanyActive.bind(this)}
......@@ -3622,6 +3628,7 @@ export default class MonthlyReport extends Component {
isApprover={this.state.isApprover}
status={this.state.status}
lastStatus={this.getLastStatus()}
master_report_type_id={this.getActiveMasterReportTypeId()}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
createCF={this.createCashFlow.bind(this)}
// getReport={this.getCompanyActive.bind(this)}
......@@ -3648,6 +3655,7 @@ export default class MonthlyReport extends Component {
isApprover={this.state.isApprover}
status={this.state.status}
lastStatus={this.getLastStatus()}
master_report_type_id={this.getActiveMasterReportTypeId()}
// getReport={this.getCompanyActive.bind(this)}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
/>
......@@ -3670,6 +3678,7 @@ export default class MonthlyReport extends Component {
isApprover={this.state.isApprover}
status={this.state.status}
lastStatus={this.getLastStatus()}
master_report_type_id={this.getActiveMasterReportTypeId()}
createCF={this.createCashFlow.bind(this)}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
/>
......@@ -3694,6 +3703,7 @@ export default class MonthlyReport extends Component {
// status={'not-yet'}
// lastStatus={'SUBMIT'}
lastStatus={this.getLastStatus()}
master_report_type_id={this.getActiveMasterReportTypeId()}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
/>
)}
......@@ -3715,6 +3725,7 @@ export default class MonthlyReport extends Component {
isApprover={this.state.isApprover}
status={this.state.status}
lastStatus={this.getLastStatus()}
master_report_type_id={this.getActiveMasterReportTypeId()}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
/>
)}
......
......@@ -434,7 +434,8 @@ export default class ProfitLossMR extends Component {
"status": type,
"months": this.props.month.month_id,
"currency_id": this.props.defaultCurrency.id,
"profit_loss": data
"profit_loss": data,
"master_report_type_id": this.props?.master_report_type_id
}
console.log(payload);
// console.log(JSON.stringify(payload));
......
......@@ -334,7 +334,8 @@ export default class TaxPlanningMR extends Component {
"status": type,
"months": this.props.month.month_id,
"currency_id": this.props.defaultCurrency.id,
"tax_planning": data
"tax_planning": data,
"master_report_type_id": this.props?.master_report_type_id
}
api.create('UPLOAD').createMonthlyReportTP(payload).then(response => {
......
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