Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Extensions
Line Item Editor
Commits
7bbf7dbb
Unverified
Commit
7bbf7dbb
authored
May 13, 2019
by
Monish Deb
Committed by
GitHub
May 13, 2019
Browse files
Merge pull request #36 from pradpnayak/core/issues/955
core/issues/955, Total Amount includes the Tax amount twice
parents
d2ac58df
0cd3ea21
Changes
1
Hide whitespace changes
Inline
Side-by-side
templates/CRM/Lineitemedit/Form/AddLineItems.tpl
View file @
7bbf7dbb
...
...
@@ -159,13 +159,15 @@ CRM.$(function($) {
function
calculateTotalAmount
()
{
var
thousandMarker
=
"
{/
literal
}{
$config
->
monetaryThousandSeparator
}{
literal
}
"
;
var
total_amount
=
(
isNaN
(
parseFloat
(
'
{/
literal
}{
$totalTaxAmount
}{
literal
}
'
))
?
0
:
parseFloat
(
'
{/
literal
}{
$totalTaxAmount
}{
literal
}
'
))
;
let
total_amount
=
0
;
if
(
$
(
'
input[id="total_amount"]
'
).
length
)
{
total_amount
=
total_amount
+
parseFloat
((
$
(
'
input[id="total_amount"]
'
).
val
().
replace
(
thousandMarker
,
''
)
||
0
));
total_amount
=
parseFloat
((
$
(
'
input[id="total_amount"]
'
).
val
().
replace
(
thousandMarker
,
''
)
||
0
));
}
else
{
total_amount
=
total_amount
+
(
isNaN
(
parseFloat
(
'
{/
literal
}{
$totalAmount
}{
literal
}
'
))
?
0
:
parseFloat
(
'
{/
literal
}{
$totalAmount
}{
literal
}
'
));
if
(
!
$
(
"
#total_amount
"
).
is
(
"
:hidden
"
))
{
total_amount
+=
calculateTaxAmount
(
$
(
'
select[id="financial_type_id"]
'
).
val
(),
total_amount
);
}
$
.
each
(
$
(
'
.line-item-row
'
),
function
()
{
total_amount
+=
parseFloat
((
$
(
'
input[id^="item_line_total_"]
'
,
this
).
val
().
replace
(
thousandMarker
,
''
)
||
0
));
if
(
$
(
'
input[id^="item_tax_amount"]
'
,
this
).
length
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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