/** * Echo the estimate discount * @param integer $id * @return string */ function si_estimate_discount($id = 0) { if (!$id) { global $post; $id = $post->ID; } echo apply_filters('si_estimate_discount', si_get_estimate_discount($id), $id); }
/** * Echo the estimate discount * @param integer $id * @return string */ function si_estimate_discount($id = 0) { if (!$id) { $id = get_the_ID(); } echo apply_filters('si_estimate_discount', si_get_estimate_discount($id), $id); }
public static function discount($atts = array()) { $discount = 0; if (si_get_doc_context() == 'estimate') { $discount = si_get_estimate_subtotal() * (si_get_estimate_discount() / 100); } else { $discount = si_get_invoice_subtotal() * (si_get_invoice_discount() / 100); } return sa_get_formatted_money($discount); }