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
aa9e3d12
Commit
aa9e3d12
authored
Jul 24, 2023
by
Riri Novita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Simulasi MB
parent
62587f66
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
789 additions
and
97 deletions
+789
-97
Login.js
src/container/Auth/Login.js
+1
-1
BalanceSheet.js
src/container/BudgetTahunan/BalanceSheet.js
+125
-20
CorporateAnnualTarget.js
src/container/BudgetTahunan/CorporateAnnualTarget.js
+273
-4
FixedAssetsMovement.js
src/container/BudgetTahunan/FixedAssetsMovement.js
+129
-20
ProfitLoss.js
src/container/BudgetTahunan/ProfitLoss.js
+123
-20
TaxPlanning.js
src/container/BudgetTahunan/TaxPlanning.js
+137
-32
Constant.js
src/library/Constant.js
+1
-0
No files found.
src/container/Auth/Login.js
View file @
aa9e3d12
...
@@ -48,7 +48,6 @@ class Login extends Component {
...
@@ -48,7 +48,6 @@ class Login extends Component {
componentDidMount
()
{
componentDidMount
()
{
this
.
getUser
()
this
.
getUser
()
var
email
=
localStorage
.
getItem
(
Constant
.
EMAIL
)
var
email
=
localStorage
.
getItem
(
Constant
.
EMAIL
)
console
.
log
(
email
)
}
}
getWindowDimensions
()
{
getWindowDimensions
()
{
...
@@ -112,6 +111,7 @@ class Login extends Component {
...
@@ -112,6 +111,7 @@ class Login extends Component {
}
else
{
}
else
{
localStorage
.
setItem
(
Constant
.
TOKEN
,
datas
.
token
)
localStorage
.
setItem
(
Constant
.
TOKEN
,
datas
.
token
)
localStorage
.
setItem
(
Constant
.
USER
,
datas
.
user_id
)
localStorage
.
setItem
(
Constant
.
USER
,
datas
.
user_id
)
localStorage
.
setItem
(
Constant
.
ROLE
,
datas
.
role_id
)
if
(
this
.
state
.
rememberMe
)
{
if
(
this
.
state
.
rememberMe
)
{
localStorage
.
setItem
(
Constant
.
EMAIL
,
this
.
state
.
email
)
localStorage
.
setItem
(
Constant
.
EMAIL
,
this
.
state
.
email
)
localStorage
.
setItem
(
Constant
.
PASSWORD
,
this
.
state
.
password
)
localStorage
.
setItem
(
Constant
.
PASSWORD
,
this
.
state
.
password
)
...
...
src/container/BudgetTahunan/BalanceSheet.js
View file @
aa9e3d12
This diff is collapsed.
Click to expand it.
src/container/BudgetTahunan/CorporateAnnualTarget.js
View file @
aa9e3d12
This diff is collapsed.
Click to expand it.
src/container/BudgetTahunan/FixedAssetsMovement.js
View file @
aa9e3d12
This diff is collapsed.
Click to expand it.
src/container/BudgetTahunan/ProfitLoss.js
View file @
aa9e3d12
...
@@ -65,7 +65,8 @@ export default class ProfitLoss extends Component {
...
@@ -65,7 +65,8 @@ export default class ProfitLoss extends Component {
handleDoubleClick
:
0
,
handleDoubleClick
:
0
,
fromUpload
:
false
,
fromUpload
:
false
,
defaultCurrencyUpload
:
this
.
props
.
defaultCurrency
,
defaultCurrencyUpload
:
this
.
props
.
defaultCurrency
,
visibleAlertSave
:
false
visibleAlertSave
:
false
,
visibleButtonUpload
:
false
}
}
this
.
handleValue
=
this
.
handleValue
.
bind
(
this
)
this
.
handleValue
=
this
.
handleValue
.
bind
(
this
)
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
this
.
fileHandler
=
this
.
fileHandler
.
bind
(
this
);
...
@@ -475,27 +476,105 @@ export default class ProfitLoss extends Component {
...
@@ -475,27 +476,105 @@ export default class ProfitLoss extends Component {
})
})
}
}
u
ploadSimulasi
()
{
checkU
ploadSimulasi
()
{
let
payload
=
{
let
payload
=
{
...
this
.
state
.
payload
,
...
this
.
state
.
payload
,
currency_id
:
this
.
state
.
defaultCurrencyUpload
?.
id
currency_id
:
this
.
state
.
defaultCurrencyUpload
?.
id
}
}
this
.
setState
({
loading
:
true
,
dataTable
:
[]
})
api
.
create
().
checkUploadMB
(
payload
).
then
(
response
=>
{
// let dataDelete = this.state.dataDelete
// console.log(JSON.stringify(this.state.payload));
// api.create().getIdDeleteFromExcel(payload).then((response) => {
console
.
log
(
response
)
// if (response.data) {
if
(
response
.
data
)
{
// // // // // // console.log(response.data)
if
(
response
.
data
.
status
===
'success'
)
{
// let idDelete = response.data.data.item_report_id
this
.
setState
({
visibleUpload
:
false
,
visibleProfitLoss
:
false
,
loading
:
true
,
visibleButtonUpload
:
true
})
// if (idDelete.length > 0) {
let
dataTable
=
response
.
data
.
data
.
map
((
item
,
index
)
=>
{
// idDelete.map((item, index) => {
return
[
// dataDelete.push(item)
item
.
type_report_id
,
// })
item
.
item_report_id
,
// this.setState({ dataDelete })
item
.
parent
,
// }
item
.
formula
,
// }
item
.
level
,
// })
item
.
item_report
,
console
.
log
(
payload
)
item
.
notes
,
api
.
create
().
uploadSimulasiMB
(
payload
).
then
(
response
=>
{
Number
(
item
.
total_actual_before
).
toFixed
(
1
),
Number
(
item
.
january
).
toFixed
(
1
),
Number
(
item
.
february
).
toFixed
(
1
),
Number
(
item
.
march
).
toFixed
(
1
),
Number
(
item
.
april
).
toFixed
(
1
),
Number
(
item
.
may
).
toFixed
(
1
),
Number
(
item
.
june
).
toFixed
(
1
),
Number
(
item
.
july
).
toFixed
(
1
),
Number
(
item
.
august
).
toFixed
(
1
),
Number
(
item
.
september
).
toFixed
(
1
),
Number
(
item
.
october
).
toFixed
(
1
),
Number
(
item
.
november
).
toFixed
(
1
),
Number
(
item
.
december
).
toFixed
(
1
),
Number
(
item
.
total_current_year
).
toFixed
(
1
),
Number
(
item
.
total_next_year
).
toFixed
(
1
),
Number
(
item
.
total_more_year
).
toFixed
(
1
),
item
.
orders
,
item
.
error
]
})
this
.
setState
({
dataTable
,
dataLoaded
:
true
,
loading
:
false
,
buttonError
:
false
,
editable
:
true
,
fromUpload
:
true
},
()
=>
{
this
.
state
.
dataTable
.
map
(
item
=>
{
if
(
item
[
24
].
length
>
0
)
{
// console.log('masuk')
this
.
setState
({
buttonError
:
true
,
errorPreview
:
true
,
editable
:
true
})
}
})
// console.log(this.state.buttonError)
})
}
else
{
this
.
setState
({
alert
:
true
,
messageAlert
:
response
.
data
.
message
,
tipeAlert
:
'warning'
,
loading
:
false
},
()
=>
{
if
(
response
.
data
.
message
.
includes
(
"Someone Logged In"
)
||
response
.
data
.
message
.
includes
(
"Token Expired"
))
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
Constant
.
TOKEN
)
window
.
location
.
reload
();
},
1000
);
}
})
}
}
})
}
uploadSimulasi
(
type
)
{
let
data
=
[]
this
.
state
.
dataTable
.
map
(
i
=>
{
data
.
push
({
item_report_id
:
i
[
1
],
notes
:
String
(
i
[
6
]),
total_actual_before
:
String
(
Number
(
i
[
7
]).
toFixed
(
1
)),
january
:
String
(
Number
(
i
[
8
]).
toFixed
(
1
)),
february
:
String
(
Number
(
i
[
9
]).
toFixed
(
1
)),
march
:
String
(
Number
(
i
[
10
]).
toFixed
(
1
)),
april
:
String
(
Number
(
i
[
11
]).
toFixed
(
1
)),
may
:
String
(
Number
(
i
[
12
]).
toFixed
(
1
)),
june
:
String
(
Number
(
i
[
13
]).
toFixed
(
1
)),
july
:
String
(
Number
(
i
[
14
]).
toFixed
(
1
)),
august
:
String
(
Number
(
i
[
15
]).
toFixed
(
1
)),
september
:
String
(
Number
(
i
[
16
]).
toFixed
(
1
)),
october
:
String
(
Number
(
i
[
17
]).
toFixed
(
1
)),
november
:
String
(
Number
(
i
[
18
]).
toFixed
(
1
)),
december
:
String
(
Number
(
i
[
19
]).
toFixed
(
1
)),
total_current_year
:
String
(
Number
(
i
[
20
]).
toFixed
(
1
)),
total_next_year
:
String
(
Number
(
i
[
21
]).
toFixed
(
1
)),
total_more_year
:
String
(
Number
(
i
[
22
]).
toFixed
(
1
)),
})
})
let
body
=
{
submission_id
:
this
.
props
.
submissionID
,
company_id
:
this
.
props
.
company
.
company_id
,
periode
:
this
.
props
.
periode
,
report_id
:
this
.
props
.
report_id
,
currency_id
:
this
.
state
.
defaultCurrencyUpload
?.
id
,
profit_loss
:
data
,
status
:
type
}
console
.
log
(
body
)
api
.
create
().
uploadSimulasiMB
(
body
).
then
(
response
=>
{
console
.
log
(
response
)
console
.
log
(
response
)
if
(
response
.
data
)
{
if
(
response
.
data
)
{
if
(
response
.
ok
)
{
if
(
response
.
ok
)
{
...
@@ -3419,13 +3498,37 @@ export default class ProfitLoss extends Component {
...
@@ -3419,13 +3498,37 @@ export default class ProfitLoss extends Component {
}}
}}
onUpload
=
{()
=>
{
onUpload
=
{()
=>
{
String
(
this
.
state
.
judul
).
includes
(
"MASTER"
)
&&
String
(
this
.
state
.
judul
).
includes
(
"BUDGET"
)
&&
String
(
this
.
state
.
judul
).
includes
(
"PROFIT"
)
&&
String
(
this
.
state
.
judul
).
includes
(
"LOSS"
)
?
String
(
this
.
state
.
judul
).
includes
(
"MASTER"
)
&&
String
(
this
.
state
.
judul
).
includes
(
"BUDGET"
)
&&
String
(
this
.
state
.
judul
).
includes
(
"PROFIT"
)
&&
String
(
this
.
state
.
judul
).
includes
(
"LOSS"
)
?
this
.
u
ploadSimulasi
()
:
this
.
checkU
ploadSimulasi
()
:
this
.
setState
({
alert
:
true
,
messageAlert
:
"Invalid Template"
,
tipeAlert
:
'warning'
})
this
.
setState
({
alert
:
true
,
messageAlert
:
"Invalid Template"
,
tipeAlert
:
'warning'
})
}}
}}
/
>
/
>
<
/div
>
<
/div
>
<
div
style
=
{{
padding
:
'0px 30px 29px'
,
fontSize
:
17
,
color
:
'red'
}}
><
b
>
Warning
:
<
/b> Valid currency for uploading data is <b>{this.props.defaultCurrency.id == 1
?
"IDR" : "USD"}</
b
><
/div
>
{
this
.
state
.
visibleButtonUpload
&&
<
div
style
=
{{
display
:
'flex'
,
justifyContent
:
'flex-end'
,
margin
:
'0px 32px 16px'
}}
>
<
div
>
<
button
type
=
"button"
// disabled={this.state.buttonError}
onClick
=
{()
=>
this
.
setState
({
handleDoubleClick
:
1
,
loading
:
true
},
()
=>
{
this
.
uploadSimulasi
(
'submitted'
)
})}
style
=
{{
backgroundColor
:
'transparent'
,
cursor
:
'pointer'
,
borderColor
:
'transparent'
,
outline
:
'none'
,
}}
>
<
div
style
=
{{
backgroundColor
:
'#354960'
,
width
:
105
,
height
:
25
,
borderRadius
:
3
,
justifyContent
:
'center'
,
display
:
'flex'
,
alignItems
:
'center'
}}
>
<
Typography
style
=
{{
fontSize
:
'11px'
,
color
:
'#fff'
,
textAlign
:
'center'
}}
>
Save
Data
<
/Typography
>
<
/div
>
<
/button
>
<
/div
>
<
/div
>
}
{
/* <div style={{ padding: '0px 30px 29px', fontSize: 17, color: 'red' }}><b>Warning:</b> Valid currency for uploading data is <b>{this.props.defaultCurrency.id == 1 ? "IDR" : "USD"}</b></div> */
}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
)}
)}
...
...
src/container/BudgetTahunan/TaxPlanning.js
View file @
aa9e3d12
This diff is collapsed.
Click to expand it.
src/library/Constant.js
View file @
aa9e3d12
const
Constant
=
{
const
Constant
=
{
TOKEN
:
null
,
TOKEN
:
null
,
USER
:
0
,
USER
:
0
,
ROLE
:
'role_id'
,
EMAIL
:
'TOKEN'
,
EMAIL
:
'TOKEN'
,
PASSWORD
:
'PASSWORD'
,
PASSWORD
:
'PASSWORD'
,
URL_BE_DEV
:
'${process.env.REACT_APP_URL_MAIN_BE}'
,
URL_BE_DEV
:
'${process.env.REACT_APP_URL_MAIN_BE}'
,
...
...
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