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
8be6dce3
Commit
8be6dce3
authored
Jun 08, 2023
by
Riri Novita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing Company
parent
b07cb2a1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
22 deletions
+49
-22
CreateCompany.js
src/container/MasterData/Company/CreateCompany.js
+49
-22
No files found.
src/container/MasterData/Company/CreateCompany.js
View file @
8be6dce3
...
...
@@ -40,12 +40,16 @@ export default class CreatePerusahaan extends Component {
errorED
:
false
,
errorJL
:
false
,
errorUB
:
false
,
errorCur
:
false
,
errorDefCur
:
false
,
msgErrorNP
:
''
,
msgErrorPC
:
''
,
msgErrorSD
:
''
,
msgErrorED
:
''
,
msgErrorJL
:
''
,
msgErrorUB
:
''
,
msgErrorCur
:
''
,
msgErrorDefCur
:
''
,
alert
:
false
,
tipeAlert
:
''
,
messageAlert
:
''
,
...
...
@@ -303,22 +307,30 @@ export default class CreatePerusahaan extends Component {
errorED
:
false
,
errorJL
:
false
,
errorUB
:
false
,
errorCur
:
false
,
errorDefCur
:
false
,
msgErrorNP
:
''
,
msgErrorPC
:
''
,
msgErrorSD
:
''
,
msgErrorED
:
''
,
msgErrorJL
:
''
,
msgErrorUB
:
''
msgErrorUB
:
''
,
msgErrorCur
:
''
,
msgErrorDefCur
:
''
})
}
validasiEdit
()
{
if
(
R
.
isEmpty
(
this
.
state
.
company
))
{
this
.
setState
({
errorNP
:
true
,
msgErrorNP
:
'Company Name Cannot be Empty'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
getPerusahaan
))
{
this
.
setState
({
errorPC
:
true
,
msgErrorPC
:
'Parent Company Cannot be Empty'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
getTypes
))
{
this
.
setState
({
errorUB
:
true
,
msgErrorUB
:
'Business Unit Cannot be Empty'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
getPerusahaan
))
{
this
.
setState
({
errorPC
:
true
,
msgErrorPC
:
'Parent Company Cannot be Empty'
})
}
else
if
(
this
.
state
.
currency
.
length
===
0
)
{
this
.
setState
({
errorCur
:
true
,
msgErrorCur
:
'Currency Cannot be Empty'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
defaultCurrency
))
{
this
.
setState
({
errorDefCur
:
true
,
msgErrorDefCur
:
'Default Currency Cannot be Empty'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
startDate
))
{
this
.
setState
({
errorSD
:
true
,
msgErrorSD
:
'Valid From Cannot be Empty'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
endDate
))
{
...
...
@@ -362,21 +374,26 @@ export default class CreatePerusahaan extends Component {
"parent"
:
this
.
state
.
getPerusahaan
.
company_id
,
"start_date"
:
this
.
state
.
startDate
,
"end_date"
:
this
.
state
.
endDate
,
"
default_currency"
:
this
.
state
.
defaultCurrency
.
id
,
"
currency"
:
currencyID
"
currency"
:
currencyID
,
"
default_currency"
:
this
.
state
.
defaultCurrency
.
id
}
console
.
log
(
payload
);
this
.
props
.
updatePerusahaan
(
payload
)
//
this.props.updatePerusahaan(payload)
}
}
validasi
()
{
console
.
log
(
this
.
state
.
currency
.
length
);
if
(
R
.
isEmpty
(
this
.
state
.
company
))
{
this
.
setState
({
errorNP
:
true
,
msgErrorNP
:
'Company Name Cannot be Empty.'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
getPerusahaan
))
{
this
.
setState
({
errorPC
:
true
,
msgErrorPC
:
'Parent Company Cannot be Empty.'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
getTypes
))
{
this
.
setState
({
errorUB
:
true
,
msgErrorUB
:
'Business Unit Cannot be Empty.'
})
this
.
setState
({
errorUB
:
true
,
msgErrorUB
:
'Business Unit Cannot be Empty'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
getPerusahaan
))
{
this
.
setState
({
errorPC
:
true
,
msgErrorPC
:
'Parent Company Cannot be Empty'
})
}
else
if
(
this
.
state
.
currency
.
length
===
0
)
{
this
.
setState
({
errorCur
:
true
,
msgErrorCur
:
'Currency Cannot be Empty'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
defaultCurrency
))
{
this
.
setState
({
errorDefCur
:
true
,
msgErrorDefCur
:
'Default Currency Cannot be Empty'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
startDate
))
{
this
.
setState
({
errorSD
:
true
,
msgErrorSD
:
'Valid From Cannot be Empty.'
})
}
else
if
(
R
.
isNil
(
this
.
state
.
endDate
))
{
...
...
@@ -396,8 +413,8 @@ export default class CreatePerusahaan extends Component {
"business_unit_id"
:
this
.
state
.
getTypes
.
business_unit_id
,
"start_date"
:
this
.
state
.
startDate
,
"end_date"
:
this
.
state
.
endDate
,
"currency"
:
currencyID
,
"default_currency"
:
this
.
state
.
defaultCurrency
.
id
,
"currency"
:
currencyID
}
// console.log(payload);
this
.
props
.
createPerusahaan
(
payload
)
...
...
@@ -495,6 +512,7 @@ export default class CreatePerusahaan extends Component {
}
})
this
.
clearError
()
}}
renderInput
=
{(
params
)
=>
(
<
TextField
...
...
@@ -505,6 +523,8 @@ export default class CreatePerusahaan extends Component {
style
=
{{
marginTop
:
0
}}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
}
}}
error
=
{
this
.
state
.
errorCur
}
helperText
=
{
this
.
state
.
msgErrorCur
}
/
>
)}
value
=
{
this
.
state
.
currency
}
...
...
@@ -619,6 +639,8 @@ export default class CreatePerusahaan extends Component {
style
=
{{
marginTop
:
7
}}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
}
}}
error
=
{
this
.
state
.
errorDefCur
}
helperText
=
{
this
.
state
.
msgErrorDefCur
}
/
>
}
...
...
@@ -763,6 +785,20 @@ export default class CreatePerusahaan extends Component {
multiple
options
=
{
this
.
state
.
dataCurrency
}
getOptionLabel
=
{(
option
)
=>
option
.
value
}
renderInput
=
{(
params
)
=>
(
<
TextField
{...
params
}
variant
=
"standard"
label
=
"Currency"
margin
=
"normal"
style
=
{{
marginTop
:
0
}}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
}
}}
error
=
{
this
.
state
.
errorCur
}
helperText
=
{
this
.
state
.
msgErrorCur
}
/
>
)}
value
=
{
this
.
state
.
currency
}
onChange
=
{(
event
,
newInputValue
)
=>
{
let
findIdx
=
newInputValue
.
findIndex
(
e
=>
e
.
id
===
2
)
let
bizpar
=
findIdx
>=
0
?
this
.
state
.
dataCurrency
.
filter
(
e
=>
e
.
id
===
2
)
:
newInputValue
...
...
@@ -775,20 +811,9 @@ export default class CreatePerusahaan extends Component {
this
.
setState
({
defaultCurrency
:
result
})
}
this
.
clearError
()
})
}}
renderInput
=
{(
params
)
=>
(
<
TextField
{...
params
}
variant
=
"standard"
label
=
"Currency"
margin
=
"normal"
style
=
{{
marginTop
:
0
}}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
}
}}
/
>
)}
value
=
{
this
.
state
.
currency
}
/
>
<
/div
>
<
div
style
=
{{
padding
:
10
,
borderRadius
:
5
}}
>
...
...
@@ -905,6 +930,8 @@ export default class CreatePerusahaan extends Component {
style
=
{{
marginTop
:
7
}}
InputProps
=
{{
...
params
.
InputProps
,
style
:
{
fontSize
:
11
}
}}
InputLabelProps
=
{{
style
:
{
fontSize
:
11
,
color
:
'#7e8085'
}
}}
error
=
{
this
.
state
.
errorDefCur
}
helperText
=
{
this
.
state
.
msgErrorDefCur
}
/
>
}
...
...
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