Commit cf0f2890 authored by Deni Rinaldi's avatar Deni Rinaldi

Merge branch 'rifka' into 'master'

tp-mr & ro

See merge request !680
parents 3838bdb2 b4b82c87
...@@ -980,7 +980,7 @@ export default class TaxPlanningMR extends Component { ...@@ -980,7 +980,7 @@ export default class TaxPlanningMR extends Component {
console.log(dataTable2) console.log(dataTable2)
let val = String(value).split(",").join("") let val = String(value).split(",").join("")
// let data = this.state.dataTable2 // let data = this.state.dataTable2
let indexParent = dataTable2.findIndex((val) => val[4] === dataTable2[tableMeta.rowIndex][5]) let indexParent = dataTable2.findIndex((val) => val[4] === dataTable2[tableMeta.rowIndex][2])
// ini buat input untuk perhitungan parent nya // ini buat input untuk perhitungan parent nya
if (indexParent > 0) { if (indexParent > 0) {
if (indexChilds == 1) { if (indexChilds == 1) {
...@@ -1141,7 +1141,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1141,7 +1141,7 @@ export default class TaxPlanningMR extends Component {
const handleParent = (tableMeta, type) => { const handleParent = (tableMeta, type) => {
let total = 0 let total = 0
dataTable2.map((item, index) => { dataTable2.map((item, index) => {
if (item[5] == tableMeta.rowData[4]) { if (item[2] == tableMeta.rowData[1]) {
total += Number(type == 1 ? total += Number(type == 1 ?
item[tableMeta.columnIndex].tbc.value == undefined ? Number(item[tableMeta.columnIndex].tbc == "" || item[tableMeta.columnIndex].tbc == "0.0" ? 0 : item[tableMeta.columnIndex].tbc) : Number(item[tableMeta.columnIndex].tbc.value == "" || item[tableMeta.columnIndex].tbc.value == "0.0" ? 0 : item[tableMeta.columnIndex].tbc.value) item[tableMeta.columnIndex].tbc.value == undefined ? Number(item[tableMeta.columnIndex].tbc == "" || item[tableMeta.columnIndex].tbc == "0.0" ? 0 : item[tableMeta.columnIndex].tbc) : Number(item[tableMeta.columnIndex].tbc.value == "" || item[tableMeta.columnIndex].tbc.value == "0.0" ? 0 : item[tableMeta.columnIndex].tbc.value)
: :
...@@ -1253,35 +1253,20 @@ export default class TaxPlanningMR extends Component { ...@@ -1253,35 +1253,20 @@ export default class TaxPlanningMR 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', width: 90 }}> <div style={{ textAlign: 'right', width: 90 }}>
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[5] === "Control (should be nil)" ?
null :
value.tbc
}
</div>
</div>
<div className="col-2">
<div style={{ textAlign: 'right', width: 90 }}>
{tableMeta.rowData[0] === 4 ?
null :
tableMeta.rowData[0] === 2 ?
null :
tableMeta.rowData[0] === 1 ?
null : null :
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
value={value.fcp} value={value.tbc}
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: "#5198ea", 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=""
value={String(tableMeta.rowData[5]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.fcp).toFixed(2) : Number(value.fcp).toFixed(1)} disabled={true}
onBlur={(event) => { value={Number(value.tbc).toFixed(1)}
handleChange(event.target.value, tableMeta, 1)
// console.log(dataTable2)
}}
/> />
} }
/> />
...@@ -1289,11 +1274,115 @@ export default class TaxPlanningMR extends Component { ...@@ -1289,11 +1274,115 @@ export default class TaxPlanningMR extends Component {
} }
</div> </div>
</div> </div>
<div className="col-2">
<div style={{ textAlign: 'right', width: 90 }}>
{tableMeta.rowData[0] === 4 ?
null
:
tableMeta.rowData[0] === 1 || tableMeta.rowData[5] === "Revenue" ?
null
:
tableMeta.rowData[0] === 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[0] === 5 ?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.fcp}
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.fcp).toFixed(1)}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}>
<FormControlLabel
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"
value={String(tableMeta.rowData[5]).toLocaleUpperCase() == "CORPORATE INCOME TAX" ? Number(value.fcp).toFixed(2) : Number(value.fcp).toFixed(1)}
onBlur={(event) => {
handleChange(event.target.value, tableMeta, 1)
// console.log(dataTable2)
}}
/>
}
/>
</div>
}
</div>
</div>
<div className="col-3"> <div className="col-3">
<div style={{ textAlign: 'right', width: 90 }}> <div style={{ textAlign: 'right', width: 90 }}>
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 4 ?
null : null :
value.tbf 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)) ?
<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[10].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>
:
<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)}
/>
} }
</div> </div>
</div> </div>
...@@ -1316,12 +1405,28 @@ export default class TaxPlanningMR extends Component { ...@@ -1316,12 +1405,28 @@ export default class TaxPlanningMR extends Component {
</th> </th>
), ),
setCellProps: () => ({ style2 }), setCellProps: () => ({ style2 }),
customBodyRender: (val, 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] === 4 ?
null : null
val :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.tbc}
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>
} }
</div> </div>
) )
...@@ -1341,12 +1446,28 @@ export default class TaxPlanningMR extends Component { ...@@ -1341,12 +1446,28 @@ export default class TaxPlanningMR extends Component {
</th> </th>
), ),
setCellProps: () => ({ style2 }), setCellProps: () => ({ style2 }),
customBodyRender: (val, 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] === 4 ?
null : null
val :
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value.tbc}
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>
} }
</div> </div>
) )
...@@ -1532,8 +1653,8 @@ export default class TaxPlanningMR extends Component { ...@@ -1532,8 +1653,8 @@ export default class TaxPlanningMR extends Component {
</div> </div>
</button> </button>
</div> </div>
{this.props.isApprover === true || this.state.dataTable.length == 0 ? null : {/* {this.props.isApprover === true || this.state.dataTable.length == 0 ? null :
(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') ? (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') ? */}
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}> <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button <button
className="button" className="button"
...@@ -1612,7 +1733,7 @@ export default class TaxPlanningMR extends Component { ...@@ -1612,7 +1733,7 @@ export default class TaxPlanningMR extends Component {
</div> </div>
</button> </button>
</div> </div>
: null } {/* : null } */}
</div> </div>
</Paper> </Paper>
: :
......
...@@ -15,6 +15,7 @@ import { DatePicker } from '@material-ui/pickers'; ...@@ -15,6 +15,7 @@ import { DatePicker } from '@material-ui/pickers';
import moment from 'moment'; import moment from 'moment';
import BalanceSheetRO from './RollingOutlook/BalanceSheetRO'; import BalanceSheetRO from './RollingOutlook/BalanceSheetRO';
import ProfitLossRO from './RollingOutlook/ProfitLossRO'; import ProfitLossRO from './RollingOutlook/ProfitLossRO';
import TaxPlanningRO from './RollingOutlook/TaxPlanningRO';
var ct = require("../library/CustomTable"); var ct = require("../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable()); const getMuiTheme = () => createMuiTheme(ct.customTable());
...@@ -1200,6 +1201,22 @@ export default class RollingOutlook extends Component { ...@@ -1200,6 +1201,22 @@ export default class RollingOutlook extends Component {
/> />
)} )}
{this.state.visibleTP && (
<TaxPlanningRO
width={this.props.width}
height={this.props.height}
open={this.props.open}
report_id={this.state.report_id}
company={this.state.company}
revision={this.state.revisionTable}
periode={this.state.periode.periode}
submissionID={this.state.submissionID}
onClickClose={() => this.setState({ visibleTP: false, visibleRollingOutlook: true })}
status={this.state.status}
lastStatus={this.state.lastStatus}
/>
)}
{this.state.visibleRevision && ( {this.state.visibleRevision && (
<div className="test app-popup-show"> <div className="test app-popup-show">
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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