Code Duplication    Length = 22-25 lines in 2 locations

includes/wpinv-gd-functions.php 2 locations

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