Commit 416ea3ee authored by Deni Rinaldi's avatar Deni Rinaldi

timbihin

parent 84c32c50
...@@ -229,6 +229,8 @@ const create = (type = "") => { ...@@ -229,6 +229,8 @@ const create = (type = "") => {
const submitOLPA = (body) => api.post('transaction/outlook_pa/submit_outlook_pa', body) const submitOLPA = (body) => api.post('transaction/outlook_pa/submit_outlook_pa', body)
const getLastestUpdateOLPA = (body) => api.post('transaction/outlook_pa/get_latest_update', body) const getLastestUpdateOLPA = (body) => api.post('transaction/outlook_pa/get_latest_update', body)
const createReportOLPA = (body) => api.post('transaction/outlook_pa/create_outlook_report', body) const createReportOLPA = (body) => api.post('transaction/outlook_pa/create_outlook_report', body)
const checkUploadOLPA = (body) => api.post('transaction/outlook_pa/check_import', body)
const uploadOLPA = (body) => api.post('transaction/outlook_pa/import_outlook_pa')
//Template //Template
const downloadTemplate = (fileName, fileType) => api.get(`attachment/download_file?fileName=${fileName}&&fileType=${fileType}`) const downloadTemplate = (fileName, fileType) => api.get(`attachment/download_file?fileName=${fileName}&&fileType=${fileType}`)
...@@ -395,7 +397,9 @@ const create = (type = "") => { ...@@ -395,7 +397,9 @@ const create = (type = "") => {
getOLPAAtt, getOLPAAtt,
submitOLPA, submitOLPA,
getLastestUpdateOLPA, getLastestUpdateOLPA,
createReportOLPA createReportOLPA,
checkUploadOLPA,
uploadOLPA
} }
} }
......
...@@ -614,7 +614,7 @@ export default class BudgetTahunan extends Component { ...@@ -614,7 +614,7 @@ export default class BudgetTahunan extends Component {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
let a = document.createElement('a'); let a = document.createElement('a');
a.href = url; a.href = url;
a.download = 'Master Budget Balance Sheet.xlsx'; a.download = 'Master Budget Attachment.xlsx';
a.click(); a.click();
} }
} }
......
...@@ -542,10 +542,10 @@ export default class OutlookPA extends Component { ...@@ -542,10 +542,10 @@ export default class OutlookPA extends Component {
let length = name.split(".").length let length = name.split(".").length
let fileType = name.split(".")[length - 1] let fileType = name.split(".")[length - 1]
console.log(fileType); console.log(fileType);
let url = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/download_attachment?fileName=${fileurl}&&fileType=${fileType}` let url = `https://tia.eksad.com/tia-reporting-dev/public/transaction/outlook_pa/download_attachment?fileName=${fileurl}&&fileType=${fileType}`
// console.log(url); // console.log(url);
let res = await fetch( let res = await fetch(
`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/outlook_pa/download_attachment?fileName=${fileurl}&&fileType=${fileType}`
) )
res = await res.blob() res = await res.blob()
this.setState({ loading: false }) this.setState({ loading: false })
...@@ -553,7 +553,7 @@ export default class OutlookPA extends Component { ...@@ -553,7 +553,7 @@ export default class OutlookPA extends Component {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
let a = document.createElement('a'); let a = document.createElement('a');
a.href = url; a.href = url;
a.download = 'Master Budget Balance Sheet.xlsx'; a.download = 'Outlook Perfromance Appraisal.xlsx';
a.click(); a.click();
} }
} }
......
...@@ -201,7 +201,7 @@ export default class BalanceSheetOLPA extends Component { ...@@ -201,7 +201,7 @@ export default class BalanceSheetOLPA extends Component {
downloadTemplate = async () => { downloadTemplate = async () => {
let res = await fetch( let res = await fetch(
`https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}` `https://tia.eksad.com/tia-reporting-dev/public/transaction/outlook_pa/download_template?report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}`
) )
res = await res.blob() res = await res.blob()
console.log(res) console.log(res)
...@@ -209,7 +209,7 @@ export default class BalanceSheetOLPA extends Component { ...@@ -209,7 +209,7 @@ export default class BalanceSheetOLPA extends Component {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
let a = document.createElement('a'); let a = document.createElement('a');
a.href = url; a.href = url;
a.download = 'Template Master Budget Balance Sheet.xlsx'; a.download = 'Template Outlook PA Balance Sheet.xlsx';
a.click(); a.click();
} }
} }
...@@ -263,7 +263,7 @@ export default class BalanceSheetOLPA extends Component { ...@@ -263,7 +263,7 @@ export default class BalanceSheetOLPA extends Component {
} }
checkUpload() { checkUpload() {
api.create().checkUploadMB(this.state.payload).then(response => { api.create().checkUploadOLPA(this.state.payload).then(response => {
// console.log(JSON.stringify(this.state.payload)); // console.log(JSON.stringify(this.state.payload));
console.log(response) console.log(response)
if (response.data) { if (response.data) {
...@@ -331,7 +331,7 @@ export default class BalanceSheetOLPA extends Component { ...@@ -331,7 +331,7 @@ export default class BalanceSheetOLPA extends Component {
}) })
}) })
let body = { let body = {
submission_id: this.props.submissionID, outlook_pa_id: this.props.outlook_pa_id,
company_id: this.props.company.company_id, company_id: this.props.company.company_id,
periode: this.props.periode, periode: this.props.periode,
report_id: this.props.report_id, report_id: this.props.report_id,
...@@ -339,7 +339,7 @@ export default class BalanceSheetOLPA extends Component { ...@@ -339,7 +339,7 @@ export default class BalanceSheetOLPA extends Component {
status: type status: type
} }
// console.log(data); // console.log(data);
api.create('UPLOAD').uploadMasterBudget(body).then(response => { api.create('UPLOAD').uploadOLPA(body).then(response => {
console.log(response); console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
...@@ -356,10 +356,10 @@ export default class BalanceSheetOLPA extends Component { ...@@ -356,10 +356,10 @@ export default class BalanceSheetOLPA extends Component {
} }
async downloadAllData() { async downloadAllData() {
let url = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=${this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}` let url = `https://tia.eksad.com/tia-reporting-dev/public/transaction/outlook_pa/export_outlook_pa?submission_id=${this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
console.log(url); console.log(url);
let res = await fetch( let res = await fetch(
`https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=${this.props.submissionID === null ? "" : this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}` `https://tia.eksad.com/tia-reporting-dev/public/transaction/outlook_pa/export_outlook_pa?submission_id=${this.props.submissionID === null ? "" : this.props.submissionID}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
) )
res = await res.blob() res = await res.blob()
this.setState({ loading: false }) this.setState({ loading: false })
......
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