negative when there's discount
This commit is contained in:
@@ -91,7 +91,7 @@ export function Bulk({ courses, onSubmit }: BulkProps) {
|
|||||||
0
|
0
|
||||||
)
|
)
|
||||||
const discount = coupon
|
const discount = coupon
|
||||||
? applyDiscount(subtotal, coupon.amount, coupon.type)
|
? applyDiscount(subtotal, coupon.amount, coupon.type) * -1
|
||||||
: 0
|
: 0
|
||||||
const total = subtotal > 0 ? subtotal - discount : 0
|
const total = subtotal > 0 ? subtotal - discount : 0
|
||||||
|
|
||||||
@@ -319,7 +319,7 @@ export function Bulk({ courses, onSubmit }: BulkProps) {
|
|||||||
|
|
||||||
<InputGroupInput
|
<InputGroupInput
|
||||||
name="discount"
|
name="discount"
|
||||||
value={currency(discount * -1)}
|
value={currency(discount)}
|
||||||
tabIndex={-1}
|
tabIndex={-1}
|
||||||
className="pointer-events-none text-muted-foreground"
|
className="pointer-events-none text-muted-foreground"
|
||||||
readOnly
|
readOnly
|
||||||
|
|||||||
Reference in New Issue
Block a user