Code Duplication    Length = 8-9 lines in 3 locations

includes/class-wpinv-invoice.php 3 locations

@@ 1272-1280 (lines=9) @@
1269
        return apply_filters( 'wpinv_cart_details', $this->cart_details, $this->ID, $this );
1270
    }
1271
    
1272
    public function get_subtotal( $currency = false ) {
1273
        $subtotal = wpinv_format_amount( $this->subtotal, NULL, !$currency );
1274
        
1275
        if ( $currency ) {
1276
            $subtotal = wpinv_price( $subtotal, $this->get_currency() );
1277
        }
1278
        
1279
        return apply_filters( 'wpinv_get_invoice_subtotal', $subtotal, $this->ID, $this, $currency );
1280
    }
1281
    
1282
    public function get_total( $currency = false ) {        
1283
        if ( $this->is_free_trial() ) {
@@ 1371-1378 (lines=8) @@
1368
        return $data;
1369
    }
1370
    
1371
    public function get_final_tax( $currency = false ) {        
1372
        $final_total = wpinv_format_amount( $this->tax, NULL, !$currency );
1373
        if ( $currency ) {
1374
            $final_total = wpinv_price( $final_total, $this->get_currency() );
1375
        }
1376
        
1377
        return apply_filters( 'wpinv_get_invoice_final_total', $final_total, $this, $currency );
1378
    }
1379
    
1380
    public function get_discounts( $array = false ) {
1381
        $discounts = $this->discounts;
@@ 1411-1419 (lines=9) @@
1408
        return $this->discount_code;
1409
    }
1410
    
1411
    public function get_tax( $currency = false ) {
1412
        $tax = wpinv_format_amount( $this->tax, NULL, !$currency );
1413
        
1414
        if ( $currency ) {
1415
            $tax = wpinv_price( $tax, $this->get_currency() );
1416
        }
1417
        
1418
        return apply_filters( 'wpinv_get_invoice_tax', $tax, $this->ID, $this, $currency );
1419
    }
1420
    
1421
    public function get_fees( $type = 'all' ) {
1422
        $fees    = array();