Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
ecommerce
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
ecommerce
Commits
b41266d4
Commit
b41266d4
authored
Jul 08, 2016
by
Ivan Ivic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SOL-1917] Rounding discrepancy between coupon offer landing page and cart
parent
208b69ab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
ecommerce/static/js/test/specs/views/offer_view_spec.js
+2
-2
ecommerce/static/js/views/offer_view.js
+3
-3
No files found.
ecommerce/static/js/test/specs/views/offer_view_spec.js
View file @
b41266d4
...
...
@@ -97,9 +97,9 @@ define([
it
(
'should set new price when setNewPrice called'
,
function
()
{
view
.
setNewPrice
(
view
.
collection
.
models
[
0
]);
expect
(
view
.
collection
.
models
[
0
].
get
(
'new_price'
)).
toBe
(
0
);
expect
(
view
.
collection
.
models
[
0
].
get
(
'new_price'
)).
toBe
(
'0.00'
);
view
.
setNewPrice
(
view
.
collection
.
models
[
1
]);
expect
(
view
.
collection
.
models
[
1
].
get
(
'new_price'
)).
toBe
(
80
);
expect
(
view
.
collection
.
models
[
1
].
get
(
'new_price'
)).
toBe
(
'80.00'
);
});
it
(
'should set benefit value when formatBenefitValue called'
,
function
()
{
...
...
ecommerce/static/js/views/offer_view.js
View file @
b41266d4
...
...
@@ -70,7 +70,7 @@ define([
setNewPrice
:
function
(
course
)
{
var
benefit
=
course
.
get
(
'benefit'
),
new_price
,
price
=
parse
Int
(
course
.
get
(
'stockrecords'
).
price_excl_tax
);
price
=
parse
Float
(
course
.
get
(
'stockrecords'
).
price_excl_tax
).
toFixed
(
2
);
if
(
benefit
.
type
===
'Percentage'
)
{
new_price
=
price
-
(
price
*
(
benefit
.
value
/
100
));
...
...
@@ -81,8 +81,8 @@ define([
}
}
course
.
get
(
'stockrecords'
).
price_excl_tax
=
Math
.
round
(
price
)
;
course
.
set
({
new_price
:
Math
.
round
(
new_price
)});
course
.
get
(
'stockrecords'
).
price_excl_tax
=
price
;
course
.
set
({
new_price
:
new_price
.
toFixed
(
2
)});
},
formatBenefitValue
:
function
(
course
)
{
...
...
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