Code Duplication    Length = 10-10 lines in 2 locations

includes/wpinv-invoice-functions.php 2 locations

@@ 535-544 (lines=10) @@
532
    return $invoice->get_transaction_id();
533
}
534
535
function wpinv_get_id_by_transaction_id( $key ) {
536
    global $wpdb;
537
538
    $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 ) );
539
540
    if ( $invoice_id != NULL )
541
        return $invoice_id;
542
543
    return 0;
544
}
545
546
function wpinv_get_invoice_meta( $invoice_id = 0, $meta_key = '_wpinv_payment_meta', $single = true ) {
547
    $invoice = new WPInv_Invoice( $invoice_id );
@@ 1886-1895 (lines=10) @@
1883
    return $display;
1884
}
1885
1886
function wpinv_get_invoice_id_by_key( $key ) {
1887
	global $wpdb;
1888
1889
	$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 ) );
1890
1891
	if ( $invoice_id != NULL )
1892
		return $invoice_id;
1893
1894
	return 0;
1895
}
1896
1897
function wpinv_can_view_receipt( $invoice_key = '' ) {
1898
	$return = false;