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
1404374e
Commit
1404374e
authored
Oct 02, 2020
by
EKSAD
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pormula
parent
bfe70c4c
Changes
1
Hide 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 @
1404374e
...
...
@@ -498,11 +498,16 @@ export default class ProfitLoss extends Component {
total
+=
Number
(
valItem
)
}
})
let
indexParent
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
tableMeta
.
rowData
[
2
]
)
if
(
String
(
tableMeta
.
rowData
[
5
]).
toLocaleLowerCase
()
==
"sales price"
)
{
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
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
return
total
...
...
@@ -769,15 +774,15 @@ export default class ProfitLoss extends Component {
// null
:
tableMeta
.
rowData
[
0
]
===
5
?
//
<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
)}
/
/ /
>
null
<
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
,
1
)).
toFixed
(
1
)}
/
>
//
null
:
tableMeta
.
rowData
[
0
]
===
1
?
// value === "" ?
...
...
@@ -859,15 +864,15 @@ export default class ProfitLoss extends Component {
// null
:
tableMeta
.
rowData
[
0
]
===
5
?
//
<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
)}
/
/ /
>
null
<
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
,
2
)).
toFixed
(
1
)}
/
>
//
null
:
tableMeta
.
rowData
[
0
]
===
1
?
// value === "" ?
...
...
@@ -949,15 +954,15 @@ export default class ProfitLoss extends Component {
// null
:
tableMeta
.
rowData
[
0
]
===
5
?
//
<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
)}
/
/ /
>
null
<
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
,
3
)).
toFixed
(
1
)}
/
>
//
null
:
tableMeta
.
rowData
[
0
]
===
1
?
// value === "" ?
...
...
@@ -1039,15 +1044,15 @@ export default class ProfitLoss extends Component {
// null
:
tableMeta
.
rowData
[
0
]
===
5
?
//
<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
)}
/
/ /
>
null
<
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
,
4
)).
toFixed
(
1
)}
/
>
//
null
:
tableMeta
.
rowData
[
0
]
===
1
?
// value === "" ?
...
...
@@ -1129,15 +1134,15 @@ export default class ProfitLoss extends Component {
// null
:
tableMeta
.
rowData
[
0
]
===
5
?
//
<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
)}
/
/ /
>
null
<
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
,
5
)).
toFixed
(
1
)}
/
>
//
null
:
tableMeta
.
rowData
[
0
]
===
1
?
// value === "" ?
...
...
@@ -1219,15 +1224,15 @@ export default class ProfitLoss extends Component {
// null
:
tableMeta
.
rowData
[
0
]
===
5
?
//
<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
)}
/
/ /
>
null
<
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
,
6
)).
toFixed
(
1
)}
/
>
//
null
:
tableMeta
.
rowData
[
0
]
===
1
?
// value === "" ?
...
...
@@ -1309,15 +1314,15 @@ export default class ProfitLoss extends Component {
// null
:
tableMeta
.
rowData
[
0
]
===
5
?
//
<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
)}
/
/ /
>
null
<
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
,
7
)).
toFixed
(
1
)}
/
>
//
null
:
tableMeta
.
rowData
[
0
]
===
1
?
// value === "" ?
...
...
@@ -1399,15 +1404,15 @@ export default class ProfitLoss extends Component {
// null
:
tableMeta
.
rowData
[
0
]
===
5
?
//
<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
)}
/
/ /
>
null
<
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
,
8
)).
toFixed
(
1
)}
/
>
//
null
:
tableMeta
.
rowData
[
0
]
===
1
?
// value === "" ?
...
...
@@ -1489,15 +1494,15 @@ export default class ProfitLoss extends Component {
// null
:
tableMeta
.
rowData
[
0
]
===
5
?
//
<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
)}
/
/ /
>
null
<
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
,
9
)).
toFixed
(
1
)}
/
>
//
null
:
tableMeta
.
rowData
[
0
]
===
1
?
// value === "" ?
...
...
@@ -1579,15 +1584,15 @@ export default class ProfitLoss extends Component {
// null
:
tableMeta
.
rowData
[
0
]
===
5
?
//
<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
)}
/
/ /
>
null
<
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
,
10
)).
toFixed
(
1
)}
/
>
//
null
:
tableMeta
.
rowData
[
0
]
===
1
?
// value === "" ?
...
...
@@ -1669,15 +1674,15 @@ export default class ProfitLoss extends Component {
// null
:
tableMeta
.
rowData
[
0
]
===
5
?
//
<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
)}
/
/ /
>
null
<
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
,
11
)).
toFixed
(
1
)}
/
>
//
null
:
tableMeta
.
rowData
[
0
]
===
1
?
// value === "" ?
...
...
@@ -1759,15 +1764,15 @@ export default class ProfitLoss extends Component {
// null
:
tableMeta
.
rowData
[
0
]
===
5
?
//
<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
)}
/
/ /
>
null
<
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
)}
/
>
//
null
:
tableMeta
.
rowData
[
0
]
===
1
?
// value === "" ?
...
...
@@ -1812,6 +1817,15 @@ export default class ProfitLoss extends Component {
value
=
{
Number
(
handleValue
(
tableMeta
)).
toFixed
(
1
)}
/
>
<
/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'
}}
>
<
NumberFormat
thousandSeparator
=
{
true
}
...
...
@@ -2288,14 +2302,15 @@ export default class ProfitLoss extends Component {
}}
onClick
=
{()
=>
this
.
state
.
editable
===
true
?
null
:
this
.
setState
({
loading
:
true
},
()
=>
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
setState
({
handleTekTekTek
:
1
},
()
=>
{
setTimeout
(()
=>
{
this
.
uploadProfitLoss
(
'draft'
)
},
100
);
})
)
null
:
this
.
setState
({
loading
:
true
},
()
=>
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
setState
({
handleTekTekTek
:
1
},
()
=>
{
setTimeout
(()
=>
{
this
.
uploadProfitLoss
(
'draft'
)
},
100
);
})
)
}
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
...
...
@@ -2312,14 +2327,15 @@ export default class ProfitLoss extends Component {
}}
onClick
=
{()
=>
this
.
state
.
editable
===
true
?
null
:
this
.
setState
({
loading
:
true
},
()
=>
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
setState
({
handleTekTekTek
:
1
},
()
=>
{
setTimeout
(()
=>
{
this
.
uploadProfitLoss
(
'submitted'
)
},
100
);
})
)
null
:
this
.
setState
({
loading
:
true
},
()
=>
this
.
state
.
handleTekTekTek
==
1
?
null
:
this
.
setState
({
handleTekTekTek
:
1
},
()
=>
{
setTimeout
(()
=>
{
this
.
uploadProfitLoss
(
'submitted'
)
},
100
);
})
)
}
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
...
...
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