Commit 4ea7657f authored by r.kurnia's avatar r.kurnia

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into rifka

parents e79b130d 3b42c7fd
...@@ -226,8 +226,6 @@ const create = (type = "") => { ...@@ -226,8 +226,6 @@ const create = (type = "") => {
const getLastestUpdateOI = (body) => api.post('transaction/operating_indicator/get_latest_update', body) const getLastestUpdateOI = (body) => api.post('transaction/operating_indicator/get_latest_update', body)
const getLastPeriodeOI = (idCompany) => api.post(`transaction/master_budget/get_last_periode/${idCompany}`) const getLastPeriodeOI = (idCompany) => api.post(`transaction/master_budget/get_last_periode/${idCompany}`)
const getReportHierarkiPL = (body) => api.post('transaction/db_report_detail/get_report_hierarki', body) const getReportHierarkiPL = (body) => api.post('transaction/db_report_detail/get_report_hierarki', body)
const getLastestUpdateMR = (body) => api.post('/transaction/monthly_report/get_latest_update', body)
const getLastestUpdateMROI = (body) => api.post('transaction/monthly_report_oi/get_latest_update', body) const getLastestUpdateMROI = (body) => api.post('transaction/monthly_report_oi/get_latest_update', body)
//CASH FLOW //CASH FLOW
...@@ -259,6 +257,7 @@ const create = (type = "") => { ...@@ -259,6 +257,7 @@ const create = (type = "") => {
const getMonthlyReportID = (body) => api.post('transaction/monthly_report/get_monthly_report_id', body) const getMonthlyReportID = (body) => api.post('transaction/monthly_report/get_monthly_report_id', body)
const getHierarkiMontlyReportBS = (body) => api.post('transaction/monthly_report_bs/get_report_hierarki', body) const getHierarkiMontlyReportBS = (body) => api.post('transaction/monthly_report_bs/get_report_hierarki', body)
const getHierarkiMontlyReportOI = (body) => api.post('transaction/monthly_report_oi/get_report_hierarki', body) const getHierarkiMontlyReportOI = (body) => api.post('transaction/monthly_report_oi/get_report_hierarki', body)
const getLastestUpdateMR = (body) => api.post('/transaction/monthly_report/get_latest_update', body)
const getHierarkiMontlyReportTP = (body) => api.post('transaction/monthly_report_tp/get_report_hierarki', body) const getHierarkiMontlyReportTP = (body) => api.post('transaction/monthly_report_tp/get_report_hierarki', body)
const getHierarkiMontlyReportLOCF = (body) => api.post('transaction/monthly_report_locf/get_report_hierarki', body) const getHierarkiMontlyReportLOCF = (body) => api.post('transaction/monthly_report_locf/get_report_hierarki', body)
const getHierarkiMontlyReportFAM = (body) => api.post('transaction/monthly_report/fam/get_report_hierarki', body) const getHierarkiMontlyReportFAM = (body) => api.post('transaction/monthly_report/fam/get_report_hierarki', body)
......
...@@ -78,7 +78,7 @@ export default class BudgetTahunan extends Component { ...@@ -78,7 +78,7 @@ export default class BudgetTahunan extends Component {
scrollToMyRef = () => window.scrollTo(0, this.myRef.current.offsetTop) scrollToMyRef = () => window.scrollTo(0, this.myRef.current.offsetTop)
componentDidMount() { componentDidMount() {
this.setState({ loading: true }, ()=> { this.setState({ loading: true }, () => {
document.body.style.overflow = 'hidden'; document.body.style.overflow = 'hidden';
}) })
this.props.selectIndex('Master Budget & CAT') this.props.selectIndex('Master Budget & CAT')
...@@ -107,16 +107,21 @@ export default class BudgetTahunan extends Component { ...@@ -107,16 +107,21 @@ export default class BudgetTahunan extends Component {
btnedit: response.data.data.edit, btnedit: response.data.data.edit,
btndelete: response.data.data.delete, btndelete: response.data.data.delete,
// load: true // load: true
}, ()=> { }, () => {
this.checkApprover() this.checkApprover()
}) })
} else { } else {
this.setState({ this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
// load: true if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
}) })
} }
} else { } else {
this.setState({ load: true }) this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
} }
}) })
} }
...@@ -129,7 +134,7 @@ export default class BudgetTahunan extends Component { ...@@ -129,7 +134,7 @@ export default class BudgetTahunan extends Component {
// this.setState({ tempData: response.data.data, privileges: response.data.data.privileges }) // this.setState({ tempData: response.data.data, privileges: response.data.data.privileges })
// // console.log(response.data.data) // // console.log(response.data.data)
if (String(response.data.data.role_name).toLocaleLowerCase() == 'superadmin') { if (String(response.data.data.role_name).toLocaleLowerCase() == 'superadmin') {
this.setState({isAdmin: true}) this.setState({ isAdmin: true })
} }
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
...@@ -156,7 +161,7 @@ export default class BudgetTahunan extends Component { ...@@ -156,7 +161,7 @@ export default class BudgetTahunan extends Component {
checkApprover() { checkApprover() {
api.create().checkApprover().then(response => { api.create().checkApprover().then(response => {
// console.log(response.data.data) console.log(response.data.data)
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
// // console.log(response); // // console.log(response);
...@@ -178,7 +183,7 @@ export default class BudgetTahunan extends Component { ...@@ -178,7 +183,7 @@ export default class BudgetTahunan extends Component {
}) })
} }
} else { } else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error'}) this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
} }
}) })
} }
...@@ -209,7 +214,7 @@ export default class BudgetTahunan extends Component { ...@@ -209,7 +214,7 @@ export default class BudgetTahunan extends Component {
indexID = companyData.findIndex((val) => val.company_id == this.state.rawData.company_id) indexID = companyData.findIndex((val) => val.company_id == this.state.rawData.company_id)
} }
this.setState({ listCompany: defaultProps, company: indexID == null? companyData[0] : companyData[indexID]}, () => { this.setState({ listCompany: defaultProps, company: indexID == null ? companyData[0] : companyData[indexID] }, () => {
// // console.log(response.data.data); // // console.log(response.data.data);
if (response.data.data.length > 0) { if (response.data.data.length > 0) {
this.getRevision() this.getRevision()
...@@ -219,7 +224,7 @@ export default class BudgetTahunan extends Component { ...@@ -219,7 +224,7 @@ export default class BudgetTahunan extends Component {
// //
}) })
} else { } else {
this.setState({ listRevision: null, revision: null, dataTable: [], checkApprover: false, lastRevision: "", visibleTableHistory: false, loading: false }, ()=> { this.setState({ listRevision: null, revision: null, dataTable: [], checkApprover: false, lastRevision: "", visibleTableHistory: false, loading: false }, () => {
document.body.style.overflow = 'unset'; document.body.style.overflow = 'unset';
}) })
} }
...@@ -289,12 +294,12 @@ export default class BudgetTahunan extends Component { ...@@ -289,12 +294,12 @@ export default class BudgetTahunan extends Component {
} }
}) })
// // console.log(dataTableRevision); // // console.log(dataTableRevision);
this.setState({ dataTable, loading: false, dataTableRevision: dataTableRevision.sort((a,b) => a.number - b.number), dataForRevision: response.data.data }, ()=> { this.setState({ dataTable, loading: false, dataTableRevision: dataTableRevision.sort((a, b) => a.number - b.number), dataForRevision: response.data.data }, () => {
document.body.style.overflow = 'unset'; document.body.style.overflow = 'unset';
}) })
} }
} else { } else {
this.setState({ loading: false }, ()=> { this.setState({ loading: false }, () => {
document.body.style.overflow = 'unset'; document.body.style.overflow = 'unset';
}) })
} }
...@@ -478,7 +483,7 @@ export default class BudgetTahunan extends Component { ...@@ -478,7 +483,7 @@ export default class BudgetTahunan extends Component {
} }
getSubmission() { getSubmission() {
this.setState({ loading: true }, ()=> { this.setState({ loading: true }, () => {
document.body.style.overflow = 'hidden'; document.body.style.overflow = 'hidden';
}) })
let payload = { let payload = {
...@@ -504,7 +509,7 @@ export default class BudgetTahunan extends Component { ...@@ -504,7 +509,7 @@ export default class BudgetTahunan extends Component {
this.getLatestPeriodSubmit() this.getLatestPeriodSubmit()
api.create().checkApprover().then(response => { api.create().checkApprover().then(response => {
// // console.log(response); // // console.log(response);
if (this.state.btncreate === true && this.state.btnedit === true ) { if (this.state.btncreate === true && this.state.btnedit === true) {
this.setState({ isApprover: false, checkApprover: false }) this.setState({ isApprover: false, checkApprover: false })
} else { } else {
this.setState({ isApprover: true, checkApprover: true }) this.setState({ isApprover: true, checkApprover: true })
...@@ -553,7 +558,7 @@ export default class BudgetTahunan extends Component { ...@@ -553,7 +558,7 @@ export default class BudgetTahunan extends Component {
approvalSubmission(type) { approvalSubmission(type) {
this.scrollToMyRef() this.scrollToMyRef()
this.setState({ loading: true }, ()=> { this.setState({ loading: true }, () => {
document.body.style.overflow = 'hidden'; document.body.style.overflow = 'hidden';
}) })
let body = { let body = {
...@@ -716,7 +721,7 @@ export default class BudgetTahunan extends Component { ...@@ -716,7 +721,7 @@ export default class BudgetTahunan extends Component {
} }
saveToMasterBudget(data) { saveToMasterBudget(data) {
this.setState({ loading: true }, ()=> { this.setState({ loading: true }, () => {
document.body.style.overflow = 'hidden'; document.body.style.overflow = 'hidden';
}) })
// // console.log(JSON.stringify(data)); // // console.log(JSON.stringify(data));
...@@ -750,7 +755,7 @@ export default class BudgetTahunan extends Component { ...@@ -750,7 +755,7 @@ export default class BudgetTahunan extends Component {
`https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/download_attachment?fileName=${fileurl}&&fileType=${fileType}` `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/download_attachment?fileName=${fileurl}&&fileType=${fileType}`
) )
res = await res.blob() res = await res.blob()
this.setState({ loading: false }, ()=> { this.setState({ loading: false }, () => {
document.body.style.overflow = 'unset'; document.body.style.overflow = 'unset';
}) })
if (res.size > 0) { if (res.size > 0) {
...@@ -763,7 +768,7 @@ export default class BudgetTahunan extends Component { ...@@ -763,7 +768,7 @@ export default class BudgetTahunan extends Component {
} }
validate() { validate() {
this.setState({ loading: true }, ()=> { this.setState({ loading: true }, () => {
document.body.style.overflow = 'hidden'; document.body.style.overflow = 'hidden';
}) })
let array = [] let array = []
...@@ -794,7 +799,7 @@ export default class BudgetTahunan extends Component { ...@@ -794,7 +799,7 @@ export default class BudgetTahunan extends Component {
} }
}) })
} else { } else {
this.setState({ alert: true, messageAlert: 'Data Is Not Complete', tipeAlert: 'warning', loading: false }, ()=> { this.setState({ alert: true, messageAlert: 'Data Is Not Complete', tipeAlert: 'warning', loading: false }, () => {
document.body.style.overflow = 'unset'; document.body.style.overflow = 'unset';
}) })
} }
...@@ -1012,10 +1017,10 @@ export default class BudgetTahunan extends Component { ...@@ -1012,10 +1017,10 @@ export default class BudgetTahunan extends Component {
number: value[3] number: value[3]
} }
let indexDataRevisi = this.state.dataTableRevision.findIndex((val) => val[3] == value[3]) let indexDataRevisi = this.state.dataTableRevision.findIndex((val) => val[3] == value[3])
let indexId = detailRevisiCheck.sort((a,b) => a.number - b.number).findIndex((val) => val.number == value[3]) let indexId = detailRevisiCheck.sort((a, b) => a.number - b.number).findIndex((val) => val.number == value[3])
// console.log(indexId) // console.log(indexId)
if (indexId == -1) { if (indexId == -1) {
this.state.dataTableRevision.map((item,index) => { this.state.dataTableRevision.map((item, index) => {
if (index > indexDataRevisi) { if (index > indexDataRevisi) {
let indexIds = detailRevisiCheck.findIndex((val) => val.number == item[3]) let indexIds = detailRevisiCheck.findIndex((val) => val.number == item[3])
if (indexIds == -1) { if (indexIds == -1) {
...@@ -1032,13 +1037,13 @@ export default class BudgetTahunan extends Component { ...@@ -1032,13 +1037,13 @@ export default class BudgetTahunan extends Component {
} else { } else {
let x = 0 let x = 0
detailRevisiCheck.sort((a,b) => a.number - b.number).map((item,index) => { detailRevisiCheck.sort((a, b) => a.number - b.number).map((item, index) => {
if (item.number < value[3]) { if (item.number < value[3]) {
x += 1 x += 1
} }
}) })
if (x < 1) { if (x < 1) {
this.state.dataTableRevision.map((item,index) => { this.state.dataTableRevision.map((item, index) => {
if (index > indexDataRevisi) { if (index > indexDataRevisi) {
let indexIdz = detailRevisiCheck.findIndex((val) => val.number == item[3]) let indexIdz = detailRevisiCheck.findIndex((val) => val.number == item[3])
if (indexIdz !== -1) { if (indexIdz !== -1) {
...@@ -1049,7 +1054,7 @@ export default class BudgetTahunan extends Component { ...@@ -1049,7 +1054,7 @@ export default class BudgetTahunan extends Component {
detailRevisiCheck.splice(indexId, 1) detailRevisiCheck.splice(indexId, 1)
} }
} }
this.setState({ detailRevisiCheck: detailRevisiCheck.sort((a,b) => a.number - b.number) }) this.setState({ detailRevisiCheck: detailRevisiCheck.sort((a, b) => a.number - b.number) })
// console.log(detailRevisiCheck) // console.log(detailRevisiCheck)
} }
...@@ -1298,7 +1303,7 @@ export default class BudgetTahunan extends Component { ...@@ -1298,7 +1303,7 @@ export default class BudgetTahunan extends Component {
</div> </div>
)} )}
</div> </div>
{this.state.isAdmin && this.state.lastStatus == 'APPROVED'? {this.state.isAdmin && this.state.lastStatus == 'APPROVED' ?
<div className="grid grid-2x" style={{ borderTop: 'solid 1px #c4c4c4', padding: 10, backgroundColor: '#f5f5f5', width: '100%', }}> <div className="grid grid-2x" style={{ borderTop: 'solid 1px #c4c4c4', padding: 10, backgroundColor: '#f5f5f5', width: '100%', }}>
<div className="col-1" /> <div className="col-1" />
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}> <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
......
...@@ -73,7 +73,18 @@ export default class FixedAssetsMovement extends Component { ...@@ -73,7 +73,18 @@ export default class FixedAssetsMovement extends Component {
this.setState({ this.setState({
updateBy: response.data.data.latest_update === null ? '-' : response.data.data.latest_update updateBy: response.data.data.latest_update === null ? '-' : response.data.data.latest_update
}) })
} else {
this.setState({ alert: true, messageAlert: response.data.message, typeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
} }
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
} }
}) })
} }
......
...@@ -54,7 +54,7 @@ export default class MonthlyReport extends Component { ...@@ -54,7 +54,7 @@ export default class MonthlyReport extends Component {
alert: false, alert: false,
tipeAlert: '', tipeAlert: '',
messageAlert: '', messageAlert: '',
btncreate: false, btnCreate: false,
loadview: false loadview: false
} }
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
...@@ -69,8 +69,10 @@ export default class MonthlyReport extends Component { ...@@ -69,8 +69,10 @@ export default class MonthlyReport extends Component {
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
btncreate: response.data.data.create, btnCreate: response.data.data.create,
loadview: response.data.data.view btnEdit: response.data.data.edit
}, () => {
this.getChecApprover()
}) })
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
...@@ -89,7 +91,6 @@ export default class MonthlyReport extends Component { ...@@ -89,7 +91,6 @@ export default class MonthlyReport extends Component {
} }
componentDidMount() { componentDidMount() {
this.getChecApprover()
this.getPermission() this.getPermission()
this.setState({ loading: true }) this.setState({ loading: true })
// this.getCompanyActive() // this.getCompanyActive()
...@@ -100,14 +101,13 @@ export default class MonthlyReport extends Component { ...@@ -100,14 +101,13 @@ export default class MonthlyReport extends Component {
console.log(response) console.log(response)
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
// console.log(response); if (response.data.data.is_approver === true) {
// if (response.data.data.is_approver === true) { this.setState({ isApprover: true, checkApprover: true }, () =>
// this.setState({ isApprover: true, checkApprover: true }, () => this.getPeriode())
// this.getPeriode()) } else {
// } else {
this.setState({ isApprover: false, checkApprover: false }, () => this.setState({ isApprover: false, checkApprover: false }, () =>
this.getCompanyActive()) this.getCompanyActive())
// } }
} 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")) {
...@@ -455,12 +455,13 @@ export default class MonthlyReport extends Component { ...@@ -455,12 +455,13 @@ export default class MonthlyReport extends Component {
this.getReportAttachment() this.getReportAttachment()
api.create().checkApproverMonthly().then(response => { api.create().checkApproverMonthly().then(response => {
// // console.log(response); // // console.log(response);
if (response.data.data.is_approver === true) { if (this.state.btnCreate === true && this.state.btnEdit === true) {
this.setState({ isApprover: true, checkApprover: true }) console.log('editable');
} else {
this.setState({ isApprover: false, checkApprover: false }) this.setState({ isApprover: false, checkApprover: false })
} else {
console.log('just view');
this.setState({ isApprover: true, checkApprover: true })
} }
}) })
}) })
} else { } else {
...@@ -1106,6 +1107,7 @@ export default class MonthlyReport extends Component { ...@@ -1106,6 +1107,7 @@ export default class MonthlyReport extends Component {
month={this.state.month} month={this.state.month}
saveToMonthlyReport={this.saveToMonthlyReport.bind(this)} saveToMonthlyReport={this.saveToMonthlyReport.bind(this)}
onClickClose={() => this.setState({ visibleBS: false, visibleMonthlyReport: true })} onClickClose={() => this.setState({ visibleBS: false, visibleMonthlyReport: true })}
isApprover={this.state.isApprover}
// getReport={this.getCompanyActive.bind(this)} // getReport={this.getCompanyActive.bind(this)}
/> />
)} )}
...@@ -1139,7 +1141,7 @@ export default class MonthlyReport extends Component { ...@@ -1139,7 +1141,7 @@ export default class MonthlyReport extends Component {
month={this.state.month} month={this.state.month}
saveToMonthlyReport={this.saveToMonthlyReport.bind(this)} saveToMonthlyReport={this.saveToMonthlyReport.bind(this)}
onClickClose={() => this.setState({ visibleTP: false, visibleMonthlyReport: true })} onClickClose={() => this.setState({ visibleTP: false, visibleMonthlyReport: true })}
btncreate={this.state.btncreate} btnCreate={this.state.btnCreate}
loadview={this.state.loadview} loadview={this.state.loadview}
// getReport={this.getCompanyActive.bind(this)} // getReport={this.getCompanyActive.bind(this)}
/> />
......
...@@ -68,7 +68,8 @@ export default class BalanceSheetMR extends Component { ...@@ -68,7 +68,8 @@ export default class BalanceSheetMR extends Component {
"monthly_report_id": this.props.monthlyReportId, "monthly_report_id": this.props.monthlyReportId,
"months": this.props.month.month_id "months": this.props.month.month_id
} }
api.create().getLastestUpdateMB(payload).then(response => { api.create().getLastestUpdateMR(payload).then(response => {
console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
...@@ -1013,10 +1014,10 @@ export default class BalanceSheetMR extends Component { ...@@ -1013,10 +1014,10 @@ export default class BalanceSheetMR extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: this.props.isApprover ? 'black' : "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={false} disabled={this.props.isApprover}
value={Number(tableMeta.rowData[9]).toFixed(1)} value={Number(tableMeta.rowData[9]).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1683,6 +1684,28 @@ export default class BalanceSheetMR extends Component { ...@@ -1683,6 +1684,28 @@ export default class BalanceSheetMR extends Component {
<Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b' }}>in IDR mn</Typography>
</div> </div>
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
{this.props.isApprover === true ?
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download'} data-for="download">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
margin: 5
}}
onClick={() =>
this.setState({ loading: true }, () => {
setTimeout(() => {
this.downloadAllData()
}, 100);
})}
>
<img src={Images.download} />
</button>
</a>
<ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
</div> :
<div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}> <div style={{ justifyContent: 'flex-end', display: 'flex', flexFlow: 'wrap' }}>
<a data-tip={'Download Template'} data-for="template"> <a data-tip={'Download Template'} data-for="template">
<button <button
...@@ -1732,6 +1755,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1732,6 +1755,7 @@ export default class BalanceSheetMR extends Component {
</a> </a>
<ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
</div> </div>
}
</div> </div>
</div> </div>
...@@ -1773,6 +1797,9 @@ export default class BalanceSheetMR extends Component { ...@@ -1773,6 +1797,9 @@ export default class BalanceSheetMR extends Component {
</div> </div>
</button> </button>
</div> </div>
{this.props.isApprover === true ?
<div className="col-2">
</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 <button
className="button" className="button"
...@@ -1843,6 +1870,7 @@ export default class BalanceSheetMR extends Component { ...@@ -1843,6 +1870,7 @@ export default class BalanceSheetMR extends Component {
</div> </div>
</button> </button>
</div> </div>
}
</div> </div>
{/* : null {/* : null
} */} } */}
......
...@@ -52,6 +52,38 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -52,6 +52,38 @@ export default class FixedAssetsMovementMR extends Component {
componentDidMount() { componentDidMount() {
this.getItemHierarki() this.getItemHierarki()
this.getLatestUpdate()
}
getLatestUpdate() {
let payload = {
"report_id": this.props.report_id,
"revision": Number(this.props.revision),
"periode": this.props.periode,
"company_id": this.props.company.company_id,
"monthly_report_id": this.props.monthlyReportId,
"months": this.props.month.month_id
}
api.create().getLastestUpdateMR(payload).then(response => {
if (response.data) {
if (response.data.status === "success") {
this.setState({
updateBy: response.data.data.latest_update === null ? '-' : response.data.data.latest_update
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, typeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
}
})
} }
getItemHierarki() { getItemHierarki() {
...@@ -131,7 +163,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -131,7 +163,7 @@ export default class FixedAssetsMovementMR extends Component {
} }
} }
}) })
console.log(dataTable); // console.log(dataTable);
this.setState({ dataTable, loading: false }) this.setState({ dataTable, loading: false })
} 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 }, () => {
...@@ -407,7 +439,7 @@ export default class FixedAssetsMovementMR extends Component { ...@@ -407,7 +439,7 @@ export default class FixedAssetsMovementMR extends Component {
// console.log(tableMeta); // console.log(tableMeta);
// console.log(tst); // console.log(tst);
let indexID = dataTable2[tableMeta.rowIndex][16].findIndex((val) => val.item_formula == tst) let indexID = dataTable2[tableMeta.rowIndex][16].findIndex((val) => val.item_formula == tst)
console.log(indexID); // console.log(indexID);
if (indexID !== -1) { if (indexID !== -1) {
let valuezz = dataTable2[tableMeta.rowIndex][16][indexID].value let valuezz = dataTable2[tableMeta.rowIndex][16][indexID].value
......
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