Code Duplication    Length = 13-13 lines in 2 locations

includes/wpinv-discount-functions.php 2 locations

@@ 451-463 (lines=13) @@
448
    if ( $discount ) {
449
        $start_date = wpinv_get_discount_start_date( $code_id );
450
451
        if ( $start_date ) {
452
            $start_date = strtotime( $start_date );
453
454
            if ( $start_date < current_time( 'timestamp' ) ) {
455
                // Discount has past the start date
456
                $return = true;
457
            } else {
458
                wpinv_set_error( 'wpinv-discount-error', __( 'This discount is not active yet.', 'invoicing' ) );
459
            }
460
        } else {
461
            // No start date for this discount, so has to be true
462
            $return = true;
463
        }
464
    }
465
466
    return apply_filters( 'wpinv_is_discount_started', $return, $code_id );
@@ 476-488 (lines=13) @@
473
    if ( $discount ) {
474
        $start_date = wpinv_get_discount_start_date( $code_id );
475
476
        if ( $start_date ) {
477
            $start_date = strtotime( $start_date );
478
479
            if ( $start_date < current_time( 'timestamp' ) ) {
480
                // Discount has past the start date
481
                $return = true;
482
            } else {
483
                wpinv_set_error( 'wpinv-discount-error', __( 'This discount is not active yet.', 'invoicing' ) );
484
            }
485
        } else {
486
            // No start date for this discount, so has to be true
487
            $return = true;
488
        }
489
        
490
        if ( $return ) {
491
            $expiration = wpinv_get_discount_expiration( $code_id );