Commit a70d7520 authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'rifka' into 'master'

taxplan bersih

See merge request !551
parents 2ba7a410 4122fe51
...@@ -68,9 +68,9 @@ export default class ApprovalMatrix extends Component { ...@@ -68,9 +68,9 @@ export default class ApprovalMatrix extends Component {
fileHandler = (event) => { fileHandler = (event) => {
let fileObj = event let fileObj = event
ExcelRenderer(fileObj, (err, resp) => { ExcelRenderer(fileObj, (err, resp) => {
console.log(resp) // console.log(resp)
if (err) { if (err) {
console.log(err); // console.log(err);
} }
else { else {
let isi = resp.rows.slice(3) let isi = resp.rows.slice(3)
...@@ -93,14 +93,14 @@ export default class ApprovalMatrix extends Component { ...@@ -93,14 +93,14 @@ export default class ApprovalMatrix extends Component {
approval_matrix: payload approval_matrix: payload
} }
this.setState({ payload: body, buttonError: false, judul: resp.rows[1][0] }) this.setState({ payload: body, buttonError: false, judul: resp.rows[1][0] })
console.log(this.state.payload) // console.log(this.state.payload)
} }
}); });
} }
checkUpload(){ checkUpload(){
api.create().checkUploadAM(this.state.payload).then(response => { api.create().checkUploadAM(this.state.payload).then(response => {
console.log(response) // console.log(response)
let dataRow = [] let dataRow = []
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
...@@ -335,7 +335,7 @@ export default class ApprovalMatrix extends Component { ...@@ -335,7 +335,7 @@ export default class ApprovalMatrix extends Component {
menu: "approval matrix" menu: "approval matrix"
} }
api.create().getPermission(payload).then(response => { api.create().getPermission(payload).then(response => {
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
...@@ -540,7 +540,6 @@ export default class ApprovalMatrix extends Component { ...@@ -540,7 +540,6 @@ export default class ApprovalMatrix extends Component {
} }
downloadDataTable = async () => { downloadDataTable = async () => {
// alert('link belum ada')
let res = await fetch( let res = await fetch(
"https://tia.eksad.com/tia-reporting-dev/public/approval_matrix/export_approval_matrix" "https://tia.eksad.com/tia-reporting-dev/public/approval_matrix/export_approval_matrix"
) )
...@@ -557,7 +556,7 @@ export default class ApprovalMatrix extends Component { ...@@ -557,7 +556,7 @@ export default class ApprovalMatrix extends Component {
uploadAM() { uploadAM() {
api.create().uploadAM(this.state.payload).then(response => { api.create().uploadAM(this.state.payload).then(response => {
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status === "success") { if (response.data.status === "success") {
...@@ -589,7 +588,7 @@ export default class ApprovalMatrix extends Component { ...@@ -589,7 +588,7 @@ export default class ApprovalMatrix extends Component {
deleteAM = (payload) => { deleteAM = (payload) => {
this.setState({ popupDel: false }) this.setState({ popupDel: false })
api.create().deleteAM(payload).then(response => { api.create().deleteAM(payload).then(response => {
console.log(response.data) // console.log(response.data)
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status == 'success') { if (response.data.status == 'success') {
......
...@@ -45,7 +45,6 @@ export default class CreateApprovalMatrix extends Component { ...@@ -45,7 +45,6 @@ export default class CreateApprovalMatrix extends Component {
this.getTypeData() this.getTypeData()
this.getOperatorData() this.getOperatorData()
let date = format(new Date, 'yyyy-MM-dd') let date = format(new Date, 'yyyy-MM-dd')
console.log(date);
this.setState({ this.setState({
startDate: date, startDate: date,
endDate: date endDate: date
...@@ -64,14 +63,12 @@ export default class CreateApprovalMatrix extends Component { ...@@ -64,14 +63,12 @@ export default class CreateApprovalMatrix extends Component {
fullname: item.fullname == null? "(NO_NAME)" : item.fullname fullname: item.fullname == null? "(NO_NAME)" : item.fullname
} }
}) })
// console.log(userData)
let defaultProps = { let defaultProps = {
options: userData, options: userData,
getOptionLabel: (option) => option.fullname, getOptionLabel: (option) => option.fullname,
}; };
this.setState({ approvedBy: defaultProps, userData: response.data.data}) this.setState({ approvedBy: defaultProps, userData: response.data.data})
} else { } else {
// alert('Approver Name: ' +response.data.message)
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In")) {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
setTimeout(() => { setTimeout(() => {
...@@ -110,7 +107,6 @@ export default class CreateApprovalMatrix extends Component { ...@@ -110,7 +107,6 @@ export default class CreateApprovalMatrix extends Component {
}; };
this.setState({ types: typeProps, typeData: response.data.data }) this.setState({ types: typeProps, typeData: response.data.data })
} else { } else {
// alert('Approval Type: ' +response.data.message)
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In")) {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
setTimeout(() => { setTimeout(() => {
...@@ -143,14 +139,12 @@ export default class CreateApprovalMatrix extends Component { ...@@ -143,14 +139,12 @@ export default class CreateApprovalMatrix extends Component {
operator_type_name: item.operator_type_name operator_type_name: item.operator_type_name
} }
}) })
// console.log(userData)
let operatorProps = { let operatorProps = {
options: operatorData, options: operatorData,
getOptionLabel: (option) => option.operator_type_name, getOptionLabel: (option) => option.operator_type_name,
}; };
this.setState({ operators: operatorProps, operatorData: response.data.data }) this.setState({ operators: operatorProps, operatorData: response.data.data })
} else { } else {
// alert('Operator: ' +response.data.message)
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In")) {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
setTimeout(() => { setTimeout(() => {
...@@ -177,12 +171,12 @@ export default class CreateApprovalMatrix extends Component { ...@@ -177,12 +171,12 @@ export default class CreateApprovalMatrix extends Component {
if (isDate && type == 'start_date') { if (isDate && type == 'start_date') {
this.setState({ startDate: format(e, 'yyyy-MM-dd'), endDate: null }, () => { this.setState({ startDate: format(e, 'yyyy-MM-dd'), endDate: null }, () => {
this.clearError() this.clearError()
console.log(this.state.startDate) // console.log(this.state.startDate)
}) })
} else if (isDate && type == 'end_date') { } else if (isDate && type == 'end_date') {
this.setState({ endDate: format(e, 'yyyy-MM-dd')}, () => { this.setState({ endDate: format(e, 'yyyy-MM-dd')}, () => {
this.clearError() this.clearError()
console.log(this.state.endDate) // console.log(this.state.endDate)
}) })
} else { } else {
// this.setState({...data, tempData: {...this.state.tempData, [e.target.name] : e.target.value}}) // this.setState({...data, tempData: {...this.state.tempData, [e.target.name] : e.target.value}})
...@@ -225,7 +219,6 @@ export default class CreateApprovalMatrix extends Component { ...@@ -225,7 +219,6 @@ export default class CreateApprovalMatrix extends Component {
} else if (R.isNil(this.state.endDate)) { } else if (R.isNil(this.state.endDate)) {
this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty' }) this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty' })
} else { } else {
console.log('masuk');
let payload = { let payload = {
"approval_type_id": this.state.typeId.approval_type_id, "approval_type_id": this.state.typeId.approval_type_id,
"orders": this.state.order, "orders": this.state.order,
...@@ -235,7 +228,6 @@ export default class CreateApprovalMatrix extends Component { ...@@ -235,7 +228,6 @@ export default class CreateApprovalMatrix extends Component {
"end_date": this.state.endDate "end_date": this.state.endDate
} }
this.props.createAM(payload) this.props.createAM(payload)
// console.log(payload)
} }
} }
......
...@@ -42,7 +42,6 @@ export default class EditApprovalMatrix extends Component { ...@@ -42,7 +42,6 @@ export default class EditApprovalMatrix extends Component {
componentDidMount() { componentDidMount() {
if (this.props.type === 'edit') { if (this.props.type === 'edit') {
this.getDetailAM() this.getDetailAM()
console.log(this.state.startDate);
// let getApprovedBy = { // let getApprovedBy = {
// user_id: data.user_id, // user_id: data.user_id,
// fullname: data.fullname // fullname: data.fullname
...@@ -265,7 +264,6 @@ export default class EditApprovalMatrix extends Component { ...@@ -265,7 +264,6 @@ export default class EditApprovalMatrix extends Component {
} else if (R.isEmpty(this.state.endDate)) { } else if (R.isEmpty(this.state.endDate)) {
this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty' }) this.setState({ errorEndDate: true, msgErrorEndDate: 'Valid To Cannot be Empty' })
} else { } else {
console.log('masuk');
if (this.props.type == 'edit') { if (this.props.type == 'edit') {
let payload = { let payload = {
"approval_matrix_id": this.state.id, "approval_matrix_id": this.state.id,
...@@ -277,7 +275,6 @@ export default class EditApprovalMatrix extends Component { ...@@ -277,7 +275,6 @@ export default class EditApprovalMatrix extends Component {
"end_date": this.state.endDate "end_date": this.state.endDate
} }
this.props.updateAM(payload) this.props.updateAM(payload)
// console.log(payload)
} }
} }
} }
......
...@@ -22,7 +22,7 @@ export default class PopUpDeleteAM extends Component { ...@@ -22,7 +22,7 @@ export default class PopUpDeleteAM extends Component {
getDetailAM() { getDetailAM() {
api.create().getDetailAM(this.props.data[1]).then(response => { api.create().getDetailAM(this.props.data[1]).then(response => {
console.log(response.data) // console.log(response.data)
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status === "success") { if (response.data.status === "success") {
......
...@@ -100,15 +100,11 @@ export default class VisualisasiAM extends Component { ...@@ -100,15 +100,11 @@ export default class VisualisasiAM extends Component {
orderId: item.orders, orderId: item.orders,
data: [item] data: [item]
}) })
// console.log(listVisual);
} else { } else {
listVisual[indexId].data.push(item) listVisual[indexId].data.push(item)
// console.log('listVisual');
// console.log(listVisual);
} }
}) })
this.setState({ listApproval: listVisual}) this.setState({ listApproval: listVisual})
// console.log(listVisual);
} 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")) {
...@@ -133,7 +129,7 @@ export default class VisualisasiAM extends Component { ...@@ -133,7 +129,7 @@ export default class VisualisasiAM extends Component {
let orderIdFrom = listApproval[fromIndex].orderId let orderIdFrom = listApproval[fromIndex].orderId
listApproval[fromIndex].orderId = listApproval[toIndex].orderId listApproval[fromIndex].orderId = listApproval[toIndex].orderId
listApproval[toIndex].orderId = orderIdFrom listApproval[toIndex].orderId = orderIdFrom
that.setState({listEdit: listApproval}, () => console.log(this.state.listEdit)) that.setState({listEdit: listApproval})
} }
handleSave() { handleSave() {
......
...@@ -62,7 +62,6 @@ export default class TaxPlanning extends Component { ...@@ -62,7 +62,6 @@ export default class TaxPlanning extends Component {
componentDidMount() { componentDidMount() {
this.getItemHierarki() this.getItemHierarki()
this.getLatestUpdate() this.getLatestUpdate()
console.log(this.props);
} }
getLatestUpdate() { getLatestUpdate() {
...@@ -94,7 +93,7 @@ export default class TaxPlanning extends Component { ...@@ -94,7 +93,7 @@ export default class TaxPlanning extends Component {
"submission_id": this.props.submissionID "submission_id": this.props.submissionID
} }
api.create().getDetailReportMB(payload).then(response => { api.create().getDetailReportMB(payload).then(response => {
console.log(response); // console.log(response);
let dataTable = [] let dataTable = []
if (response.data) { if (response.data) {
let res = response.data.data let res = response.data.data
...@@ -308,7 +307,7 @@ export default class TaxPlanning extends Component { ...@@ -308,7 +307,7 @@ export default class TaxPlanning extends Component {
"status": type, "status": type,
"tax_planning": data "tax_planning": data
} }
console.log(JSON.stringify(payload)); // console.log(JSON.stringify(payload));
this.props.saveToMasterBudget(payload) this.props.saveToMasterBudget(payload)
this.props.onClickClose() this.props.onClickClose()
} }
...@@ -318,12 +317,12 @@ export default class TaxPlanning extends Component { ...@@ -318,12 +317,12 @@ export default class TaxPlanning extends Component {
ExcelRenderer(fileObj, (err, resp) => { ExcelRenderer(fileObj, (err, resp) => {
// console.log(resp) // console.log(resp)
if (err) { if (err) {
console.log(err); // console.log(err);
} }
else { else {
let isi = resp.rows.slice(4) let isi = resp.rows.slice(4)
console.log(resp.rows[2]); // console.log(resp.rows[2]);
console.log(resp.rows); // console.log(resp.rows);
let payload = [] let payload = []
let reg = /^[-+]?(?:[0-9]+,)*[0-9]+(?:\.[0-9]+)?$/; let reg = /^[-+]?(?:[0-9]+,)*[0-9]+(?:\.[0-9]+)?$/;
isi.map((i, index) => { isi.map((i, index) => {
...@@ -412,15 +411,15 @@ export default class TaxPlanning extends Component { ...@@ -412,15 +411,15 @@ export default class TaxPlanning extends Component {
tax_planning: payload tax_planning: payload
} }
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] })
console.log(this.state.judulColumn) // console.log(this.state.judulColumn)
} }
}); });
} }
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 })
...@@ -472,11 +471,11 @@ export default class TaxPlanning extends Component { ...@@ -472,11 +471,11 @@ export default class TaxPlanning extends Component {
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true, saveDraft: true }, () => { this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true, saveDraft: true }, () => {
this.state.dataTable.map(item => { this.state.dataTable.map(item => {
if (item[27].length > 0) { if (item[27].length > 0) {
console.log('masuk') // console.log('masuk')
this.setState({ buttonError: true, errorPreview: true, editable: true, saveDraft: true }) this.setState({ buttonError: true, errorPreview: true, editable: true, saveDraft: true })
} }
}) })
console.log(this.state.dataTable); // console.log(this.state.dataTable);
}) })
} }
} }
...@@ -571,7 +570,7 @@ export default class TaxPlanning extends Component { ...@@ -571,7 +570,7 @@ export default class TaxPlanning extends Component {
} }
// console.log(data); // console.log(data);
api.create('UPLOAD').uploadMasterBudget(body).then(response => { api.create('UPLOAD').uploadMasterBudget(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") {
this.props.onClickClose() this.props.onClickClose()
...@@ -588,7 +587,7 @@ export default class TaxPlanning extends Component { ...@@ -588,7 +587,7 @@ export default class TaxPlanning extends Component {
handleValidate() { handleValidate() {
let data = [] let data = []
console.log(this.state.dataTable) // console.log(this.state.dataTable)
this.state.dataTable.map(i => { this.state.dataTable.map(i => {
// console.log(i[0]) // console.log(i[0])
data.push({ data.push({
...@@ -674,9 +673,9 @@ export default class TaxPlanning extends Component { ...@@ -674,9 +673,9 @@ export default class TaxPlanning extends Component {
"tax_planning": data, "tax_planning": data,
"status": "submitted" "status": "submitted"
} }
console.log(JSON.stringify(payload)); // console.log(JSON.stringify(payload));
api.create().validateSubmitReport(payload).then((response) => { api.create().validateSubmitReport(payload).then((response) => {
console.log(response) // console.log(response)
if (response.data.data.result) { if (response.data.data.result) {
this.setState({ loading: false, buttonError: false, editable: false, saveDraft: false }) this.setState({ loading: false, buttonError: false, editable: false, saveDraft: false })
// alert("Type Input Can't be Empty") // alert("Type Input Can't be Empty")
...@@ -691,7 +690,7 @@ export default class TaxPlanning extends Component { ...@@ -691,7 +690,7 @@ export default class TaxPlanning extends Component {
`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/master_budget/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)
if (res.size > 0) { if (res.size > 0) {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
let a = document.createElement('a'); let a = document.createElement('a');
...@@ -704,7 +703,7 @@ export default class TaxPlanning extends Component { ...@@ -704,7 +703,7 @@ export default class TaxPlanning 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/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 sub_null = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}` let sub_null = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/export_master_budget?submission_id=&&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(
this.props.submissionID == null ? sub_null : url this.props.submissionID == null ? sub_null : url
) )
...@@ -947,14 +946,9 @@ export default class TaxPlanning extends Component { ...@@ -947,14 +946,9 @@ export default class TaxPlanning extends Component {
const handleForecast = (tableMeta, periode, dex) => { const handleForecast = (tableMeta, periode, dex) => {
let total = 0 let total = 0
// console.log(dataTable2[tableMeta.rowIndex][6])
// console.log(dex)
let data = dex == 1? dataTable2[tableMeta.rowIndex][6].tbc : dex == 2? dataTable2[tableMeta.rowIndex][6].fcp : dataTable2[tableMeta.rowIndex][6].tbf let data = dex == 1? dataTable2[tableMeta.rowIndex][6].tbc : dex == 2? dataTable2[tableMeta.rowIndex][6].fcp : dataTable2[tableMeta.rowIndex][6].tbf
// let valuue =
// if (tableMeta.rowData[8] == '')
let forecast = dex == 1 ? dataTable2[tableMeta.rowIndex][27] : dex == 2? dataTable2[tableMeta.rowIndex][28] : dataTable2[tableMeta.rowIndex][29] let forecast = dex == 1 ? dataTable2[tableMeta.rowIndex][27] : dex == 2? dataTable2[tableMeta.rowIndex][28] : dataTable2[tableMeta.rowIndex][29]
if (data.includes('#PL')) { if (data.includes('#PL')) {
// console.log(tableMeta.rowData[8])
if (tableMeta.rowData[8] == "Control (should be nil)") { if (tableMeta.rowData[8] == "Control (should be nil)") {
total = handleValueFormula(5, tableMeta, dex, data, forecast, periode) total = handleValueFormula(5, tableMeta, dex, data, forecast, periode)
} else { } else {
...@@ -965,10 +959,7 @@ export default class TaxPlanning extends Component { ...@@ -965,10 +959,7 @@ export default class TaxPlanning extends Component {
}) })
} }
} else { } else {
// console.log(tableMeta.rowData[8])
// console.log(data)
total = handleValueFormula(5, tableMeta, dex, data) total = handleValueFormula(5, tableMeta, dex, data)
// console.log(total)
} }
if (dex == 1) { if (dex == 1) {
...@@ -1006,7 +997,6 @@ export default class TaxPlanning extends Component { ...@@ -1006,7 +997,6 @@ export default class TaxPlanning extends Component {
a = dataTable2[indexParent][tableMeta.columnIndex].fcp = jagain === undefined ? (0 + Number(val)) : (Number(jagain) + Number(val)) a = dataTable2[indexParent][tableMeta.columnIndex].fcp = jagain === undefined ? (0 + Number(val)) : (Number(jagain) + Number(val))
} }
} else { } else {
// console.log(tableMeta)
if (indexChilds == 0) { if (indexChilds == 0) {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc = Number(val) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc = Number(val)
} }
...@@ -1026,7 +1016,7 @@ export default class TaxPlanning extends Component { ...@@ -1026,7 +1016,7 @@ export default class TaxPlanning extends Component {
let valItem = item.tbf.value == undefined || item.tbf.value == "" || item.tbf.value == "undefined" ? 0.0 : item.tbf.value let valItem = item.tbf.value == undefined || item.tbf.value == "" || item.tbf.value == "undefined" ? 0.0 : item.tbf.value
total += Number(valItem) total += Number(valItem)
} else { } else {
if (dataTable2[tableMeta.rowIndex][8] === "Fiscal Correction positive / (negative) Year To Date"){ if (tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date"){
let valItem = item.fcp == undefined || item.fcp == "" || item.fcp == "undefined" ? 0.0 : item.fcp let valItem = item.fcp == undefined || item.fcp == "" || item.fcp == "undefined" ? 0.0 : item.fcp
total += Number(valItem) total += Number(valItem)
} else { } else {
...@@ -1037,16 +1027,11 @@ export default class TaxPlanning extends Component { ...@@ -1037,16 +1027,11 @@ export default class TaxPlanning extends Component {
} }
}) })
dataTable2[tableMeta.rowIndex][21] = total dataTable2[tableMeta.rowIndex][21] = Number(total).toFixed(1)
if (tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date"){
console.log("masuk")
console.log(total)
}
return total return total
} }
const handleValue = (data) => { const handleValue = (data) => {
let total = 0 let total = 0
// console.log(dataTable2)
dataTable2.map((item, index) => { dataTable2.map((item, index) => {
if (data.rowData[4] === item[5]) { if (data.rowData[4] === item[5]) {
total = item[data.columnIndex] === undefined ? (Number(total) + 0) : (Number(total) + Number(item[data.columnIndex].fcp)) total = item[data.columnIndex] === undefined ? (Number(total) + 0) : (Number(total) + Number(item[data.columnIndex].fcp))
...@@ -1054,7 +1039,6 @@ export default class TaxPlanning extends Component { ...@@ -1054,7 +1039,6 @@ export default class TaxPlanning extends Component {
}) })
let indexParent = dataTable2.findIndex((val) => val[4] === dataTable2[data.rowIndex][5]) let indexParent = dataTable2.findIndex((val) => val[4] === dataTable2[data.rowIndex][5])
let a = dataTable2[data.rowIndex][data.columnIndex].fcp = Number(total) let a = dataTable2[data.rowIndex][data.columnIndex].fcp = Number(total)
// console.log(indexParent);
return a return a
} }
...@@ -1103,10 +1087,6 @@ export default class TaxPlanning extends Component { ...@@ -1103,10 +1087,6 @@ export default class TaxPlanning extends Component {
"formula": rilFormula "formula": rilFormula
} }
api.create().countingFormula(body).then(response => { api.create().countingFormula(body).then(response => {
// console.log(response)
// console.log(tableMeta)
// console.log(tableMeta.rowIndex)
// console.log(rowColumn)
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
return response.data.data.result return response.data.data.result
...@@ -1160,8 +1140,6 @@ export default class TaxPlanning extends Component { ...@@ -1160,8 +1140,6 @@ export default class TaxPlanning extends Component {
} else { } else {
total = Number(total) total = Number(total)
} }
// console.log(Number(total))
// console.log(dataTable2[tableMeta.rowIndex])
let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = total let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = total
return a return a
} }
...@@ -1169,7 +1147,6 @@ export default class TaxPlanning extends Component { ...@@ -1169,7 +1147,6 @@ export default class TaxPlanning extends Component {
} }
const handleParent = (tableMeta, type) => { const handleParent = (tableMeta, type) => {
// console.log(tableMeta)
let total = 0 let total = 0
dataTable2.map((item, index) => { dataTable2.map((item, index) => {
if (item[5] == tableMeta.rowData[4]) { if (item[5] == tableMeta.rowData[4]) {
...@@ -1206,7 +1183,6 @@ export default class TaxPlanning extends Component { ...@@ -1206,7 +1183,6 @@ export default class TaxPlanning extends Component {
} else { } else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf = total dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf = total
} }
// console.log(dataTable2)
return total return total
} }
...@@ -1312,8 +1288,6 @@ export default class TaxPlanning extends Component { ...@@ -1312,8 +1288,6 @@ export default class TaxPlanning extends Component {
), ),
setCellProps: () => ({ style2 }), setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
// console.log(tableMeta.rowData);
// console.log(value)
return ( return (
<div> <div>
<div className="grid grid-3x content-center"> <div className="grid grid-3x content-center">
...@@ -1336,7 +1310,7 @@ export default class TaxPlanning extends Component { ...@@ -1336,7 +1310,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 0) handleChange(event.target.value, tableMeta, 0)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1465,10 +1439,8 @@ export default class TaxPlanning extends Component { ...@@ -1465,10 +1439,8 @@ export default class TaxPlanning extends Component {
// disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)} // disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
value={Number(value.fcp).toFixed(1)} value={Number(value.fcp).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 1) handleChange(event.target.value, tableMeta, 1)
console.log(dataTable2) // console.log(dataTable2)
// console.log(event.target.value)
}} }}
/> />
} }
...@@ -1599,7 +1571,7 @@ export default class TaxPlanning extends Component { ...@@ -1599,7 +1571,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2) handleChange(event.target.value, tableMeta, 2)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1741,7 +1713,6 @@ export default class TaxPlanning extends Component { ...@@ -1741,7 +1713,6 @@ export default class TaxPlanning extends Component {
), ),
setCellProps: () => ({ style2 }), setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
// console.log(value)
return ( return (
<div> <div>
<div className="grid grid-3x content-center"> <div className="grid grid-3x content-center">
...@@ -1763,7 +1734,7 @@ export default class TaxPlanning extends Component { ...@@ -1763,7 +1734,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 0) handleChange(event.target.value, tableMeta, 0)
console.log(event.target.value)
}} }}
/> />
} }
...@@ -1892,10 +1863,8 @@ export default class TaxPlanning extends Component { ...@@ -1892,10 +1863,8 @@ export default class TaxPlanning extends Component {
disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)} disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
value={Number(value.fcp).toFixed(1)} value={Number(value.fcp).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 1) handleChange(event.target.value, tableMeta, 1)
console.log(dataTable2) // console.log(dataTable2)
// console.log(event.target.value)
}} }}
/> />
} }
...@@ -2024,9 +1993,8 @@ export default class TaxPlanning extends Component { ...@@ -2024,9 +1993,8 @@ export default class TaxPlanning extends Component {
disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)} disabled={this.props.isApprover == true ? true : ((this.props.lastStatus === 'SUBMIT' || this.props.lastStatus === 'REVISION') && this.props.prevRevision === false && (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') ? false : true)}
value={Number(value.tbf).toFixed(1)} value={Number(value.tbf).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2) handleChange(event.target.value, tableMeta, 2)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -2169,7 +2137,6 @@ export default class TaxPlanning extends Component { ...@@ -2169,7 +2137,6 @@ export default class TaxPlanning extends Component {
), ),
setCellProps: () => ({ style2 }), setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
// console.log(value)
return ( return (
<div> <div>
<div className="grid grid-3x content-center"> <div className="grid grid-3x content-center">
...@@ -2191,7 +2158,7 @@ export default class TaxPlanning extends Component { ...@@ -2191,7 +2158,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 0) handleChange(event.target.value, tableMeta, 0)
console.log(event.target.value)
}} }}
/> />
} }
...@@ -2322,8 +2289,7 @@ export default class TaxPlanning extends Component { ...@@ -2322,8 +2289,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 1) handleChange(event.target.value, tableMeta, 1)
console.log(dataTable2) // console.log(dataTable2)
// console.log(event.target.value)
}} }}
/> />
} }
...@@ -2454,7 +2420,7 @@ export default class TaxPlanning extends Component { ...@@ -2454,7 +2420,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2) handleChange(event.target.value, tableMeta, 2)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -2596,7 +2562,6 @@ export default class TaxPlanning extends Component { ...@@ -2596,7 +2562,6 @@ export default class TaxPlanning extends Component {
), ),
setCellProps: () => ({ style2 }), setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
// console.log(value)
return ( return (
<div> <div>
<div className="grid grid-3x content-center"> <div className="grid grid-3x content-center">
...@@ -2618,7 +2583,7 @@ export default class TaxPlanning extends Component { ...@@ -2618,7 +2583,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 0) handleChange(event.target.value, tableMeta, 0)
console.log(event.target.value)
}} }}
/> />
} }
...@@ -2750,7 +2715,6 @@ export default class TaxPlanning extends Component { ...@@ -2750,7 +2715,6 @@ export default class TaxPlanning extends Component {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 1) handleChange(event.target.value, tableMeta, 1)
console.log(dataTable2) console.log(dataTable2)
// console.log(event.target.value)
}} }}
/> />
} }
...@@ -2881,7 +2845,7 @@ export default class TaxPlanning extends Component { ...@@ -2881,7 +2845,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2) handleChange(event.target.value, tableMeta, 2)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -3023,7 +2987,7 @@ export default class TaxPlanning extends Component { ...@@ -3023,7 +2987,7 @@ export default class TaxPlanning extends Component {
), ),
setCellProps: () => ({ style2 }), setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
// console.log(value)
return ( return (
<div> <div>
<div className="grid grid-3x content-center"> <div className="grid grid-3x content-center">
...@@ -3177,7 +3141,7 @@ export default class TaxPlanning extends Component { ...@@ -3177,7 +3141,7 @@ export default class TaxPlanning extends Component {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 1) handleChange(event.target.value, tableMeta, 1)
console.log(dataTable2) console.log(dataTable2)
// console.log(event.target.value)
}} }}
/> />
} }
...@@ -3450,7 +3414,7 @@ export default class TaxPlanning extends Component { ...@@ -3450,7 +3414,7 @@ export default class TaxPlanning extends Component {
), ),
setCellProps: () => ({ style2 }), setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
// console.log(value)
return ( return (
<div> <div>
<div className="grid grid-3x content-center"> <div className="grid grid-3x content-center">
...@@ -3604,7 +3568,7 @@ export default class TaxPlanning extends Component { ...@@ -3604,7 +3568,7 @@ export default class TaxPlanning extends Component {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 1) handleChange(event.target.value, tableMeta, 1)
console.log(dataTable2) console.log(dataTable2)
// console.log(event.target.value)
}} }}
/> />
} }
...@@ -3877,7 +3841,7 @@ export default class TaxPlanning extends Component { ...@@ -3877,7 +3841,7 @@ export default class TaxPlanning extends Component {
), ),
setCellProps: () => ({ style2 }), setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
// console.log(value)
return ( return (
<div> <div>
<div className="grid grid-3x content-center"> <div className="grid grid-3x content-center">
...@@ -4031,7 +3995,7 @@ export default class TaxPlanning extends Component { ...@@ -4031,7 +3995,7 @@ export default class TaxPlanning extends Component {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 1) handleChange(event.target.value, tableMeta, 1)
console.log(dataTable2) console.log(dataTable2)
// console.log(event.target.value)
}} }}
/> />
} }
...@@ -4304,7 +4268,7 @@ export default class TaxPlanning extends Component { ...@@ -4304,7 +4268,7 @@ export default class TaxPlanning extends Component {
), ),
setCellProps: () => ({ style2 }), setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
// console.log(value)
return ( return (
<div> <div>
<div className="grid grid-3x content-center"> <div className="grid grid-3x content-center">
...@@ -4458,7 +4422,7 @@ export default class TaxPlanning extends Component { ...@@ -4458,7 +4422,7 @@ export default class TaxPlanning extends Component {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 1) handleChange(event.target.value, tableMeta, 1)
console.log(dataTable2) console.log(dataTable2)
// console.log(event.target.value)
}} }}
/> />
} }
...@@ -4731,7 +4695,7 @@ export default class TaxPlanning extends Component { ...@@ -4731,7 +4695,7 @@ export default class TaxPlanning extends Component {
), ),
setCellProps: () => ({ style2 }), setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
// console.log(value)
return ( return (
<div> <div>
<div className="grid grid-3x content-center"> <div className="grid grid-3x content-center">
...@@ -4885,7 +4849,7 @@ export default class TaxPlanning extends Component { ...@@ -4885,7 +4849,7 @@ export default class TaxPlanning extends Component {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 1) handleChange(event.target.value, tableMeta, 1)
console.log(dataTable2) console.log(dataTable2)
// console.log(event.target.value)
}} }}
/> />
} }
...@@ -5158,7 +5122,7 @@ export default class TaxPlanning extends Component { ...@@ -5158,7 +5122,7 @@ export default class TaxPlanning extends Component {
), ),
setCellProps: () => ({ style2 }), setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
// console.log(value)
return ( return (
<div> <div>
<div className="grid grid-3x content-center"> <div className="grid grid-3x content-center">
...@@ -5312,7 +5276,7 @@ export default class TaxPlanning extends Component { ...@@ -5312,7 +5276,7 @@ export default class TaxPlanning extends Component {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 1) handleChange(event.target.value, tableMeta, 1)
console.log(dataTable2) console.log(dataTable2)
// console.log(event.target.value)
}} }}
/> />
} }
...@@ -5585,7 +5549,7 @@ export default class TaxPlanning extends Component { ...@@ -5585,7 +5549,7 @@ export default class TaxPlanning extends Component {
), ),
setCellProps: () => ({ style2 }), setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
// console.log(value)
return ( return (
<div> <div>
<div className="grid grid-3x content-center"> <div className="grid grid-3x content-center">
...@@ -5739,7 +5703,7 @@ export default class TaxPlanning extends Component { ...@@ -5739,7 +5703,7 @@ export default class TaxPlanning extends Component {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 1) handleChange(event.target.value, tableMeta, 1)
console.log(dataTable2) console.log(dataTable2)
// console.log(event.target.value)
}} }}
/> />
} }
...@@ -6012,7 +5976,7 @@ export default class TaxPlanning extends Component { ...@@ -6012,7 +5976,7 @@ export default class TaxPlanning extends Component {
), ),
setCellProps: () => ({ style2 }), setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
// console.log(value)
return ( return (
<div> <div>
<div className="grid grid-3x content-center"> <div className="grid grid-3x content-center">
...@@ -6166,7 +6130,7 @@ export default class TaxPlanning extends Component { ...@@ -6166,7 +6130,7 @@ export default class TaxPlanning extends Component {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 1) handleChange(event.target.value, tableMeta, 1)
console.log(dataTable2) console.log(dataTable2)
// console.log(event.target.value)
}} }}
/> />
} }
...@@ -6464,10 +6428,10 @@ export default class TaxPlanning extends Component { ...@@ -6464,10 +6428,10 @@ export default class TaxPlanning extends Component {
/> />
</span> </span>
: :
tableMeta.rowData[1] === 4 ? tableMeta.rowData[3] === 4 ?
null null
: :
tableMeta.rowData[1] === 6 ? tableMeta.rowData[3] === 6 ?
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
...@@ -6477,7 +6441,7 @@ export default class TaxPlanning extends Component { ...@@ -6477,7 +6441,7 @@ export default class TaxPlanning extends Component {
value={Number(handleTotal(tableMeta, 6)).toFixed(1)} value={Number(handleTotal(tableMeta, 6)).toFixed(1)}
/> />
: :
tableMeta.rowData[1] === 5 ? tableMeta.rowData[3] === 5 ?
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
...@@ -6487,7 +6451,17 @@ export default class TaxPlanning extends Component { ...@@ -6487,7 +6451,17 @@ export default class TaxPlanning extends Component {
value={Number(handleTotal(tableMeta, 5)).toFixed(1)} value={Number(handleTotal(tableMeta, 5)).toFixed(1)}
/> />
: :
tableMeta.rowData[1] === 1 ? tableMeta.rowData[3] === 1 ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleTotal(tableMeta, 1)).toFixed(1)}
/>
:
tableMeta.rowData[3] === 7 ?
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
...@@ -6517,20 +6491,20 @@ export default class TaxPlanning extends Component { ...@@ -6517,20 +6491,20 @@ export default class TaxPlanning extends Component {
<div style={{ borderBottom: "1px #fff solid", textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5 }}>{columnMeta.name}</div> <div style={{ borderBottom: "1px #fff solid", textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5 }}>{columnMeta.name}</div>
<div className="grid grid-3x" style={{ ...style2, backgroundColor: '#37b5e6', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}> <div className="grid grid-3x" style={{ ...style2, backgroundColor: '#37b5e6', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}> <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
<span>{"Trial Balance (Commercial) MTD"}</span> <span>{"Trial Balance (Commercial) YTD"}</span>
</div> </div>
<div className="column-2" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}> <div className="column-2" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
<span>{"Fiscal Correction Positive /(Negative)"}</span> <span>{"Fiscal Correction Positive /(Negative)"}</span>
</div> </div>
<div className="column-3" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}> <div className="column-3" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
<span>{"Trial Balance (Fiscal) MTD"}</span> <span>{"Trial Balance (Fiscal) YTD"}</span>
</div> </div>
</div> </div>
</th> </th>
), ),
setCellProps: () => ({ style2 }), setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
// console.log(value)
return ( return (
<div> <div>
<div className="grid grid-3x content-center"> <div className="grid grid-3x content-center">
...@@ -6552,7 +6526,7 @@ export default class TaxPlanning extends Component { ...@@ -6552,7 +6526,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 0) handleChange(event.target.value, tableMeta, 0)
console.log(event.target.value)
}} }}
/> />
} }
...@@ -6685,8 +6659,8 @@ export default class TaxPlanning extends Component { ...@@ -6685,8 +6659,8 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 1) handleChange(event.target.value, tableMeta, 1)
console.log(dataTable2) // console.log(dataTable2)
// console.log(event.target.value)
}} }}
/> />
} }
...@@ -6818,7 +6792,7 @@ export default class TaxPlanning extends Component { ...@@ -6818,7 +6792,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2) handleChange(event.target.value, tableMeta, 2)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -6948,20 +6922,20 @@ export default class TaxPlanning extends Component { ...@@ -6948,20 +6922,20 @@ export default class TaxPlanning extends Component {
<div style={{ borderBottom: "1px #fff solid", textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5 }}>{columnMeta.name}</div> <div style={{ borderBottom: "1px #fff solid", textAlign: 'center', fontSize: 12, fontWeight: 'bold', padding: 5 }}>{columnMeta.name}</div>
<div className="grid grid-3x" style={{ ...style2, backgroundColor: '#37b5e6', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}> <div className="grid grid-3x" style={{ ...style2, backgroundColor: '#37b5e6', color: '#fff', fontSize: 12, fontWeight: 'bold', position: "sticky" }}>
<div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}> <div className="column-1" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
<span>{"Trial Balance (Commercial) MTD"}</span> <span>{"Trial Balance (Commercial) YTD"}</span>
</div> </div>
<div className="column-2" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}> <div className="column-2" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
<span>{"Fiscal Correction Positive /(Negative)"}</span> <span>{"Fiscal Correction Positive /(Negative)"}</span>
</div> </div>
<div className="column-3" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}> <div className="column-3" style={{ placeSelf: 'center', textAlign: 'center', padding: 5 }}>
<span>{"Trial Balance (Fiscal) MTD"}</span> <span>{"Trial Balance (Fiscal) YTD"}</span>
</div> </div>
</div> </div>
</th> </th>
), ),
setCellProps: () => ({ style2 }), setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
// console.log(value)
return ( return (
<div> <div>
<div className="grid grid-3x content-center"> <div className="grid grid-3x content-center">
...@@ -6983,7 +6957,7 @@ export default class TaxPlanning extends Component { ...@@ -6983,7 +6957,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 0) handleChange(event.target.value, tableMeta, 0)
console.log(event.target.value) // console.log(event.target.value)
}} }}
/> />
} }
...@@ -7115,8 +7089,8 @@ export default class TaxPlanning extends Component { ...@@ -7115,8 +7089,8 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 1) handleChange(event.target.value, tableMeta, 1)
console.log(dataTable2) // console.log(dataTable2)
// console.log(event.target.value)
}} }}
/> />
} }
...@@ -7248,7 +7222,7 @@ export default class TaxPlanning extends Component { ...@@ -7248,7 +7222,7 @@ export default class TaxPlanning extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2) handleChange(event.target.value, tableMeta, 2)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
......
...@@ -41,7 +41,6 @@ export default class getAllDocument extends Component { ...@@ -41,7 +41,6 @@ export default class getAllDocument extends Component {
const { refresh, id } = this.props; const { refresh, id } = this.props;
if (props.refresh !== refresh) { if (props.refresh !== refresh) {
this.getData() this.getData()
console.log(this.props.data)
} }
} }
...@@ -51,14 +50,13 @@ export default class getAllDocument extends Component { ...@@ -51,14 +50,13 @@ export default class getAllDocument extends Component {
} }
this.setState({ loading: true }) this.setState({ loading: true })
api.create().getAllDocument(payload).then(response => { api.create().getAllDocument(payload).then(response => {
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status == 'success') { if (response.data.status == 'success') {
let dataTable = [] let dataTable = []
response.data.data.map((item, index) => { response.data.data.map((item, index) => {
let indexId = this.props.userCompActive.findIndex((val) => val == item.company_id) let indexId = this.props.userCompActive.findIndex((val) => val == item.company_id)
console.log(indexId)
if (String(this.props.name).includes('Manual')){ if (String(this.props.name).includes('Manual')){
dataTable.push( [ dataTable.push( [
index, index,
...@@ -89,7 +87,7 @@ export default class getAllDocument extends Component { ...@@ -89,7 +87,7 @@ export default class getAllDocument extends Component {
} }
} }
}) })
console.log(dataTable) // console.log(dataTable)
this.setState({ dataTable, loading: false }) this.setState({ dataTable, loading: false })
let docPath = response.data.data.map((item) => { let docPath = response.data.data.map((item) => {
return [ return [
...@@ -124,7 +122,6 @@ export default class getAllDocument extends Component { ...@@ -124,7 +122,6 @@ export default class getAllDocument extends Component {
openPopUp = async (index, val, type) =>{ openPopUp = async (index, val, type) =>{
if (type === 'download') { if (type === 'download') {
console.log(this.state.docPath[val])
let res = await fetch( let res = await fetch(
"https://tia.eksad.com/tia-reporting-dev/public/document/download_document?documentName="+this.state.docPath[val]+"&&fileType="+index[5] "https://tia.eksad.com/tia-reporting-dev/public/document/download_document?documentName="+this.state.docPath[val]+"&&fileType="+index[5]
) )
...@@ -157,7 +154,7 @@ export default class getAllDocument extends Component { ...@@ -157,7 +154,7 @@ export default class getAllDocument extends Component {
deleteDoc = (payload) => { deleteDoc = (payload) => {
this.setState({ popupDel: false, loading: true }) this.setState({ popupDel: false, loading: true })
api.create().deleteDocument(payload).then(response => { api.create().deleteDocument(payload).then(response => {
console.log(response.data) // console.log(response.data)
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status == 'success') { if (response.data.status == 'success') {
...@@ -185,7 +182,7 @@ export default class getAllDocument extends Component { ...@@ -185,7 +182,7 @@ export default class getAllDocument extends Component {
updateDocument(payload) { updateDocument(payload) {
this.setState({ visibleEdit: false, loading: true }) this.setState({ visibleEdit: false, loading: true })
api.create().updateDocument(payload).then(response => { api.create().updateDocument(payload).then(response => {
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status === "success") { if (response.data.status === "success") {
...@@ -231,7 +228,6 @@ export default class getAllDocument extends Component { ...@@ -231,7 +228,6 @@ export default class getAllDocument extends Component {
borderColor: 'transparent', borderColor: 'transparent',
marginRight: 15 marginRight: 15
}} }}
// onClick={() => console.log(tableMeta)}
onClick={() => this.openPopUp(tableMeta.rowData, val, 'download')} onClick={() => this.openPopUp(tableMeta.rowData, val, 'download')}
> >
<img src={Images.download} /> <img src={Images.download} />
...@@ -247,7 +243,6 @@ export default class getAllDocument extends Component { ...@@ -247,7 +243,6 @@ export default class getAllDocument extends Component {
borderColor: 'transparent', borderColor: 'transparent',
marginRight: 15 marginRight: 15
}} }}
// onClick={() => console.log(tableMeta)}
onClick={() => this.openPopUp(tableMeta.rowData, val, 'edit')} onClick={() => this.openPopUp(tableMeta.rowData, val, 'edit')}
> >
<img src={Images.editCopy} /> <img src={Images.editCopy} />
......
...@@ -66,7 +66,7 @@ export default class CreateManagementDoc extends Component { ...@@ -66,7 +66,7 @@ export default class CreateManagementDoc extends Component {
type: 'MAX_FILE_SIZE' type: 'MAX_FILE_SIZE'
} }
api.create().getAllSettingByType(body).then(response => { api.create().getAllSettingByType(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") {
if (response.data.data.length == 0) { if (response.data.data.length == 0) {
...@@ -115,7 +115,7 @@ export default class CreateManagementDoc extends Component { ...@@ -115,7 +115,7 @@ export default class CreateManagementDoc extends Component {
}) })
} }
} else { } else {
alert(response.problem) this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
} }
}) })
} }
...@@ -148,7 +148,7 @@ export default class CreateManagementDoc extends Component { ...@@ -148,7 +148,7 @@ export default class CreateManagementDoc extends Component {
}) })
} }
}) })
console.log(typeData) // console.log(typeData)
let typeProps = { let typeProps = {
options: typeData.sort((a, b) => a.document_category_id - b.document_category_id), options: typeData.sort((a, b) => a.document_category_id - b.document_category_id),
getOptionLabel: (option) => option.document_category_name, getOptionLabel: (option) => option.document_category_name,
...@@ -165,7 +165,7 @@ export default class CreateManagementDoc extends Component { ...@@ -165,7 +165,7 @@ export default class CreateManagementDoc extends Component {
}) })
} }
} else { } else {
alert(response.problem) this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
} }
}) })
} }
...@@ -173,7 +173,6 @@ export default class CreateManagementDoc extends Component { ...@@ -173,7 +173,6 @@ export default class CreateManagementDoc extends Component {
getPeriode() { getPeriode() {
api.create().getPeriodeTransaction().then(response => { api.create().getPeriodeTransaction().then(response => {
let dateNow = new Date let dateNow = new Date
// console.log(dateNow)
let year = format(dateNow, 'yyyy') let year = format(dateNow, 'yyyy')
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
...@@ -236,14 +235,13 @@ export default class CreateManagementDoc extends Component { ...@@ -236,14 +235,13 @@ export default class CreateManagementDoc extends Component {
let fileObj = event let fileObj = event
let length = event.name.split(".").length let length = event.name.split(".").length
let fileType = event.name.split(".")[length - 1] let fileType = event.name.split(".")[length - 1]
// console.log(fileType)
if (fileType === 'zip' || 'rar') { if (fileType === 'zip' || 'rar') {
this.setState({ file: event, fileType: String(fileType) }) this.setState({ file: event, fileType: String(fileType) })
} else { } else {
ExcelRenderer(fileObj, (err, resp) => { ExcelRenderer(fileObj, (err, resp) => {
console.log(fileType) // console.log(fileType)
if (err) { if (err) {
console.log(err); // console.log(err);
} }
else { else {
this.setState({ file: event, fileType: String(fileType) }) this.setState({ file: event, fileType: String(fileType) })
......
...@@ -72,7 +72,7 @@ export default class DocumentManagement extends Component { ...@@ -72,7 +72,7 @@ export default class DocumentManagement extends Component {
getDataDocument(id, name) { getDataDocument(id, name) {
api.create().getDocumentCategory().then(response => { api.create().getDocumentCategory().then(response => {
console.log(response); // console.log(response);
if (response) { if (response) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
...@@ -82,7 +82,6 @@ export default class DocumentManagement extends Component { ...@@ -82,7 +82,6 @@ export default class DocumentManagement extends Component {
loadTable: true, loadTable: true,
refresh: id === undefined ? '' : 'create' refresh: id === undefined ? '' : 'create'
}) })
// console.log(this.state.listData)
} else { } else {
} }
...@@ -95,7 +94,7 @@ export default class DocumentManagement extends Component { ...@@ -95,7 +94,7 @@ export default class DocumentManagement extends Component {
createDocument(payload, settingID, menuName) { createDocument(payload, settingID, menuName) {
this.setState({ loading: true }) this.setState({ loading: true })
api.create().uploadDocument(payload).then(response => { api.create().uploadDocument(payload).then(response => {
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.message === "The Document Already Exists in The System, Do You Want to Overwrite It?") { if (response.data.message === "The Document Already Exists in The System, Do You Want to Overwrite It?") {
...@@ -131,7 +130,7 @@ export default class DocumentManagement extends Component { ...@@ -131,7 +130,7 @@ export default class DocumentManagement extends Component {
formData.append("updated", 1) formData.append("updated", 1)
this.setState({ loading: true }) this.setState({ loading: true })
api.create().updateDocument(formData).then(response => { api.create().updateDocument(formData).then(response => {
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status === "success") { if (response.data.status === "success") {
...@@ -157,7 +156,7 @@ export default class DocumentManagement extends Component { ...@@ -157,7 +156,7 @@ export default class DocumentManagement extends Component {
} }
getID(id) { getID(id) {
console.log(id); // console.log(id);
this.setState({ id }) this.setState({ id })
} }
...@@ -208,7 +207,7 @@ export default class DocumentManagement extends Component { ...@@ -208,7 +207,7 @@ export default class DocumentManagement extends Component {
this.setState({ btnadd: false}) this.setState({ btnadd: false})
} }
this.setState({ userCompActive, visibleTrue: true }) this.setState({ userCompActive, visibleTrue: true })
console.log(userCompActive) // console.log(userCompActive)
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', visibleTrue: true }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', visibleTrue: true }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In")) {
......
...@@ -68,7 +68,7 @@ export default class EditManagementDoc extends Component { ...@@ -68,7 +68,7 @@ export default class EditManagementDoc extends Component {
type: 'MAX_FILE_SIZE' type: 'MAX_FILE_SIZE'
} }
api.create().getAllSettingByType(body).then(response => { api.create().getAllSettingByType(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") {
this.setState({ this.setState({
...@@ -81,7 +81,7 @@ export default class EditManagementDoc extends Component { ...@@ -81,7 +81,7 @@ export default class EditManagementDoc extends Component {
getDetailDoc() { getDetailDoc() {
api.create().getDetailDocument(this.props.idoc).then(response => { api.create().getDetailDocument(this.props.idoc).then(response => {
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status === "success") { if (response.data.status === "success") {
...@@ -159,7 +159,7 @@ export default class EditManagementDoc extends Component { ...@@ -159,7 +159,7 @@ export default class EditManagementDoc extends Component {
}) })
} }
} else { } else {
alert(response.problem) this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
} }
}) })
} }
...@@ -172,7 +172,7 @@ export default class EditManagementDoc extends Component { ...@@ -172,7 +172,7 @@ export default class EditManagementDoc extends Component {
// } // }
api.create().getDocumentCategory().then(response => { api.create().getDocumentCategory().then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status == 'success') { if (response.data.status == 'success') {
let data = response.data.data let data = response.data.data
...@@ -199,7 +199,7 @@ export default class EditManagementDoc extends Component { ...@@ -199,7 +199,7 @@ export default class EditManagementDoc extends Component {
}) })
} }
} else { } else {
alert(response.problem) this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
} }
}) })
} }
...@@ -275,7 +275,7 @@ export default class EditManagementDoc extends Component { ...@@ -275,7 +275,7 @@ export default class EditManagementDoc extends Component {
ExcelRenderer(fileObj, (err, resp) => { ExcelRenderer(fileObj, (err, resp) => {
// console.log(fileType) // console.log(fileType)
if (err) { if (err) {
console.log(err); // console.log(err);
} }
else { else {
this.setState({ file: event, fileType: String(fileType) }) this.setState({ file: event, fileType: String(fileType) })
......
...@@ -16,8 +16,8 @@ export default class PopUpDelete extends Component { ...@@ -16,8 +16,8 @@ export default class PopUpDelete extends Component {
componentDidMount() { componentDidMount() {
if (this.props.type === 'delete') { if (this.props.type === 'delete') {
console.log(this.props.idoc) // console.log(this.props.idoc)
console.log(this.props.data) // console.log(this.props.data)
} }
} }
......
...@@ -61,7 +61,7 @@ export default class TaxPlanningOLPA extends Component { ...@@ -61,7 +61,7 @@ export default class TaxPlanningOLPA extends Component {
componentDidMount() { componentDidMount() {
this.getItemHierarki() this.getItemHierarki()
this.lastUpdate() this.lastUpdate()
console.log(this.props); // console.log(this.props);
} }
lastUpdate(){ lastUpdate(){
...@@ -93,7 +93,7 @@ export default class TaxPlanningOLPA extends Component { ...@@ -93,7 +93,7 @@ export default class TaxPlanningOLPA extends Component {
"company_id": this.props.company.company_id "company_id": this.props.company.company_id
} }
api.create().getDetailReportOLPA(payload).then(response => { api.create().getDetailReportOLPA(payload).then(response => {
console.log(response); // console.log(response);
let dataTable = [] let dataTable = []
if (response.data) { if (response.data) {
let res = response.data.data let res = response.data.data
...@@ -310,12 +310,12 @@ export default class TaxPlanningOLPA extends Component { ...@@ -310,12 +310,12 @@ export default class TaxPlanningOLPA extends Component {
ExcelRenderer(fileObj, (err, resp) => { ExcelRenderer(fileObj, (err, resp) => {
// console.log(resp) // console.log(resp)
if (err) { if (err) {
console.log(err); // console.log(err);
} }
else { else {
let isi = resp.rows.slice(4) let isi = resp.rows.slice(4)
console.log(resp.rows[2]); // console.log(resp.rows[2]);
console.log(resp.rows); // console.log(resp.rows);
let payload = [] let payload = []
let reg = /^[-+]?(?:[0-9]+,)*[0-9]+(?:\.[0-9]+)?$/; let reg = /^[-+]?(?:[0-9]+,)*[0-9]+(?:\.[0-9]+)?$/;
isi.map((i, index) => { isi.map((i, index) => {
...@@ -404,15 +404,15 @@ export default class TaxPlanningOLPA extends Component { ...@@ -404,15 +404,15 @@ export default class TaxPlanningOLPA extends Component {
tax_planning: payload tax_planning: payload
} }
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] })
console.log(this.state.judulColumn) // console.log(this.state.judulColumn)
} }
}); });
} }
checkUpload() { checkUpload() {
api.create().checkUploadOLPA(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) {
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 })
...@@ -493,11 +493,11 @@ export default class TaxPlanningOLPA extends Component { ...@@ -493,11 +493,11 @@ export default class TaxPlanningOLPA extends Component {
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true }, () => { this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true }, () => {
this.state.dataTable.map(item => { this.state.dataTable.map(item => {
if (item[25].length > 0) { if (item[25].length > 0) {
console.log('masuk') // console.log('masuk')
this.setState({ buttonError: true, errorPreview: true, editable: true }) this.setState({ buttonError: true, errorPreview: true, editable: true })
} }
}) })
console.log(this.state.dataTable); // console.log(this.state.dataTable);
}) })
} }
} }
...@@ -592,26 +592,25 @@ export default class TaxPlanningOLPA extends Component { ...@@ -592,26 +592,25 @@ export default class TaxPlanningOLPA extends Component {
} }
// console.log(data); // console.log(data);
api.create('UPLOAD').uploadOLPA(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") {
this.props.onClickClose() this.props.onClickClose()
this.props.getReport() this.props.getReport()
} else { } else {
alert(response.data.status) this.setState({ alert: true, messageAlert: response.data.status, tipeAlert: 'error', loading: false })
} }
} else { } else {
this.setState({ loading: false }) this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
alert(response.problem)
} }
}) })
} }
handleValidate() { handleValidate() {
let data = [] let data = []
console.log(this.state.dataTable) // console.log(this.state.dataTable)
this.state.dataTable.map(i => { this.state.dataTable.map(i => {
console.log(i[0]) // console.log(i[0])
data.push({ data.push({
item_report_id: i[4], item_report_id: i[4],
january: { january: {
...@@ -687,7 +686,7 @@ export default class TaxPlanningOLPA extends Component { ...@@ -687,7 +686,7 @@ export default class TaxPlanningOLPA extends Component {
} }
}) })
}) })
console.log(JSON.stringify(data)) // console.log(JSON.stringify(data))
let payload = { let payload = {
"outlook_pa_id": this.props.outlook_pa_id, "outlook_pa_id": this.props.outlook_pa_id,
"company_id": this.props.company.company_id, "company_id": this.props.company.company_id,
...@@ -697,7 +696,7 @@ export default class TaxPlanningOLPA extends Component { ...@@ -697,7 +696,7 @@ export default class TaxPlanningOLPA extends Component {
"status": "submitted" "status": "submitted"
} }
api.create().validateSubmitReportOLPA(payload).then((response) => { api.create().validateSubmitReportOLPA(payload).then((response) => {
console.log(response) // console.log(response)
if (response.data.data.result) { if (response.data.data.result) {
this.setState({ loading: false, buttonError: false, editable: false }) this.setState({ loading: false, buttonError: false, editable: false })
} else { } else {
...@@ -711,7 +710,7 @@ export default class TaxPlanningOLPA extends Component { ...@@ -711,7 +710,7 @@ export default class TaxPlanningOLPA extends Component {
`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}` `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)
if (res.size > 0) { if (res.size > 0) {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
let a = document.createElement('a'); let a = document.createElement('a');
...@@ -724,7 +723,7 @@ export default class TaxPlanningOLPA extends Component { ...@@ -724,7 +723,7 @@ export default class TaxPlanningOLPA extends Component {
async downloadAllData() { async downloadAllData() {
let url = `https://tia.eksad.com/tia-reporting-dev/public/transaction/outlook_pa/export_outlook_pa?outlook_pa_id=${this.props.outlook_pa_id}&&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?outlook_pa_id=${this.props.outlook_pa_id}&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}`
let sub_null = `https://tia.eksad.com/tia-reporting-dev/public/transaction/outlook_pa/export_outlook_pa?outlook_pa_id=&&report_id=${this.props.report_id}&&company_id=${this.props.company.company_id}&&year=${this.props.periode}&&revision=${this.props.revision}` let sub_null = `https://tia.eksad.com/tia-reporting-dev/public/transaction/outlook_pa/export_outlook_pa?outlook_pa_id=&&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(
this.props.outlook_pa_id == null ? sub_null : url this.props.outlook_pa_id == null ? sub_null : url
) )
...@@ -757,7 +756,7 @@ export default class TaxPlanningOLPA extends Component { ...@@ -757,7 +756,7 @@ export default class TaxPlanningOLPA extends Component {
a = dataTable2[indexParent][tableMeta.columnIndex].fcp = jagain === undefined ? (0 + Number(val)) : (Number(jagain) + Number(val)) a = dataTable2[indexParent][tableMeta.columnIndex].fcp = jagain === undefined ? (0 + Number(val)) : (Number(jagain) + Number(val))
} }
} else { } else {
console.log(tableMeta) // console.log(tableMeta)
if (indexChilds == 0){ if (indexChilds == 0){
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc = Number(val) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc = Number(val)
} }
...@@ -783,7 +782,7 @@ export default class TaxPlanningOLPA extends Component { ...@@ -783,7 +782,7 @@ export default class TaxPlanningOLPA extends Component {
} }
const handleValue = (data) => { const handleValue = (data) => {
let total = 0 let total = 0
// console.log(dataTable2) // // console.log(dataTable2)
dataTable2.map((item, index) => { dataTable2.map((item, index) => {
if (data.rowData[4] === item[5]) { if (data.rowData[4] === item[5]) {
total = item[data.columnIndex] === undefined ? (Number(total) + 0) : (Number(total) + Number(item[data.columnIndex].fcp)) total = item[data.columnIndex] === undefined ? (Number(total) + 0) : (Number(total) + Number(item[data.columnIndex].fcp))
...@@ -1019,7 +1018,7 @@ export default class TaxPlanningOLPA extends Component { ...@@ -1019,7 +1018,7 @@ export default class TaxPlanningOLPA extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2) handleChange(event.target.value, tableMeta, 2)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1119,7 +1118,7 @@ export default class TaxPlanningOLPA extends Component { ...@@ -1119,7 +1118,7 @@ export default class TaxPlanningOLPA extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2) handleChange(event.target.value, tableMeta, 2)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1222,7 +1221,7 @@ export default class TaxPlanningOLPA extends Component { ...@@ -1222,7 +1221,7 @@ export default class TaxPlanningOLPA extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2) handleChange(event.target.value, tableMeta, 2)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1324,7 +1323,7 @@ export default class TaxPlanningOLPA extends Component { ...@@ -1324,7 +1323,7 @@ export default class TaxPlanningOLPA extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2) handleChange(event.target.value, tableMeta, 2)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1426,7 +1425,7 @@ export default class TaxPlanningOLPA extends Component { ...@@ -1426,7 +1425,7 @@ export default class TaxPlanningOLPA extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2) handleChange(event.target.value, tableMeta, 2)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1528,7 +1527,7 @@ export default class TaxPlanningOLPA extends Component { ...@@ -1528,7 +1527,7 @@ export default class TaxPlanningOLPA extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2) handleChange(event.target.value, tableMeta, 2)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1630,7 +1629,7 @@ export default class TaxPlanningOLPA extends Component { ...@@ -1630,7 +1629,7 @@ export default class TaxPlanningOLPA extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2) handleChange(event.target.value, tableMeta, 2)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1732,7 +1731,7 @@ export default class TaxPlanningOLPA extends Component { ...@@ -1732,7 +1731,7 @@ export default class TaxPlanningOLPA extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2) handleChange(event.target.value, tableMeta, 2)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1834,7 +1833,7 @@ export default class TaxPlanningOLPA extends Component { ...@@ -1834,7 +1833,7 @@ export default class TaxPlanningOLPA extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2) handleChange(event.target.value, tableMeta, 2)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -1936,7 +1935,7 @@ export default class TaxPlanningOLPA extends Component { ...@@ -1936,7 +1935,7 @@ export default class TaxPlanningOLPA extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2) handleChange(event.target.value, tableMeta, 2)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -2125,7 +2124,7 @@ export default class TaxPlanningOLPA extends Component { ...@@ -2125,7 +2124,7 @@ export default class TaxPlanningOLPA extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 1) handleChange(event.target.value, tableMeta, 1)
console.log(dataTable2) // console.log(dataTable2)
// console.log(event.target.value) // console.log(event.target.value)
}} }}
/> />
...@@ -2204,7 +2203,7 @@ export default class TaxPlanningOLPA extends Component { ...@@ -2204,7 +2203,7 @@ export default class TaxPlanningOLPA extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2) handleChange(event.target.value, tableMeta, 2)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
...@@ -2315,7 +2314,7 @@ export default class TaxPlanningOLPA extends Component { ...@@ -2315,7 +2314,7 @@ export default class TaxPlanningOLPA extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 0) handleChange(event.target.value, tableMeta, 0)
console.log(event.target.value) // console.log(event.target.value)
}} }}
/> />
} }
...@@ -2393,7 +2392,7 @@ export default class TaxPlanningOLPA extends Component { ...@@ -2393,7 +2392,7 @@ export default class TaxPlanningOLPA extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 1) handleChange(event.target.value, tableMeta, 1)
console.log(dataTable2) // console.log(dataTable2)
// console.log(event.target.value) // console.log(event.target.value)
}} }}
/> />
...@@ -2472,7 +2471,7 @@ export default class TaxPlanningOLPA extends Component { ...@@ -2472,7 +2471,7 @@ export default class TaxPlanningOLPA extends Component {
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2) handleChange(event.target.value, tableMeta, 2)
console.log(dataTable2) // console.log(dataTable2)
}} }}
/> />
} }
......
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