Commit eb858944 authored by r.kurnia's avatar r.kurnia

hierarki monthly tp

parent 58b33e5a
...@@ -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)
//Template //Template
const downloadTemplate = (fileName, fileType) => api.get(`attachment/download_file?fileName=${fileName}&&fileType=${fileType}`) const downloadTemplate = (fileName, fileType) => api.get(`attachment/download_file?fileName=${fileName}&&fileType=${fileType}`)
...@@ -439,6 +440,7 @@ const create = (type = "") => { ...@@ -439,6 +440,7 @@ const create = (type = "") => {
getDashboardUser, getDashboardUser,
getHierarkiMontlyReportBS, getHierarkiMontlyReportBS,
getHierarkiMontlyReportOI, getHierarkiMontlyReportOI,
getHierarkiMontlyReportTP,
getDetailReportCF, getDetailReportCF,
getReportHierarkiPL, getReportHierarkiPL,
getMonthlyReportID, getMonthlyReportID,
......
...@@ -777,7 +777,6 @@ export default class MonthlyReport extends Component { ...@@ -777,7 +777,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