Code Duplication    Length = 22-25 lines in 2 locations

includes/wpinv-gd-functions.php 2 locations

@@ 389-410 (lines=22) @@
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 : 'pending';
391
    
392
    switch ( $status ) {
393
        case 'confirmed':
394
            $inv_status = 'publish';
395
        break;
396
        case 'cancelled':
397
            $inv_status = 'wpi-cancelled';
398
        break;
399
        case 'failed':
400
            $inv_status = 'wpi-failed';
401
        break;
402
        case 'onhold':
403
            $inv_status = 'wpi-onhold';
404
        break;
405
        case 'refunded':
406
            $inv_status = 'wpi-refunded';
407
        break;
408
    }
409
    return $inv_status;
410
}
411
412
function wpinv_wpi_to_gdp_status( $status ) {
413
    $inv_status = $status ? $status : 'pending';
@@ 412-436 (lines=25) @@
409
    return $inv_status;
410
}
411
412
function wpinv_wpi_to_gdp_status( $status ) {
413
    $inv_status = $status ? $status : 'pending';
414
    
415
    switch ( $status ) {
416
        case 'publish':
417
        case 'wpi-processing':
418
        case 'wpi-renewal':
419
            $inv_status = 'confirmed';
420
        break;
421
        case 'wpi-cancelled':
422
            $inv_status = 'cancelled';
423
        break;
424
        case 'wpi-failed':
425
            $inv_status = 'failed';
426
        break;
427
        case 'wpi-onhold':
428
            $inv_status = 'onhold';
429
        break;
430
        case 'wpi-refunded':
431
            $inv_status = 'refunded';
432
        break;
433
    }
434
    
435
    return $inv_status;
436
}
437
438
function wpinv_wpi_to_gdp_id( $invoice_id ) {
439
    global $wpdb;