Commit b5ed8d3c authored by Riri Novita's avatar Riri Novita

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into riri

parents 2560585b b0faafcb
...@@ -255,6 +255,7 @@ const create = (type = "") => { ...@@ -255,6 +255,7 @@ const create = (type = "") => {
const getMonthlyReportID = (body) => api.post('transaction/monthly_report_bs/get_monthly_report_id', body) const getMonthlyReportID = (body) => api.post('transaction/monthly_report_bs/get_monthly_report_id', body)
const getHierarkiMontlyReportBS = (body) => api.post('transaction/monthly_report_bs/get_report_hierarki', body) const getHierarkiMontlyReportBS = (body) => api.post('transaction/monthly_report_bs/get_report_hierarki', body)
const getHierarkiMontlyReportOI = (body) => api.post('transaction/monthly_report_oi/get_report_hierarki', body) const getHierarkiMontlyReportOI = (body) => api.post('transaction/monthly_report_oi/get_report_hierarki', body)
const getHierarkiMontlyReportTP = (body) => api.post('transaction/monthly_report_tp/get_report_hierarki', body)
// MonthlyPL // MonthlyPL
const getHierarkiMontlyReportPL = (body) => api.post('transaction/monthly_report_pl/get_report_hierarki', body) const getHierarkiMontlyReportPL = (body) => api.post('transaction/monthly_report_pl/get_report_hierarki', body)
...@@ -442,6 +443,7 @@ const create = (type = "") => { ...@@ -442,6 +443,7 @@ const create = (type = "") => {
getDashboardUser, getDashboardUser,
getHierarkiMontlyReportBS, getHierarkiMontlyReportBS,
getHierarkiMontlyReportOI, getHierarkiMontlyReportOI,
getHierarkiMontlyReportTP,
getDetailReportCF, getDetailReportCF,
getReportHierarkiPL, getReportHierarkiPL,
getMonthlyReportID, getMonthlyReportID,
......
...@@ -155,7 +155,7 @@ export default class TaxPlanning extends Component { ...@@ -155,7 +155,7 @@ export default class TaxPlanning extends Component {
{ tbc: this.props.status === 'CLOSED' ? Number(item.tax_planning.october.tbc).toFixed(1) : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.october.tbc, formula: item.tax_planning.october_formula } : item.tax_planning.october.tbc, fcp: this.props.status === 'CLOSED' ? Number(item.tax_planning.october.fcp).toFixed(1) : item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.october.fcp, formula: item.tax_planning.october_formula } : item.tax_planning.october.fcp, tbf: this.props.status === 'CLOSED' ? Number(item.tax_planning.october.tbf).toFixed(1) : item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.october.tbf, formula: item.tax_planning.october_formula } : item.tax_planning.october.tbf }, { tbc: this.props.status === 'CLOSED' ? Number(item.tax_planning.october.tbc).toFixed(1) : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.october.tbc, formula: item.tax_planning.october_formula } : item.tax_planning.october.tbc, fcp: this.props.status === 'CLOSED' ? Number(item.tax_planning.october.fcp).toFixed(1) : item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.october.fcp, formula: item.tax_planning.october_formula } : item.tax_planning.october.fcp, tbf: this.props.status === 'CLOSED' ? Number(item.tax_planning.october.tbf).toFixed(1) : item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.october.tbf, formula: item.tax_planning.october_formula } : item.tax_planning.october.tbf },
{ tbc: this.props.status === 'CLOSED' ? Number(item.tax_planning.november.tbc).toFixed(1) : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.november.tbc, formula: item.tax_planning.november_formula } : item.tax_planning.november.tbc, fcp: this.props.status === 'CLOSED' ? Number(item.tax_planning.november.fcp).toFixed(1) : item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.november.fcp, formula: item.tax_planning.november_formula } : item.tax_planning.november.fcp, tbf: this.props.status === 'CLOSED' ? Number(item.tax_planning.november.tbf).toFixed(1) : item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.november.tbf, formula: item.tax_planning.november_formula } : item.tax_planning.november.tbf }, { tbc: this.props.status === 'CLOSED' ? Number(item.tax_planning.november.tbc).toFixed(1) : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.november.tbc, formula: item.tax_planning.november_formula } : item.tax_planning.november.tbc, fcp: this.props.status === 'CLOSED' ? Number(item.tax_planning.november.fcp).toFixed(1) : item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.november.fcp, formula: item.tax_planning.november_formula } : item.tax_planning.november.fcp, tbf: this.props.status === 'CLOSED' ? Number(item.tax_planning.november.tbf).toFixed(1) : item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.november.tbf, formula: item.tax_planning.november_formula } : item.tax_planning.november.tbf },
{ tbc: this.props.status === 'CLOSED' ? Number(item.tax_planning.december.tbc).toFixed(1) : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.december.tbc, formula: item.tax_planning.december_formula } : item.tax_planning.december.tbc, fcp: this.props.status === 'CLOSED' ? Number(item.tax_planning.december.fcp).toFixed(1) : item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.december.fcp, formula: item.tax_planning.december_formula } : item.tax_planning.december.fcp, tbf: this.props.status === 'CLOSED' ? Number(item.tax_planning.december.tbf).toFixed(1) : item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.december.tbf, formula: item.tax_planning.december_formula } : item.tax_planning.december.tbf }, { tbc: this.props.status === 'CLOSED' ? Number(item.tax_planning.december.tbc).toFixed(1) : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.december.tbc, formula: item.tax_planning.december_formula } : item.tax_planning.december.tbc, fcp: this.props.status === 'CLOSED' ? Number(item.tax_planning.december.fcp).toFixed(1) : item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.december.fcp, formula: item.tax_planning.december_formula } : item.tax_planning.december.fcp, tbf: this.props.status === 'CLOSED' ? Number(item.tax_planning.december.tbf).toFixed(1) : item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.december.tbf, formula: item.tax_planning.december_formula } : item.tax_planning.december.tbf },
item.tax_planning.total_current_year, Number(item.tax_planning.total_current_year).toFixed(1),
// { tbc: item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.total_next_year.tbc } : item.tax_planning.total_next_year.tbc, fcp: item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.total_next_year.fcp } : item.tax_planning.total_next_year.fcp, tbf: item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.total_next_year.tbf } : item.tax_planning.total_next_year.tbf }, // { tbc: item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.total_next_year.tbc } : item.tax_planning.total_next_year.tbc, fcp: item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.total_next_year.fcp } : item.tax_planning.total_next_year.fcp, tbf: item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.total_next_year.tbf } : item.tax_planning.total_next_year.tbf },
{ tbc: item.tax_planning.total_next_year.tbc, fcp: item.tax_planning.total_next_year.fcp, tbf: item.tax_planning.total_next_year.tbf }, { tbc: item.tax_planning.total_next_year.tbc, fcp: item.tax_planning.total_next_year.fcp, tbf: item.tax_planning.total_next_year.tbf },
{ tbc: item.tax_planning.total_more_year.tbc, fcp: item.tax_planning.total_more_year.fcp, tbf: item.tax_planning.total_more_year.tbf }, { tbc: item.tax_planning.total_more_year.tbc, fcp: item.tax_planning.total_more_year.fcp, tbf: item.tax_planning.total_more_year.tbf },
...@@ -198,7 +198,7 @@ export default class TaxPlanning extends Component { ...@@ -198,7 +198,7 @@ export default class TaxPlanning extends Component {
{ tbc: this.props.status === 'CLOSED' ? Number(item.tax_planning.october.tbc).toFixed(1) : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.october.tbc, formula: item.tax_planning.october_formula } : item.tax_planning.october.tbc, fcp: this.props.status === 'CLOSED' ? Number(item.tax_planning.october.fcp).toFixed(1) : item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.october.fcp, formula: item.tax_planning.october_formula } : item.tax_planning.october.fcp, tbf: this.props.status === 'CLOSED' ? Number(item.tax_planning.october.tbf).toFixed(1) : item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.october.tbf, formula: item.tax_planning.october_formula } : item.tax_planning.october.tbf }, { tbc: this.props.status === 'CLOSED' ? Number(item.tax_planning.october.tbc).toFixed(1) : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.october.tbc, formula: item.tax_planning.october_formula } : item.tax_planning.october.tbc, fcp: this.props.status === 'CLOSED' ? Number(item.tax_planning.october.fcp).toFixed(1) : item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.october.fcp, formula: item.tax_planning.october_formula } : item.tax_planning.october.fcp, tbf: this.props.status === 'CLOSED' ? Number(item.tax_planning.october.tbf).toFixed(1) : item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.october.tbf, formula: item.tax_planning.october_formula } : item.tax_planning.october.tbf },
{ tbc: this.props.status === 'CLOSED' ? Number(item.tax_planning.november.tbc).toFixed(1) : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.november.tbc, formula: item.tax_planning.november_formula } : item.tax_planning.november.tbc, fcp: this.props.status === 'CLOSED' ? Number(item.tax_planning.november.fcp).toFixed(1) : item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.november.fcp, formula: item.tax_planning.november_formula } : item.tax_planning.november.fcp, tbf: this.props.status === 'CLOSED' ? Number(item.tax_planning.november.tbf).toFixed(1) : item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.november.tbf, formula: item.tax_planning.november_formula } : item.tax_planning.november.tbf }, { tbc: this.props.status === 'CLOSED' ? Number(item.tax_planning.november.tbc).toFixed(1) : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.november.tbc, formula: item.tax_planning.november_formula } : item.tax_planning.november.tbc, fcp: this.props.status === 'CLOSED' ? Number(item.tax_planning.november.fcp).toFixed(1) : item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.november.fcp, formula: item.tax_planning.november_formula } : item.tax_planning.november.fcp, tbf: this.props.status === 'CLOSED' ? Number(item.tax_planning.november.tbf).toFixed(1) : item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.november.tbf, formula: item.tax_planning.november_formula } : item.tax_planning.november.tbf },
{ tbc: this.props.status === 'CLOSED' ? Number(item.tax_planning.december.tbc).toFixed(1) : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.december.tbc, formula: item.tax_planning.december_formula } : item.tax_planning.december.tbc, fcp: this.props.status === 'CLOSED' ? Number(item.tax_planning.december.fcp).toFixed(1) : item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.december.fcp, formula: item.tax_planning.december_formula } : item.tax_planning.december.fcp, tbf: this.props.status === 'CLOSED' ? Number(item.tax_planning.december.tbf).toFixed(1) : item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.december.tbf, formula: item.tax_planning.december_formula } : item.tax_planning.december.tbf }, { tbc: this.props.status === 'CLOSED' ? Number(item.tax_planning.december.tbc).toFixed(1) : item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.december.tbc, formula: item.tax_planning.december_formula } : item.tax_planning.december.tbc, fcp: this.props.status === 'CLOSED' ? Number(item.tax_planning.december.fcp).toFixed(1) : item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.december.fcp, formula: item.tax_planning.december_formula } : item.tax_planning.december.fcp, tbf: this.props.status === 'CLOSED' ? Number(item.tax_planning.december.tbf).toFixed(1) : item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.december.tbf, formula: item.tax_planning.december_formula } : item.tax_planning.december.tbf },
item.tax_planning.total_current_year, Number(item.tax_planning.total_current_year).toFixed(1),
// { tbc: item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.total_next_year.tbc } : item.tax_planning.total_next_year.tbc, fcp: item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.total_next_year.fcp } : item.tax_planning.total_next_year.fcp, tbf: item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.total_next_year.tbf } : item.tax_planning.total_next_year.tbf }, // { tbc: item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.total_next_year.tbc } : item.tax_planning.total_next_year.tbc, fcp: item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.total_next_year.fcp } : item.tax_planning.total_next_year.fcp, tbf: item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.total_next_year.tbf } : item.tax_planning.total_next_year.tbf },
{ tbc: item.tax_planning.total_next_year.tbc, fcp: item.tax_planning.total_next_year.fcp, tbf: item.tax_planning.total_next_year.tbf }, { tbc: item.tax_planning.total_next_year.tbc, fcp: item.tax_planning.total_next_year.fcp, tbf: item.tax_planning.total_next_year.tbf },
{ tbc: item.tax_planning.total_more_year.tbc, fcp: item.tax_planning.total_more_year.fcp, tbf: item.tax_planning.total_more_year.tbf }, { tbc: item.tax_planning.total_more_year.tbc, fcp: item.tax_planning.total_more_year.fcp, tbf: item.tax_planning.total_more_year.tbf },
...@@ -1234,7 +1234,23 @@ export default class TaxPlanning extends Component { ...@@ -1234,7 +1234,23 @@ export default class TaxPlanning extends Component {
} }
} }
} }
const handleTotal = (tableMeta, dex) => { const handleTotalControl = (tableMeta, dex, periode) => {
let total = 0
dataTable2[tableMeta.rowIndex].map((item, index) => {
if (index >= 9 && index <= 20) {
let indexChild = item.tbf.formula.findIndex((val) => val.periode === periode)
if (indexChild !== -1) {
total += Number(item.tbf.formula[indexChild].value)
}
}
})
let nilai = Number(total) + Number(dataTable2[88][21])
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = nilai
// console.log(nilai);
return nilai
}
const handleTotal = (tableMeta, dex, periode) => {
let total = 0 let total = 0
let totalfcp = 0 let totalfcp = 0
if (String(tableMeta.rowData[8]).toLowerCase() === "fiscal correction positive / (negative) year to date") { if (String(tableMeta.rowData[8]).toLowerCase() === "fiscal correction positive / (negative) year to date") {
...@@ -7571,83 +7587,114 @@ export default class TaxPlanning extends Component { ...@@ -7571,83 +7587,114 @@ export default class TaxPlanning extends Component {
/> />
</div> </div>
: :
tableMeta.rowData[3] === 3 ? tableMeta.rowData[8] === "Control (should be nil)" ?
<div style={{ flex: 1 }}> (Number(handleTotalControl(tableMeta, 1, this.props.periode)).toFixed(1) >= Number(this.state.minValue) && Number(handleTotalControl(tableMeta, 1, this.props.periode)).toFixed(1) <= Number(this.state.maxValue)) ?
<FormControlLabel <NumberFormat
style={{ margin: 0 }} thousandSeparator={true}
value={value} style={{ color: 'black', fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
control={ type="text"
<NumberFormat placeholder=""
thousandSeparator={true} disabled={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} value={Number(handleTotalControl(tableMeta, 1, this.props.periode)).toFixed(1)}
type="text" /> :
placeholder="input" <LightTooltip title={this.state.minValue === null ? `Value Should be 0` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
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(handleTotal(tableMeta, 3)).toFixed(1)}
/>
}
/>
</div> :
tableMeta.rowData[3] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}>
<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', color: 'red' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleTotal(tableMeta, 2)).toFixed(1)} value={Number(handleTotalControl(tableMeta, 1, this.props.periode)).toFixed(1)}
/> />
</span> </LightTooltip>
:
String(tableMeta.rowData[8]).toLowerCase() === "fiscal correction positive / (negative) year to date" ?
<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] === 4 ? tableMeta.rowData[3] === 3 ?
null <div style={{ flex: 1 }}>
: <FormControlLabel
tableMeta.rowData[3] === 6 ? style={{ margin: 0 }}
<NumberFormat value={value}
thousandSeparator={true} control={
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} <NumberFormat
type="text" thousandSeparator={true}
placeholder="" style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
disabled={true} type="text"
value={Number(handleTotal(tableMeta, 6)).toFixed(1)} placeholder="input"
/> 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(handleTotal(tableMeta, 3)).toFixed(1)}
tableMeta.rowData[3] === 5 ? />
<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, 5)).toFixed(1)}
/> />
</div> :
tableMeta.rowData[3] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}>
<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, 2)).toFixed(1)}
/>
</span>
: :
tableMeta.rowData[3] === 1 ? tableMeta.rowData[3] === 4 ?
null null
: :
tableMeta.rowData[3] === 7 ? tableMeta.rowData[3] === 6 ?
(Number(handleTotal(tableMeta, 1)) >= Number(this.state.minValue) && Number(handleTotal(tableMeta, 1)) <= Number(this.state.maxValue)) ? <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, 6)).toFixed(1)}
/>
:
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' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleTotal(tableMeta, 1)).toFixed(1)} value={Number(handleTotal(tableMeta, 5)).toFixed(1)}
/> : />
<LightTooltip title={this.state.minValue === null ? `Value Should be 0` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> :
<NumberFormat tableMeta.rowData[3] === 1 ?
thousandSeparator={true} null
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', color: 'red' }} :
type="text" tableMeta.rowData[3] === 7 ?
placeholder="" (Number(handleTotal(tableMeta, 1)) >= Number(this.state.minValue) && Number(handleTotal(tableMeta, 1)) <= Number(this.state.maxValue)) ?
disabled={true} <NumberFormat
value={Number(handleTotal(tableMeta, 1)).toFixed(1)} thousandSeparator={true}
/> style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
</LightTooltip> type="text"
: placeholder=""
null disabled={true}
value={Number(handleTotal(tableMeta, 1, this.props.periode)).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be 0` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent', color: 'red' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleTotal(tableMeta, 1, this.props.periode)).toFixed(1)}
/>
</LightTooltip>
:
null
} }
</div> </div>
{/* </div> */} {/* </div> */}
......
...@@ -505,7 +505,7 @@ export default class SubHolding extends Component { ...@@ -505,7 +505,7 @@ export default class SubHolding extends Component {
} else if (this.state.report.value === 4) { } else if (this.state.report.value === 4) {
api.create().getReportHierarkiFR(payload).then(response => { api.create().getReportHierarkiFR(payload).then(response => {
// console.log(payload); // console.log(payload);
console.log(response); // console.log(response);
let dataTable = [] let dataTable = []
if (response.data) { if (response.data) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
...@@ -522,20 +522,20 @@ export default class SubHolding extends Component { ...@@ -522,20 +522,20 @@ export default class SubHolding extends Component {
item.description, item.description,
item.uom, item.uom,
item.ratio.total_actual_before === null ? "0.0" : item.ratio.total_actual_before === "" ? "0.0" : item.ratio.total_actual_before, item.ratio.total_actual_before === null ? "0.0" : item.ratio.total_actual_before === "" ? "0.0" : item.ratio.total_actual_before,
Number(item.ratio.january).toFixed(1), Number(item.ratio.january).toFixed(2),
Number(item.ratio.february).toFixed(1), Number(item.ratio.february).toFixed(2),
Number(item.ratio.march).toFixed(1), Number(item.ratio.march).toFixed(2),
Number(item.ratio.april).toFixed(1), Number(item.ratio.april).toFixed(2),
Number(item.ratio.may).toFixed(1), Number(item.ratio.may).toFixed(2),
Number(item.ratio.june).toFixed(1), Number(item.ratio.june).toFixed(2),
Number(item.ratio.july).toFixed(1), Number(item.ratio.july).toFixed(2),
Number(item.ratio.august).toFixed(1), Number(item.ratio.august).toFixed(2),
Number(item.ratio.september).toFixed(1), Number(item.ratio.september).toFixed(2),
Number(item.ratio.october).toFixed(1), Number(item.ratio.october).toFixed(2),
Number(item.ratio.november).toFixed(1), Number(item.ratio.november).toFixed(2),
Number(item.ratio.december).toFixed(1), Number(item.ratio.december).toFixed(2),
Number(item.ratio.total_next_year).toFixed(1), Number(item.ratio.total_next_year).toFixed(2),
Number(item.ratio.total_more_year).toFixed(1), Number(item.ratio.total_more_year).toFixed(2),
item.order, item.order,
item.condition_it_should_be, item.condition_it_should_be,
item.condition_if_wrong item.condition_if_wrong
...@@ -559,20 +559,20 @@ export default class SubHolding extends Component { ...@@ -559,20 +559,20 @@ export default class SubHolding extends Component {
item.description, item.description,
item.oum, item.oum,
item.ratio.total_actual_before === null ? "0.0" : item.ratio.total_actual_before === "" ? "0.0" : item.ratio.total_actual_before, item.ratio.total_actual_before === null ? "0.0" : item.ratio.total_actual_before === "" ? "0.0" : item.ratio.total_actual_before,
Number(item.ratio.january).toFixed(1), Number(item.ratio.january).toFixed(2),
Number(item.ratio.february).toFixed(1), Number(item.ratio.february).toFixed(2),
Number(item.ratio.march).toFixed(1), Number(item.ratio.march).toFixed(2),
Number(item.ratio.april).toFixed(1), Number(item.ratio.april).toFixed(2),
Number(item.ratio.may).toFixed(1), Number(item.ratio.may).toFixed(2),
Number(item.ratio.june).toFixed(1), Number(item.ratio.june).toFixed(2),
Number(item.ratio.july).toFixed(1), Number(item.ratio.july).toFixed(2),
Number(item.ratio.august).toFixed(1), Number(item.ratio.august).toFixed(2),
Number(item.ratio.september).toFixed(1), Number(item.ratio.september).toFixed(2),
Number(item.ratio.october).toFixed(1), Number(item.ratio.october).toFixed(2),
Number(item.ratio.november).toFixed(1), Number(item.ratio.november).toFixed(2),
Number(item.ratio.december).toFixed(1), Number(item.ratio.december).toFixed(2),
Number(item.ratio.total_next_year).toFixed(1), Number(item.ratio.total_next_year).toFixed(2),
Number(item.ratio.total_more_year).toFixed(1), Number(item.ratio.total_more_year).toFixed(2),
item.order, item.order,
item.condition_it_should_be, item.condition_it_should_be,
item.condition_if_wrong item.condition_if_wrong
......
...@@ -778,7 +778,6 @@ export default class MonthlyReport extends Component { ...@@ -778,7 +778,6 @@ export default class MonthlyReport extends Component {
company={this.state.company} company={this.state.company}
revision={this.state.revisionTable} revision={this.state.revisionTable}
periode={this.state.periode.periode} periode={this.state.periode.periode}
// submissionID={this.state.submissionID}
monthlyReportId={this.state.monthlyReportId} monthlyReportId={this.state.monthlyReportId}
month={this.state.month} month={this.state.month}
// saveToMasterBudget={this.saveToMasterBudget.bind(this)} // saveToMasterBudget={this.saveToMasterBudget.bind(this)}
......
...@@ -86,14 +86,15 @@ export default class TaxPlanningMR extends Component { ...@@ -86,14 +86,15 @@ export default class TaxPlanningMR extends Component {
getItemHierarki() { getItemHierarki() {
this.setState({ loading: true, judulColumn: null }) this.setState({ loading: true, judulColumn: null })
let payload = { let payload = {
"report_id": 5, "report_id": this.props.report_id,
"revision": 0, "revision": Number(this.props.revision),
"periode": 2021, "periode": this.props.periode,
"company_id": 2193390, "company_id": this.props.company.company_id,
"submission_id": 3425765 "monthly_report_id": this.props.monthlyReportId,
"month": this.props.month.month_id
} }
api.create().getDetailReportMB(payload).then(response => { api.create().getHierarkiMontlyReportTP(payload).then(response => {
// console.log(response); console.log(response);
let dataTable = [] let dataTable = []
if (response.data) { if (response.data) {
if (response.data.status == 'success') { if (response.data.status == 'success') {
...@@ -103,23 +104,21 @@ export default class TaxPlanningMR extends Component { ...@@ -103,23 +104,21 @@ export default class TaxPlanningMR extends Component {
if (indexIDzz === -1) { if (indexIDzz === -1) {
dataTable.push([ dataTable.push([
item.type_report_id, item.type_report_id,
item.type_report_tax.value_tbc.type_report_id,
item.type_report_tax.value_fc.type_report_id,
item.type_report_tax.value_tbf.type_report_id,
item.id, item.id,
item.parent, item.parent,
{ tbc: item.formula_tax.value_tbc, fcp: item.formula_tax.value_fc, tbf: item.formula_tax.value_tbf }, item.formula,
item.level, item.level,
item.description, item.description,
{ tbc: item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.january.tbc, formula: item.tax_planning.january_formula } : item.tax_planning.january.tbc, fcp: item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.january.fcp, formula: item.tax_planning.january_formula } : item.tax_planning.january.fcp, tbf: item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.january.tbf, formula: item.tax_planning.january_formula } : item.tax_planning.january.tbf }, {
item.tax_planning.total_current_year, tbc: item.tax_planning.trial_balance_commercial === null ? "0.0" : item.tax_planning.trial_balance_commercial === "" ? "0.0" : item.tax_planning.trial_balance_commercial,
item.tax_planning.total_current_year, fcp: item.tax_planning.fiscal_correction === null ? "0.0" : item.tax_planning.fiscal_correction === "" ? "0.0" : item.tax_planning.fiscal_correction,
tbf: item.tax_planning.trial_balance_fiscal === null ? "0.0" : item.tax_planning.trial_balance_fiscal === "" ? "0.0" : item.tax_planning.trial_balance_fiscal,
},
item.tax_planning.trial_balance_fiscal_actual === null ? "0.0" : item.tax_planning.trial_balance_fiscal_actual === "" ? "0.0" : item.tax_planning.trial_balance_fiscal_actual,
item.tax_planning.trial_balance_fiscal_mb === null ? "0.0" : item.tax_planning.trial_balance_fiscal_mb === "" ? "0.0" : item.tax_planning.trial_balance_fiscal_mb,
item.order, item.order,
{ tbc: item.condition_it_should_be_tax.value_tbc, fcp: item.condition_it_should_be_tax.value_fc, tbf: item.condition_it_should_be_tax.value_tbf }, item.condition_it_should_be,
{ tbc: item.condition_if_wrong_tax.value_tbc, fcp: item.condition_if_wrong_tax.value_fc, tbf: item.condition_if_wrong_tax.value_tbf }, item.condition_if_wrong,
item.tax_planning.forecast_tbc_formula,
item.tax_planning.forecast_fcp_formula,
item.tax_planning.forecast_tbf_formula,
]) ])
} }
if (item.children !== null) { if (item.children !== null) {
...@@ -133,23 +132,21 @@ export default class TaxPlanningMR extends Component { ...@@ -133,23 +132,21 @@ export default class TaxPlanningMR extends Component {
res.map((item, index) => { res.map((item, index) => {
dataTable.push([ dataTable.push([
item.type_report_id, item.type_report_id,
item.type_report_tax.value_tbc.type_report_id,
item.type_report_tax.value_fc.type_report_id,
item.type_report_tax.value_tbf.type_report_id,
item.id, item.id,
item.parent, item.parent,
{ tbc: item.formula_tax.value_tbc, fcp: item.formula_tax.value_fc, tbf: item.formula_tax.value_tbf }, item.formula,
item.level, item.level,
item.description, item.description,
{ tbc: item.type_report_tax.value_tbc.type_report_id == 5 || item.type_report_tax.value_tbc.type_report_id == 6 || item.type_report_tax.value_tbc.type_report_id == 7 ? { value: item.tax_planning.january.tbc, formula: item.tax_planning.january_formula } : item.tax_planning.january.tbc, fcp: item.type_report_tax.value_fc.type_report_id == 5 || item.type_report_tax.value_fc.type_report_id == 6 || item.type_report_tax.value_fc.type_report_id == 7 ? { value: item.tax_planning.january.fcp, formula: item.tax_planning.january_formula } : item.tax_planning.january.fcp, tbf: item.type_report_tax.value_tbf.type_report_id == 5 || item.type_report_tax.value_tbf.type_report_id == 6 || item.type_report_tax.value_tbf.type_report_id == 7 ? { value: item.tax_planning.january.tbf, formula: item.tax_planning.january_formula } : item.tax_planning.january.tbf }, {
item.tax_planning.total_current_year, tbc: item.tax_planning.trial_balance_commercial === null ? "0.0" : item.tax_planning.trial_balance_commercial === "" ? "0.0" : item.tax_planning.trial_balance_commercial,
item.tax_planning.total_current_year, fcp: item.tax_planning.fiscal_correction === null ? "0.0" : item.tax_planning.fiscal_correction === "" ? "0.0" : item.tax_planning.fiscal_correction,
tbf: item.tax_planning.trial_balance_fiscal === null ? "0.0" : item.tax_planning.trial_balance_fiscal === "" ? "0.0" : item.tax_planning.trial_balance_fiscal,
},
item.tax_planning.trial_balance_fiscal_actual === null ? "0.0" : item.tax_planning.trial_balance_fiscal_actual === "" ? "0.0" : item.tax_planning.trial_balance_fiscal_actual,
item.tax_planning.trial_balance_fiscal_mb === null ? "0.0" : item.tax_planning.trial_balance_fiscal_mb === "" ? "0.0" : item.tax_planning.trial_balance_fiscal_mb,
item.order, item.order,
{ tbc: item.condition_it_should_be_tax.value_tbc, fcp: item.condition_it_should_be_tax.value_fc, tbf: item.condition_it_should_be_tax.value_tbf }, item.condition_it_should_be,
{ tbc: item.condition_if_wrong_tax.value_tbc, fcp: item.condition_if_wrong_tax.value_fc, tbf: item.condition_if_wrong_tax.value_tbf }, item.condition_if_wrong,
item.tax_planning.forecast_tbc_formula,
item.tax_planning.forecast_fcp_formula,
item.tax_planning.forecast_tbf_formula
]) ])
if (item.children !== null) { if (item.children !== null) {
if (item.children.length > 0) { if (item.children.length > 0) {
...@@ -1166,22 +1163,8 @@ export default class TaxPlanningMR extends Component { ...@@ -1166,22 +1163,8 @@ export default class TaxPlanningMR extends Component {
return total return total
} }
const columns = [{ const columns = [
name: "", {
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "",
options: {
display: false
}
}, {
name: "", name: "",
options: { options: {
display: false display: false
...@@ -1219,17 +1202,17 @@ export default class TaxPlanningMR extends Component { ...@@ -1219,17 +1202,17 @@ export default class TaxPlanningMR extends Component {
return ( return (
<div style={{ width: 300 }}> <div style={{ width: 300 }}>
{tableMeta.rowData[0] === null ? {tableMeta.rowData[0] === null ?
tableMeta.rowData[7] == 0 ? tableMeta.rowData[4] == 0 ?
<LightTooltip title={"Report Items Not Registered"} arrow> <LightTooltip title={"Report Items Not Registered"} arrow>
<span style={{ fontSize: 12, fontWeight: 'bold', color: 'red' }}>{String(val).toUpperCase()}</span> <span style={{ fontSize: 12, fontWeight: 'bold', color: 'red' }}>{String(val).toUpperCase()}</span>
</LightTooltip> : </LightTooltip> :
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[7]) }}> <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>
</LightTooltip> </LightTooltip>
</div> </div>
: :
tableMeta.rowData[7] == 0 ? tableMeta.rowData[4] == 0 ?
<span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span> <span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
: :
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[7]) }}> <div style={{ paddingLeft: 20 * Number(tableMeta.rowData[7]) }}>
...@@ -1263,370 +1246,31 @@ export default class TaxPlanningMR extends Component { ...@@ -1263,370 +1246,31 @@ export default class TaxPlanningMR extends Component {
</th> </th>
), ),
setCellProps: () => ({ style2 }), setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (val, tableMeta, updateValue) => {
return ( return (
<div> <div>
<div className="grid grid-3x content-center"> <div className="grid grid-3x content-center">
<div className="col-1"> <div className="col-1">
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right', width: 90 }}>
{tableMeta.rowData[1] === 3 ? {tableMeta.rowData[0] === 4 ?
<div style={{ flex: 1 }}> null :
<FormControlLabel val.tbc
style={{ margin: 0 }}
value={value.tbc}
control={
<NumberFormat
thousandSeparator={true}
decimalSeparator={"."}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
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.tbc).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 0)
// console.log(dataTable2)
}}
/>
}
/>
</div> :
tableMeta.rowData[1] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleParent(tableMeta, 1)).toFixed(1)}
/>
</span>
:
tableMeta.rowData[1] === 4 ?
null
:
tableMeta.rowData[1] === 6 ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(value, tableMeta, 1)).toFixed(1)}
/>
:
tableMeta.rowData[1] === 5 ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(value, tableMeta, 1)).toFixed(1)}
/>
:
tableMeta.rowData[1] === 1 ?
null
:
tableMeta.rowData[1] === 7 ?
Number(handleValueFormula(value, tableMeta, 0)).toFixed(1) === Number(tableMeta.rowData[13].tbc === "" ? "0" : tableMeta.rowData[13].tbc === "" ? "0" : tableMeta.rowData[13].tbc === "" ? "0" : tableMeta.rowData[13].tbc).toFixed(1) ?
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(value, tableMeta, 1)).toFixed(1)}
/> : tableMeta.rowData[14].tbc === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[13].tbc === "" ? "0" : tableMeta.rowData[13].tbc}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(value, tableMeta, 1)).toFixed(1)}
/>
</LightTooltip> :
<LightTooltip title={`Value Should be ${tableMeta.rowData[13].tbc === "" ? "0" : tableMeta.rowData[13].tbc}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(value, tableMeta, 1)).toFixed(1)}
/>
</LightTooltip>
:
null
} }
</div> </div>
</div> </div>
<div className="col-2"> <div className="col-2">
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right', width: 90 }}>
{tableMeta.rowData[2] === 3 ? {tableMeta.rowData[0] === 4 ?
<div style={{ flex: 1 }}> null :
<FormControlLabel val.fcp
style={{ margin: 0 }}
value={value.fcp}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
// 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)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta, 1)
// console.log(dataTable2)
}}
/>
}
/>
</div> :
tableMeta.rowData[2] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleParent(tableMeta, 2)).toFixed(1)}
/>
</span>
:
tableMeta.rowData[2] === 4 ?
null
:
tableMeta.rowData[2] === 6 ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(value, tableMeta, 2)).toFixed(1)}
/>
:
tableMeta.rowData[2] === 5 ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(value, tableMeta, 2)).toFixed(1)}
/>
:
tableMeta.rowData[2] === 1 ?
null
:
tableMeta.rowData[2] === 7 ?
Number(handleValueFormula(value, tableMeta, 2)).toFixed(1) === Number(tableMeta.rowData[13].fcp === "" ? "0" : tableMeta.rowData[13].fcp).toFixed(1) ?
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(value, tableMeta, 2)).toFixed(1)}
/> : tableMeta.rowData[14].fcp === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[13].fcp === "" ? "0" : tableMeta.rowData[13].fcp}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(value, tableMeta, 2)).toFixed(1)}
/>
</LightTooltip> :
<LightTooltip title={`Value Should be ${tableMeta.rowData[13].fcp === "" ? "0" : tableMeta.rowData[13].fcp}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(value, tableMeta, 2)).toFixed(1)}
/>
</LightTooltip>
:
null
} }
</div> </div>
</div> </div>
<div className="col-3"> <div className="col-3">
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right', width: 90 }}>
{tableMeta.rowData[3] === 3 ? {tableMeta.rowData[0] === 4 ?
<div style={{ flex: 1 }}> null :
<FormControlLabel val.tbf
style={{ margin: 0 }}
value={value.tbf}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
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)}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta, 2)
// console.log(dataTable2)
}}
/>
}
/>
</div> :
tableMeta.rowData[3] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleParent(tableMeta, 3)).toFixed(1)}
/>
</span>
:
tableMeta.rowData[3] === 4 ?
null
:
tableMeta.rowData[3] === 6 ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
/>
:
tableMeta.rowData[3] === 5 ?
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
disabled={false}
value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
/>
:
tableMeta.rowData[3] === 1 ?
null
:
tableMeta.rowData[3] === 7 ?
Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) === Number(tableMeta.rowData[13].tbf === "" ? "0" : tableMeta.rowData[13].tbf).toFixed(1) ?
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'black'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
/> : tableMeta.rowData[14].tbf === "STOPPER" ?
<LightTooltip title={`Value Should be ${tableMeta.rowData[13].tbf === "" ? "0" : tableMeta.rowData[13].tbf}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
/>
</LightTooltip> :
<LightTooltip title={`Value Should be ${tableMeta.rowData[13].tbf === "" ? "0" : tableMeta.rowData[13].tbf}`} arrow>
<NumberFormat
thousandSeparator={true}
style={{
fontSize: 12,
textAlign: 'right',
borderColor: 'transparent',
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'red'
}}
type="text"
placeholder=""
disabled={true}
value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
/>
</LightTooltip>
:
null
} }
</div> </div>
</div> </div>
...@@ -1649,89 +1293,13 @@ export default class TaxPlanningMR extends Component { ...@@ -1649,89 +1293,13 @@ export default class TaxPlanningMR extends Component {
</th> </th>
), ),
setCellProps: () => ({ style2 }), setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (val, tableMeta, updateValue) => {
return ( return (
<div> <div style={{ textAlign: 'right', width: 90 }}>
<div className="grid grid-3x content-center"> {tableMeta.rowData[0] === 4 ?
{/* <div className="col-1"> */} null :
<div style={{ textAlign: 'right' }}> val
{tableMeta.rowData[3] === 3 ? }
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
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(handleTotal(tableMeta, 3)).toFixed(1)}
/>
}
/>
</div> :
tableMeta.rowData[3] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}>
<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, 2)).toFixed(1)}
/>
</span>
:
tableMeta.rowData[3] === 4 ?
null
:
tableMeta.rowData[3] === 6 ?
<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, 6)).toFixed(1)}
/>
:
tableMeta.rowData[3] === 5 ?
<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, 5)).toFixed(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
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)}
/>
:
null
}
</div>
{/* </div> */}
</div>
</div> </div>
) )
} }
...@@ -1750,89 +1318,13 @@ export default class TaxPlanningMR extends Component { ...@@ -1750,89 +1318,13 @@ export default class TaxPlanningMR extends Component {
</th> </th>
), ),
setCellProps: () => ({ style2 }), setCellProps: () => ({ style2 }),
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (val, tableMeta, updateValue) => {
return ( return (
<div> <div style={{ textAlign: 'right', width: 90 }}>
<div className="grid grid-3x content-center"> {tableMeta.rowData[0] === 4 ?
{/* <div className="col-1"> */} null :
<div style={{ textAlign: 'right' }}> val
{tableMeta.rowData[3] === 3 ? }
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder="input"
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(handleTotal(tableMeta, 3)).toFixed(1)}
/>
}
/>
</div> :
tableMeta.rowData[3] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}>
<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, 2)).toFixed(1)}
/>
</span>
:
tableMeta.rowData[3] === 4 ?
null
:
tableMeta.rowData[3] === 6 ?
<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, 6)).toFixed(1)}
/>
:
tableMeta.rowData[3] === 5 ?
<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, 5)).toFixed(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
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)}
/>
:
null
}
</div>
{/* </div> */}
</div>
</div> </div>
) )
} }
......
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