Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Tia-dev
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dida Adams Arizona
Tia-dev
Commits
19e89efe
Commit
19e89efe
authored
Oct 13, 2020
by
Dida Adams Arizona
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'didam' into 'master'
bismilaah See merge request
!528
parents
8b8854ef
bd7c151b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
18 deletions
+75
-18
TaxPlanning.js
src/container/BudgetTahunan/TaxPlanning.js
+64
-15
HomePage.js
src/container/HomePage.js
+11
-3
No files found.
src/container/BudgetTahunan/TaxPlanning.js
View file @
19e89efe
...
@@ -717,6 +717,8 @@ export default class TaxPlanning extends Component {
...
@@ -717,6 +717,8 @@ export default class TaxPlanning extends Component {
render
()
{
render
()
{
let
dataTable2
=
this
.
state
.
dataTable
let
dataTable2
=
this
.
state
.
dataTable
let
dataFormula
=
[]
let
dataFormula
=
[]
let
id
=
0
let
double
=
false
const
handleValueFormula
=
(
value
,
tableMeta
,
dex
)
=>
{
const
handleValueFormula
=
(
value
,
tableMeta
,
dex
)
=>
{
let
form
=
dex
===
1
?
tableMeta
.
rowData
[
6
].
tbc
:
dex
===
2
?
tableMeta
.
rowData
[
6
].
fcp
:
tableMeta
.
rowData
[
6
].
tbf
let
form
=
dex
===
1
?
tableMeta
.
rowData
[
6
].
tbc
:
dex
===
2
?
tableMeta
.
rowData
[
6
].
fcp
:
tableMeta
.
rowData
[
6
].
tbf
let
splitFormula
=
String
(
form
).
split
(
'@'
)
let
splitFormula
=
String
(
form
).
split
(
'@'
)
...
@@ -773,6 +775,9 @@ export default class TaxPlanning extends Component {
...
@@ -773,6 +775,9 @@ export default class TaxPlanning extends Component {
}
else
{
}
else
{
let
indexID
=
dataTable2
.
findIndex
((
val
)
=>
val
[
24
]
==
item
)
let
indexID
=
dataTable2
.
findIndex
((
val
)
=>
val
[
24
]
==
item
)
if
(
indexID
!==
-
1
)
{
if
(
indexID
!==
-
1
)
{
if
(
dataTable2
[
indexID
][
24
]
==
tableMeta
.
rowData
[
24
])
{
anjay
.
push
(
0
)
}
else
{
// console.log(dataTable2[indexID][tableMeta.columnIndex]);
// 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
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
let
valuezz
=
data
.
value
==
undefined
?
data
:
data
.
value
...
@@ -781,6 +786,8 @@ export default class TaxPlanning extends Component {
...
@@ -781,6 +786,8 @@ export default class TaxPlanning extends Component {
// console.log(valuezz);
// console.log(valuezz);
anjay
.
push
(
valuezz
==
""
?
0
:
valuezz
)
anjay
.
push
(
valuezz
==
""
?
0
:
valuezz
)
}
}
}
}
}
}
}
})
})
...
@@ -816,6 +823,7 @@ export default class TaxPlanning extends Component {
...
@@ -816,6 +823,7 @@ export default class TaxPlanning extends Component {
// console.log(anjay)
// console.log(anjay)
// console.log(total)
// console.log(total)
// console.log(splitFormula)
// 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
// 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
(
dex
==
1
)
{
if
(
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
].
tbc
.
value
==
undefined
)
{
if
(
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
].
tbc
.
value
==
undefined
)
{
...
@@ -1000,6 +1008,48 @@ export default class TaxPlanning extends Component {
...
@@ -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
=
[{
const
columns
=
[{
name
:
""
,
name
:
""
,
options
:
{
options
:
{
...
@@ -1140,7 +1190,7 @@ export default class TaxPlanning extends Component {
...
@@ -1140,7 +1190,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
(
handleParent
(
tableMeta
,
1
)).
toFixed
(
1
)}
/
>
/
>
<
/span
>
<
/span
>
:
:
...
@@ -1252,7 +1302,7 @@ export default class TaxPlanning extends Component {
...
@@ -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'
}}
style
=
{{
color
:
"#5198ea"
,
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
(
value
.
fcp
).
toFixed
(
1
)}
value
=
{
Number
(
value
.
fcp
).
toFixed
(
1
)}
onBlur
=
{(
event
)
=>
{
onBlur
=
{(
event
)
=>
{
// updateValue(event.target.value)
// updateValue(event.target.value)
...
@@ -1272,7 +1322,7 @@ export default class TaxPlanning extends Component {
...
@@ -1272,7 +1322,7 @@ export default class TaxPlanning extends Component {
type
=
"text"
type
=
"text"
placeholder
=
""
placeholder
=
""
disabled
=
{
true
}
disabled
=
{
true
}
value
=
{
Number
(
handle
Value
(
tableMeta
)).
toFixed
(
1
)}
value
=
{
Number
(
handle
Parent
(
tableMeta
,
2
)).
toFixed
(
1
)}
/
>
/
>
<
/span
>
<
/span
>
:
:
...
@@ -1403,7 +1453,7 @@ export default class TaxPlanning extends Component {
...
@@ -1403,7 +1453,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
(
handleParent
(
tableMeta
,
3
)).
toFixed
(
1
)}
/
>
/
>
<
/span
>
<
/span
>
:
:
...
@@ -7021,8 +7071,8 @@ export default class TaxPlanning extends Component {
...
@@ -7021,8 +7071,8 @@ export default class TaxPlanning 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"
...
@@ -7095,8 +7145,7 @@ export default class TaxPlanning extends Component {
...
@@ -7095,8 +7145,7 @@ export default class TaxPlanning extends Component {
<
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
>
<
/div> : nul
l
<
/div
>
}
<
/div
>
<
/div
>
<
/Paper
>
<
/Paper
>
:
:
...
...
src/container/HomePage.js
View file @
19e89efe
...
@@ -7,6 +7,7 @@ import Constant from '../library/Constant';
...
@@ -7,6 +7,7 @@ import Constant from '../library/Constant';
import
api
from
'../api'
;
import
api
from
'../api'
;
import
{
Link
}
from
'react-router-dom'
;
import
{
Link
}
from
'react-router-dom'
;
import
{
PropagateLoader
}
from
'react-spinners'
;
import
{
PropagateLoader
}
from
'react-spinners'
;
import
{
titleCase
}
from
'../library/Utils'
;
var
ct
=
require
(
"../library/CustomTable"
);
var
ct
=
require
(
"../library/CustomTable"
);
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
const
getMuiTheme
=
()
=>
createMuiTheme
(
ct
.
customTable
());
...
@@ -94,7 +95,8 @@ class HomePage extends Component {
...
@@ -94,7 +95,8 @@ class HomePage extends Component {
if
(
String
(
response
.
data
.
status
).
toLocaleLowerCase
()
==
'success'
)
{
if
(
String
(
response
.
data
.
status
).
toLocaleLowerCase
()
==
'success'
)
{
let
data
=
response
.
data
.
data
let
data
=
response
.
data
.
data
data
.
map
((
item
,
index
)
=>
{
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
})
this
.
setState
({
listDashboard
,
rawData
:
response
.
data
.
data
})
}
}
...
@@ -141,7 +143,13 @@ class HomePage extends Component {
...
@@ -141,7 +143,13 @@ class HomePage extends Component {
}
}
render
()
{
render
()
{
const
columns
=
[
"#"
,
"ID"
,
"Company"
,
"Report Type"
,
"Revision"
,
"Status"
,
{
const
columns
=
[
"#"
,
"ID"
,
"Company"
,
"Report Type"
,
"Revision"
,
{
name
:
""
,
options
:
{
display
:
false
}
},
'Status'
,
{
name
:
"Action"
,
name
:
"Action"
,
options
:
{
options
:
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
customBodyRender
:
(
val
,
tableMeta
)
=>
{
...
@@ -240,7 +248,7 @@ class HomePage extends Component {
...
@@ -240,7 +248,7 @@ class HomePage extends Component {
<
/div
>
<
/div
>
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
<
div
style
=
{{
flex
:
1
,
padding
:
20
,
width
:
'100%'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
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
>
<
/div
>
<
/div
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment