Code Duplication    Length = 8-9 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_format_amount( $this->subtotal, NULL, !$currency );
1271
        
1272
        if ( $currency ) {
1273
            $subtotal = wpinv_price( $subtotal, $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() ) {
@@ 1368-1375 (lines=8) @@
1365
        return $data;
1366
    }
1367
    
1368
    public function get_final_tax( $currency = false ) {        
1369
        $final_total = wpinv_format_amount( $this->tax, NULL, !$currency );
1370
        if ( $currency ) {
1371
            $final_total = wpinv_price( $final_total, $this->get_currency() );
1372
        }
1373
        
1374
        return apply_filters( 'wpinv_get_invoice_final_total', $final_total, $this, $currency );
1375
    }
1376
    
1377
    public function get_discounts( $array = false ) {
1378
        $discounts = $this->discounts;
@@ 1408-1416 (lines=9) @@
1405
        return $this->discount_code;
1406
    }
1407
    
1408
    public function get_tax( $currency = false ) {
1409
        $tax = wpinv_format_amount( $this->tax, NULL, !$currency );
1410
        
1411
        if ( $currency ) {
1412
            $tax = wpinv_price( $tax, $this->get_currency() );
1413
        }
1414
        
1415
        return apply_filters( 'wpinv_get_invoice_tax', $tax, $this->ID, $this, $currency );
1416
    }
1417
    
1418
    public function get_fees( $type = 'all' ) {
1419
        $fees    = array();