Commit 7501ca6e authored by Rifka Kurnia Irfiana's avatar Rifka Kurnia Irfiana

upload taxplan

parent 89e0a0bc
...@@ -46,8 +46,7 @@ export default class TaxPlanning extends Component { ...@@ -46,8 +46,7 @@ export default class TaxPlanning extends Component {
disabledSave: true, disabledSave: true,
editable: false, editable: false,
buttonError: false, buttonError: false,
judulColumn: null, judulColumn: null
reportName: ''
} }
this.handleValue = this.handleValue.bind(this) this.handleValue = this.handleValue.bind(this)
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
...@@ -148,7 +147,7 @@ export default class TaxPlanning extends Component { ...@@ -148,7 +147,7 @@ export default class TaxPlanning extends Component {
} }
} }
}) })
this.setState({ dataTable, loading: false, buttonError: true, reportName: res[0].report_name }) this.setState({ dataTable, loading: false, buttonError: true })
} else { } else {
this.setState({ dataTable, loading: false, buttonError: true }) this.setState({ dataTable, loading: false, buttonError: true })
} }
...@@ -295,7 +294,6 @@ export default class TaxPlanning extends Component { ...@@ -295,7 +294,6 @@ export default class TaxPlanning extends Component {
if (i.length > 0) { if (i.length > 0) {
payload.push({ payload.push({
item_report_id: i[0] === undefined ? "" : String(i[0]).trim(), item_report_id: i[0] === undefined ? "" : String(i[0]).trim(),
// 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(),
...@@ -403,21 +401,63 @@ export default class TaxPlanning extends Component { ...@@ -403,21 +401,63 @@ export default class TaxPlanning extends Component {
// {tbc: item.formula.tbc, fcp: item.formula.fcp, tbf: item.formula.tbf}, // {tbc: item.formula.tbc, fcp: item.formula.fcp, tbf: item.formula.tbf},
item.level, item.level,
item.item_report, item.item_report,
{tbc : item.january.tbc, fcp: item.january.fcp, tbf: item.january.tbf}, {tbc : Number(item.type_report_id.tbc) === 3 && item.january.tbc === "" ? "0" : item.january.tbc ,
{tbc : item.february.tbc, fcp: item.february.fcp, tbf: item.february.tbf}, fcp: Number(item.type_report_id.fcp) === 3 && item.january.fcp === "" ? "0" : item.january.fcp,
{tbc : item.march.tbc, fcp: item.march.fcp, tbf: item.march.tbf}, tbf: Number(item.type_report_id.tbf) === 3 && item.january.tbf === "" ? "0" : item.january.tbf
{tbc : item.april.tbc, fcp: item.april.fcp, tbf: item.april.tbf}, },
{tbc : item.may.tbc, fcp: item.may.fcp, tbf: item.may.tbf}, { tbc : Number(item.type_report_id.tbc) === 3 && item.february.tbc === "" ? "0" : item.february.tbc,
{tbc : item.june.tbc, fcp: item.june.fcp, tbf: item.june.tbf}, fcp: Number(item.type_report_id.fcp) === 3 && item.january.fcp === "" ? "0" : item.january.fcp,
{tbc : item.july.tbc, fcp: item.july.fcp, tbf: item.july.tbf}, tbf: Number(item.type_report_id.tbf) === 3 && item.february.tbf === "" ? "0" : item.february.tbf
{tbc : item.august.tbc, fcp: item.august.fcp, tbf: item.august.tbf}, },
{tbc : item.september.tbc, fcp: item.september.fcp, tbf: item.september.tbf}, { tbc: Number(item.type_report_id.tbc) === 3 && item.march.tbc === "" ? "0" : item.march.tbc,
{tbc : item.october.tbc, fcp: item.october.fcp, tbf: item.october.tbf}, fcp: Number(item.type_report_id.fcp) === 3 && item.march.fcp === "" ? "0" : item.march.fcp,
{tbc : item.november.tbc, fcp: item.november.fcp, tbf: item.november.tbf}, tbf: Number(item.type_report_id.tbf) === 3 && item.march.tbf === "" ? "0" : item.march.tbf
{tbc : item.december.tbc, fcp: item.december.fcp, tbf: item.december.tbf}, },
{ tbc: Number(item.type_report_id.tbc) === 3 && item.april.tbc === "" ? "0" : item.april.tbc,
fcp: Number(item.type_report_id.fcp) === 3 && item.april.fcp === "" ? "0" : item.april.fcp,
tbf: Number(item.type_report_id.tbf) === 3 && item.april.tbf === "" ? "0" : item.april.tbf
},
{ tbc: Number(item.type_report_id.tbc) === 3 && item.may.tbc === "" ? "0" : item.may.tbc,
fcp: Number(item.type_report_id.fcp) === 3 && item.may.fcp === "" ? "0" : item.may.fcp,
tbf: Number(item.type_report_id.tbf) === 3 && item.may.tbf === "" ? "0" : item.may.tbf
},
{ tbc: Number(item.type_report_id.tbc) === 3 && item.june.tbc === "" ? "0" : item.june.tbc,
fcp: Number(item.type_report_id.fcp) === 3 && item.june.fcp === "" ? "0" : item.june.fcp,
tbf: Number(item.type_report_id.tbf) === 3 && item.june.tbf === "" ? "0" : item.june.tbf
},
{ tbc: Number(item.type_report_id.tbc) === 3 && item.july.tbc === "" ? "0" : item.july.tbc,
fcp: Number(item.type_report_id.fcp) === 3 && item.july.fcp === "" ? "0" : item.july.fcp,
tbf: Number(item.type_report_id.tbf) === 3 && item.july.tbf === "" ? "0" : item.july.tbf
},
{ tbc: Number(item.type_report_id.tbc) === 3 && item.august.tbc === "" ? "0" : item.august.tbc,
fcp: Number(item.type_report_id.fcp) === 3 && item.august.fcp === "" ? "0" : item.august.fcp,
tbf: Number(item.type_report_id.tbf) === 3 && item.august.tbf === "" ? "0" : item.august.tbf
},
{ tbc: Number(item.type_report_id.tbc) === 3 && item.september.tbc === "" ? "0" : item.september.tbc,
fcp: Number(item.type_report_id.fcp) === 3 && item.september.fcp === "" ? "0" : item.september.fcp,
tbf: Number(item.type_report_id.tbf) === 3 && item.september.tbf === "" ? "0" : item.september.tbf
},
{ tbc: Number(item.type_report_id.tbc) === 3 && item.october.tbc === "" ? "0" : item.october.tbc,
fcp: Number(item.type_report_id.fcp) === 3 && item.october.fcp === "" ? "0" : item.october.fcp,
tbf: Number(item.type_report_id.tbf) === 3 && item.october.tbf === "" ? "0" : item.october.tbf
},
{ tbc: Number(item.type_report_id.tbc) === 3 && item.november.tbc === "" ? "0" : item.november.tbc,
fcp: Number(item.type_report_id.fcp) === 3 && item.november.fcp === "" ? "0" : item.november.fcp,
tbf: Number(item.type_report_id.tbf) === 3 && item.november.tbf === "" ? "0" : item.november.tbf
},
{ tbc: Number(item.type_report_id.tbc) === 3 && item.december.tbc === "" ? "0" : item.december.tbc,
fcp: Number(item.type_report_id.fcp) === 3 && item.december.fcp === "" ? "0" : item.december.fcp,
tbf: Number(item.type_report_id.tbf) === 3 && item.december.tbf === "" ? "0" : item.december.tbf
},
item.total_current_year, item.total_current_year,
{tbc : item.total_next_year.tbc, fcp: item.total_next_year.fcp, tbf: item.total_next_year.tbf}, { tbc: Number(item.type_report_id.tbc) === 3 && item.total_next_year.tbc === "" ? "0" : item.total_next_year.tbc,
{tbc : item.total_more_year.tbc, fcp: item.total_more_year.fcp, tbf: item.total_more_year.tbf}, fcp: Number(item.type_report_id.fcp) === 3 && item.total_next_year.fcp === "" ? "0" : item.total_next_year.fcp,
tbf: Number(item.type_report_id.tbf) === 3 && item.total_next_year.tbf === "" ? "0" : item.total_next_year.tbf
},
{ tbc: Number(item.type_report_id.tbc) === 3 && item.total_more_year.tbc === "" ? "0" : item.total_more_year.tbc,
fcp: Number(item.type_report_id.fcp) === 3 && item.total_more_year.fcp === "" ? "0" : item.total_more_year.fcp,
tbf: Number(item.type_report_id.tbf) === 3 && item.total_more_year.tbf === "" ? "0" : item.total_more_year.tbf
},
item.error item.error
] ]
}) })
...@@ -4771,7 +4811,7 @@ export default class TaxPlanning extends Component { ...@@ -4771,7 +4811,7 @@ export default class TaxPlanning extends Component {
<button <button
className="button" className="button"
type="button" type="button"
disabled={this.state.buttonError} // disabled={this.state.buttonError}
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer', cursor: this.state.buttonError === true ? 'default' : 'pointer',
......
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