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
9f7680c2
Commit
9f7680c2
authored
Oct 02, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'riri' into 'master'
apdet See merge request
!421
parents
c20dcfed
a5730bda
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
141 additions
and
125 deletions
+141
-125
ProfitLoss.js
src/container/BudgetTahunan/ProfitLoss.js
+141
-125
No files found.
src/container/BudgetTahunan/ProfitLoss.js
View file @
9f7680c2
...
@@ -498,11 +498,16 @@ export default class ProfitLoss extends Component {
...
@@ -498,11 +498,16 @@ export default class ProfitLoss extends Component {
total
+=
Number
(
valItem
)
total
+=
Number
(
valItem
)
}
}
})
})
let
indexParent
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
tableMeta
.
rowData
[
2
]
)
if
(
String
(
tableMeta
.
rowData
[
5
]).
toLocaleLowerCase
()
==
"sales price"
)
{
if
(
String
(
tableMeta
.
rowData
[
5
]).
toLocaleLowerCase
()
==
"sales price"
)
{
let
value
=
Number
(
dataTable2
[
tableMeta
.
rowIndex
-
2
][
20
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
-
1
][
20
])
let
value
=
Number
(
dataTable2
[
tableMeta
.
rowIndex
-
2
][
20
])
/
Number
(
dataTable2
[
tableMeta
.
rowIndex
-
1
][
20
])
dataTable2
[
tableMeta
.
rowIndex
][
20
]
=
R
.
equals
(
value
,
NaN
)
?
"0.0"
:
value
dataTable2
[
tableMeta
.
rowIndex
][
20
]
=
R
.
equals
(
value
,
NaN
)
?
"0.0"
:
value
return
R
.
equals
(
value
,
NaN
)
?
"0.0"
:
value
return
R
.
equals
(
value
,
NaN
)
?
"0.0"
:
value
}
else
{
}
else
if
(
indexParent
!==
-
1
&&
String
(
dataTable2
[
indexParent
][
5
]).
toLocaleUpperCase
()
==
"GROSS PROFIT MARGIN (% OF REVENUE)"
)
{
// console.log("oke")
return
handleFormula
(
0
,
tableMeta
,
0
)
}
else
{
dataTable2
[
tableMeta
.
rowIndex
][
20
]
=
total
dataTable2
[
tableMeta
.
rowIndex
][
20
]
=
total
return
total
return
total
...
@@ -769,15 +774,15 @@ export default class ProfitLoss extends Component {
...
@@ -769,15 +774,15 @@ export default class ProfitLoss extends Component {
// null
// null
:
:
tableMeta
.
rowData
[
0
]
===
5
?
tableMeta
.
rowData
[
0
]
===
5
?
//
<NumberFormat
<
NumberFormat
//
thousandSeparator={true}
thousandSeparator
=
{
true
}
//
style={{ 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=""
placeholder
=
""
//
disabled={true}
disabled
=
{
true
}
// value={handleFormula(value, tableMeta
)}
value
=
{
Number
(
handleFormula
(
value
,
tableMeta
,
1
)).
toFixed
(
1
)}
/
/ /
>
/
>
null
//
null
:
:
tableMeta
.
rowData
[
0
]
===
1
?
tableMeta
.
rowData
[
0
]
===
1
?
// value === "" ?
// value === "" ?
...
@@ -859,15 +864,15 @@ export default class ProfitLoss extends Component {
...
@@ -859,15 +864,15 @@ export default class ProfitLoss extends Component {
// null
// null
:
:
tableMeta
.
rowData
[
0
]
===
5
?
tableMeta
.
rowData
[
0
]
===
5
?
//
<NumberFormat
<
NumberFormat
//
thousandSeparator={true}
thousandSeparator
=
{
true
}
//
style={{ 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=""
placeholder
=
""
//
disabled={true}
disabled
=
{
true
}
// value={handleFormula(value, tableMeta
)}
value
=
{
Number
(
handleFormula
(
value
,
tableMeta
,
2
)).
toFixed
(
1
)}
/
/ /
>
/
>
null
//
null
:
:
tableMeta
.
rowData
[
0
]
===
1
?
tableMeta
.
rowData
[
0
]
===
1
?
// value === "" ?
// value === "" ?
...
@@ -949,15 +954,15 @@ export default class ProfitLoss extends Component {
...
@@ -949,15 +954,15 @@ export default class ProfitLoss extends Component {
// null
// null
:
:
tableMeta
.
rowData
[
0
]
===
5
?
tableMeta
.
rowData
[
0
]
===
5
?
//
<NumberFormat
<
NumberFormat
//
thousandSeparator={true}
thousandSeparator
=
{
true
}
//
style={{ 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=""
placeholder
=
""
//
disabled={true}
disabled
=
{
true
}
// value={handleFormula(value, tableMeta
)}
value
=
{
Number
(
handleFormula
(
value
,
tableMeta
,
3
)).
toFixed
(
1
)}
/
/ /
>
/
>
null
//
null
:
:
tableMeta
.
rowData
[
0
]
===
1
?
tableMeta
.
rowData
[
0
]
===
1
?
// value === "" ?
// value === "" ?
...
@@ -1039,15 +1044,15 @@ export default class ProfitLoss extends Component {
...
@@ -1039,15 +1044,15 @@ export default class ProfitLoss extends Component {
// null
// null
:
:
tableMeta
.
rowData
[
0
]
===
5
?
tableMeta
.
rowData
[
0
]
===
5
?
//
<NumberFormat
<
NumberFormat
//
thousandSeparator={true}
thousandSeparator
=
{
true
}
//
style={{ 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=""
placeholder
=
""
//
disabled={true}
disabled
=
{
true
}
// value={handleFormula(value, tableMeta
)}
value
=
{
Number
(
handleFormula
(
value
,
tableMeta
,
4
)).
toFixed
(
1
)}
/
/ /
>
/
>
null
//
null
:
:
tableMeta
.
rowData
[
0
]
===
1
?
tableMeta
.
rowData
[
0
]
===
1
?
// value === "" ?
// value === "" ?
...
@@ -1129,15 +1134,15 @@ export default class ProfitLoss extends Component {
...
@@ -1129,15 +1134,15 @@ export default class ProfitLoss extends Component {
// null
// null
:
:
tableMeta
.
rowData
[
0
]
===
5
?
tableMeta
.
rowData
[
0
]
===
5
?
//
<NumberFormat
<
NumberFormat
//
thousandSeparator={true}
thousandSeparator
=
{
true
}
//
style={{ 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=""
placeholder
=
""
//
disabled={true}
disabled
=
{
true
}
// value={handleFormula(value, tableMeta
)}
value
=
{
Number
(
handleFormula
(
value
,
tableMeta
,
5
)).
toFixed
(
1
)}
/
/ /
>
/
>
null
//
null
:
:
tableMeta
.
rowData
[
0
]
===
1
?
tableMeta
.
rowData
[
0
]
===
1
?
// value === "" ?
// value === "" ?
...
@@ -1219,15 +1224,15 @@ export default class ProfitLoss extends Component {
...
@@ -1219,15 +1224,15 @@ export default class ProfitLoss extends Component {
// null
// null
:
:
tableMeta
.
rowData
[
0
]
===
5
?
tableMeta
.
rowData
[
0
]
===
5
?
//
<NumberFormat
<
NumberFormat
//
thousandSeparator={true}
thousandSeparator
=
{
true
}
//
style={{ 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=""
placeholder
=
""
//
disabled={true}
disabled
=
{
true
}
// value={handleFormula(value, tableMeta
)}
value
=
{
Number
(
handleFormula
(
value
,
tableMeta
,
6
)).
toFixed
(
1
)}
/
/ /
>
/
>
null
//
null
:
:
tableMeta
.
rowData
[
0
]
===
1
?
tableMeta
.
rowData
[
0
]
===
1
?
// value === "" ?
// value === "" ?
...
@@ -1309,15 +1314,15 @@ export default class ProfitLoss extends Component {
...
@@ -1309,15 +1314,15 @@ export default class ProfitLoss extends Component {
// null
// null
:
:
tableMeta
.
rowData
[
0
]
===
5
?
tableMeta
.
rowData
[
0
]
===
5
?
//
<NumberFormat
<
NumberFormat
//
thousandSeparator={true}
thousandSeparator
=
{
true
}
//
style={{ 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=""
placeholder
=
""
//
disabled={true}
disabled
=
{
true
}
// value={handleFormula(value, tableMeta
)}
value
=
{
Number
(
handleFormula
(
value
,
tableMeta
,
7
)).
toFixed
(
1
)}
/
/ /
>
/
>
null
//
null
:
:
tableMeta
.
rowData
[
0
]
===
1
?
tableMeta
.
rowData
[
0
]
===
1
?
// value === "" ?
// value === "" ?
...
@@ -1399,15 +1404,15 @@ export default class ProfitLoss extends Component {
...
@@ -1399,15 +1404,15 @@ export default class ProfitLoss extends Component {
// null
// null
:
:
tableMeta
.
rowData
[
0
]
===
5
?
tableMeta
.
rowData
[
0
]
===
5
?
//
<NumberFormat
<
NumberFormat
//
thousandSeparator={true}
thousandSeparator
=
{
true
}
//
style={{ 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=""
placeholder
=
""
//
disabled={true}
disabled
=
{
true
}
// value={handleFormula(value, tableMeta
)}
value
=
{
Number
(
handleFormula
(
value
,
tableMeta
,
8
)).
toFixed
(
1
)}
/
/ /
>
/
>
null
//
null
:
:
tableMeta
.
rowData
[
0
]
===
1
?
tableMeta
.
rowData
[
0
]
===
1
?
// value === "" ?
// value === "" ?
...
@@ -1489,15 +1494,15 @@ export default class ProfitLoss extends Component {
...
@@ -1489,15 +1494,15 @@ export default class ProfitLoss extends Component {
// null
// null
:
:
tableMeta
.
rowData
[
0
]
===
5
?
tableMeta
.
rowData
[
0
]
===
5
?
//
<NumberFormat
<
NumberFormat
//
thousandSeparator={true}
thousandSeparator
=
{
true
}
//
style={{ 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=""
placeholder
=
""
//
disabled={true}
disabled
=
{
true
}
// value={handleFormula(value, tableMeta
)}
value
=
{
Number
(
handleFormula
(
value
,
tableMeta
,
9
)).
toFixed
(
1
)}
/
/ /
>
/
>
null
//
null
:
:
tableMeta
.
rowData
[
0
]
===
1
?
tableMeta
.
rowData
[
0
]
===
1
?
// value === "" ?
// value === "" ?
...
@@ -1579,15 +1584,15 @@ export default class ProfitLoss extends Component {
...
@@ -1579,15 +1584,15 @@ export default class ProfitLoss extends Component {
// null
// null
:
:
tableMeta
.
rowData
[
0
]
===
5
?
tableMeta
.
rowData
[
0
]
===
5
?
//
<NumberFormat
<
NumberFormat
//
thousandSeparator={true}
thousandSeparator
=
{
true
}
//
style={{ 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=""
placeholder
=
""
//
disabled={true}
disabled
=
{
true
}
// value={handleFormula(value, tableMeta
)}
value
=
{
Number
(
handleFormula
(
value
,
tableMeta
,
10
)).
toFixed
(
1
)}
/
/ /
>
/
>
null
//
null
:
:
tableMeta
.
rowData
[
0
]
===
1
?
tableMeta
.
rowData
[
0
]
===
1
?
// value === "" ?
// value === "" ?
...
@@ -1669,15 +1674,15 @@ export default class ProfitLoss extends Component {
...
@@ -1669,15 +1674,15 @@ export default class ProfitLoss extends Component {
// null
// null
:
:
tableMeta
.
rowData
[
0
]
===
5
?
tableMeta
.
rowData
[
0
]
===
5
?
//
<NumberFormat
<
NumberFormat
//
thousandSeparator={true}
thousandSeparator
=
{
true
}
//
style={{ 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=""
placeholder
=
""
//
disabled={true}
disabled
=
{
true
}
// value={handleFormula(value, tableMeta
)}
value
=
{
Number
(
handleFormula
(
value
,
tableMeta
,
11
)).
toFixed
(
1
)}
/
/ /
>
/
>
null
//
null
:
:
tableMeta
.
rowData
[
0
]
===
1
?
tableMeta
.
rowData
[
0
]
===
1
?
// value === "" ?
// value === "" ?
...
@@ -1759,15 +1764,15 @@ export default class ProfitLoss extends Component {
...
@@ -1759,15 +1764,15 @@ export default class ProfitLoss extends Component {
// null
// null
:
:
tableMeta
.
rowData
[
0
]
===
5
?
tableMeta
.
rowData
[
0
]
===
5
?
//
<NumberFormat
<
NumberFormat
//
thousandSeparator={true}
thousandSeparator
=
{
true
}
//
style={{ 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=""
placeholder
=
""
//
disabled={true}
disabled
=
{
true
}
// value={handleFormula(value, tableMeta
)}
value
=
{
Number
(
handleFormula
(
value
,
tableMeta
,
12
)).
toFixed
(
1
)}
/
/ /
>
/
>
null
//
null
:
:
tableMeta
.
rowData
[
0
]
===
1
?
tableMeta
.
rowData
[
0
]
===
1
?
// value === "" ?
// value === "" ?
...
@@ -1812,6 +1817,15 @@ export default class ProfitLoss extends Component {
...
@@ -1812,6 +1817,15 @@ export default class ProfitLoss extends Component {
value
=
{
Number
(
handleValue
(
tableMeta
)).
toFixed
(
1
)}
value
=
{
Number
(
handleValue
(
tableMeta
)).
toFixed
(
1
)}
/
>
/
>
<
/span>
:
<
/span>
:
// tableMeta.rowData[0] === 6 ?
// <NumberFormat
// thousandSeparator={true}
// style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
// type="text"
// placeholder=""
// disabled={true}
// value={Number(handleFormula(value, tableMeta, 12)).toFixed(1)}
// /> :
<
span
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
}}
>
<
span
style
=
{{
fontSize
:
12
,
textAlign
:
'right'
}}
>
<
NumberFormat
<
NumberFormat
thousandSeparator
=
{
true
}
thousandSeparator
=
{
true
}
...
@@ -2288,7 +2302,8 @@ export default class ProfitLoss extends Component {
...
@@ -2288,7 +2302,8 @@ export default class ProfitLoss extends Component {
}}
}}
onClick
=
{()
=>
onClick
=
{()
=>
this
.
state
.
editable
===
true
?
this
.
state
.
editable
===
true
?
null
:
this
.
setState
({
loading
:
true
},
()
=>
null
:
this
.
setState
({
loading
:
true
},
()
=>
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
setState
({
handleTekTekTek
:
1
},
()
=>
{
this
.
setState
({
handleTekTekTek
:
1
},
()
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
@@ -2312,7 +2327,8 @@ export default class ProfitLoss extends Component {
...
@@ -2312,7 +2327,8 @@ export default class ProfitLoss extends Component {
}}
}}
onClick
=
{()
=>
onClick
=
{()
=>
this
.
state
.
editable
===
true
?
this
.
state
.
editable
===
true
?
null
:
this
.
setState
({
loading
:
true
},
()
=>
null
:
this
.
setState
({
loading
:
true
},
()
=>
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
setState
({
handleTekTekTek
:
1
},
()
=>
{
this
.
setState
({
handleTekTekTek
:
1
},
()
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
...
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