Commit 4f91a297 authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'didam' into 'master'

update banyak

See merge request !1012
parents 217d2dea c875310d
...@@ -233,6 +233,14 @@ const create = (type = "") => { ...@@ -233,6 +233,14 @@ const create = (type = "") => {
const getReportHierarkiPL = (body) => api.post('transaction/db_profit_loss_detail/get_report_hierarki', body) const getReportHierarkiPL = (body) => api.post('transaction/db_profit_loss_detail/get_report_hierarki', body)
const getLastestUpdateMROI = (body) => api.post('transaction/operating_indicator/monthly_report/get_latest_update', body) const getLastestUpdateMROI = (body) => api.post('transaction/operating_indicator/monthly_report/get_latest_update', body)
//REPORT NEW
const getReportBSMB = (body) => api.post('/transaction/db_balance_sheet/master_budget/get_report_hierarki', body)
const getReportBSMR = (body) => api.post('/transaction/db_balance_sheet/monthly_report/get_report_hierarki', body)
const getReportPLDetailMB = (body) => api.post('/transaction/db_profit_loss_detail/master_budget/get_report_hierarki', body)
const getReportPLDetailMR = (body) => api.post('/transaction/db_profit_loss_detail/monthly_report/get_report_hierarki', body)
const getReportPLMB = (body) => api.post('/transaction/db_report_detail/get_report_hierarki', body)
//CASH FLOW //CASH FLOW
const getDetailReportCF = (body) => api.post('/transaction/cash_flow/master_budget/get_report_hierarki', body) const getDetailReportCF = (body) => api.post('/transaction/cash_flow/master_budget/get_report_hierarki', body)
...@@ -572,7 +580,12 @@ const create = (type = "") => { ...@@ -572,7 +580,12 @@ const create = (type = "") => {
getListUserSubcoMB, getListUserSubcoMB,
getListUserSubcoMR, getListUserSubcoMR,
validateSubmitReportFAM, validateSubmitReportFAM,
createMonthlyReportCF createMonthlyReportCF,
getReportBSMB,
getReportBSMR,
getReportPLDetailMB,
getReportPLDetailMR,
getReportPLMB
} }
} }
......
This diff is collapsed.
...@@ -264,7 +264,11 @@ export default class BalanceSheet extends Component { ...@@ -264,7 +264,11 @@ export default class BalanceSheet extends Component {
} }
// console.log(data); // console.log(data);
this.setState({ loading: false }) this.setState({ loading: false })
this.props.saveToMasterBudget(payload) if (type == 'submitted') {
this.props.saveToMasterBudget(payload, 'BS')
} else {
this.props.saveToMasterBudget(payload)
}
this.props.onClickClose() this.props.onClickClose()
} }
...@@ -431,7 +435,11 @@ export default class BalanceSheet extends Component { ...@@ -431,7 +435,11 @@ export default class BalanceSheet extends Component {
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() if (type == 'submitted') {
this.props.getReport('BS')
} else {
this.props.getReport()
}
} 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")) { if (response.data.message.includes("Someone Logged In")) {
......
This diff is collapsed.
...@@ -259,7 +259,11 @@ export default class FixedAssetsMovement extends Component { ...@@ -259,7 +259,11 @@ export default class FixedAssetsMovement extends Component {
"fixed_asset_movement": data "fixed_asset_movement": data
} }
// // console.log(data); // // console.log(data);
this.props.saveToMasterBudget(payload) if (type == 'submitted') {
this.props.saveToMasterBudget(payload, 'FAM')
} else {
this.props.saveToMasterBudget(payload)
}
this.props.onClickClose() this.props.onClickClose()
} }
...@@ -431,7 +435,11 @@ export default class FixedAssetsMovement extends Component { ...@@ -431,7 +435,11 @@ export default class FixedAssetsMovement extends Component {
if (response.ok) { if (response.ok) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.props.onClickClose() this.props.onClickClose()
this.props.getReport() if (type == 'submitted') {
this.props.getReport('FAM')
} else {
this.props.getReport()
}
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In")) {
......
...@@ -272,7 +272,11 @@ export default class ProfitLoss extends Component { ...@@ -272,7 +272,11 @@ export default class ProfitLoss extends Component {
} }
// console.log(data); // console.log(data);
this.setState({ loading: false }) this.setState({ loading: false })
this.props.saveToMasterBudget(payload) if (type == 'submitted') {
this.props.saveToMasterBudget(payload, 'PL')
} else {
this.props.saveToMasterBudget(payload)
}
this.props.onClickClose() this.props.onClickClose()
} }
...@@ -432,7 +436,11 @@ export default class ProfitLoss extends Component { ...@@ -432,7 +436,11 @@ export default class ProfitLoss extends Component {
if (response.ok) { if (response.ok) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.props.onClickClose() this.props.onClickClose()
this.props.getReport() if (type == 'submitted') {
this.props.getReport('PL')
} else {
this.props.getReport()
}
} 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")) { if (response.data.message.includes("Someone Logged In")) {
......
This diff is collapsed.
This diff is collapsed.
...@@ -70,7 +70,8 @@ export default class MonthlyReport extends Component { ...@@ -70,7 +70,8 @@ export default class MonthlyReport extends Component {
detailRevisiCheck: [], detailRevisiCheck: [],
isApprovedMB: false, isApprovedMB: false,
textRevision: '', textRevision: '',
dbCF: [] dbCF: [],
PLBSFAMSubmitted: false
} }
this.myRef = React.createRef() this.myRef = React.createRef()
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
...@@ -575,7 +576,7 @@ export default class MonthlyReport extends Component { ...@@ -575,7 +576,7 @@ export default class MonthlyReport extends Component {
}) })
} }
getMonthlyReportID() { getMonthlyReportID(type) {
let payload = { let payload = {
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
"periode": this.state.periode.periode, "periode": this.state.periode.periode,
...@@ -600,7 +601,7 @@ export default class MonthlyReport extends Component { ...@@ -600,7 +601,7 @@ export default class MonthlyReport extends Component {
// // console.log(this.state.lastStatus); // // console.log(this.state.lastStatus);
this.historyApproval() this.historyApproval()
this.getLatestPeriodSubmit() this.getLatestPeriodSubmit()
this.getCashFlow() this.getCashFlow(type)
// this.getReport() // this.getReport()
// this.getReportAttachment() // this.getReportAttachment()
api.create().checkApproverMonthly().then(response => { api.create().checkApproverMonthly().then(response => {
...@@ -674,7 +675,7 @@ export default class MonthlyReport extends Component { ...@@ -674,7 +675,7 @@ export default class MonthlyReport extends Component {
}) })
} }
saveToMonthlyReport() { saveToMonthlyReport(type) {
this.setState({ this.setState({
visibleMonthlyReport: true, visibleMonthlyReport: true,
visibleBS: false, visibleBS: false,
...@@ -685,7 +686,7 @@ export default class MonthlyReport extends Component { ...@@ -685,7 +686,7 @@ export default class MonthlyReport extends Component {
visibleLOCF: false, visibleLOCF: false,
visibleOI: false, visibleOI: false,
}, () => { }, () => {
this.getMonthlyReportID() this.getMonthlyReportID(type)
}) })
} }
...@@ -695,6 +696,7 @@ export default class MonthlyReport extends Component { ...@@ -695,6 +696,7 @@ export default class MonthlyReport extends Component {
console.log(revision) console.log(revision)
console.log(item) console.log(item)
let items = '' let items = ''
let PLBSFAMSubmitted = 0
if (item === 'Corporate Annual Target') { if (item === 'Corporate Annual Target') {
items = 'CAT' items = 'CAT'
} else { } else {
...@@ -708,6 +710,11 @@ export default class MonthlyReport extends Component { ...@@ -708,6 +710,11 @@ export default class MonthlyReport extends Component {
this.setState({ prevRevision: false }) this.setState({ prevRevision: false })
} }
} }
if (String(i.report_name).toLocaleLowerCase() == "profit loss" || String(i.report_name).toLocaleLowerCase() == "balance sheet" || String(i.report_name).toLocaleLowerCase() == "fixed assets movement" ) {
if (String(i.current_status).toLocaleLowerCase() == "submitted") {
PLBSFAMSubmitted += 1
}
}
}) })
this.setState({ this.setState({
report_id: id, report_id: id,
...@@ -810,6 +817,7 @@ export default class MonthlyReport extends Component { ...@@ -810,6 +817,7 @@ export default class MonthlyReport extends Component {
visibleLOCF: false, visibleLOCF: false,
visibleOI: false, visibleOI: false,
visibleCF: true, visibleCF: true,
PLBSFAMSubmitted: PLBSFAMSubmitted == 3? true : false
}) })
} }
}) })
...@@ -993,14 +1001,11 @@ export default class MonthlyReport extends Component { ...@@ -993,14 +1001,11 @@ export default class MonthlyReport extends Component {
if (type == 'revision') { if (type == 'revision') {
api.create().createPeriodeRevisionMonthly(payload).then((res)) api.create().createPeriodeRevisionMonthly(payload).then((res))
} }
if (type == "approve") {
this.createCashFlow()
}
this.getMonthlyReportID() this.getMonthlyReportID()
}) })
} }
getCashFlow() { getCashFlow(type) {
let payload = { let payload = {
"report_id": 13, "report_id": 13,
"revision": Number(this.state.lastRevision), "revision": Number(this.state.lastRevision),
...@@ -1061,7 +1066,7 @@ export default class MonthlyReport extends Component { ...@@ -1061,7 +1066,7 @@ export default class MonthlyReport extends Component {
}) })
console.log(dataTable) console.log(dataTable)
this.setState({ dbCF: dataTable, loading: false }, () => { this.setState({ dbCF: dataTable, loading: false }, () => {
this.olahDataCashFlow(this.state.dbCF) this.olahDataCashFlow(this.state.dbCF, type)
}) })
} }
}) })
...@@ -1290,7 +1295,7 @@ export default class MonthlyReport extends Component { ...@@ -1290,7 +1295,7 @@ export default class MonthlyReport extends Component {
return total return total
} }
olahDataCashFlow(dbCF) { olahDataCashFlow(dbCF, type) {
dbCF.map((item,index) => { dbCF.map((item,index) => {
if(item[0] == 5 || item[0] == 6) { if(item[0] == 5 || item[0] == 6) {
item[6].value = this.handleValueFormula(item,index) item[6].value = this.handleValueFormula(item,index)
...@@ -1298,11 +1303,11 @@ export default class MonthlyReport extends Component { ...@@ -1298,11 +1303,11 @@ export default class MonthlyReport extends Component {
}) })
// console.log(dbCF) // console.log(dbCF)
this.setState({dbCF}, () => { this.setState({dbCF}, () => {
this.payloadCF() this.payloadCF(type)
}) })
} }
payloadCF() { payloadCF(type) {
let listCF = [] let listCF = []
this.state.dbCF.map((item,index) => { this.state.dbCF.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") {
...@@ -1321,7 +1326,14 @@ export default class MonthlyReport extends Component { ...@@ -1321,7 +1326,14 @@ export default class MonthlyReport extends Component {
}) })
// console.log(listCF) // console.log(listCF)
this.setState({dbCF: listCF}) this.setState({dbCF: listCF} , () => {
if (type != undefined) {
if (type == 'BS' || type == 'FAM' || type == 'PL') {
console.log('tarik sis')
this.createCashFlow()
}
}
})
} }
createCashFlow() { createCashFlow() {
...@@ -2135,6 +2147,7 @@ export default class MonthlyReport extends Component { ...@@ -2135,6 +2147,7 @@ export default class MonthlyReport extends Component {
status={this.state.status} status={this.state.status}
lastStatus={this.state.lastStatus} lastStatus={this.state.lastStatus}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true} prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
createCF={this.createCashFlow.bind(this)}
// getReport={this.getCompanyActive.bind(this)} // getReport={this.getCompanyActive.bind(this)}
/> />
)} )}
...@@ -2155,6 +2168,7 @@ export default class MonthlyReport extends Component { ...@@ -2155,6 +2168,7 @@ export default class MonthlyReport extends Component {
status={this.state.status} status={this.state.status}
lastStatus={this.state.lastStatus} lastStatus={this.state.lastStatus}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true} prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
createCF={this.createCashFlow.bind(this)}
// getReport={this.getCompanyActive.bind(this)} // getReport={this.getCompanyActive.bind(this)}
/> />
...@@ -2197,6 +2211,7 @@ export default class MonthlyReport extends Component { ...@@ -2197,6 +2211,7 @@ export default class MonthlyReport extends Component {
isApprover={this.state.isApprover} isApprover={this.state.isApprover}
status={this.state.status} status={this.state.status}
lastStatus={this.state.lastStatus} lastStatus={this.state.lastStatus}
createCF={this.createCashFlow.bind(this)}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true} prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
/> />
)} )}
...@@ -2271,6 +2286,7 @@ export default class MonthlyReport extends Component { ...@@ -2271,6 +2286,7 @@ export default class MonthlyReport extends Component {
onClickClose={() => this.setState({ visibleCF: false, visibleMonthlyReport: true })} onClickClose={() => this.setState({ visibleCF: false, visibleMonthlyReport: true })}
status={this.state.status} status={this.state.status}
lastStatus={this.state.lastStatus} lastStatus={this.state.lastStatus}
PLBSFAMSubmitted={this.state.PLBSFAMSubmitted}
/> />
)} )}
......
...@@ -468,7 +468,11 @@ export default class BalanceSheetMR extends Component { ...@@ -468,7 +468,11 @@ export default class BalanceSheetMR extends Component {
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
// this.props.onClickClose() // this.props.onClickClose()
this.props.saveToMonthlyReport() if (type == 'submitted') {
this.props.saveToMonthlyReport('BS')
} else {
this.props.saveToMonthlyReport()
}
this.setState({loading: false, handleTekTekTek: 0}) this.setState({loading: false, handleTekTekTek: 0})
// this.props.getReport() // this.props.getReport()
} else { } else {
...@@ -524,7 +528,11 @@ export default class BalanceSheetMR extends Component { ...@@ -524,7 +528,11 @@ export default class BalanceSheetMR extends Component {
console.log(JSON.stringify(payload)) console.log(JSON.stringify(payload))
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.props.saveToMonthlyReport() if (type == 'submitted') {
this.props.saveToMonthlyReport('BS')
} else {
this.props.saveToMonthlyReport()
}
} else { } else {
this.setState({ loading: false, handleTekTekTek: 0 }, () => { this.setState({ loading: false, handleTekTekTek: 0 }, () => {
this.props.saveToMonthlyReport() this.props.saveToMonthlyReport()
......
...@@ -53,6 +53,7 @@ export default class CashFlowMR extends Component { ...@@ -53,6 +53,7 @@ export default class CashFlowMR extends Component {
componentDidMount() { componentDidMount() {
// this.getItemHierarki() // this.getItemHierarki()
console.log(this.props.PLBSFAMSubmitted)
this.getSettingControl() this.getSettingControl()
} }
...@@ -492,7 +493,7 @@ export default class CashFlowMR extends Component { ...@@ -492,7 +493,7 @@ export default class CashFlowMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.props.status == 'approved'? Number(tableMeta.rowData[6].value) : Number(handleValueFormula(tableMeta, 6)).toFixed(1)} value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[6].value) : Number(handleValueFormula(tableMeta, 6)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -522,7 +523,7 @@ export default class CashFlowMR extends Component { ...@@ -522,7 +523,7 @@ export default class CashFlowMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.props.status == 'approved'? Number(tableMeta.rowData[6].value) :Number(handleValueFormula(tableMeta, 6)).toFixed(1)} value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[6].value) :Number(handleValueFormula(tableMeta, 6)).toFixed(1)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? null : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? null : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -539,7 +540,7 @@ export default class CashFlowMR extends Component { ...@@ -539,7 +540,7 @@ export default class CashFlowMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={this.props.status == 'approved'? Number(tableMeta.rowData[6].value) :Number(handleValueFormula(tableMeta, 6)).toFixed(1)} value={this.props.PLBSFAMSubmitted ? Number(tableMeta.rowData[6].value) :Number(handleValueFormula(tableMeta, 6)).toFixed(1)}
/> />
</LightTooltip> </LightTooltip>
: null} : null}
......
...@@ -372,7 +372,11 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -372,7 +372,11 @@ export default class FixedAssetsMovementMR extends Component {
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
// this.props.onClickClose() // this.props.onClickClose()
this.props.saveToMonthlyReport() if (type == 'submitted') {
this.props.saveToMonthlyReport('FAM')
} else {
this.props.saveToMonthlyReport()
}
// this.props.getReport() // this.props.getReport()
} 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 }, () => {
...@@ -421,7 +425,11 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -421,7 +425,11 @@ export default class FixedAssetsMovementMR extends Component {
// console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.props.saveToMonthlyReport() if (type == 'submitted') {
this.props.saveToMonthlyReport('FAM')
} else {
this.props.saveToMonthlyReport()
}
} else { } else {
this.setState({ loading: false }, () => { this.setState({ loading: false }, () => {
this.props.saveToMonthlyReport() this.props.saveToMonthlyReport()
......
...@@ -409,7 +409,11 @@ export default class ProfitLossMR extends Component { ...@@ -409,7 +409,11 @@ export default class ProfitLossMR extends Component {
console.log(response); console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.props.saveToMonthlyReport() if (type == 'submitted') {
this.props.saveToMonthlyReport('PL')
} else {
this.props.saveToMonthlyReport()
}
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false, handleTekTekTek: 0 }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false, handleTekTekTek: 0 }, () => {
document.body.style.overflow = 'unset'; document.body.style.overflow = 'unset';
...@@ -563,7 +567,11 @@ export default class ProfitLossMR extends Component { ...@@ -563,7 +567,11 @@ export default class ProfitLossMR extends Component {
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.props.saveToMonthlyReport() if (type == 'submitted') {
this.props.saveToMonthlyReport('PL')
} else {
this.props.saveToMonthlyReport()
}
// this.props.onClickClose() // this.props.onClickClose()
// this.props.getReport() // this.props.getReport()
} else { } else {
......
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