Commit 21ce0aae authored by Deni Rinaldi's avatar Deni Rinaldi

Merge branch 'deni-dev(pc)' into 'master'

Deni dev(pc)

See merge request !218
parents de6f5610 a43a3427
......@@ -161,6 +161,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
const getRevision = (body) => api.post('transaction/get_revision', body)
const getPeriodeTransaction = () => api.get('transaction/get_periode')
const deleteAttachment = (id) => api.post(`transaction/delete_attachment/${id}`)
const getDetailReportMB = (body) => api.post('/transaction/master_budget/get_report_hierarki', body)
//Template
const downloadTemplate = (fileName, fileType) => api.get(`attachment/download_file?fileName=${fileName}&&fileType=${fileType}`)
......@@ -264,7 +265,8 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
uploadAttachment,
getPeriodeTransaction,
getRevision,
deleteAttachment
deleteAttachment,
getDetailReportMB
}
}
......
......@@ -32,7 +32,8 @@ export default class BudgetTahunan extends Component {
visibleFAM: false,
visibleCAT: false,
listAttachment: [],
visibleUpload: false
visibleUpload: false,
revisionTable: null
}
this.fileHandler = this.fileHandler.bind(this);
}
......@@ -161,54 +162,59 @@ export default class BudgetTahunan extends Component {
})
}
clickDetail(item, id) {
this.setState({ report_id: id })
if (item === 'Balance Sheet') {
this.setState({
visibleBudgetTahunan: false,
visibleBS: true,
visiblePL: false,
visibleCAT: false,
visibleFAM: false,
visibleTP: false,
})
} else if (item === 'Profit & Loss') {
this.setState({
visibleBudgetTahunan: false,
visibleBS: false,
visiblePL: true,
visibleCAT: false,
visibleFAM: false,
visibleTP: false
})
} else if (item === 'Tax Planning') {
this.setState({
visibleBudgetTahunan: false,
visibleBS: false,
visiblePL: false,
visibleCAT: false,
visibleFAM: false,
visibleTP: true
})
} else if (item === 'Fixed Assets Movement') {
this.setState({
visibleBudgetTahunan: false,
visibleBS: false,
visiblePL: false,
visibleCAT: false,
visibleFAM: true,
visibleTP: false
})
} else if (item === 'CAT') {
this.setState({
visibleBudgetTahunan: false,
visibleBS: false,
visiblePL: false,
visibleCAT: true,
visibleFAM: false,
visibleTP: false
})
}
clickDetail(item, id, revision) {
console.log(item);
this.setState({
report_id: id,
revisionTable: revision,
}, () => {
if (item === 'Balance Sheet') {
this.setState({
visibleBudgetTahunan: false,
visibleBS: true,
visiblePL: false,
visibleCAT: false,
visibleFAM: false,
visibleTP: false,
})
} else if (item === 'Profit Loss') {
this.setState({
visibleBudgetTahunan: false,
visibleBS: false,
visiblePL: true,
visibleCAT: false,
visibleFAM: false,
visibleTP: false
})
} else if (item === 'Tax Planning') {
this.setState({
visibleBudgetTahunan: false,
visibleBS: false,
visiblePL: false,
visibleCAT: false,
visibleFAM: false,
visibleTP: true
})
} else if (item === 'Fixed Assets Movement') {
this.setState({
visibleBudgetTahunan: false,
visibleBS: false,
visiblePL: false,
visibleCAT: false,
visibleFAM: true,
visibleTP: false
})
} else if (item === 'CAT') {
this.setState({
visibleBudgetTahunan: false,
visibleBS: false,
visiblePL: false,
visibleCAT: true,
visibleFAM: false,
visibleTP: false
})
}
})
}
handleChange(value, tableMeta) {
......@@ -323,7 +329,7 @@ export default class BudgetTahunan extends Component {
borderColor: 'transparent'
}}
onClick={() =>
tableMeta.rowData[5] ? this.clickDetail(tableMeta.rowData[1], tableMeta.rowData[4]) : null
tableMeta.rowData[5] ? this.clickDetail(tableMeta.rowData[1], tableMeta.rowData[4], tableMeta.rowData[2]) : null
}
>
<Typography style={{ color: tableMeta.rowData[5] ? '#5198ea' : 'GrayText', fontSize: 12, }}>Detail</Typography>
......@@ -554,6 +560,8 @@ export default class BudgetTahunan extends Component {
<BalanceSheet
report_id={this.state.report_id}
company={this.state.company}
revision={this.state.revisionTable}
periode={this.state.periode.periode}
onClickClose={() => this.setState({ visibleBS: false, visibleBudgetTahunan: true })}
/>
)}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -455,7 +455,7 @@ export default class CreateParameter extends Component {
} else if (R.isNil(this.state.getParameter)) {
this.setState({ errorParameter: true, msgErrorParameter: 'Parameter Cannot be Empty.' })
} else if (R.isNil(this.state.getPerusahaan)) {
this.setState({ errorPerusahaan: true, msgErrorPerusahaan: 'Perusahaan Cannot be Empty.' })
this.setState({ errorPerusahaan: true, msgErrorPerusahaan: 'Company Cannot be Empty.' })
// } else if (R.isEmpty(this.state.description)) {
// this.setState({ errorDeskripsi: true, msgErrorDeskripsi: 'Deskripsi tidak boleh kosong' })
// } else if (R.isNil(this.state.value)) {
......
......@@ -75,10 +75,12 @@ export default class UnitBisnis extends Component {
}
this.setState({ payload: body, buttonError: false })
api.create().checkUploadUnitBisnis(body).then(response => {
console.log(response)
let dataRow = []
if (response.data) {
if (response.ok) {
if (response.data.status === "success") {
let dataRow = response.data.data.map((item, index) => {
dataRow = response.data.data.map((item, index) => {
return [
index + 1,
item.business_unit_name,
......
......@@ -70,7 +70,7 @@ class Upload extends Component {
uploadProgress: false,
percentage: '0'
})
this.setState({ alertMessage: "Unsupported File", alert: true })
this.setState({ alertMessage: "File extension not allowed.", alert: true })
// alert("Unsupported Media Type")
}
}
......@@ -95,11 +95,11 @@ class Upload extends Component {
if (this.state.sizeFile < 1000) {
this.props.onUpload()
} else {
this.setState({ alertMessage: 'File cannot be more than 1MB', alert: true })
this.setState({ alertMessage: 'The file is too large. Allowed maximum size is 1MB', alert: true })
// alert('File Tidak Boleh Lebih Dari 1MB')
}
} else {
this.setState({ alertMessage: 'Unsupported File', alert: true })
this.setState({ alertMessage: 'File extension not allowed.', alert: true })
// alert('File Tidak Mendukung')
}
}
......
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