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
a2726c50
Commit
a2726c50
authored
Jan 24, 2018
by
Nitesh Laxman Chaughule
Browse files
'paymentmode' column is added in invoice table and respected changes in gkupgrade function.
parent
77daf30c
Changes
2
Hide whitespace changes
Inline
Side-by-side
gkcore/models/gkdb.py
View file @
a2726c50
...
...
@@ -297,7 +297,8 @@ Bankdetails is a dictionary will have bankname,accountno., branchname and ifscco
taxstate is a destination sate.
sourcestate is source state from where invoice is initiated.
Structure of a tax field is {productcode:taxrate}
save orgstategstin of sourcestate for organisation.
save orgstategstin of sourcestate for organisation.
paymentmode states that Mode of payment i.e 'bank' or 'cash'. Default value is set as 2 for 'bank' and 3 for 'cash'.
"""
invoice
=
Table
(
'invoice'
,
metadata
,
Column
(
'invid'
,
Integer
,
primary_key
=
True
),
...
...
@@ -328,6 +329,7 @@ invoice = Table('invoice',metadata,
Column
(
'vehicleno'
,
UnicodeText
),
Column
(
'dateofsupply'
,
DateTime
),
Column
(
'discount'
,
JSONB
),
Column
(
'paymentmode'
,
Integer
,
default
=
2
),
UniqueConstraint
(
'orgcode'
,
'invoiceno'
,
'custid'
,
'icflag'
),
Index
(
"invoice_orgcodeindex"
,
"orgcode"
),
Index
(
"invoice_invoicenoindex"
,
"invoiceno"
)
...
...
gkcore/views/api_organisation.py
View file @
a2726c50
...
...
@@ -62,6 +62,7 @@ class api_organisation(object):
"""
self
.
con
=
eng
.
connect
()
try
:
self
.
con
.
execute
(
select
(
gkdb
.
invoice
.
c
.
paymentmode
))
self
.
con
.
execute
(
select
(
gkdb
.
organisation
.
c
.
bankdetails
))
self
.
con
.
execute
(
select
([
func
.
count
(
gkdb
.
delchal
.
c
.
consignee
)]))
self
.
con
.
execute
(
select
([
func
.
count
(
gkdb
.
invoice
.
c
.
orgstategstin
)]))
...
...
@@ -87,6 +88,7 @@ class api_organisation(object):
self
.
con
.
execute
(
select
(
gkdb
.
organisation
.
c
.
billflag
))
self
.
con
.
execute
(
select
([
func
.
count
(
gkdb
.
billwise
.
c
.
billid
)]))
except
:
self
.
con
.
execute
(
"alter table invoice add paymentmode integer"
)
self
.
con
.
execute
(
"alter table organisation add bankdetails json"
)
self
.
con
.
execute
(
"alter table delchal add consignee jsonb"
)
self
.
con
.
execute
(
"alter table invoice add orgstategstin text"
)
...
...
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