Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $criteria->select = array("*",
- "COALESCE((SELECT (ROUND(SUM(quotation_detail.selling_price * quotation_detail.quantity),2)) FROM quotation_detail WHERE quotation_detail.quotation_header_id=$this->alias.id GROUP BY quotation_detail.quotation_header_id),0) as totalAmount",
- "COALESCE((SELECT ROUND(totalAmount*(1-(COALESCE($this->alias.discount/100,0))),2) FROM quotation_detail WHERE quotation_detail.quotation_header_id=$this->alias.id GROUP BY quotation_detail.quotation_header_id),0) as totalDiscountedAmount",
- "COALESCE((SELECT ROUND(totalDiscountedAmount*(1+(COALESCE($this->alias.tax/100,0))),2) FROM quotation_detail WHERE quotation_detail.quotation_header_id=$this->alias.id GROUP BY quotation_detail.quotation_header_id),0.00) as totalTaxedAmount",
- "COALESCE((SELECT (ROUND(SUM(amount),2)) FROM sale WHERE quoation_id=$this->alias.id GROUP BY quoation_id),0.00) AS totalSalesCredited"
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement