Code Duplication    Length = 9-12 lines in 3 locations

includes/class-wpinv-invoice.php 3 locations

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