Code Duplication    Length = 10-10 lines in 2 locations

includes/wpinv-invoice-functions.php 2 locations

@@ 530-539 (lines=10) @@
527
    return $invoice->get_transaction_id();
528
}
529
530
function wpinv_get_id_by_transaction_id( $key ) {
531
    global $wpdb;
532
533
    $invoice_id = $wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_wpinv_transaction_id' AND meta_value = %s LIMIT 1", $key ) );
534
535
    if ( $invoice_id != NULL )
536
        return $invoice_id;
537
538
    return 0;
539
}
540
541
function wpinv_get_invoice_meta( $invoice_id = 0, $meta_key = '_wpinv_payment_meta', $single = true ) {
542
    $invoice = new WPInv_Invoice( $invoice_id );
@@ 1868-1877 (lines=10) @@
1865
    return $display;
1866
}
1867
1868
function wpinv_get_invoice_id_by_key( $key ) {
1869
	global $wpdb;
1870
1871
	$invoice_id = $wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_wpinv_key' AND meta_value = %s LIMIT 1", $key ) );
1872
1873
	if ( $invoice_id != NULL )
1874
		return $invoice_id;
1875
1876
	return 0;
1877
}
1878
1879
function wpinv_can_view_receipt( $invoice_key = '' ) {
1880
	$return = false;