Commit bd7c151b authored by d.arizona's avatar d.arizona

bismilaah

parent 8b8854ef
......@@ -717,6 +717,8 @@ export default class TaxPlanning extends Component {
render() {
let dataTable2 = this.state.dataTable
let dataFormula = []
let id = 0
let double = false
const handleValueFormula = (value, tableMeta, dex) => {
let form = dex === 1 ? tableMeta.rowData[6].tbc : dex === 2 ? tableMeta.rowData[6].fcp : tableMeta.rowData[6].tbf
let splitFormula = String(form).split('@')
......@@ -773,6 +775,9 @@ export default class TaxPlanning extends Component {
} else {
let indexID = dataTable2.findIndex((val) => val[24] == item)
if (indexID !== -1) {
if (dataTable2[indexID][24] == tableMeta.rowData[24]) {
anjay.push(0)
} 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 valuezz = data.value == undefined ? data : data.value
......@@ -781,6 +786,8 @@ export default class TaxPlanning extends Component {
// console.log(valuezz);
anjay.push(valuezz == "" ? 0 : valuezz)
}
}
}
}
})
......@@ -816,6 +823,7 @@ export default class TaxPlanning extends Component {
// console.log(anjay)
// console.log(total)
// console.log(splitFormula)
// 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 (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc.value == undefined) {
......@@ -1000,6 +1008,48 @@ export default class TaxPlanning extends Component {
}
const handleParent = (tableMeta, type) => {
// console.log(tableMeta)
let total = 0
dataTable2.map((item, index) => {
if (item[5] == tableMeta.rowData[4]) {
// if (type == 1) {
// console.log(item[tableMeta.columnIndex].tbc.value)
// console.log(item[tableMeta.columnIndex].tbc)
// } else
// if (type == 2) {
// console.log(item[tableMeta.columnIndex].fcp.value)
// console.log(item[tableMeta.columnIndex].fcp)}
// console.log(type)
// if (type == 3) {
// console.log(item[tableMeta.columnIndex].tbf.value)
// console.log(item[tableMeta.columnIndex].tbf)
// }
// console.log(item[4])
// console.log(tableMeta.rowData[5])
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)
:
(type == 2?
item[tableMeta.columnIndex].fcp.value == undefined? Number(item[tableMeta.columnIndex].fcp == "" || item[tableMeta.columnIndex].fcp == "0.0"? 0 : item[tableMeta.columnIndex].fcp) : Number(item[tableMeta.columnIndex].fcp.value == "" || item[tableMeta.columnIndex].fcp.value == "0.0"? 0 : item[tableMeta.columnIndex].fcp.value)
:
item[tableMeta.columnIndex].tbf.value == undefined? Number(item[tableMeta.columnIndex].tbf == "" || item[tableMeta.columnIndex].tbf == "0.0"? 0 : item[tableMeta.columnIndex].tbf) : Number(item[tableMeta.columnIndex].tbf.value == "" || item[tableMeta.columnIndex].tbf.value == "0.0"? 0 : item[tableMeta.columnIndex].tbf.value)
)
)
}
})
if (type == 1) {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbc = total
} else if (type == 2) {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].fcp = total
} else {
dataTable2[tableMeta.rowIndex][tableMeta.columnIndex].tbf = total
}
// console.log(dataTable2)
return total
}
const columns = [{
name: "",
options: {
......@@ -1140,7 +1190,7 @@ export default class TaxPlanning extends Component {
type="text"
placeholder=""
disabled={true}
// value={Number(handleValue(tableMeta)).toFixed(1)}
value={Number(handleParent(tableMeta, 1)).toFixed(1)}
/>
</span>
:
......@@ -1252,7 +1302,7 @@ export default class TaxPlanning extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
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(value.fcp).toFixed(1)}
onBlur={(event) => {
// updateValue(event.target.value)
......@@ -1272,7 +1322,7 @@ export default class TaxPlanning extends Component {
type="text"
placeholder=""
disabled={true}
value={Number(handleValue(tableMeta)).toFixed(1)}
value={Number(handleParent(tableMeta, 2)).toFixed(1)}
/>
</span>
:
......@@ -1403,7 +1453,7 @@ export default class TaxPlanning extends Component {
type="text"
placeholder=""
disabled={true}
// value={Number(handleValue(tableMeta)).toFixed(1)}
value={Number(handleParent(tableMeta, 3)).toFixed(1)}
/>
</span>
:
......@@ -7021,8 +7071,8 @@ export default class TaxPlanning extends Component {
</div>
</button>
</div>
{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.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') ? */}
<div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button
className="button"
......@@ -7095,8 +7145,7 @@ export default class TaxPlanning extends Component {
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</div>
</button>
</div> : null
}
</div>
</div>
</Paper>
:
......
......@@ -7,6 +7,7 @@ import Constant from '../library/Constant';
import api from '../api';
import { Link } from 'react-router-dom';
import { PropagateLoader } from 'react-spinners';
import { titleCase } from '../library/Utils';
var ct = require("../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable());
......@@ -94,7 +95,8 @@ class HomePage extends Component {
if (String(response.data.status).toLocaleLowerCase() == 'success') {
let data = response.data.data
data.map((item, index) => {
listDashboard.push([index + 1, item.approval_id, item.company_name, `${item.type_report} - ${item.periode}`, item.revision, item.status])
let statusConvert = item.status == 'approval_review'? 'Waiting For Review' : item.status == 'approval_proccess'? 'Waiting For Approval' : titleCase(item.status)
listDashboard.push([index + 1, item.approval_id, item.company_name, `${item.type_report} - ${item.periode}`, item.revision, item.status, statusConvert])
})
this.setState({ listDashboard, rawData: response.data.data })
}
......@@ -141,7 +143,13 @@ class HomePage extends Component {
}
render() {
const columns = ["#", "ID", "Company", "Report Type", "Revision", "Status", {
const columns = ["#", "ID", "Company", "Report Type", "Revision",
{
name: "",
options: {
display: false
}
}, 'Status', {
name: "Action",
options: {
customBodyRender: (val, tableMeta) => {
......@@ -240,7 +248,7 @@ class HomePage extends Component {
</div>
<div style={{ flex: 1, padding: 20, width: '100%' }}>
<div style={{ display: 'flex' }}>
<Typography style={{ color: '#656565', fontSize: '16px', fontWeight: 'bold' }}>Waiting Your Submission</Typography>
<Typography style={{ color: '#656565', fontSize: '16px', fontWeight: 'bold' }}>Waiting Your Approval</Typography>
</div>
</div>
......
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