Code Duplication    Length = 9-12 lines in 3 locations

includes/class-wpinv-invoice.php 3 locations

@@ 1275-1283 (lines=9) @@
1272
        return apply_filters( 'wpinv_cart_details', $this->cart_details, $this->ID, $this );
1273
    }
1274
    
1275
    public function get_subtotal( $currency = false ) {
1276
        $subtotal = wpinv_round_amount( $this->subtotal );
1277
        
1278
        if ( $currency ) {
1279
            $subtotal = wpinv_price( wpinv_format_amount( $subtotal, NULL, !$currency ), $this->get_currency() );
1280
        }
1281
        
1282
        return apply_filters( 'wpinv_get_invoice_subtotal', $subtotal, $this->ID, $this, $currency );
1283
    }
1284
    
1285
    public function get_total( $currency = false ) {        
1286
        if ( $this->is_free_trial() ) {
@@ 1285-1296 (lines=12) @@
1282
        return apply_filters( 'wpinv_get_invoice_subtotal', $subtotal, $this->ID, $this, $currency );
1283
    }
1284
    
1285
    public function get_total( $currency = false ) {        
1286
        if ( $this->is_free_trial() ) {
1287
            $total = wpinv_round_amount( 0 );
1288
        } else {
1289
            $total = wpinv_round_amount( $this->total );
1290
        }
1291
        if ( $currency ) {
1292
            $total = wpinv_price( wpinv_format_amount( $total, NULL, !$currency ), $this->get_currency() );
1293
        }
1294
        
1295
        return apply_filters( 'wpinv_get_invoice_total', $total, $this->ID, $this, $currency );
1296
    }
1297
    
1298
    public function get_recurring_details( $field = '', $currency = false ) {        
1299
        $data                 = array();
@@ 1420-1428 (lines=9) @@
1417
        return $this->discount_code;
1418
    }
1419
    
1420
    public function get_tax( $currency = false ) {
1421
        $tax = wpinv_round_amount( $this->tax );
1422
        
1423
        if ( $currency ) {
1424
            $tax = wpinv_price( wpinv_format_amount( $tax, NULL, !$currency ), $this->get_currency() );
1425
        }
1426
        
1427
        return apply_filters( 'wpinv_get_invoice_tax', $tax, $this->ID, $this, $currency );
1428
    }
1429
    
1430
    public function get_fees( $type = 'all' ) {
1431
        $fees    = array();