Code Duplication    Length = 8-9 lines in 3 locations

includes/class-wpinv-invoice.php 3 locations

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