Code Duplication    Length = 25-28 lines in 2 locations

includes/wpinv-gd-functions.php 2 locations

@@ 389-413 (lines=25) @@
386
}
387
add_action( 'geodir_payment_invoice_transaction_details_changed', 'wpinv_transaction_details_note', 11, 2 );
388
389
function wpinv_gdp_to_wpi_status( $status ) {
390
    $inv_status = $status ? $status : 'wpi-pending';
391
    
392
    switch ( $status ) {
393
        case 'pending':
394
            $inv_status = 'wpi-pending';
395
        break;
396
        case 'confirmed':
397
            $inv_status = 'publish';
398
        break;
399
        case 'cancelled':
400
            $inv_status = 'wpi-cancelled';
401
        break;
402
        case 'failed':
403
            $inv_status = 'wpi-failed';
404
        break;
405
        case 'onhold':
406
            $inv_status = 'wpi-onhold';
407
        break;
408
        case 'refunded':
409
            $inv_status = 'wpi-refunded';
410
        break;
411
    }
412
    return $inv_status;
413
}
414
415
function wpinv_wpi_to_gdp_status( $status ) {
416
    $inv_status = $status ? $status : 'pending';
@@ 415-442 (lines=28) @@
412
    return $inv_status;
413
}
414
415
function wpinv_wpi_to_gdp_status( $status ) {
416
    $inv_status = $status ? $status : 'pending';
417
    
418
    switch ( $status ) {
419
        case 'wpi-pending':
420
            $inv_status = 'pending';
421
        break;
422
        case 'publish':
423
        case 'wpi-processing':
424
        case 'wpi-renewal':
425
            $inv_status = 'confirmed';
426
        break;
427
        case 'wpi-cancelled':
428
            $inv_status = 'cancelled';
429
        break;
430
        case 'wpi-failed':
431
            $inv_status = 'failed';
432
        break;
433
        case 'wpi-onhold':
434
            $inv_status = 'onhold';
435
        break;
436
        case 'wpi-refunded':
437
            $inv_status = 'refunded';
438
        break;
439
    }
440
    
441
    return $inv_status;
442
}
443
444
function wpinv_wpi_to_gdp_id( $invoice_id ) {
445
    global $wpdb;