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
e60849ac
Commit
e60849ac
authored
Nov 24, 2020
by
Riri Novita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save monthly pl
parent
10579c37
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
0 deletions
+85
-0
index.js
src/api/index.js
+2
-0
ProfitLossMR.js
src/container/MonthlyReport/ProfitLossMR.js
+83
-0
No files found.
src/api/index.js
View file @
e60849ac
...
@@ -272,6 +272,7 @@ const create = (type = "") => {
...
@@ -272,6 +272,7 @@ const create = (type = "") => {
// MonthlyPL
// MonthlyPL
const
getHierarkiMontlyReportPL
=
(
body
)
=>
api
.
post
(
'transaction/monthly_report_pl/get_report_hierarki'
,
body
)
const
getHierarkiMontlyReportPL
=
(
body
)
=>
api
.
post
(
'transaction/monthly_report_pl/get_report_hierarki'
,
body
)
const
createMonthlyReportPL
=
(
body
)
=>
api
.
post
(
'transaction/monthly_report_pl/create_monthly_report'
,
body
)
//Template
//Template
const
downloadTemplate
=
(
fileName
,
fileType
)
=>
api
.
get
(
`attachment/download_file?fileName=
${
fileName
}
&&fileType=
${
fileType
}
`
)
const
downloadTemplate
=
(
fileName
,
fileType
)
=>
api
.
get
(
`attachment/download_file?fileName=
${
fileName
}
&&fileType=
${
fileType
}
`
)
...
@@ -405,6 +406,7 @@ const create = (type = "") => {
...
@@ -405,6 +406,7 @@ const create = (type = "") => {
createSubmitReport
,
createSubmitReport
,
createMonthlyReportBS
,
createMonthlyReportBS
,
createMonthlyReportTP
,
createMonthlyReportTP
,
createMonthlyReportPL
,
getSubmission
,
getSubmission
,
checkUploadMB
,
checkUploadMB
,
getAllOperatingInd
,
getAllOperatingInd
,
...
...
src/container/MonthlyReport/ProfitLossMR.js
View file @
e60849ac
...
@@ -6,6 +6,7 @@ import Images from '../../assets/Images';
...
@@ -6,6 +6,7 @@ import Images from '../../assets/Images';
import
api
from
'../../api'
;
import
api
from
'../../api'
;
import
NumberFormat
from
'react-number-format'
;
import
NumberFormat
from
'react-number-format'
;
import
*
as
R
from
'ramda'
;
import
*
as
R
from
'ramda'
;
import
{
PropagateLoader
}
from
'react-spinners'
;
const
LightTooltip
=
withStyles
((
theme
)
=>
({
const
LightTooltip
=
withStyles
((
theme
)
=>
({
tooltip
:
{
tooltip
:
{
...
@@ -149,6 +150,88 @@ export default class ProfitLossMR extends Component {
...
@@ -149,6 +150,88 @@ export default class ProfitLossMR extends Component {
})
})
}
}
downloadTemplate
=
async
()
=>
{
let
res
=
await
fetch
(
`https://tia.eksad.com/tia-reporting-dev/public/transaction/monthly_report_pl/download_template?report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
`
)
res
=
await
res
.
blob
()
// console.log(res)
if
(
res
.
size
>
0
)
{
let
url
=
window
.
URL
.
createObjectURL
(
res
);
let
a
=
document
.
createElement
(
'a'
);
a
.
href
=
url
;
a
.
download
=
'Template Monthly Report Profit Loss.xlsx'
;
a
.
click
();
}
}
async
downloadAllData
()
{
let
url
=
`https://tia.eksad.com/tia-reporting-dev/public/transaction/monthly_report_pl/export_monthly_report?monthly_report_id=
${
this
.
props
.
monthlyReportId
}
&&report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
&&revision=
${
this
.
props
.
revision
}
&&months=
${
this
.
props
.
month
.
month_id
}
`
console
.
log
(
url
);
let
res
=
await
fetch
(
`https://tia.eksad.com/tia-reporting-dev/public/transaction/monthly_report_pl/export_monthly_report?monthly_report_id=
${
this
.
props
.
monthlyReportId
===
null
?
""
:
this
.
props
.
monthlyReportId
}
&&report_id=
${
this
.
props
.
report_id
}
&&company_id=
${
this
.
props
.
company
.
company_id
}
&&year=
${
this
.
props
.
periode
}
&&revision=
${
this
.
props
.
revision
}
&&months=
${
this
.
props
.
month
.
month_id
}
`
)
res
=
await
res
.
blob
()
this
.
setState
({
loading
:
false
})
if
(
res
.
size
>
0
)
{
let
url
=
window
.
URL
.
createObjectURL
(
res
);
let
a
=
document
.
createElement
(
'a'
);
a
.
href
=
url
;
a
.
download
=
'Monthly Report Profit Loss.xlsx'
;
a
.
click
();
}
}
backToMonthlyReport
(
type
)
{
console
.
log
(
this
.
state
.
dataTable
);
let
data
=
[]
this
.
state
.
dataTable
.
map
(
i
=>
{
data
.
push
({
"item_report_id"
:
i
[
2
],
"rolling_outlook"
:
i
[
6
],
"master_budget"
:
i
[
7
],
"rolling_budget"
:
i
[
8
],
"actual"
:
i
[
9
],
"actual_previous_month"
:
i
[
10
],
"amount_act_vs_previous_month"
:
i
[
11
],
"percent_act_vs_previous_month"
:
i
[
12
],
"amount_act_vs_mb"
:
i
[
13
],
"percent_act_vs_mb"
:
i
[
14
],
"amount_act_vs_rb"
:
i
[
15
],
"percent_act_vs_rb"
:
i
[
16
],
"mtd_vs_previous_month"
:
i
[
17
],
"mtd_vs_mb"
:
i
[
18
],
"mtd_vs_rb"
:
i
[
19
]
})
})
let
payload
=
{
"monthly_report_id"
:
this
.
props
.
submissionID
,
"company_id"
:
this
.
props
.
company
.
company_id
,
"periode"
:
this
.
props
.
periode
,
"report_id"
:
this
.
props
.
report_id
,
"status"
:
type
,
"months"
:
this
.
props
.
month
.
month_id
,
"balance_sheet"
:
data
}
api
.
create
(
'UPLOAD'
).
createMonthlyReportPL
(
payload
).
then
(
response
=>
{
console
.
log
(
response
);
if
(
response
.
data
)
{
if
(
response
.
data
.
status
===
"success"
)
{
this
.
props
.
saveToMonthlyReport
()
}
else
{
this
.
setState
({
loading
:
false
},
()
=>
{
this
.
props
.
saveToMonthlyReport
()
})
}
}
else
{
this
.
setState
({
loading
:
false
},
()
=>
{
this
.
getSubmission
()
document
.
body
.
style
.
overflow
=
'unset'
;
})
}
})
}
render
()
{
render
()
{
let
dataTable2
=
this
.
state
.
dataTable
let
dataTable2
=
this
.
state
.
dataTable
...
...
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