Commit eb23bd59 authored by Rifka Kurnia Irfiana's avatar Rifka Kurnia Irfiana

push

parent dd6887b9
...@@ -590,7 +590,7 @@ export default class TaxPlanning extends Component { ...@@ -590,7 +590,7 @@ export default class TaxPlanning extends Component {
let data = [] let data = []
console.log(this.state.dataTable) console.log(this.state.dataTable)
this.state.dataTable.map(i => { this.state.dataTable.map(i => {
console.log(i[0]) // console.log(i[0])
data.push({ data.push({
item_report_id: i[4], item_report_id: i[4],
january: { january: {
...@@ -1018,16 +1018,30 @@ export default class TaxPlanning extends Component { ...@@ -1018,16 +1018,30 @@ export default class TaxPlanning extends Component {
} }
} }
} }
const handleTotal = (tableMeta) => { const handleTotal = (tableMeta, dex) => {
let total = 0 let total = 0
dataTable2[tableMeta.rowIndex].map((item, index) => { dataTable2[tableMeta.rowIndex].map((item, index) => {
if (index >= 9 && index <= 20) { if (index >= 9 && index <= 20) {
// console.log(item); if ( tableMeta.rowData[3] === 5 || tableMeta.rowData[3] === 6 || tableMeta.rowData[3] === 7 ) {
let valItem = item.fcp == undefined || item.fcp == "" || item.fcp == "undefined" ? 0 : item.fcp let valItem = item.tbf.value == undefined || item.tbf.value == "" || item.tbf.value == "undefined" ? 0.0 : item.tbf.value
total += Number(valItem) total += Number(valItem)
} else {
if (dataTable2[tableMeta.rowIndex][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][21] = total dataTable2[tableMeta.rowIndex][21] = total
if (tableMeta.rowData[8] === "Fiscal Correction positive / (negative) Year To Date"){
console.log("masuk")
console.log(total)
}
return total return total
} }
const handleValue = (data) => { const handleValue = (data) => {
...@@ -6421,36 +6435,24 @@ export default class TaxPlanning extends Component { ...@@ -6421,36 +6435,24 @@ export default class TaxPlanning extends Component {
<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' }}>
{tableMeta.rowData[2] === 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=""
// value={value.tbc}
// onBlur={(event) => {
// // updateValue(event.target.value)
// // handleChange(event.target.value, tableMeta)
// console.log(event.target.value)
// }}
// />
<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="input" 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)} 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)).toFixed(1)} value={Number(handleTotal(tableMeta, 3)).toFixed(1)}
/> />
} }
/> />
</div> : </div> :
tableMeta.rowData[1] === 2 ? tableMeta.rowData[3] === 2 ?
<span style={{ fontSize: 12, textAlign: 'right' }}> <span style={{ fontSize: 12, textAlign: 'right' }}>
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
...@@ -6458,7 +6460,7 @@ export default class TaxPlanning extends Component { ...@@ -6458,7 +6460,7 @@ export default class TaxPlanning extends Component {
type="text" type="text"
placeholder="" placeholder=""
disabled={true} disabled={true}
// value={Number(handleValue(tableMeta)).toFixed(1)} value={Number(handleTotal(tableMeta, 2)).toFixed(1)}
/> />
</span> </span>
: :
...@@ -6466,39 +6468,34 @@ export default class TaxPlanning extends Component { ...@@ -6466,39 +6468,34 @@ export default class TaxPlanning extends Component {
null null
: :
tableMeta.rowData[1] === 6 ? tableMeta.rowData[1] === 6 ?
// <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(handleFormula(value, tableMeta)).toFixed(1)} value={Number(handleTotal(tableMeta, 6)).toFixed(1)}
// /> />
null
: :
tableMeta.rowData[1] === 5 ? tableMeta.rowData[1] === 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(handleFormula(value, tableMeta)).toFixed(1)} value={Number(handleTotal(tableMeta, 5)).toFixed(1)}
// /> />
null
: :
tableMeta.rowData[1] === 1 ? tableMeta.rowData[1] === 1 ?
// value[0] === "" ? <NumberFormat
// null : thousandSeparator={true}
// <NumberFormat style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// thousandSeparator={true} type="text"
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} placeholder=""
// type="text" disabled={true}
// placeholder="" value={Number(handleTotal(tableMeta, 1)).toFixed(1)}
// disabled={true} />
// value={Number(value[0])}
// />
null
: :
null null
} }
......
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