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
6450e96a
Commit
6450e96a
authored
Sep 17, 2020
by
EKSAD
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
53d5c621
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
43 deletions
+43
-43
ProfitLoss.js
src/container/BudgetTahunan/ProfitLoss.js
+43
-43
No files found.
src/container/BudgetTahunan/ProfitLoss.js
View file @
6450e96a
...
@@ -404,50 +404,50 @@ export default class ProfitLoss extends Component {
...
@@ -404,50 +404,50 @@ export default class ProfitLoss extends Component {
// console.log(indexParent);
// console.log(indexParent);
return
a
return
a
}
}
//
const handleFormula = (data, tableMeta) => {
const
handleFormula
=
(
data
,
tableMeta
)
=>
{
//
let arrayFormula = tableMeta.rowData[3].match(/[a-zA-Z]+|[0-9]+|[-!$%^&*()_+|~=`{}\[\]:";'<>?,.\/]+(?:\.[0-9]+@|)/g)
let
arrayFormula
=
tableMeta
.
rowData
[
3
].
match
(
/
[
a-zA-Z
]
+|
[
0-9
]
+|
[
-!$%^&*()_+|~=`{}
\[\]
:";'<>?,.
\/]
+
(?:\.[
0-9
]
+@|
)
/g
)
//
let arrayJumlah = []
let
arrayJumlah
=
[]
//
arrayFormula.map((item, indexs) => {
arrayFormula
.
map
((
item
,
indexs
)
=>
{
//
let index = dataTable2.findIndex((val) => val[1] == item)
let
index
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
item
)
//
if (index > 0) {
if
(
index
>
0
)
{
//
arrayJumlah.push(dataTable2[index][tableMeta.columnIndex])
arrayJumlah
.
push
(
dataTable2
[
index
][
tableMeta
.
columnIndex
])
//
} else {
}
else
{
//
arrayJumlah.push(item)
arrayJumlah
.
push
(
item
)
//
}
}
//
// if (indexs % 2 !== 0) {
// if (indexs % 2 !== 0) {
//
// operator.push(item)
// operator.push(item)
//
// }
// }
//
})
})
//
let array = arrayJumlah
let
array
=
arrayJumlah
//
let total = 0
let
total
=
0
//
let opt = ""
let
opt
=
""
//
array.map((item, index) => {
array
.
map
((
item
,
index
)
=>
{
//
if (item == "+") {
if
(
item
==
"+"
)
{
//
opt = "tambah"
opt
=
"tambah"
//
} else if (item == "-") {
}
else
if
(
item
==
"-"
)
{
//
opt = "kurang"
opt
=
"kurang"
//
} else if (item == "*") {
}
else
if
(
item
==
"*"
)
{
//
opt = "kali"
opt
=
"kali"
//
} else if (item == "/") {
}
else
if
(
item
==
"/"
)
{
//
opt = "bagi"
opt
=
"bagi"
//
} else {
}
else
{
//
if (opt == "tambah") {
if
(
opt
==
"tambah"
)
{
//
total = Number(total) + Number(item)
total
=
Number
(
total
)
+
Number
(
item
)
//
} else if (opt == "kurang") {
}
else
if
(
opt
==
"kurang"
)
{
//
total = Number(total) - Number(item)
total
=
Number
(
total
)
-
Number
(
item
)
//
} else if (opt == "kali") {
}
else
if
(
opt
==
"kali"
)
{
//
total = Number(total) * Number(item)
total
=
Number
(
total
)
*
Number
(
item
)
//
} else if (opt == "bagi") {
}
else
if
(
opt
==
"bagi"
)
{
//
total = Number(total) / Number(item)
total
=
Number
(
total
)
/
Number
(
item
)
//
} else {
}
else
{
//
total += item
total
+=
item
//
}
}
//
}
}
//
})
})
//
let a = dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] = Number(total)
let
a
=
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
total
)
//
return a
return
a
//
}
}
const
columns
=
[{
const
columns
=
[{
name
:
""
,
name
:
""
,
...
...
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