Code Duplication    Length = 9-12 lines in 3 locations

includes/class-wpinv-invoice.php 3 locations

@@ 1269-1277 (lines=9) @@
1266
        return apply_filters( 'wpinv_cart_details', $this->cart_details, $this->ID, $this );
1267
    }
1268
    
1269
    public function get_subtotal( $currency = false ) {
1270
        $subtotal = wpinv_round_amount( $this->subtotal );
1271
        
1272
        if ( $currency ) {
1273
            $subtotal = wpinv_price( wpinv_format_amount( $subtotal, NULL, !$currency ), $this->get_currency() );
1274
        }
1275
        
1276
        return apply_filters( 'wpinv_get_invoice_subtotal', $subtotal, $this->ID, $this, $currency );
1277
    }
1278
    
1279
    public function get_total( $currency = false ) {        
1280
        if ( $this->is_free_trial() ) {
@@ 1279-1290 (lines=12) @@
1276
        return apply_filters( 'wpinv_get_invoice_subtotal', $subtotal, $this->ID, $this, $currency );
1277
    }
1278
    
1279
    public function get_total( $currency = false ) {        
1280
        if ( $this->is_free_trial() ) {
1281
            $total = wpinv_round_amount( 0 );
1282
        } else {
1283
            $total = wpinv_round_amount( $this->total );
1284
        }
1285
        if ( $currency ) {
1286
            $total = wpinv_price( wpinv_format_amount( $total, NULL, !$currency ), $this->get_currency() );
1287
        }
1288
        
1289
        return apply_filters( 'wpinv_get_invoice_total', $total, $this->ID, $this, $currency );
1290
    }
1291
    
1292
    public function get_recurring_details( $field = '', $currency = false ) {        
1293
        $data                 = array();
@@ 1414-1422 (lines=9) @@
1411
        return $this->discount_code;
1412
    }
1413
    
1414
    public function get_tax( $currency = false ) {
1415
        $tax = wpinv_round_amount( $this->tax );
1416
        
1417
        if ( $currency ) {
1418
            $tax = wpinv_price( wpinv_format_amount( $tax, NULL, !$currency ), $this->get_currency() );
1419
        }
1420
        
1421
        return apply_filters( 'wpinv_get_invoice_tax', $tax, $this->ID, $this, $currency );
1422
    }
1423
    
1424
    public function get_fees( $type = 'all' ) {
1425
        $fees    = array();