Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gnukhata
gkcore
Commits
c89b293b
Commit
c89b293b
authored
Dec 20, 2017
by
Krishnakant Mane
Committed by
Prajkta_Patkar
Jan 10, 2018
Browse files
final changes to voucher number auto generation code.
parent
6b605eb6
Changes
1
Hide whitespace changes
Inline
Side-by-side
gkcore/views/api_transaction.py
View file @
c89b293b
...
...
@@ -72,6 +72,7 @@ class api_transaction(object):
Purpose:
Generates a new vouchernumber based on vouchertype and max count for that type.
"""
initialType
=
""
if
voucherType
==
"Journal"
:
initialType
=
"jr"
if
voucherType
==
"Contra"
:
...
...
@@ -100,12 +101,14 @@ class api_transaction(object):
else
:
vchCodeResult
=
self
.
con
.
execute
(
"select max(vouchercode) as vcode from vouchers"
)
vchCode
=
vchCodeResult
.
fetchone
()
initialType
=
initialType
+
str
(
vchCode
)
initialType
=
initialType
+
str
(
vchCode
[
"vcode"
])
return
initialType
@
view_config
(
request_method
=
'POST'
,
renderer
=
'json'
)
def
addVoucher
(
self
):
"""
Purpose:
adds a new voucher for given organisation and returns success as gkstatus if adding is successful.
Description:
...
...
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