@@ 1257-1265 (lines=9) @@ | ||
1254 | return apply_filters( 'wpinv_cart_details', $this->cart_details, $this->ID, $this ); |
|
1255 | } |
|
1256 | ||
1257 | public function get_subtotal( $currency = false ) { |
|
1258 | $subtotal = wpinv_round_amount( $this->subtotal ); |
|
1259 | ||
1260 | if ( $currency ) { |
|
1261 | $subtotal = wpinv_price( wpinv_format_amount( $subtotal, NULL, !$currency ), $this->get_currency() ); |
|
1262 | } |
|
1263 | ||
1264 | return apply_filters( 'wpinv_get_invoice_subtotal', $subtotal, $this->ID, $this, $currency ); |
|
1265 | } |
|
1266 | ||
1267 | public function get_total( $currency = false ) { |
|
1268 | if ( $this->is_free_trial() ) { |
|
@@ 1267-1278 (lines=12) @@ | ||
1264 | return apply_filters( 'wpinv_get_invoice_subtotal', $subtotal, $this->ID, $this, $currency ); |
|
1265 | } |
|
1266 | ||
1267 | public function get_total( $currency = false ) { |
|
1268 | if ( $this->is_free_trial() ) { |
|
1269 | $total = wpinv_round_amount( 0 ); |
|
1270 | } else { |
|
1271 | $total = wpinv_round_amount( $this->total ); |
|
1272 | } |
|
1273 | if ( $currency ) { |
|
1274 | $total = wpinv_price( wpinv_format_amount( $total, NULL, !$currency ), $this->get_currency() ); |
|
1275 | } |
|
1276 | ||
1277 | return apply_filters( 'wpinv_get_invoice_total', $total, $this->ID, $this, $currency ); |
|
1278 | } |
|
1279 | ||
1280 | public function get_recurring_details( $field = '', $currency = false ) { |
|
1281 | $data = array(); |
|
@@ 1402-1410 (lines=9) @@ | ||
1399 | return $this->discount_code; |
|
1400 | } |
|
1401 | ||
1402 | public function get_tax( $currency = false ) { |
|
1403 | $tax = wpinv_round_amount( $this->tax ); |
|
1404 | ||
1405 | if ( $currency ) { |
|
1406 | $tax = wpinv_price( wpinv_format_amount( $tax, NULL, !$currency ), $this->get_currency() ); |
|
1407 | } |
|
1408 | ||
1409 | return apply_filters( 'wpinv_get_invoice_tax', $tax, $this->ID, $this, $currency ); |
|
1410 | } |
|
1411 | ||
1412 | public function get_fees( $type = 'all' ) { |
|
1413 | $fees = array(); |