Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT name, (
- SELECT SUM(qty * (
- IF(ifnull(base_ref_rate, 0)=0, ifnull(basic_rate, 0), ifnull(base_ref_rate, 0)) - ifnull(basic_rate, 0))
- )
- FROM `tabSales Invoice Item`
- WHERE `tabSales Invoice Item`.parent = `tabSales Invoice`.name
- ) AS discount_value
- FROM `tabSales Invoice` WHERE docstatus=1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement