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 );
@@ 1861-1870 (lines=10) @@
1858
    return $display;
1859
}
1860
1861
function wpinv_get_invoice_id_by_key( $key ) {
1862
	global $wpdb;
1863
1864
	$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 ) );
1865
1866
	if ( $invoice_id != NULL )
1867
		return $invoice_id;
1868
1869
	return 0;
1870
}
1871
1872
function wpinv_can_view_receipt( $invoice_key = '' ) {
1873
	$return = false;