Code Duplication    Length = 8-9 lines in 3 locations

includes/class-wpinv-invoice.php 3 locations

@@ 1281-1289 (lines=9) @@
1278
        return apply_filters( 'wpinv_cart_details', $this->cart_details, $this->ID, $this );
1279
    }
1280
    
1281
    public function get_subtotal( $currency = false ) {
1282
        $subtotal = wpinv_format_amount( $this->subtotal, NULL, !$currency );
1283
        
1284
        if ( $currency ) {
1285
            $subtotal = wpinv_price( $subtotal, $this->get_currency() );
1286
        }
1287
        
1288
        return apply_filters( 'wpinv_get_invoice_subtotal', $subtotal, $this->ID, $this, $currency );
1289
    }
1290
    
1291
    public function get_total( $currency = false ) {        
1292
        if ( $this->is_free_trial() ) {
@@ 1380-1387 (lines=8) @@
1377
        return $data;
1378
    }
1379
    
1380
    public function get_final_tax( $currency = false ) {        
1381
        $final_total = wpinv_format_amount( $this->tax, NULL, !$currency );
1382
        if ( $currency ) {
1383
            $final_total = wpinv_price( $final_total, $this->get_currency() );
1384
        }
1385
        
1386
        return apply_filters( 'wpinv_get_invoice_final_total', $final_total, $this, $currency );
1387
    }
1388
    
1389
    public function get_discounts( $array = false ) {
1390
        $discounts = $this->discounts;
@@ 1420-1428 (lines=9) @@
1417
        return $this->discount_code;
1418
    }
1419
    
1420
    public function get_tax( $currency = false ) {
1421
        $tax = wpinv_format_amount( $this->tax, NULL, !$currency );
1422
        
1423
        if ( $currency ) {
1424
            $tax = wpinv_price( $tax, $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();