Code Duplication    Length = 10-10 lines in 2 locations

includes/wpinv-invoice-functions.php 2 locations

@@ 314-323 (lines=10) @@
311
    return $invoice->get_transaction_id();
312
}
313
314
function wpinv_get_id_by_transaction_id( $key ) {
315
    global $wpdb;
316
317
    $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 ) );
318
319
    if ( $invoice_id != NULL )
320
        return $invoice_id;
321
322
    return 0;
323
}
324
325
function wpinv_get_invoice_meta( $invoice_id = 0, $meta_key = '_wpinv_payment_meta', $single = true ) {
326
    $invoice = new WPInv_Invoice( $invoice_id );
@@ 1627-1636 (lines=10) @@
1624
    return $display;
1625
}
1626
1627
function wpinv_get_invoice_id_by_key( $key ) {
1628
	global $wpdb;
1629
1630
	$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 ) );
1631
1632
	if ( $invoice_id != NULL )
1633
		return $invoice_id;
1634
1635
	return 0;
1636
}
1637
1638
function wpinv_can_view_receipt( $invoice_key = '' ) {
1639
	$return = false;