Code Duplication    Length = 9-12 lines in 3 locations

includes/class-wpinv-invoice.php 3 locations

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