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
f9432be4
Commit
f9432be4
authored
Nov 27, 2020
by
Deni Rinaldi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PLPLPLPLPLLPL
parent
4aa84a78
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
30 deletions
+50
-30
ProfitLoss.js
src/container/BudgetTahunan/ProfitLoss.js
+50
-30
No files found.
src/container/BudgetTahunan/ProfitLoss.js
View file @
f9432be4
...
@@ -104,7 +104,7 @@ export default class ProfitLoss extends Component {
...
@@ -104,7 +104,7 @@ export default class ProfitLoss extends Component {
"submission_id"
:
this
.
props
.
submissionID
"submission_id"
:
this
.
props
.
submissionID
}
}
api
.
create
().
getDetailReportMB
(
payload
).
then
(
response
=>
{
api
.
create
().
getDetailReportMB
(
payload
).
then
(
response
=>
{
//
console.log(response);
console
.
log
(
response
);
let
dataTable
=
[]
let
dataTable
=
[]
this
.
setState
({
visibleProfitLoss
:
true
})
this
.
setState
({
visibleProfitLoss
:
true
})
if
(
response
.
data
)
{
if
(
response
.
data
)
{
...
@@ -123,24 +123,28 @@ export default class ProfitLoss extends Component {
...
@@ -123,24 +123,28 @@ export default class ProfitLoss extends Component {
item
.
description
,
item
.
description
,
item
.
profit_loss
.
notes
===
""
?
null
:
item
.
profit_loss
.
notes
,
item
.
profit_loss
.
notes
===
""
?
null
:
item
.
profit_loss
.
notes
,
item
.
profit_loss
.
total_actual_before
===
null
?
"0"
:
item
.
profit_loss
.
total_actual_before
===
""
?
"0"
:
item
.
profit_loss
.
total_actual_before
,
item
.
profit_loss
.
total_actual_before
===
null
?
"0"
:
item
.
profit_loss
.
total_actual_before
===
""
?
"0"
:
item
.
profit_loss
.
total_actual_before
,
this
.
props
.
status
===
'CLOSED'
?
Number
(
item
.
profit_loss
.
january
).
toFixed
(
1
)
:
Number
(
item
.
profit_loss
.
january
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
january
).
toFixed
(
1
),
this
.
props
.
status
===
'CLOSED'
?
Number
(
item
.
profit_loss
.
february
).
toFixed
(
1
)
:
Number
(
item
.
profit_loss
.
february
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
february
).
toFixed
(
1
),
this
.
props
.
status
===
'CLOSED'
?
Number
(
item
.
profit_loss
.
march
).
toFixed
(
1
)
:
Number
(
item
.
profit_loss
.
march
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
march
).
toFixed
(
1
),
this
.
props
.
status
===
'CLOSED'
?
Number
(
item
.
profit_loss
.
april
).
toFixed
(
1
)
:
Number
(
item
.
profit_loss
.
april
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
april
).
toFixed
(
1
),
this
.
props
.
status
===
'CLOSED'
?
Number
(
item
.
profit_loss
.
may
).
toFixed
(
1
)
:
Number
(
item
.
profit_loss
.
may
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
may
).
toFixed
(
1
),
this
.
props
.
status
===
'CLOSED'
?
Number
(
item
.
profit_loss
.
june
).
toFixed
(
1
)
:
Number
(
item
.
profit_loss
.
june
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
june
).
toFixed
(
1
),
this
.
props
.
status
===
'CLOSED'
?
Number
(
item
.
profit_loss
.
july
).
toFixed
(
1
)
:
Number
(
item
.
profit_loss
.
july
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
july
).
toFixed
(
1
),
this
.
props
.
status
===
'CLOSED'
?
Number
(
item
.
profit_loss
.
august
).
toFixed
(
1
)
:
Number
(
item
.
profit_loss
.
august
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
august
).
toFixed
(
1
),
this
.
props
.
status
===
'CLOSED'
?
Number
(
item
.
profit_loss
.
september
).
toFixed
(
1
)
:
Number
(
item
.
profit_loss
.
september
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
september
).
toFixed
(
1
),
this
.
props
.
status
===
'CLOSED'
?
Number
(
item
.
profit_loss
.
october
).
toFixed
(
1
)
:
Number
(
item
.
profit_loss
.
october
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
october
).
toFixed
(
1
),
this
.
props
.
status
===
'CLOSED'
?
Number
(
item
.
profit_loss
.
november
).
toFixed
(
1
)
:
Number
(
item
.
profit_loss
.
november
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
november
).
toFixed
(
1
),
this
.
props
.
status
===
'CLOSED'
?
Number
(
item
.
profit_loss
.
december
).
toFixed
(
1
)
:
Number
(
item
.
profit_loss
.
december
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
december
).
toFixed
(
1
),
item
.
profit_loss
.
total_current_year
,
item
.
profit_loss
.
total_current_year
,
item
.
profit_loss
.
total_next_year
,
item
.
profit_loss
.
total_next_year
,
item
.
profit_loss
.
total_more_year
,
item
.
profit_loss
.
total_more_year
,
item
.
order
item
.
order
])
])
}
}
if
(
item
.
id
===
20092
)
{
console
.
log
(
item
);
console
.
log
(
dataTable
);
}
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
!==
null
)
{
if
(
item
.
children
.
length
>
0
)
{
if
(
item
.
children
.
length
>
0
)
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
item
.
children
.
map
((
items
,
indexs
)
=>
{
...
@@ -159,18 +163,18 @@ export default class ProfitLoss extends Component {
...
@@ -159,18 +163,18 @@ export default class ProfitLoss extends Component {
item
.
description
,
item
.
description
,
item
.
profit_loss
.
notes
===
""
?
null
:
item
.
profit_loss
.
notes
,
item
.
profit_loss
.
notes
===
""
?
null
:
item
.
profit_loss
.
notes
,
item
.
profit_loss
.
total_actual_before
===
null
?
"0"
:
item
.
profit_loss
.
total_actual_before
===
""
?
"0"
:
item
.
profit_loss
.
total_actual_before
,
item
.
profit_loss
.
total_actual_before
===
null
?
"0"
:
item
.
profit_loss
.
total_actual_before
===
""
?
"0"
:
item
.
profit_loss
.
total_actual_before
,
this
.
props
.
status
===
'CLOSED'
?
Number
(
item
.
profit_loss
.
january
).
toFixed
(
1
)
:
Number
(
item
.
profit_loss
.
january
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
january
).
toFixed
(
1
),
this
.
props
.
status
===
'CLOSED'
?
Number
(
item
.
profit_loss
.
february
).
toFixed
(
1
)
:
Number
(
item
.
profit_loss
.
february
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
february
).
toFixed
(
1
),
this
.
props
.
status
===
'CLOSED'
?
Number
(
item
.
profit_loss
.
march
).
toFixed
(
1
)
:
Number
(
item
.
profit_loss
.
march
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
march
).
toFixed
(
1
),
this
.
props
.
status
===
'CLOSED'
?
Number
(
item
.
profit_loss
.
april
).
toFixed
(
1
)
:
Number
(
item
.
profit_loss
.
april
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
april
).
toFixed
(
1
),
this
.
props
.
status
===
'CLOSED'
?
Number
(
item
.
profit_loss
.
may
).
toFixed
(
1
)
:
Number
(
item
.
profit_loss
.
may
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
may
).
toFixed
(
1
),
this
.
props
.
status
===
'CLOSED'
?
Number
(
item
.
profit_loss
.
june
).
toFixed
(
1
)
:
Number
(
item
.
profit_loss
.
june
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
june
).
toFixed
(
1
),
this
.
props
.
status
===
'CLOSED'
?
Number
(
item
.
profit_loss
.
july
).
toFixed
(
1
)
:
Number
(
item
.
profit_loss
.
july
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
july
).
toFixed
(
1
),
this
.
props
.
status
===
'CLOSED'
?
Number
(
item
.
profit_loss
.
august
).
toFixed
(
1
)
:
Number
(
item
.
profit_loss
.
august
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
august
).
toFixed
(
1
),
this
.
props
.
status
===
'CLOSED'
?
Number
(
item
.
profit_loss
.
september
).
toFixed
(
1
)
:
Number
(
item
.
profit_loss
.
september
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
september
).
toFixed
(
1
),
this
.
props
.
status
===
'CLOSED'
?
Number
(
item
.
profit_loss
.
october
).
toFixed
(
1
)
:
Number
(
item
.
profit_loss
.
october
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
october
).
toFixed
(
1
),
this
.
props
.
status
===
'CLOSED'
?
Number
(
item
.
profit_loss
.
november
).
toFixed
(
1
)
:
Number
(
item
.
profit_loss
.
november
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
november
).
toFixed
(
1
),
this
.
props
.
status
===
'CLOSED'
?
Number
(
item
.
profit_loss
.
december
).
toFixed
(
1
)
:
Number
(
item
.
profit_loss
.
december
).
toFixed
(
1
),
Number
(
item
.
profit_loss
.
december
).
toFixed
(
1
),
item
.
profit_loss
.
total_current_year
,
item
.
profit_loss
.
total_current_year
,
item
.
profit_loss
.
total_next_year
,
item
.
profit_loss
.
total_next_year
,
item
.
profit_loss
.
total_more_year
,
item
.
profit_loss
.
total_more_year
,
...
@@ -184,7 +188,7 @@ export default class ProfitLoss extends Component {
...
@@ -184,7 +188,7 @@ export default class ProfitLoss extends Component {
}
}
}
}
})
})
//
console.log(dataTable)
console
.
log
(
dataTable
)
this
.
setState
({
dataTable
,
loading
:
false
,
buttonError
:
true
,
editable
:
true
},
()
=>
{
this
.
setState
({
dataTable
,
loading
:
false
,
buttonError
:
true
,
editable
:
true
},
()
=>
{
})
})
}
else
{
}
else
{
...
@@ -418,7 +422,8 @@ export default class ProfitLoss extends Component {
...
@@ -418,7 +422,8 @@ export default class ProfitLoss extends Component {
profit_loss
:
data
,
profit_loss
:
data
,
status
:
type
status
:
type
}
}
// console.log(data);
console
.
log
(
this
.
state
.
dataTable
);
console
.
log
(
JSON
.
stringify
(
body
));
api
.
create
(
'UPLOAD'
).
uploadMasterBudget
(
body
).
then
(
response
=>
{
api
.
create
(
'UPLOAD'
).
uploadMasterBudget
(
body
).
then
(
response
=>
{
// console.log(response);
// console.log(response);
if
(
response
.
data
)
{
if
(
response
.
data
)
{
...
@@ -526,6 +531,10 @@ export default class ProfitLoss extends Component {
...
@@ -526,6 +531,10 @@ export default class ProfitLoss extends Component {
total
+=
Number
(
valItem
)
total
+=
Number
(
valItem
)
}
}
})
})
// if (tableMeta.rowData[1] === 20092) {
// console.log(total);
// console.log(dataTable2[tableMeta.rowIndex]);
// }
let
indexParent
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
tableMeta
.
rowData
[
2
])
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
])
...
@@ -580,10 +589,14 @@ export default class ProfitLoss extends Component {
...
@@ -580,10 +589,14 @@ export default class ProfitLoss extends Component {
}
}
}
else
{
}
else
{
if
(
index
!=
-
1
)
{
if
(
index
!=
-
1
)
{
if
(
item
===
String
(
tableMeta
.
rowData
[
23
]))
{
arrayJumlah
.
push
(
0
)
}
else
{
arrayJumlah
.
push
(
dataTable2
[
index
][
tableMeta
.
columnIndex
])
arrayJumlah
.
push
(
dataTable2
[
index
][
tableMeta
.
columnIndex
])
}
}
}
}
}
}
}
// if (indexs % 2 !== 0) {
// if (indexs % 2 !== 0) {
// operator.push(item)
// operator.push(item)
...
@@ -621,8 +634,15 @@ export default class ProfitLoss extends Component {
...
@@ -621,8 +634,15 @@ export default class ProfitLoss extends Component {
}
}
}
}
})
})
let
a
=
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
total
)
return
a
if
(
tableMeta
.
rowData
[
1
]
===
20092
)
{
console
.
log
(
total
);
console
.
log
(
arrayJumlah
);
}
// if (dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] === "" || dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] === undefined || dataTable2[tableMeta.rowIndex][tableMeta.columnIndex] === null) {
dataTable2
[
tableMeta
.
rowIndex
][
tableMeta
.
columnIndex
]
=
Number
(
total
)
// }
return
Number
(
total
)
}
}
...
...
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