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
8c7dfd4e
Commit
8c7dfd4e
authored
Mar 08, 2021
by
Riri Novita
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'riri' into 'master'
up See merge request
!1262
parents
4752199b
79747d8b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
5 deletions
+63
-5
SubHolding.js
src/container/Laporan/SubHolding.js
+7
-0
ProfitLossRO.js
src/container/RollingOutlook/ProfitLossRO.js
+56
-5
No files found.
src/container/Laporan/SubHolding.js
View file @
8c7dfd4e
...
...
@@ -3062,10 +3062,17 @@ export default class SubHolding extends Component {
a
.
click
();
}
}
else
if
(
this
.
state
.
report
.
value
===
8
)
{
<<<<<<<
HEAD
let
url
=
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/summary_profit_loss/export_report?submission_id=
${
this
.
state
.
submissionID
===
null
?
""
:
this
.
state
.
submissionID
}
&&report_id=28&&company_id=
${
this
.
state
.
company
.
company_id
}
&&year=
${
this
.
state
.
periode
.
periode
}
&&revision=
${
this
.
state
.
revisionType
}
&&months=
${
this
.
state
.
month
.
month_id
}
&&quarter=1`
console
.
log
(
url
);
let
res
=
await
fetch
(
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/summary_profit_loss/export_report?submission_id=
${
this
.
state
.
submissionID
===
null
?
""
:
this
.
state
.
submissionID
}
&&report_id=28&&company_id=
${
this
.
state
.
company
.
company_id
}
&&year=
${
this
.
state
.
periode
.
periode
}
&&revision=
${
this
.
state
.
revisionType
}
&&months=
${
this
.
state
.
month
.
month_id
}
&&quarter=1`
=======
let
url
=
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/summary_profit_loss/export_report_summary?submission_id=
${
this
.
state
.
submissionID
===
null
?
""
:
this
.
state
.
submissionID
}
&&report_id=28&&company_id=
${
this
.
state
.
company
.
company_id
}
&&year=
${
this
.
state
.
periode
.
periode
}
&&revision=
${
this
.
state
.
revisionType
}
&&months=
${
this
.
state
.
month
.
month_id
}
&&quarter=1`
console
.
log
(
url
);
let
res
=
await
fetch
(
`
${
process
.
env
.
REACT_APP_URL_MAIN_BE
}
/public/transaction/summary_profit_loss/export_report_summary?submission_id=
${
this
.
state
.
submissionID
===
null
?
""
:
this
.
state
.
submissionID
}
&&report_id=28&&company_id=
${
this
.
state
.
company
.
company_id
}
&&year=
${
this
.
state
.
periode
.
periode
}
&&revision=
${
this
.
state
.
revisionType
}
&&months=
${
this
.
state
.
month
.
month_id
}
&&quarter=1`
>>>>>>>
4752199
b2929e79f17c72bc4f983e9058f435870
)
res
=
await
res
.
blob
()
this
.
setState
({
loading
:
false
})
...
...
src/container/RollingOutlook/ProfitLossRO.js
View file @
8c7dfd4e
...
...
@@ -142,7 +142,7 @@ export default class ProfitLossRO extends Component {
item
.
formula
,
item
.
level
,
item
.
description
,
item
.
profit_loss
.
notes
===
""
?
null
:
item
.
profit_loss
.
notes
,
item
.
profit_loss
.
notes
===
undefined
?
""
:
item
.
profit_loss
.
notes
,
item
.
profit_loss
.
last_year_total
===
""
?
"0"
:
item
.
profit_loss
.
last_year_total
,
item
.
profit_loss
.
january
===
""
?
"0"
:
item
.
profit_loss
.
january
,
item
.
profit_loss
.
february
===
""
?
"0"
:
item
.
profit_loss
.
february
,
...
...
@@ -179,7 +179,8 @@ export default class ProfitLossRO extends Component {
item
.
formula
,
item
.
level
,
item
.
description
,
item
.
profit_loss
.
last_year_total
===
""
?
"0"
:
item
.
profit_loss
.
last_year_total
,
item
.
profit_loss
.
notes
===
undefined
?
""
:
item
.
profit_loss
.
notes
,
item
.
profit_loss
.
last_year_total
===
""
?
"0"
:
item
.
profit_loss
.
last_year_total
,
item
.
profit_loss
.
january
===
""
?
"0"
:
item
.
profit_loss
.
january
,
item
.
profit_loss
.
february
===
""
?
"0"
:
item
.
profit_loss
.
february
,
item
.
profit_loss
.
march
===
""
?
"0"
:
item
.
profit_loss
.
march
,
...
...
@@ -206,7 +207,7 @@ export default class ProfitLossRO extends Component {
}
}
})
//
console.log(dataTable)
console
.
log
(
dataTable
)
this
.
setState
({
dataTable
,
loading
:
false
,
buttonError
:
true
,
saveDraft
:
true
,
refresh
:
false
})
}
else
{
this
.
setState
({
loading
:
false
,
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
},
()
=>
{
...
...
@@ -258,6 +259,50 @@ export default class ProfitLossRO extends Component {
// }
}
handleValidate
()
{
let
data
=
[]
// console.log(JSON.stringify(this.state.dataTable))
// this.state.dataTable.map(i => {
// data.push({
// item_report_id: i[1],
// notes: i[6] == null || i[6] == "" ? "" : String(i[6]),
// total_actual_before: String(i[7]),
// january: i[0] === 3 && i[8] === "" ? "0" : String(i[8]),
// february: i[0] === 3 && i[9] === "" ? "0" : String(i[9]),
// march: i[0] === 3 && i[10] === "" ? "0" : String(i[10]),
// april: i[0] === 3 && i[11] === "" ? "0" : String(i[11]),
// may: i[0] === 3 && i[12] === "" ? "0" : String(i[12]),
// june: i[0] === 3 && i[13] === "" ? "0" : String(i[13]),
// july: i[0] === 3 && i[14] === "" ? "0" : String(i[14]),
// august: i[0] === 3 && i[15] === "" ? "0" : String(i[15]),
// september: i[0] === 3 && i[16] === "" ? "0" : String(i[16]),
// october: i[0] === 3 && i[17] === "" ? "0" : String(i[17]),
// november: i[0] === 3 && i[18] === "" ? "0" : String(i[18]),
// december: i[0] === 3 && i[19] === "" ? "0" : String(i[19]),
// total_current_year: i[0] === 3 && i[20] === "" ? "0" : String(i[20]),
// total_next_year: i[0] === 3 && i[21] === "" ? "0" : String(i[21]),
// total_more_year: i[0] === 3 && i[22] === "" ? "0" : String(i[22])
// })
// })
// let payload = {
// "submission_id": this.props.submissionID,
// "company_id": this.props.company.company_id,
// "periode": this.props.periode,
// "report_id": this.props.report_id,
// "profit_loss": data,
// "status": "submitted"
// }
// console.log(payload)
// api.create().validateSubmitReport(payload).then((response) => {
// console.log(response)
// if (response.data.data.result) {
this
.
setState
({
loading
:
false
,
buttonError
:
false
,
editable
:
false
})
// } else {
// this.setState({ loading: false, buttonError: true, editable: true })
// }
// })
}
closeAlert
()
{
this
.
setState
({
alert
:
false
})
}
...
...
@@ -280,14 +325,20 @@ export default class ProfitLossRO extends Component {
const
handleValue
=
(
value
,
data
)
=>
{
let
total
=
0
// console.log(data);
// console.log(dataTable2);
dataTable2
.
map
((
item
,
index
)
=>
{
if
(
data
.
rowData
[
1
]
==
item
[
2
])
{
total
=
item
[
data
.
columnIndex
]
==
undefined
?
(
Number
(
total
)
+
0
)
:
(
Number
(
total
)
+
Number
(
String
(
item
[
data
.
columnIndex
]).
includes
(
'-'
)
?
Number
(
String
(
item
[
data
.
columnIndex
]).
substr
(
1
,
String
(
item
[
data
.
columnIndex
]).
length
))
*
-
1
:
Number
(
item
[
data
.
columnIndex
])))
}
})
// console.log(total);
let
indexParent
=
dataTable2
.
findIndex
((
val
)
=>
val
[
1
]
==
dataTable2
[
data
.
rowIndex
][
2
])
let
a
=
dataTable2
[
data
.
rowIndex
][
data
.
columnIndex
]
=
Number
(
total
)
// console.log(indexParent);
// if (data.rowData[5] == "Unit Business/ Brand/ SubCo 1") {
// console.log(total);
// console.log(a);
// }
return
a
}
...
...
@@ -302,7 +353,7 @@ export default class ProfitLossRO extends Component {
}
else
if
(
item
==
'-'
||
item
==
'+'
||
item
==
'/'
||
item
==
'*'
)
{
arrayJumlah
.
push
(
item
)
}
else
{
let
index
=
dataTable2
.
findIndex
((
val
)
=>
val
[
2
3
]
==
item
)
let
index
=
dataTable2
.
findIndex
((
val
)
=>
val
[
2
2
]
==
item
)
if
(
tambahan
)
{
if
(
item
==
'-'
||
item
==
'+'
||
item
==
'/'
||
item
==
'*'
)
{
opet
=
item
...
...
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