Commit 31aba3e5 authored by Riri Novita's avatar Riri Novita

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

parents 0721b43f 5f1c12ec
......@@ -304,8 +304,9 @@ export default class TaxPlanningMR extends Component {
months: this.props.month.month_id,
tax_planning: payload
}
this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[2] })
// console.log(this.state.judulColumn)
this.setState({ payload: body, judul: resp.rows[1][0], judulColumn: resp.rows[0][0] })
console.log(this.state.judulColumn)
console.log(this.state.judul)
}
});
}
......@@ -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
// 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) => {
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
total = Number(valItemTBC) + Number(valItemFCP)
// console.log(valItemFCP)
total = Number(value) + Number(valItemFCP)
}
})
dataTable2[tableMeta.rowIndex][9].tbf = Number(total).toFixed(1)
return total
if (dex == 4) {
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) => {
......@@ -1149,49 +1143,27 @@ export default class TaxPlanningMR extends Component {
/>
</span>
:
// tableMeta.rowData[3] === 3 ?
// <div style={{ flex: 1 }}>
// <FormControlLabel
// style={{ margin: 0 }}
// value={value}
// 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)) ?
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
thousandSeparator={true}
style={{
......@@ -1201,50 +1173,32 @@ export default class TaxPlanningMR extends Component {
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'black'
color: 'red'
}}
type="text"
placeholder=""
disabled={true}
// value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
// value={Number(handleValueFormula(value, tableMeta, 4)).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
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, 4)).toFixed(1)}
value={Number(value).toFixed(1)}
/>
</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>
/>
</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(handleTotal(value, tableMeta, 4)).toFixed(2) : Number(handleTotal(value, tableMeta, 4)).toFixed(1)}
/>
}
/>
</div>
}
</div>
......@@ -1283,49 +1237,27 @@ export default class TaxPlanningMR extends Component {
/>
</span>
:
// tableMeta.rowData[3] === 3 ?
// <div style={{ flex: 1 }}>
// <FormControlLabel
// style={{ margin: 0 }}
// value={value}
// 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)) ?
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
thousandSeparator={true}
style={{
......@@ -1335,50 +1267,32 @@ export default class TaxPlanningMR extends Component {
margin: 0,
width: 96,
backgroundColor: 'transparent',
color: 'black'
color: 'red'
}}
type="text"
placeholder=""
disabled={true}
// value={Number(handleValueFormula(value, tableMeta, 3)).toFixed(1)}
// value={Number(handleValueFormula(value, tableMeta, 4)).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
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, 4)).toFixed(1)}
value={Number(value).toFixed(1)}
/>
</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>
/>
</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(handleTotal(value, tableMeta, 5)).toFixed(2) : Number(handleTotal(value, tableMeta, 5)).toFixed(1)}
/>
}
/>
</div>
}
</div>
)
......@@ -1546,7 +1460,7 @@ export default class TaxPlanningMR extends Component {
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>
</div>
</button>
......@@ -1628,7 +1542,7 @@ export default class TaxPlanningMR extends Component {
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>
</div>
</button>
......@@ -1667,7 +1581,7 @@ export default class TaxPlanningMR extends Component {
this.getItemHierarki()
}, 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' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Back</Typography>
......@@ -1741,7 +1655,7 @@ export default class TaxPlanningMR extends Component {
}, 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>
</div>
</button>
......@@ -1780,7 +1694,7 @@ export default class TaxPlanningMR extends Component {
this.setState({ uploadStatus: 'idle', percentage: '0' })
}}
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.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