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
870b7956
Commit
870b7956
authored
Sep 14, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'deni-dev(pc)' into 'master'
pormule See merge request
!293
parents
df1f8b97
b4f8677e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
285 additions
and
44 deletions
+285
-44
BalanceSheet.js
src/container/BudgetTahunan/BalanceSheet.js
+285
-44
No files found.
src/container/BudgetTahunan/BalanceSheet.js
View file @
870b7956
...
...
@@ -780,14 +780,13 @@ export default class BalanceSheet extends Component {
// console.log(indexParent);
return
a
}
const
handleFormula
=
(
data
,
tableMeta
,
column
)
=>
{
const
handleFormula
=
(
data
,
tableMeta
)
=>
{
let
arrayFormula
=
tableMeta
.
rowData
[
3
].
match
(
/
[
a-zA-Z
]
+|
[
0-9
]
+|
[
-!$%^&*()_+|~=`{}
\[\]
:";'<>?,.
\/]
+
(?:\.[
0-9
]
+@|
)
/g
)
let
arrayJumlah
=
[]
let
operator
=
[]
arrayFormula
.
map
((
item
,
indexs
)
=>
{
let
index
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
item
)
if
(
index
>
0
)
{
arrayJumlah
.
push
(
dataTable2
[
index
][
column
])
arrayJumlah
.
push
(
dataTable2
[
index
][
tableMeta
.
columnIndex
])
}
else
{
arrayJumlah
.
push
(
item
)
}
...
...
@@ -795,15 +794,33 @@ export default class BalanceSheet extends Component {
// operator.push(item)
// }
})
let
a
=
arrayJumlah
.
join
(
""
)
console
.
log
(
arrayJumlah
);
// if (arrayJumlah.length > 0) {
// console.log(arrayJumlah);
// let a = Number(arrayJumlah[0]) + Number(arrayJumlah[1])
// return a
// } else {
// return 'Formula'
// }
let
array
=
arrayJumlah
let
total
=
0
let
opt
=
""
array
.
map
((
item
,
index
)
=>
{
if
(
item
==
"+"
)
{
opt
=
"tambah"
}
else
if
(
item
==
"-"
)
{
opt
=
"kurang"
}
else
if
(
item
==
"*"
)
{
opt
=
"kali"
}
else
if
(
item
==
"/"
)
{
opt
=
"bagi"
}
else
{
if
(
opt
==
"tambah"
)
{
total
=
Number
(
total
)
+
Number
(
item
)
}
else
if
(
opt
==
"kurang"
)
{
total
=
Number
(
total
)
-
Number
(
item
)
}
else
if
(
opt
==
"kali"
)
{
total
=
Number
(
total
)
*
Number
(
item
)
}
else
if
(
opt
==
"bagi"
)
{
total
=
Number
(
total
)
/
Number
(
item
)
}
else
{
total
+=
item
}
}
})
return
total
}
const
columns
=
[{
...
...
@@ -903,10 +920,24 @@ export default class BalanceSheet extends Component {
null
:
tableMeta
.
rowData
[
0
]
===
6
?
<
span
>
Formula
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
5
?
<
span
>
{
handleFormula
(
value
,
tableMeta
,
6
)}
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
1
?
value
===
""
?
...
...
@@ -975,10 +1006,24 @@ export default class BalanceSheet extends Component {
null
:
tableMeta
.
rowData
[
0
]
===
6
?
<
span
>
Formula
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
5
?
<
span
>
Formula
Summary
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
1
?
value
===
""
?
...
...
@@ -1047,10 +1092,24 @@ export default class BalanceSheet extends Component {
null
:
tableMeta
.
rowData
[
0
]
===
6
?
<
span
>
Formula
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
5
?
<
span
>
Formula
Summary
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
1
?
value
===
""
?
...
...
@@ -1119,10 +1178,24 @@ export default class BalanceSheet extends Component {
null
:
tableMeta
.
rowData
[
0
]
===
6
?
<
span
>
Formula
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
5
?
<
span
>
Formula
Summary
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
1
?
value
===
""
?
...
...
@@ -1191,10 +1264,24 @@ export default class BalanceSheet extends Component {
null
:
tableMeta
.
rowData
[
0
]
===
6
?
<
span
>
Formula
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
5
?
<
span
>
Formula
Summary
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
1
?
value
===
""
?
...
...
@@ -1263,10 +1350,24 @@ export default class BalanceSheet extends Component {
null
:
tableMeta
.
rowData
[
0
]
===
6
?
<
span
>
Formula
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
5
?
<
span
>
Formula
Summary
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
1
?
value
===
""
?
...
...
@@ -1335,10 +1436,24 @@ export default class BalanceSheet extends Component {
null
:
tableMeta
.
rowData
[
0
]
===
6
?
<
span
>
Formula
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
5
?
<
span
>
Formula
Summary
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
1
?
value
===
""
?
...
...
@@ -1407,10 +1522,24 @@ export default class BalanceSheet extends Component {
null
:
tableMeta
.
rowData
[
0
]
===
6
?
<
span
>
Formula
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
5
?
<
span
>
Formula
Summary
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
1
?
value
===
""
?
...
...
@@ -1479,10 +1608,24 @@ export default class BalanceSheet extends Component {
null
:
tableMeta
.
rowData
[
0
]
===
6
?
<
span
>
Formula
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
5
?
<
span
>
Formula
Summary
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
1
?
value
===
""
?
...
...
@@ -1551,10 +1694,24 @@ export default class BalanceSheet extends Component {
null
:
tableMeta
.
rowData
[
0
]
===
6
?
<
span
>
Formula
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
5
?
<
span
>
Formula
Summary
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
1
?
value
===
""
?
...
...
@@ -1623,10 +1780,24 @@ export default class BalanceSheet extends Component {
null
:
tableMeta
.
rowData
[
0
]
===
6
?
<
span
>
Formula
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
5
?
<
span
>
Formula
Summary
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
1
?
value
===
""
?
...
...
@@ -1695,10 +1866,24 @@ export default class BalanceSheet extends Component {
null
:
tableMeta
.
rowData
[
0
]
===
6
?
<
span
>
Formula
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
5
?
<
span
>
Formula
Summary
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
1
?
value
===
""
?
...
...
@@ -1767,10 +1952,24 @@ export default class BalanceSheet extends Component {
null
:
tableMeta
.
rowData
[
0
]
===
6
?
<
span
>
Formula
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
5
?
<
span
>
Formula
Summary
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
1
?
value
===
""
?
...
...
@@ -1839,10 +2038,24 @@ export default class BalanceSheet extends Component {
null
:
tableMeta
.
rowData
[
0
]
===
6
?
<
span
>
Formula
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
5
?
<
span
>
Formula
Summary
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
1
?
value
===
""
?
...
...
@@ -1911,10 +2124,24 @@ export default class BalanceSheet extends Component {
null
:
tableMeta
.
rowData
[
0
]
===
6
?
<
span
>
Formula
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
5
?
<
span
>
Formula
Summary
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
1
?
value
===
""
?
...
...
@@ -1983,10 +2210,24 @@ export default class BalanceSheet extends Component {
null
:
tableMeta
.
rowData
[
0
]
===
6
?
<
span
>
Formula
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
5
?
<
span
>
Formula
Summary
<
/span
>
<
NumberFormat
thousandSeparator
=
{
true
}
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
,
borderColor
:
'transparent'
,
margin
:
0
,
width
:
96
,
backgroundColor
:
'transparent'
}}
type
=
"text"
placeholder
=
""
disabled
=
{
true
}
value
=
{
handleFormula
(
value
,
tableMeta
)}
/
>
:
tableMeta
.
rowData
[
0
]
===
1
?
value
===
""
?
...
...
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