Commit 51691d8d authored by rifkaki's avatar rifkaki

issue tp

parent d0db23d0
...@@ -304,8 +304,9 @@ export default class TaxPlanningMR extends Component { ...@@ -304,8 +304,9 @@ export default class TaxPlanningMR extends Component {
months: this.props.month.month_id, months: this.props.month.month_id,
tax_planning: payload tax_planning: payload
} }
this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[2] }) this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[0][0] })
// console.log(this.state.judulColumn) console.log(this.state.judulColumn)
console.log(this.state.judul)
} }
}); });
} }
...@@ -724,35 +725,28 @@ export default class TaxPlanningMR extends Component { ...@@ -724,35 +725,28 @@ export default class TaxPlanningMR extends Component {
} }
} }
} }
const handleTotal = (tableMeta, dex) => { const handleTotal = (value, tableMeta, dex) => {
console.log(value)
let total = 0 let total = 0
// dataTable2[tableMeta.rowIndex].map((item, index) => {
// if (index == 9) {
// if ( tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 7 ) {
// let valItem = item.tbf.value == undefined || item.tbf.value == "" || item.tbf.value == "undefined" ? 0.0 : item.tbf.value
// total += Number(valItem)
// } else {
// if (tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date"){
// let valItem = item.fcp == undefined || item.fcp == "" || item.fcp == "undefined" ? 0.0 : item.fcp
// total += Number(valItem)
// } else {
// let valItem = item.tbf == undefined || item.tbf == "" || item.tbf == "undefined" ? 0.0 : item.tbf
// total += Number(valItem)
// }
// }
// }
// })
dataTable2[tableMeta.rowIndex].map((item, index) => { dataTable2[tableMeta.rowIndex].map((item, index) => {
if (index == 9) { if (index == 9) {
let valItemTBC = item.tbc == undefined || item.tbc == "" || item.tbc == "undefined" ? 0.0 : item.tbc
let valItemFCP = item.fcp == undefined || item.fcp == "" || item.fcp == "undefined" ? 0.0 : item.fcp let valItemFCP = item.fcp == undefined || item.fcp == "" || item.fcp == "undefined" ? 0.0 : item.fcp
total = Number(valItemTBC) + Number(valItemFCP) // console.log(valItemFCP)
total = Number(value) + Number(valItemFCP)
} }
}) })
dataTable2[tableMeta.rowIndex][9].tbf = Number(total).toFixed(1) if (dex == 4) {
return total console.log('masuk')
dataTable2[tableMeta.rowIndex][10] = Number(total).toFixed(1)
console.log(dataTable2[tableMeta.rowIndex][10])
console.log(total)
return total
} else {
dataTable2[tableMeta.rowIndex][11] = Number(total).toFixed(1)
return total
}
} }
const handleParent = (tableMeta, type) => { const handleParent = (tableMeta, type) => {
...@@ -1149,49 +1143,27 @@ export default class TaxPlanningMR extends Component { ...@@ -1149,49 +1143,27 @@ export default class TaxPlanningMR extends Component {
/> />
</span> </span>
: :
// tableMeta.rowData[3] === 3 ? tableMeta.rowData[3] === 7 ?
// <div style={{ flex: 1 }}> // (Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) <= Number(this.state.maxValue)) ?
// <FormControlLabel (Number(value).toFixed(1) >= Number(this.state.minValue) && Number(value).toFixed(1) <= Number(this.state.maxValue)) ?
// style={{ margin: 0 }} <NumberFormat
// value={value} thousandSeparator={true}
// control={ style={{
// <NumberFormat fontSize: 12,
// thousandSeparator={true} textAlign: 'right',
// style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} borderColor: 'transparent',
// type="text" margin: 0,
// placeholder="input" width: 96,
// disabled={true} backgroundColor: 'transparent',
// value={Number(value).toFixed(1)} color: 'black'
// onBlur={(event) => { }}
// handleChange(event.target.value, tableMeta, 3) type="text"
// // console.log(dataTable2) placeholder=""
// }} disabled={true}
// /> // value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
// } value={Number(value).toFixed(1)}
// /> /> :
// </div> <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>
// :
// 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 <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ style={{
...@@ -1201,50 +1173,32 @@ export default class TaxPlanningMR extends Component { ...@@ -1201,50 +1173,32 @@ export default class TaxPlanningMR extends Component {
margin: 0, margin: 0,
width: 96, width: 96,
backgroundColor: 'transparent', backgroundColor: 'transparent',
color: 'black' color: 'red'
}} }}
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)} 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>
<NumberFormat :
thousandSeparator={true} <div style={{ flex: 1 }}>
style={{ <FormControlLabel
fontSize: 12, style={{ margin: 0 }}
textAlign: 'right', value={value}
borderColor: 'transparent', control={
margin: 0, <NumberFormat
width: 96, thousandSeparator={true}
backgroundColor: 'transparent', style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
color: 'red' type="text"
}} placeholder=""
type="text" disabled={true}
placeholder="" value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(handleTotal(value, tableMeta, 4)).toFixed(2) : Number(handleTotal(value, tableMeta, 4)).toFixed(1)}
disabled={true} />
// value={Number(handleValueFormula(value, tableMeta, 4)).toFixed(1)} }
value={Number(value).toFixed(1)} />
/> </div>
</LightTooltip>
:
<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={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value).toFixed(2) : Number(value).toFixed(1)}
/>
}
/>
</div>
} }
</div> </div>
...@@ -1283,49 +1237,27 @@ export default class TaxPlanningMR extends Component { ...@@ -1283,49 +1237,27 @@ export default class TaxPlanningMR extends Component {
/> />
</span> </span>
: :
// tableMeta.rowData[3] === 3 ? tableMeta.rowData[3] === 7 ?
// <div style={{ flex: 1 }}> // (Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) >= Number(this.state.minValue) && Number(handleValueFormula(value, tableMeta, 3)).toFixed(1) <= Number(this.state.maxValue)) ?
// <FormControlLabel (Number(value).toFixed(1) >= Number(this.state.minValue) && Number(value).toFixed(1) <= Number(this.state.maxValue)) ?
// style={{ margin: 0 }} <NumberFormat
// value={value} thousandSeparator={true}
// control={ style={{
// <NumberFormat fontSize: 12,
// thousandSeparator={true} textAlign: 'right',
// style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} borderColor: 'transparent',
// type="text" margin: 0,
// placeholder="input" width: 96,
// disabled={true} backgroundColor: 'transparent',
// value={Number(value).toFixed(1)} color: 'black'
// onBlur={(event) => { }}
// handleChange(event.target.value, tableMeta, 3) type="text"
// // console.log(dataTable2) placeholder=""
// }} disabled={true}
// /> // value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
// } value={Number(value).toFixed(1)}
// /> /> :
// </div> <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>
// :
// 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 <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ style={{
...@@ -1335,50 +1267,32 @@ export default class TaxPlanningMR extends Component { ...@@ -1335,50 +1267,32 @@ export default class TaxPlanningMR extends Component {
margin: 0, margin: 0,
width: 96, width: 96,
backgroundColor: 'transparent', backgroundColor: 'transparent',
color: 'black' color: 'red'
}} }}
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)} 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>
<NumberFormat :
thousandSeparator={true} <div style={{ flex: 1 }}>
style={{ <FormControlLabel
fontSize: 12, style={{ margin: 0 }}
textAlign: 'right', value={value}
borderColor: 'transparent', control={
margin: 0, <NumberFormat
width: 96, thousandSeparator={true}
backgroundColor: 'transparent', style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
color: 'red' type="text"
}} placeholder=""
type="text" disabled={true}
placeholder="" value={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(handleTotal(value, tableMeta, 5)).toFixed(2) : Number(handleTotal(value, tableMeta, 5)).toFixed(1)}
disabled={true} />
// value={Number(handleValueFormula(value, tableMeta, 4)).toFixed(1)} }
value={Number(value).toFixed(1)} />
/> </div>
</LightTooltip>
:
<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={String(tableMeta.rowData[8]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value).toFixed(2) : Number(value).toFixed(1)}
/>
}
/>
</div>
} }
</div> </div>
) )
...@@ -1546,7 +1460,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1546,7 +1460,7 @@ export default class TaxPlanningMR extends Component {
outline: 'none' outline: 'none'
}} }}
> >
<div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', marginLeft: 20 }}> <div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', marginLeft: 10 }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography>
</div> </div>
</button> </button>
...@@ -1628,7 +1542,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1628,7 +1542,7 @@ export default class TaxPlanningMR extends Component {
outline: 'none' outline: 'none'
}} }}
> >
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', marginRight: 20 }}> <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', marginRight: 10 }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</div> </div>
</button> </button>
...@@ -1667,7 +1581,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1667,7 +1581,7 @@ export default class TaxPlanningMR extends Component {
this.getItemHierarki() this.getItemHierarki()
}, 100); }, 100);
})} })}
style={{ marginRight: 20 }} style={{ marginRight: 20, marginLeft: 10 }}
> >
<div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <div style={{ backgroundColor: '#019ce5', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography>
...@@ -1741,7 +1655,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1741,7 +1655,7 @@ export default class TaxPlanningMR extends Component {
}, 100); }, 100);
})} })}
> >
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center', marginRight: 10 }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</div> </div>
</button> </button>
...@@ -1780,7 +1694,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1780,7 +1694,7 @@ export default class TaxPlanningMR extends Component {
this.setState({ uploadStatus: 'idle', percentage: '0' }) this.setState({ uploadStatus: 'idle', percentage: '0' })
}} }}
onUpload={() => { onUpload={() => {
String(this.state.judul).includes("TAX") && String(this.state.judul).includes("PLANNING") && String(this.state.judul).includes("MONTHLY") && String(this.state.judul).includes("REPORT") ? String(this.state.judulColumn).includes("TEMPLATE") && String(this.state.judulColumn).includes("UPLOAD") && String(this.state.judul).includes("TAX") && String(this.state.judul).includes("PLANNING") && String(this.state.judul).includes("MONTHLY") && String(this.state.judul).includes("REPORT") ?
this.checkUpload() : this.checkUpload() :
this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning' }) this.setState({ alert: true, messageAlert: "Invalid Template", tipeAlert: 'warning' })
}} }}
......
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