Commit de54a1ba authored by Rifka Kurnia Irfiana's avatar Rifka Kurnia Irfiana

download all create edit tax plan, extension managdoc

parent 3d99476e
...@@ -93,7 +93,8 @@ export default class TaxPlanning extends Component { ...@@ -93,7 +93,8 @@ export default class TaxPlanning extends Component {
{tbc : item.tax_planning.may.tbc, fcp: item.tax_planning.may.fcp, tbf: item.tax_planning.may.tbf}, {tbc : item.tax_planning.may.tbc, fcp: item.tax_planning.may.fcp, tbf: item.tax_planning.may.tbf},
{tbc : item.tax_planning.june.tbc, fcp: item.tax_planning.june.fcp, tbf: item.tax_planning.june.tbf}, {tbc : item.tax_planning.june.tbc, fcp: item.tax_planning.june.fcp, tbf: item.tax_planning.june.tbf},
{tbc : item.tax_planning.july.tbc, fcp: item.tax_planning.july.fcp, tbf: item.tax_planning.july.tbf}, {tbc : item.tax_planning.july.tbc, fcp: item.tax_planning.july.fcp, tbf: item.tax_planning.july.tbf},
{tbc : item.tax_planning.august.tbc, fcp: item.tax_planning.august.fcp, tbf: item.tax_planning.august.tbf}, {tbc : item.tax_planning.august.tbc === null ? "0" : item.tax_planning.august.tbc === "" ? "0" : item.tax_planning.august.tbc,
fcp: item.tax_planning.august.fcp, tbf: item.tax_planning.august.tbf},
{tbc : item.tax_planning.september.tbc, fcp: item.tax_planning.september.fcp, tbf: item.tax_planning.september.tbf}, {tbc : item.tax_planning.september.tbc, fcp: item.tax_planning.september.fcp, tbf: item.tax_planning.september.tbf},
{tbc : item.tax_planning.october.tbc, fcp: item.tax_planning.october.fcp, tbf: item.tax_planning.october.tbf}, {tbc : item.tax_planning.october.tbc, fcp: item.tax_planning.october.fcp, tbf: item.tax_planning.october.tbf},
{tbc : item.tax_planning.november.tbc, fcp: item.tax_planning.november.fcp, tbf: item.tax_planning.november.tbf}, {tbc : item.tax_planning.november.tbc, fcp: item.tax_planning.november.fcp, tbf: item.tax_planning.november.tbf},
...@@ -129,7 +130,8 @@ export default class TaxPlanning extends Component { ...@@ -129,7 +130,8 @@ export default class TaxPlanning extends Component {
{tbc : item.tax_planning.may.tbc, fcp: item.tax_planning.may.fcp, tbf: item.tax_planning.may.tbf}, {tbc : item.tax_planning.may.tbc, fcp: item.tax_planning.may.fcp, tbf: item.tax_planning.may.tbf},
{tbc : item.tax_planning.june.tbc, fcp: item.tax_planning.june.fcp, tbf: item.tax_planning.june.tbf}, {tbc : item.tax_planning.june.tbc, fcp: item.tax_planning.june.fcp, tbf: item.tax_planning.june.tbf},
{tbc : item.tax_planning.july.tbc, fcp: item.tax_planning.july.fcp, tbf: item.tax_planning.july.tbf}, {tbc : item.tax_planning.july.tbc, fcp: item.tax_planning.july.fcp, tbf: item.tax_planning.july.tbf},
{tbc : item.tax_planning.august.tbc, fcp: item.tax_planning.august.fcp, tbf: item.tax_planning.august.tbf}, {tbc : item.tax_planning.august.tbc === null ? "0" : item.tax_planning.august.tbc === "" ? "0" : item.tax_planning.august.tbc,
fcp: item.tax_planning.august.fcp, tbf: item.tax_planning.august.tbf},
{tbc : item.tax_planning.september.tbc, fcp: item.tax_planning.september.fcp, tbf: item.tax_planning.september.tbf}, {tbc : item.tax_planning.september.tbc, fcp: item.tax_planning.september.fcp, tbf: item.tax_planning.september.tbf},
{tbc : item.tax_planning.october.tbc, fcp: item.tax_planning.october.fcp, tbf: item.tax_planning.october.tbf}, {tbc : item.tax_planning.october.tbc, fcp: item.tax_planning.october.fcp, tbf: item.tax_planning.october.tbf},
{tbc : item.tax_planning.november.tbc, fcp: item.tax_planning.november.fcp, tbf: item.tax_planning.november.tbf}, {tbc : item.tax_planning.november.tbc, fcp: item.tax_planning.november.fcp, tbf: item.tax_planning.november.tbf},
...@@ -191,75 +193,75 @@ export default class TaxPlanning extends Component { ...@@ -191,75 +193,75 @@ export default class TaxPlanning extends Component {
data.push({ data.push({
item_report_id: i[4], item_report_id: i[4],
january: { january: {
TBC: String(i[9].tbc), tbc: String(i[9].tbc),
FCP: String(i[9].fcp), fcp: String(i[9].fcp),
TBF: String(i[9].tbf) tbf: String(i[9].tbf)
}, },
february: { february: {
TBC: String(i[10].tbc), tbc: String(i[10].tbc),
FCP: String(i[10].fcp), fcp: String(i[10].fcp),
TBF: String(i[10].tbf) tbf: String(i[10].tbf)
}, },
march: { march: {
TBC: String(i[11].tbc), tbc: String(i[11].tbc),
FCP: String(i[11].fcp), fcp: String(i[11].fcp),
TBF: String(i[11].tbf) tbf: String(i[11].tbf)
}, },
april: { april: {
TBC: String(i[12].tbc), tbc: String(i[12].tbc),
FCP: String(i[12].fcp), fcp: String(i[12].fcp),
TBF: String(i[12].tbf) tbf: String(i[12].tbf)
}, },
may: { may: {
TBC: String(i[13].tbc), tbc: String(i[13].tbc),
FCP: String(i[13].fcp), fcp: String(i[13].fcp),
TBF: String(i[13].tbf) tbf: String(i[13].tbf)
}, },
june: { june: {
TBC: String(i[14].tbc), tbc: String(i[14].tbc),
FCP: String(i[14].fcp), fcp: String(i[14].fcp),
TBF: String(i[14].tbf) tbf: String(i[14].tbf)
}, },
july: { july: {
TBC: String(i[15].tbc), tbc: String(i[15].tbc),
FCP: String(i[15].fcp), fcp: String(i[15].fcp),
TBF: String(i[15].tbf) tbf: String(i[15].tbf)
}, },
august: { august: {
TBC: String(i[16].tbc), tbc: String(i[16].tbc),
FCP: String(i[16].fcp), fcp: String(i[16].fcp),
TBF: String(i[16].tbf) tbf: String(i[16].tbf)
}, },
september: { september: {
TBC: String(i[17].tbc), tbc: String(i[17].tbc),
FCP: String(i[17].fcp), fcp: String(i[17].fcp),
TBF: String(i[17].tbf) tbf: String(i[17].tbf)
}, },
october: { october: {
TBC: String(i[18].tbc), tbc: String(i[18].tbc),
FCP: String(i[18].fcp), fcp: String(i[18].fcp),
TBF: String(i[18].tbf) tbf: String(i[18].tbf)
}, },
november: { november: {
TBC: String(i[19].tbc), tbc: String(i[19].tbc),
FCP: String(i[19].fcp), fcp: String(i[19].fcp),
TBF: String(i[19].tbf) tbf: String(i[19].tbf)
}, },
december: { december: {
TBC: String(i[20].tbc), tbc: String(i[20].tbc),
FCP: String(i[20].fcp), fcp: String(i[20].fcp),
TBF: String(i[20].tbf) tbf: String(i[20].tbf)
}, },
total_current_year: String(i[21]), total_current_year: String(i[21]),
total_next_year: { total_next_year: {
TBC: String(i[22].tbc), tbc: String(i[22].tbc),
FCP: String(i[22].fcp), fcp: String(i[22].fcp),
TBF: String(i[22].tbf) tbf: String(i[22].tbf)
}, },
total_more_year: { total_more_year: {
TBC: String(i[23].tbc), tbc: String(i[23].tbc),
FCP: String(i[23].fcp), fcp: String(i[23].fcp),
TBF: String(i[23].tbf) tbf: String(i[23].tbf)
} }
}) })
}) })
...@@ -296,75 +298,75 @@ export default class TaxPlanning extends Component { ...@@ -296,75 +298,75 @@ export default class TaxPlanning extends Component {
// item_report_name: this.state.reportName, // item_report_name: this.state.reportName,
item_report: i[1] === undefined ? "" : String(i[1]).trim(), item_report: i[1] === undefined ? "" : String(i[1]).trim(),
january: { january: {
TBC: i[2] === undefined ? "" : String(i[2]).trim(), tbc: i[2] === undefined ? "" : String(i[2]).trim(),
FCP: i[3] === undefined ? "0" : reg.test(String(i[3])) === false ? "0" : String(i[3]).trim(), fcp: i[3] === undefined ? "0" : reg.test(String(i[3])) === false ? "0" : String(i[3]).trim(),
TBF: i[4] === undefined ? "" : String(i[4]).trim() tbf: i[4] === undefined ? "" : String(i[4]).trim()
}, },
february: { february: {
TBC: String(i[10].tbc), tbc: i[5] === undefined ? "" : String(i[5]).trim(),
FCP: String(i[10].fcp), fcp: i[6] === undefined ? "0" : reg.test(String(i[6])) === false ? "0" : String(i[6]).trim(),
TBF: String(i[10].tbf) tbf: i[7] === undefined ? "" : String(i[7]).trim()
}, },
march: { march: {
TBC: String(i[11].tbc), tbc: i[8] === undefined ? "" : String(i[8]).trim(),
FCP: String(i[11].fcp), fcp: i[9] === undefined ? "0" : reg.test(String(i[9])) === false ? "0" : String(i[9]).trim(),
TBF: String(i[11].tbf) tbf: i[10] === undefined ? "" : String(i[10]).trim(),
}, },
april: { april: {
TBC: String(i[12].tbc), tbc: i[11] === undefined ? "" : String(i[11]).trim(),
FCP: String(i[12].fcp), fcp: i[12] === undefined ? "0" : reg.test(String(i[12])) === false ? "0" : String(i[12]).trim(),
TBF: String(i[12].tbf) tbf: i[13] === undefined ? "" : String(i[13]).trim()
}, },
may: { may: {
TBC: String(i[13].tbc), tbc: i[14] === undefined ? "" : String(i[14]).trim(),
FCP: String(i[13].fcp), fcp: i[15] === undefined ? "0" : reg.test(String(i[15])) === false ? "0" : String(i[15]).trim(),
TBF: String(i[13].tbf) tbf: i[16] === undefined ? "" : String(i[16]).trim()
}, },
june: { june: {
TBC: String(i[14].tbc), tbc: i[17] === undefined ? "" : String(i[17]).trim(),
FCP: String(i[14].fcp), fcp: i[18] === undefined ? "0" : reg.test(String(i[18])) === false ? "0" : String(i[18]).trim(),
TBF: String(i[14].tbf) tbf: i[19] === undefined ? "" : String(i[19]).trim()
}, },
july: { july: {
TBC: String(i[15].tbc), tbc: i[20] === undefined ? "" : String(i[20]).trim(),
FCP: String(i[15].fcp), fcp: i[21] === undefined ? "0" : reg.test(String(i[21])) === false ? "0" : String(i[21]).trim(),
TBF: String(i[15].tbf) tbf: i[22] === undefined ? "" : String(i[22]).trim()
}, },
august: { august: {
TBC: String(i[16].tbc), tbc: i[23] === undefined ? "" : String(i[23]).trim(),
FCP: String(i[16].fcp), fcp: i[24] === undefined ? "0" : reg.test(String(i[24])) === false ? "0" : String(i[24]).trim(),
TBF: String(i[16].tbf) tbf: i[25] === undefined ? "" : String(i[25]).trim()
}, },
september: { september: {
TBC: String(i[17].tbc), tbc: i[26] === undefined ? "" : String(i[26]).trim(),
FCP: String(i[17].fcp), fcp: i[27] === undefined ? "0" : reg.test(String(i[27])) === false ? "0" : String(i[27]).trim(),
TBF: String(i[17].tbf) tbf: i[28] === undefined ? "" : String(i[28]).trim()
}, },
october: { october: {
TBC: String(i[18].tbc), tbc: i[29] === undefined ? "" : String(i[29]).trim(),
FCP: String(i[18].fcp), fcp: i[30] === undefined ? "0" : reg.test(String(i[30])) === false ? "0" : String(i[30]).trim(),
TBF: String(i[18].tbf) tbf: i[31] === undefined ? "" : String(i[31]).trim()
}, },
november: { november: {
TBC: String(i[19].tbc), tbc: i[32] === undefined ? "" : String(i[32]).trim(),
FCP: String(i[19].fcp), fcp: i[33] === undefined ? "0" : reg.test(String(i[33])) === false ? "0" : String(i[33]).trim(),
TBF: String(i[19].tbf) tbf: i[34] === undefined ? "" : String(i[34]).trim()
}, },
december: { december: {
TBC: String(i[20].tbc), tbc: i[35] === undefined ? "" : String(i[35]).trim(),
FCP: String(i[20].fcp), fcp: i[36] === undefined ? "0" : reg.test(String(i[36])) === false ? "0" : String(i[36]).trim(),
TBF: String(i[20].tbf) tbf: i[37] === undefined ? "" : String(i[37]).trim()
}, },
total_current_year: String(i[21]), total_current_year: i[38] === undefined ? "" : String(i[38]).trim(),
total_next_year: { total_next_year: {
TBC: String(i[22].tbc), tbc: i[39] === undefined ? "" : String(i[39]).trim(),
FCP: String(i[22].fcp), fcp: i[40] === undefined ? "0" : reg.test(String(i[40])) === false ? "0" : String(i[40]).trim(),
TBF: String(i[22].tbf) tbf: i[41] === undefined ? "" : String(i[41]).trim()
}, },
total_more_year: { total_more_year: {
TBC: String(i[23].tbc), tbc: i[42] === undefined ? "" : String(i[42]).trim(),
FCP: String(i[23].fcp), fcp: i[43] === undefined ? "0" : reg.test(String(i[43])) === false ? "0" : String(i[43]).trim(),
TBF: String(i[23].tbf) tbf: i[44] === undefined ? "" : String(i[44]).trim()
} }
}) })
} }
...@@ -373,7 +375,7 @@ export default class TaxPlanning extends Component { ...@@ -373,7 +375,7 @@ export default class TaxPlanning extends Component {
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,
balance_sheet: payload tax_planning: payload
} }
console.log(body) console.log(body)
this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[2] }) this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[2] })
...@@ -383,49 +385,94 @@ export default class TaxPlanning extends Component { ...@@ -383,49 +385,94 @@ export default class TaxPlanning extends Component {
checkUpload() { checkUpload() {
api.create().checkUploadMB(this.state.payload).then(response => { api.create().checkUploadMB(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) {
// if (response.data.status === 'success') { if (response.data.status === 'success') {
// this.setState({ visibleUpload: false, visibleTP: false, loading: true }) this.setState({ visibleUpload: false, visibleTP: false, loading: true })
// let dataTable = response.data.data.map((item, index) => { let dataTable = response.data.data.map((item, index) => {
// return [ return [
// item.type_report_id, item.type_report_id,
// item.item_report_id, item.item_report_id,
// item.parent, item.parent,
// item.formula, item.formula,
// item.level, item.level,
// item.item_report, item.description,
// item.total_actual_before, {tbc : item.tax_planning.january.tbc, fcp: item.tax_planning.january.fcp, tbf: item.tax_planning.january.tbf},
// item.january, {tbc : item.tax_planning.february.tbc, fcp: item.tax_planning.february.fcp, tbf: item.tax_planning.february.tbf},
// item.february, {tbc : item.tax_planning.march.tbc, fcp: item.tax_planning.march.fcp, tbf: item.tax_planning.march.tbf},
// item.march, {tbc : item.tax_planning.april.tbc, fcp: item.tax_planning.april.fcp, tbf: item.tax_planning.april.tbf},
// item.april, {tbc : item.tax_planning.may.tbc, fcp: item.tax_planning.may.fcp, tbf: item.tax_planning.may.tbf},
// item.may, {tbc : item.tax_planning.june.tbc, fcp: item.tax_planning.june.fcp, tbf: item.tax_planning.june.tbf},
// item.june, {tbc : item.tax_planning.july.tbc, fcp: item.tax_planning.july.fcp, tbf: item.tax_planning.july.tbf},
// item.july, {tbc : item.tax_planning.august.tbc, fcp: item.tax_planning.august.fcp, tbf: item.tax_planning.august.tbf},
// item.august, {tbc : item.tax_planning.september.tbc, fcp: item.tax_planning.september.fcp, tbf: item.tax_planning.september.tbf},
// item.september, {tbc : item.tax_planning.october.tbc, fcp: item.tax_planning.october.fcp, tbf: item.tax_planning.october.tbf},
// item.october, {tbc : item.tax_planning.november.tbc, fcp: item.tax_planning.november.fcp, tbf: item.tax_planning.november.tbf},
// item.november, {tbc : item.tax_planning.december.tbc, fcp: item.tax_planning.december.fcp, tbf: item.tax_planning.december.tbf},
// item.december, item.tax_planning.total_current_year,
// item.total_current_year, {tbc : item.tax_planning.total_next_year.tbc, fcp: item.tax_planning.total_next_year.fcp, tbf: item.tax_planning.total_next_year.tbf},
// item.total_next_year, {tbc : item.tax_planning.total_more_year.tbc, fcp: item.tax_planning.total_more_year.fcp, tbf: item.tax_planning.total_more_year.tbf},
// item.total_more_year, item.error
// item.error ]
// ] })
// }) this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false }, () => {
// this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false }, () => { this.state.dataTable.map(item => {
// this.state.dataTable.map(item => { if (item[24].length > 0) {
// if (item[22].length > 0) { console.log('masuk')
// console.log('masuk') this.setState({ buttonError: true, errorPreview: true })
// this.setState({ buttonError: true, errorPreview: true }) }
// } })
// }) // console.log(this.state.dataTable);
// // console.log(this.state.dataTable); })
// }) }
// } }
// } })
}
uploadTP() {
let data = []
this.state.dataTable.map(i => {
data.push({
item_report_id: i[1],
total_actual_before: String(i[6]),
january: String(i[7]),
february: String(i[8]),
march: String(i[9]),
april: String(i[10]),
may: String(i[11]),
june: String(i[12]),
july: String(i[13]),
august: String(i[14]),
september: String(i[15]),
october: String(i[16]),
november: String(i[17]),
december: String(i[18]),
total_current_year: String(i[19]),
total_next_year: String(i[20]),
total_more_year: String(i[21])
})
})
let body = {
submission_id: this.props.submissionID,
company_id: this.props.company.company_id,
periode: this.props.periode,
report_id: this.props.report_id,
balance_sheet: data
}
console.log(data);
api.create('UPLOAD').uploadMasterBudget(body).then(response => {
console.log(response);
if (response.data) {
if (response.data.status === "success") {
this.props.onClickClose()
this.props.getReport()
} else {
alert(response.data.status)
}
} else {
alert(response.problem)
}
}) })
} }
...@@ -586,8 +633,8 @@ export default class TaxPlanning extends Component { ...@@ -586,8 +633,8 @@ export default class TaxPlanning extends Component {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ width: 300 }}> <div style={{ width: 300 }}>
{tableMeta.rowData[22] ? {tableMeta.rowData[24] ?
tableMeta.rowData[22].length > 0 ? tableMeta.rowData[24].length > 0 ?
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}> <div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
<LightTooltip title={"Report Items Not Registered"} arrow> <LightTooltip title={"Report Items Not Registered"} arrow>
<span style={{ fontSize: 12, color: 'red' }}>{tableMeta.rowData[0] === 4 ? "" : val}</span> <span style={{ fontSize: 12, color: 'red' }}>{tableMeta.rowData[0] === 4 ? "" : val}</span>
...@@ -4675,7 +4722,7 @@ export default class TaxPlanning extends Component { ...@@ -4675,7 +4722,7 @@ export default class TaxPlanning extends Component {
disabled={this.state.buttonError} disabled={this.state.buttonError}
onClick={() => this.setState({ loading: true }, () => { onClick={() => this.setState({ loading: true }, () => {
setTimeout(() => { setTimeout(() => {
this.uploadBalanceSheet() this.uploadTP()
}, 100); }, 100);
})} })}
> >
......
...@@ -362,7 +362,7 @@ export default class CreateManagementDoc extends Component { ...@@ -362,7 +362,7 @@ export default class CreateManagementDoc extends Component {
type={this.state.uploadStatus} type={this.state.uploadStatus}
percentage={this.state.percentage} percentage={this.state.percentage}
result={this.state.result} result={this.state.result}
acceptedFiles={["xls", "xlsx", "pdf", "PDF"]} acceptedFiles={["xls", "xlsx", "pdf", "PDF", "docx", "doc", "pptx", "ppt", "ods", "odf" ]}
intent={"management"} intent={"management"}
onHandle={(dt) => { onHandle={(dt) => {
this.fileHandler(dt) this.fileHandler(dt)
......
...@@ -407,7 +407,7 @@ export default class EditManagementDoc extends Component { ...@@ -407,7 +407,7 @@ export default class EditManagementDoc extends Component {
type={this.state.uploadStatus} type={this.state.uploadStatus}
percentage={this.state.percentage} percentage={this.state.percentage}
result={this.state.result} result={this.state.result}
acceptedFiles={["xls", "xlsx", "pdf", "PDF"]} acceptedFiles={["xls", "xlsx", "pdf", "PDF", "docx", "doc", "pptx", "ppt", "ods", "odf" ]}
intent={"management"} intent={"management"}
onHandle={(dt) => { onHandle={(dt) => {
this.fileHandler(dt) this.fileHandler(dt)
......
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