Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sakshi Agrawal
gkcore
Commits
cded351b
Commit
cded351b
authored
Jan 23, 2018
by
Nitesh Laxman Chaughule
Browse files
Statecode receiving from frontend view and orgnisation details sent to the frontend.
parent
02acfddb
Changes
1
Hide whitespace changes
Inline
Side-by-side
gkcore/views/api_organisation.py
View file @
cded351b
...
...
@@ -482,9 +482,13 @@ class api_organisation(object):
else
:
try
:
self
.
con
=
eng
.
connect
()
statecode
=
self
.
request
.
params
[
"statecode"
]
result
=
self
.
con
.
execute
(
select
([
gkdb
.
organisation
]).
where
(
gkdb
.
organisation
.
c
.
orgcode
==
authDetails
[
"orgcode"
]))
#gkdb.organisation.c.orgstate==self.request.params["statecode"]
row
=
result
.
fetchone
()
if
(
row
[
"orgcity"
]
==
None
):
orgcity
=
""
else
:
orgcity
=
row
[
"orgcity"
]
if
(
row
[
"orgaddr"
]
==
None
):
orgaddr
=
""
else
:
...
...
@@ -497,7 +501,6 @@ class api_organisation(object):
orgstate
=
""
else
:
orgstate
=
row
[
"orgstate"
]
orgstatecode
=
getStateCode
(
orgstate
,
self
.
con
)[
"statecode"
]
if
(
row
[
"orgwebsite"
]
==
None
):
orgwebsite
=
""
else
:
...
...
@@ -508,10 +511,12 @@ class api_organisation(object):
orgpan
=
row
[
"orgpan"
]
if
(
row
[
"gstin"
]
==
None
):
gstin
=
""
elif
(
row
[
"gstin"
].
has_key
(
str
(
statecode
))):
gstin
=
row
[
"gstin"
][
str
(
statecode
)]
else
:
gstin
=
row
[
"gstin"
][
str
(
orgstatecode
)]
gstin
=
""
orgDetails
=
{
"orgname"
:
row
[
"orgname"
],
"orgaddr"
:
orgaddr
,
"orgpincode"
:
orgpincode
,
"orgstate"
:
orgstate
,
"orgwebsite"
:
orgwebsite
,
"orgpan"
:
orgpan
,
"gstin"
:
gstin
}
orgDetails
=
{
"orgname"
:
row
[
"orgname"
],
"orgaddr"
:
orgaddr
,
"orgpincode"
:
orgpincode
,
"orgstate"
:
orgstate
,
"orgwebsite"
:
orgwebsite
,
"orgpan"
:
orgpan
,
"
orgstate
gstin"
:
gstin
,
"orgcity"
:
orgcity
}
self
.
con
.
close
()
return
{
"gkstatus"
:
enumdict
[
"Success"
],
"gkdata"
:
orgDetails
}
...
...
Write
Preview
Supports
Markdown
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