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
Aditi
gkcore
Commits
814126b7
Commit
814126b7
authored
Nov 11, 2017
by
Krishnakant Mane
Browse files
Merge branch 'devel' into 'master'
Merge branch Devel to master See merge request !18
parents
decc6bfe
b0b81bbd
Changes
1
Show whitespace changes
Inline
Side-by-side
gkcore/views/api_invoice.py
View file @
814126b7
...
...
@@ -367,6 +367,7 @@ There will be an icFlag which will determine if it's an incrementing or decreme
taxRate
=
0.00
totalAmount
=
0.00
taxRate
=
float
(
invrow
[
"tax"
][
pc
])
if
int
(
invrow
[
"taxflag"
])
==
22
:
taxRate
=
float
(
invrow
[
"tax"
][
pc
])
taxAmount
=
(
taxableAmount
*
float
(
taxRate
/
100
))
...
...
@@ -378,25 +379,22 @@ There will be an icFlag which will determine if it's an incrementing or decreme
invContents
[
pc
]
=
{
"proddesc"
:
prodrow
[
"productdesc"
],
"gscode"
:
prodrow
[
"gscode"
],
"uom"
:
unitofMeasurement
,
"qty"
:
"%.2f"
%
(
float
(
contentsData
[
pc
][
contentsData
[
pc
].
keys
()[
0
]])),
"freeqty"
:
"%.2f"
%
(
float
(
freeqty
)),
"priceperunit"
:
"%.2f"
%
(
float
(
contentsData
[
pc
].
keys
()[
0
])),
"discount"
:
"%.2f"
%
(
float
(
discount
)),
"taxableamount"
:
"%.2f"
%
(
float
(
taxableAmount
)),
"totalAmount"
:
"%.2f"
%
(
float
(
totalAmount
)),
"taxname"
:
"VAT"
,
"taxrate"
:
"%.2f"
%
(
float
(
taxRate
)),
"taxamount"
:
"%.2f"
%
(
float
(
taxAmount
))}
else
:
TaxData
=
calTax
(
7
,
invrow
[
"sourcestate"
],
invrow
[
"taxstate"
],
pc
,
self
.
con
)
taxResult
=
TaxData
[
"gkresult"
]
cessRate
=
0.00
cessAmount
=
0.00
cessVal
=
0.00
taxname
=
""
if
taxResult
.
has_key
(
'CESS'
)
:
cessVal
=
float
(
taxResult
[
"CESS"
])
if
invrow
[
"cess"
]
!=
None
:
cessVal
=
float
(
invrow
[
"cess"
][
pc
])
cessAmount
=
(
taxableAmount
*
(
cessVal
/
100
))
totalCessAmt
=
totalCessAmt
+
cessAmount
if
taxResult
.
has_key
(
'IGST'
)
:
if
invrow
[
"sourcestate"
]
!=
invrow
[
"taxstate"
]
:
taxname
=
"IGST"
taxRate
=
float
(
taxResult
[
"IGST"
])
taxAmount
=
(
taxableAmount
*
(
taxRate
/
100
))
totalAmount
=
taxableAmount
+
taxAmount
+
cessAmount
else
:
taxname
=
"SGST"
taxRate
=
float
(
taxResult
[
"SGST"
]
)
taxRate
=
(
taxRate
/
2
)
taxAmount
=
(
taxableAmount
*
(
taxRate
/
100
))
totalAmount
=
taxableAmount
+
(
taxableAmount
*
((
taxRate
*
2
)
/
100
))
+
cessAmount
...
...
@@ -404,7 +402,6 @@ There will be an icFlag which will determine if it's an incrementing or decreme
totalTaxableVal
=
totalTaxableVal
+
taxableAmount
totalTaxAmt
=
totalTaxAmt
+
taxAmount
invContents
[
pc
]
=
{
"proddesc"
:
prodrow
[
"productdesc"
],
"gscode"
:
prodrow
[
"gscode"
],
"uom"
:
unitofMeasurement
,
"qty"
:
"%.2f"
%
(
float
(
contentsData
[
pc
][
contentsData
[
pc
].
keys
()[
0
]])),
"freeqty"
:
"%.2f"
%
(
float
(
freeqty
)),
"priceperunit"
:
"%.2f"
%
(
float
(
contentsData
[
pc
].
keys
()[
0
])),
"discount"
:
"%.2f"
%
(
float
(
discount
)),
"taxableamount"
:
"%.2f"
%
(
float
(
taxableAmount
)),
"totalAmount"
:
"%.2f"
%
(
float
(
totalAmount
)),
"taxname"
:
taxname
,
"taxrate"
:
"%.2f"
%
(
float
(
taxRate
)),
"taxamount"
:
"%.2f"
%
(
float
(
taxAmount
)),
"cess"
:
"%.2f"
%
(
float
(
cessAmount
)),
"cessrate"
:
"%.2f"
%
(
float
(
cessVal
))}
inv
[
"totaldiscount"
]
=
"%.2f"
%
(
float
(
totalDisc
))
inv
[
"totaltaxablevalue"
]
=
"%.2f"
%
(
float
(
totalTaxableVal
))
...
...
@@ -412,6 +409,7 @@ There will be an icFlag which will determine if it's an incrementing or decreme
inv
[
"totalcessamt"
]
=
"%.2f"
%
(
float
(
totalCessAmt
))
inv
[
'taxname'
]
=
taxname
inv
[
"invcontents"
]
=
invContents
return
{
"gkstatus"
:
gkcore
.
enumdict
[
"Success"
],
"gkresult"
:
inv
}
except
:
return
{
"gkstatus"
:
gkcore
.
enumdict
[
"ConnectionFailed"
]}
...
...
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