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 = "") => {
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)
//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
const getDetailReportCF = (body) => api.post('/transaction/cash_flow/master_budget/get_report_hierarki', body)
......@@ -572,7 +580,12 @@ const create = (type = "") => {
getListUserSubcoMB,
getListUserSubcoMR,
validateSubmitReportFAM,
createMonthlyReportCF
createMonthlyReportCF,
getReportBSMB,
getReportBSMR,
getReportPLDetailMB,
getReportPLDetailMR,
getReportPLMB
}
}
......
This diff is collapsed.
......@@ -264,7 +264,11 @@ export default class BalanceSheet extends Component {
}
// console.log(data);
this.setState({ loading: false })
this.props.saveToMasterBudget(payload)
if (type == 'submitted') {
this.props.saveToMasterBudget(payload, 'BS')
} else {
this.props.saveToMasterBudget(payload)
}
this.props.onClickClose()
}
......@@ -431,7 +435,11 @@ export default class BalanceSheet extends Component {
if (response.data) {
if (response.data.status === "success") {
this.props.onClickClose()
this.props.getReport()
if (type == 'submitted') {
this.props.getReport('BS')
} else {
this.props.getReport()
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) {
......
This diff is collapsed.
......@@ -259,7 +259,11 @@ export default class FixedAssetsMovement extends Component {
"fixed_asset_movement": data
}
// // console.log(data);
this.props.saveToMasterBudget(payload)
if (type == 'submitted') {
this.props.saveToMasterBudget(payload, 'FAM')
} else {
this.props.saveToMasterBudget(payload)
}
this.props.onClickClose()
}
......@@ -431,7 +435,11 @@ export default class FixedAssetsMovement extends Component {
if (response.ok) {
if (response.data.status === "success") {
this.props.onClickClose()
this.props.getReport()
if (type == 'submitted') {
this.props.getReport('FAM')
} else {
this.props.getReport()
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) {
......
......@@ -272,7 +272,11 @@ export default class ProfitLoss extends Component {
}
// console.log(data);
this.setState({ loading: false })
this.props.saveToMasterBudget(payload)
if (type == 'submitted') {
this.props.saveToMasterBudget(payload, 'PL')
} else {
this.props.saveToMasterBudget(payload)
}
this.props.onClickClose()
}
......@@ -432,7 +436,11 @@ export default class ProfitLoss extends Component {
if (response.ok) {
if (response.data.status === "success") {
this.props.onClickClose()
this.props.getReport()
if (type == 'submitted') {
this.props.getReport('PL')
} else {
this.props.getReport()
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
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 {
detailRevisiCheck: [],
isApprovedMB: false,
textRevision: '',
dbCF: []
dbCF: [],
PLBSFAMSubmitted: false
}
this.myRef = React.createRef()
this.fileHandler = this.fileHandler.bind(this);
......@@ -575,7 +576,7 @@ export default class MonthlyReport extends Component {
})
}
getMonthlyReportID() {
getMonthlyReportID(type) {
let payload = {
"company_id": this.state.company.company_id,
"periode": this.state.periode.periode,
......@@ -600,7 +601,7 @@ export default class MonthlyReport extends Component {
// // console.log(this.state.lastStatus);
this.historyApproval()
this.getLatestPeriodSubmit()
this.getCashFlow()
this.getCashFlow(type)
// this.getReport()
// this.getReportAttachment()
api.create().checkApproverMonthly().then(response => {
......@@ -674,7 +675,7 @@ export default class MonthlyReport extends Component {
})
}
saveToMonthlyReport() {
saveToMonthlyReport(type) {
this.setState({
visibleMonthlyReport: true,
visibleBS: false,
......@@ -685,7 +686,7 @@ export default class MonthlyReport extends Component {
visibleLOCF: false,
visibleOI: false,
}, () => {
this.getMonthlyReportID()
this.getMonthlyReportID(type)
})
}
......@@ -695,6 +696,7 @@ export default class MonthlyReport extends Component {
console.log(revision)
console.log(item)
let items = ''
let PLBSFAMSubmitted = 0
if (item === 'Corporate Annual Target') {
items = 'CAT'
} else {
......@@ -708,6 +710,11 @@ export default class MonthlyReport extends Component {
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({
report_id: id,
......@@ -810,6 +817,7 @@ export default class MonthlyReport extends Component {
visibleLOCF: false,
visibleOI: false,
visibleCF: true,
PLBSFAMSubmitted: PLBSFAMSubmitted == 3? true : false
})
}
})
......@@ -993,14 +1001,11 @@ export default class MonthlyReport extends Component {
if (type == 'revision') {
api.create().createPeriodeRevisionMonthly(payload).then((res))
}
if (type == "approve") {
this.createCashFlow()
}
this.getMonthlyReportID()
})
}
getCashFlow() {
getCashFlow(type) {
let payload = {
"report_id": 13,
"revision": Number(this.state.lastRevision),
......@@ -1061,7 +1066,7 @@ export default class MonthlyReport extends Component {
})
console.log(dataTable)
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 {
return total
}
olahDataCashFlow(dbCF) {
olahDataCashFlow(dbCF, type) {
dbCF.map((item,index) => {
if(item[0] == 5 || item[0] == 6) {
item[6].value = this.handleValueFormula(item,index)
......@@ -1298,11 +1303,11 @@ export default class MonthlyReport extends Component {
})
// console.log(dbCF)
this.setState({dbCF}, () => {
this.payloadCF()
this.payloadCF(type)
})
}
payloadCF() {
payloadCF(type) {
let listCF = []
this.state.dbCF.map((item,index) => {
if (item[6].value == "" || item[6].value == 0 || item[6].value == "0.0") {
......@@ -1321,7 +1326,14 @@ export default class MonthlyReport extends Component {
})
// 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() {
......@@ -2135,6 +2147,7 @@ export default class MonthlyReport extends Component {
status={this.state.status}
lastStatus={this.state.lastStatus}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
createCF={this.createCashFlow.bind(this)}
// getReport={this.getCompanyActive.bind(this)}
/>
)}
......@@ -2155,6 +2168,7 @@ export default class MonthlyReport extends Component {
status={this.state.status}
lastStatus={this.state.lastStatus}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
createCF={this.createCashFlow.bind(this)}
// getReport={this.getCompanyActive.bind(this)}
/>
......@@ -2197,6 +2211,7 @@ export default class MonthlyReport extends Component {
isApprover={this.state.isApprover}
status={this.state.status}
lastStatus={this.state.lastStatus}
createCF={this.createCashFlow.bind(this)}
prevRevision={this.state.isSubmit ? this.state.prevRevision : true}
/>
)}
......@@ -2271,6 +2286,7 @@ export default class MonthlyReport extends Component {
onClickClose={() => this.setState({ visibleCF: false, visibleMonthlyReport: true })}
status={this.state.status}
lastStatus={this.state.lastStatus}
PLBSFAMSubmitted={this.state.PLBSFAMSubmitted}
/>
)}
......
......@@ -468,7 +468,11 @@ export default class BalanceSheetMR extends Component {
if (response.data) {
if (response.data.status === "success") {
// this.props.onClickClose()
this.props.saveToMonthlyReport()
if (type == 'submitted') {
this.props.saveToMonthlyReport('BS')
} else {
this.props.saveToMonthlyReport()
}
this.setState({loading: false, handleTekTekTek: 0})
// this.props.getReport()
} else {
......@@ -524,7 +528,11 @@ export default class BalanceSheetMR extends Component {
console.log(JSON.stringify(payload))
if (response.data) {
if (response.data.status === "success") {
this.props.saveToMonthlyReport()
if (type == 'submitted') {
this.props.saveToMonthlyReport('BS')
} else {
this.props.saveToMonthlyReport()
}
} else {
this.setState({ loading: false, handleTekTekTek: 0 }, () => {
this.props.saveToMonthlyReport()
......
......@@ -53,6 +53,7 @@ export default class CashFlowMR extends Component {
componentDidMount() {
// this.getItemHierarki()
console.log(this.props.PLBSFAMSubmitted)
this.getSettingControl()
}
......@@ -492,7 +493,7 @@ export default class CashFlowMR extends Component {
type="text"
placeholder=""
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>
:
......@@ -522,7 +523,7 @@ export default class CashFlowMR extends Component {
type="text"
placeholder=""
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>
<NumberFormat
......@@ -539,7 +540,7 @@ export default class CashFlowMR extends Component {
type="text"
placeholder=""
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>
: null}
......
......@@ -372,7 +372,11 @@ export default class FixedAssetsMovementMR extends Component {
if (response.data) {
if (response.data.status === "success") {
// this.props.onClickClose()
this.props.saveToMonthlyReport()
if (type == 'submitted') {
this.props.saveToMonthlyReport('FAM')
} else {
this.props.saveToMonthlyReport()
}
// this.props.getReport()
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
......@@ -421,7 +425,11 @@ export default class FixedAssetsMovementMR extends Component {
// console.log(response);
if (response.data) {
if (response.data.status === "success") {
this.props.saveToMonthlyReport()
if (type == 'submitted') {
this.props.saveToMonthlyReport('FAM')
} else {
this.props.saveToMonthlyReport()
}
} else {
this.setState({ loading: false }, () => {
this.props.saveToMonthlyReport()
......
......@@ -409,7 +409,11 @@ export default class ProfitLossMR extends Component {
console.log(response);
if (response.data) {
if (response.data.status === "success") {
this.props.saveToMonthlyReport()
if (type == 'submitted') {
this.props.saveToMonthlyReport('PL')
} else {
this.props.saveToMonthlyReport()
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false, handleTekTekTek: 0 }, () => {
document.body.style.overflow = 'unset';
......@@ -563,7 +567,11 @@ export default class ProfitLossMR extends Component {
if (response.data) {
if (response.ok) {
if (response.data.status === "success") {
this.props.saveToMonthlyReport()
if (type == 'submitted') {
this.props.saveToMonthlyReport('PL')
} else {
this.props.saveToMonthlyReport()
}
// this.props.onClickClose()
// this.props.getReport()
} 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