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

issue tp mr

parent 658a0d2d
...@@ -52,7 +52,8 @@ export default class TaxPlanningMR extends Component { ...@@ -52,7 +52,8 @@ export default class TaxPlanningMR extends Component {
buttonDraft: true, buttonDraft: true,
handleTekTekTek: 0, handleTekTekTek: 0,
saveDraft: true, saveDraft: true,
buttonError: true buttonError: true,
shouldBeNil: true
} }
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
...@@ -62,7 +63,6 @@ export default class TaxPlanningMR extends Component { ...@@ -62,7 +63,6 @@ export default class TaxPlanningMR extends Component {
this.getSettingControl() this.getSettingControl()
// this.getItemHierarki() // this.getItemHierarki()
this.getLatestUpdate() this.getLatestUpdate()
console.log(this.props.isApprover)
} }
getSettingControl() { getSettingControl() {
...@@ -93,7 +93,6 @@ export default class TaxPlanningMR extends Component { ...@@ -93,7 +93,6 @@ export default class TaxPlanningMR extends Component {
"months": this.props.month.month_id "months": this.props.month.month_id
} }
api.create().getLastestUpdateMR(payload).then(response => { api.create().getLastestUpdateMR(payload).then(response => {
console.log(response)
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
...@@ -115,7 +114,7 @@ export default class TaxPlanningMR extends Component { ...@@ -115,7 +114,7 @@ export default class TaxPlanningMR extends Component {
"months": this.props.month.month_id "months": this.props.month.month_id
} }
api.create().getHierarkiMontlyReportTP(payload).then(response => { api.create().getHierarkiMontlyReportTP(payload).then(response => {
// console.log(response); console.log(response);
// console.log(payload); // console.log(payload);
let dataTable = [] let dataTable = []
if (response.data) { if (response.data) {
...@@ -186,7 +185,7 @@ export default class TaxPlanningMR extends Component { ...@@ -186,7 +185,7 @@ export default class TaxPlanningMR extends Component {
} }
} }
}) })
this.setState({ dataTable, loading: false, editable: true }) this.setState({ dataTable, loading: false, editable: true, shouldBeNil: false })
} else { } else {
this.setState({ loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In")) {
...@@ -200,7 +199,7 @@ export default class TaxPlanningMR extends Component { ...@@ -200,7 +199,7 @@ export default class TaxPlanningMR extends Component {
} else { } else {
this.setState({ dataTable, loading: false, editable: true }) this.setState({ dataTable, loading: false, editable: true })
} }
// console.log(this.state.dataTable) console.log(this.state.dataTable)
}) })
} }
...@@ -229,10 +228,10 @@ export default class TaxPlanningMR extends Component { ...@@ -229,10 +228,10 @@ export default class TaxPlanningMR extends Component {
data.push({ data.push({
item_report_id: i[4], item_report_id: i[4],
trial_balance_commercial: String(Number(i[9].tbc).toFixed(1)), trial_balance_commercial: String(Number(i[9].tbc).toFixed(1)),
fiscal_correction: String(Number(i[9].fcp).toFixed(1)), fiscal_correction: String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(Number(i[9].fcp).toFixed(2)) : String(Number(i[9].fcp).toFixed(1)),
trial_balance_fiscal: String(Number(i[9].tbf).toFixed(1)), trial_balance_fiscal: String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(Number(i[9].tbf).toFixed(2)) : String(Number(i[9].tbf).toFixed(1)),
trial_balance_fiscal_actual: String(Number(i[10]).toFixed(1)), trial_balance_fiscal_actual: String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(Number(i[10]).toFixed(2)) : String(Number(i[10]).toFixed(1)),
trial_balance_fiscal_mb: String(Number(i[11]).toFixed(1)) trial_balance_fiscal_mb: String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(Number(i[11]).toFixed(2)) : String(Number(i[11]).toFixed(1))
}) })
}) })
let payload = { let payload = {
...@@ -289,7 +288,7 @@ export default class TaxPlanningMR extends Component { ...@@ -289,7 +288,7 @@ export default class TaxPlanningMR extends Component {
item_report_id: i[1] === undefined ? "" : String(i[1]).trim(), item_report_id: i[1] === undefined ? "" : String(i[1]).trim(),
item_report_name: i[2] === undefined ? "" : String(i[2]).trim(), item_report_name: i[2] === undefined ? "" : String(i[2]).trim(),
trial_balance_commercial: "", trial_balance_commercial: "",
fiscal_correction: i[3] === undefined ? "0" : reg.test(String(i[3])) === false ? "0" : String(i[3]).trim(), fiscal_correction: i[3] === undefined ? "0" : reg.test(String(i[3])) === false ? "0" : String(i[2]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(Number(String(i[3]).trim()).toFixed(2)) :String(Number(String(i[3]).trim()).toFixed(1)),
trial_balance_fiscal: "", trial_balance_fiscal: "",
trial_balance_fiscal_actual: "", trial_balance_fiscal_actual: "",
trial_balance_fiscal_mb: "", trial_balance_fiscal_mb: "",
...@@ -330,11 +329,11 @@ export default class TaxPlanningMR extends Component { ...@@ -330,11 +329,11 @@ export default class TaxPlanningMR extends Component {
item.item_report, item.item_report,
{ {
tbc: item.trial_balance_commercial === null ? "0.0" : item.trial_balance_commercial === "" ? "0.0" : item.trial_balance_commercial, tbc: item.trial_balance_commercial === null ? "0.0" : item.trial_balance_commercial === "" ? "0.0" : item.trial_balance_commercial,
fcp: item.fiscal_correction === null ? "0.0" : item.fiscal_correction === "" ? "0.0" : item.fiscal_correction, fcp: item.fiscal_correction === null ? "0.0" : item.fiscal_correction === "" ? "0.0" : String(item.item_report).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(item.fiscal_correction).toFixed(2) : Number(item.fiscal_correction).toFixed(1),
tbf: item.trial_balance_fiscal === null ? "0.0" : item.trial_balance_fiscal === "" ? "0.0" : item.trial_balance_fiscal, tbf: item.trial_balance_fiscal === null ? "0.0" : item.trial_balance_fiscal === "" ? "0.0" : String(item.item_report).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(item.trial_balance_fiscal).toFixed(2) : Number(item.trial_balance_fiscal).toFixed(1),
}, },
item.trial_balance_fiscal_actual === null ? "0.0" : item.trial_balance_fiscal_actual === "" ? "0.0" : item.trial_balance_fiscal_actual, item.trial_balance_fiscal_actual === null ? "0.0" : item.trial_balance_fiscal_actual === "" ? "0.0" : String(item.item_report).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(item.trial_balance_fiscal_actual).toFixed(2) : Number(item.trial_balance_fiscal_actual).toFixed(1),
item.trial_balance_fiscal_mb === null ? "0.0" : item.trial_balance_fiscal_mb === "" ? "0.0" : item.trial_balance_fiscal_mb, item.trial_balance_fiscal_mb === null ? "0.0" : item.trial_balance_fiscal_mb === "" ? "0.0" : String(item.item_report).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(item.trial_balance_fiscal_mb).toFixed(2) : Number(item.trial_balance_fiscal_mb).toFixed(1),
item.actual_formula, item.actual_formula,
item.orders, item.orders,
{ tbc: item.condition_it_should_be.tbc, fcp: item.condition_it_should_be.fcp, tbf: item.condition_it_should_be.tbf }, { tbc: item.condition_it_should_be.tbc, fcp: item.condition_it_should_be.fcp, tbf: item.condition_it_should_be.tbf },
...@@ -362,10 +361,10 @@ export default class TaxPlanningMR extends Component { ...@@ -362,10 +361,10 @@ export default class TaxPlanningMR extends Component {
data.push({ data.push({
item_report_id: i[4], item_report_id: i[4],
trial_balance_commercial: String(Number(i[9].tbc).toFixed(1)), trial_balance_commercial: String(Number(i[9].tbc).toFixed(1)),
fiscal_correction: String(Number(i[9].fcp).toFixed(1)), fiscal_correction: String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(Number(i[9].fcp).toFixed(2)) : String(Number(i[9].fcp).toFixed(1)),
trial_balance_fiscal: String(Number(i[9].tbf).toFixed(1)), trial_balance_fiscal: String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(Number(i[9].tbf).toFixed(2)) : String(Number(i[9].tbf).toFixed(1)),
trial_balance_fiscal_actual: String(Number(i[10]).toFixed(1)), trial_balance_fiscal_actual: String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(Number(i[10]).toFixed(2)) : String(Number(i[10]).toFixed(1)),
trial_balance_fiscal_mb: String(Number(i[11]).toFixed(1)) trial_balance_fiscal_mb: String(i[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? String(Number(i[11]).toFixed(2)) : String(Number(i[11]).toFixed(1))
}) })
}) })
let body = { let body = {
...@@ -565,12 +564,8 @@ export default class TaxPlanningMR extends Component { ...@@ -565,12 +564,8 @@ export default class TaxPlanningMR extends Component {
if (dataTable2[indexID][13] == tableMeta.rowData[13]) { if (dataTable2[indexID][13] == tableMeta.rowData[13]) {
anjay.push(0) anjay.push(0)
} else { } else {
// console.log(dataTable2[indexID][tableMeta.columnIndex]);
let data = dex == 1 ? dataTable2[indexID][tableMeta.columnIndex].tbc : dex == 2 ? dataTable2[indexID][tableMeta.columnIndex].fcp : dataTable2[indexID][tableMeta.columnIndex].tbf let data = dex == 1 ? dataTable2[indexID][tableMeta.columnIndex].tbc : dex == 2 ? dataTable2[indexID][tableMeta.columnIndex].fcp : dataTable2[indexID][tableMeta.columnIndex].tbf
let valuezz = data.value == undefined ? data : data.value let valuezz = data.value == undefined ? data : data.value
// console.log(data);
// console.log(data.value);
// console.log(valuezz);
anjay.push(valuezz == "" ? 0 : valuezz) anjay.push(valuezz == "" ? 0 : valuezz)
} }
...@@ -658,19 +653,7 @@ export default class TaxPlanningMR extends Component { ...@@ -658,19 +653,7 @@ export default class TaxPlanningMR extends Component {
} }
total = R.equals(total, NaN) ? "0.0" : total total = R.equals(total, NaN) ? "0.0" : total
// console.log(tableMeta.rowData[8])
// if (xntd !== undefined && tableMeta.rowData[8] == "Under payment /(Over Payment ) Income Tax Art. 29") {
// console.log(tableMeta.rowData[8])
// // console.log(splitFormula)
// console.log(xntd)
// console.log(baru)
// console.log(anjay)
// console.log(total)
// console.log(total2)
// console.log(opt)
// }
// let dataSub = dex == 1? dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc : dex == 2? dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].fcp : dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf
if (dex == 1) { if (dex == 1) {
if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc.value == undefined) { if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc.value == undefined) {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc = Number(total).toFixed(1) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc = Number(total).toFixed(1)
...@@ -684,7 +667,14 @@ export default class TaxPlanningMR extends Component { ...@@ -684,7 +667,14 @@ export default class TaxPlanningMR extends Component {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].fcp.value = Number(total).toFixed(1) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].fcp.value = Number(total).toFixed(1)
} }
} else { } else {
if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf.value == undefined) { if (tableMeta.rowData[8] == "Corporate Income Tax") {
if (total < 0) {
total = 0
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf = Number(total).toFixed(1)
} else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf = Number(total).toFixed(2)
}
} else if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf.value == undefined) {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf = Number(total).toFixed(1) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf = Number(total).toFixed(1)
} else { } else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf.value = Number(total).toFixed(1) dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf.value = Number(total).toFixed(1)
...@@ -969,7 +959,7 @@ export default class TaxPlanningMR extends Component { ...@@ -969,7 +959,7 @@ export default class TaxPlanningMR extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="input" placeholder="input"
value={Number(value.fcp).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.fcp).toFixed(2) : Number(value.fcp).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 1) handleChange(event.target.value, tableMeta, 1)
// console.log(dataTable2) // console.log(dataTable2)
...@@ -1028,8 +1018,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1028,8 +1018,7 @@ export default class TaxPlanningMR extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="input" placeholder="input"
disabled={true} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.tbf).toFixed(2) : Number(value.tbf).toFixed(1)}
value={Number(value.tbf).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
handleChange(event.target.value, tableMeta, 2) handleChange(event.target.value, tableMeta, 2)
// console.log(dataTable2) // console.log(dataTable2)
...@@ -1037,7 +1026,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1037,7 +1026,7 @@ export default class TaxPlanningMR extends Component {
/> />
} }
/> />
</div> </div>
: :
// tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 ? // tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 ?
// <NumberFormat // <NumberFormat
...@@ -1060,7 +1049,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1060,7 +1049,7 @@ export default class TaxPlanningMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(handleValueFormula(value, tableMeta, 3)).toFixed(2) : Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
/> />
} }
/> />
...@@ -1084,7 +1073,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1084,7 +1073,7 @@ export default class TaxPlanningMR extends Component {
disabled={true} disabled={true}
value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)} value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[14].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[14].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})` } arrow>
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ style={{
...@@ -1129,10 +1118,10 @@ export default class TaxPlanningMR extends Component { ...@@ -1129,10 +1118,10 @@ export default class TaxPlanningMR extends Component {
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right', width: 90 }}> <div style={{ textAlign: 'right', width: 90 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
null null
: :
tableMeta.rowData[0] === 2 ? tableMeta.rowData[3] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}> <span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
...@@ -1144,48 +1133,49 @@ export default class TaxPlanningMR extends Component { ...@@ -1144,48 +1133,49 @@ export default class TaxPlanningMR extends Component {
/> />
</span> </span>
: :
tableMeta.rowData[0] === 3 ? // tableMeta.rowData[3] === 3 ?
<div style={{ flex: 1 }}> // <div style={{ flex: 1 }}>
<FormControlLabel // <FormControlLabel
style={{ margin: 0 }} // style={{ margin: 0 }}
value={value} // value={value}
control={ // control={
<NumberFormat // <NumberFormat
thousandSeparator={true} // thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} // style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" // type="text"
placeholder="input" // placeholder="input"
disabled={true} // disabled={true}
value={Number(value).toFixed(1)} // value={Number(value).toFixed(1)}
onBlur={(event) => { // onBlur={(event) => {
handleChange(event.target.value, tableMeta, 3) // handleChange(event.target.value, tableMeta, 3)
// console.log(dataTable2) // // console.log(dataTable2)
}} // }}
/> // />
} // }
/> // />
</div> // </div>
: // :
tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 ? // tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 ?
<div style={{ flex: 1 }}> // <div style={{ flex: 1 }}>
<FormControlLabel // <FormControlLabel
style={{ margin: 0 }} // style={{ margin: 0 }}
value={value} // value={value}
control={ // control={
<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(value).toFixed(1)} // value={Number(value).toFixed(1)}
/> // />
} // }
/> // />
</div> // </div>
: // :
tableMeta.rowData[0] === 7 ? tableMeta.rowData[3] === 7 ?
(Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) <= Number(this.state.maxValue)) ? // (Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) <= Number(this.state.maxValue)) ?
(Number(value).toFixed(1) >= Number(this.state.minValue) && Number(value).toFixed(1) <= Number(this.state.maxValue)) ?
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ style={{
...@@ -1200,7 +1190,8 @@ export default class TaxPlanningMR extends Component { ...@@ -1200,7 +1190,8 @@ export default class TaxPlanningMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)} // value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
value={Number(value).toFixed(1)}
/> : /> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[14].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow> <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[14].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
...@@ -1217,7 +1208,8 @@ export default class TaxPlanningMR extends Component { ...@@ -1217,7 +1208,8 @@ export default class TaxPlanningMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)} // value={Number(handleValueFormula(value, tableMeta, 4)).toFixed(1)}
value={Number(value).toFixed(1)}
/> />
</LightTooltip> </LightTooltip>
: :
...@@ -1232,7 +1224,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1232,7 +1224,7 @@ export default class TaxPlanningMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(value).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value).toFixed(2) : Number(value).toFixed(1)}
/> />
} }
/> />
...@@ -1260,10 +1252,10 @@ export default class TaxPlanningMR extends Component { ...@@ -1260,10 +1252,10 @@ export default class TaxPlanningMR extends Component {
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right', width: 90 }}> <div style={{ textAlign: 'right', width: 90 }}>
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[3] === 4 || tableMeta.rowData[3] === 1 ?
null null
: :
tableMeta.rowData[0] === 2 ? tableMeta.rowData[3] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}> <span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
...@@ -1275,82 +1267,85 @@ export default class TaxPlanningMR extends Component { ...@@ -1275,82 +1267,85 @@ export default class TaxPlanningMR extends Component {
/> />
</span> </span>
: :
tableMeta.rowData[0] === 3 ? // tableMeta.rowData[3] === 3 ?
<div style={{ flex: 1 }}> // <div style={{ flex: 1 }}>
<FormControlLabel // <FormControlLabel
style={{ margin: 0 }} // style={{ margin: 0 }}
value={value} // value={value}
control={ // control={
// <NumberFormat
// thousandSeparator={true}
// style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder="input"
// disabled={true}
// value={Number(value).toFixed(1)}
// onBlur={(event) => {
// handleChange(event.target.value, tableMeta, 3)
// // console.log(dataTable2)
// }}
// />
// }
// />
// </div>
// :
// tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 ?
// <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=""
// disabled={true}
// value={Number(value).toFixed(1)}
// />
// }
// />
// </div>
// :
tableMeta.rowData[3] === 7 ?
// (Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) <= Number(this.state.maxValue)) ?
(Number(value).toFixed(1) >= Number(this.state.minValue) && Number(value).toFixed(1) <= Number(this.state.maxValue)) ?
<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)}
value={Number(value).toFixed(1)}
/> :
<LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[14].tbf}` : `Value Should be (${this.state.minValue}) up to (${this.state.maxValue})`} arrow>
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{
type="text" fontSize: 12,
placeholder="input" textAlign: 'right',
disabled={true} borderColor: 'transparent',
value={Number(value).toFixed(1)} margin: 0,
onBlur={(event) => { width: 96,
handleChange(event.target.value, tableMeta, 3) backgroundColor: 'transparent',
// console.log(dataTable2) color: 'red'
}} }}
/>
}
/>
</div>
:
tableMeta.rowData[0] === 5 || tableMeta.rowData[0] === 6 ?
<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" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
// value={Number(handleValueFormula(value, tableMeta, 4)).toFixed(1)}
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
/> />
} </LightTooltip>
/>
</div>
:
tableMeta.rowData[0] === 7 ? null
// (Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) <= Number(this.state.maxValue)) ?
// <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)}
// /> :
// <LightTooltip title={this.state.minValue === null ? `Value Should be ${tableMeta.rowData[14].tbf}` : `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(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
// />
// </LightTooltip>
: :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
...@@ -1363,7 +1358,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1363,7 +1358,7 @@ export default class TaxPlanningMR extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
value={Number(value).toFixed(1)} value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value).toFixed(2) : Number(value).toFixed(1)}
/> />
} }
/> />
...@@ -1603,15 +1598,16 @@ export default class TaxPlanningMR extends Component { ...@@ -1603,15 +1598,16 @@ export default class TaxPlanningMR extends Component {
this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' }) this.setState({ alert: true, messageAlert: 'Data is not complete !', tipeAlert: 'warning' })
: :
this.state.handleTekTekTek == 1 ? null : this.state.handleTekTekTek == 1 ? null :
this.setState({ handleTekTekTek: 1, loading: true }, () => { this.state.shouldBeNil === true ? null :
setTimeout(() => { this.setState({ handleTekTekTek: 1, loading: true }, () => {
this.backToMonthlyReport('submitted') setTimeout(() => {
}, 100); this.backToMonthlyReport('submitted')
}) }, 100);
})
} }
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
cursor: this.state.buttonError === true ? 'default' : 'pointer', cursor: (this.state.buttonError === true) || (this.state.shouldBeNil === true) ? 'default' : 'pointer',
borderColor: 'transparent', borderColor: 'transparent',
outline: 'none' outline: 'none'
}} }}
......
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