Forums / Built-in Shipping and Payment Modules / Finnish referal number counter

Finnish referal number counter

Locked

Views: 1,156

Results 1 to 1 of 1
This thread is locked. New replies are disabled.
23 Jul 2006, 2:24 PM
#1
paradise avatar

paradise

New Zenner

Join Date:
Jul 2006
Posts:
4
Plugin Contributions:
0

Finnish referal number counter

Hi,

i need referal number in finnish invoice. i dont use credit cart or bank gateways and i need only that referal number . I find check number calculation method in old finnish bank gateway ( http://www.zen-cart.com/archived_contributions/payment/).

// Counts a check number for the referer
function mkref_check() {
if ( empty($this->refer)) $this->make_ref();
$timer = array('1','3','7');
$refer = $this->str_split($this->refer);
$c = 0;
$calc = array();

	foreach ( $refer as $i ) {
		if ($c == 0) { $calc[] = $timer[$c] * $i; $c = 1; }
		elseif ($c == 1) { $calc[] = $timer[$c] * $i; $c = 2; }
		elseif ($c == 2) { $calc[] = $timer[$c] * $i; $c = 0; }
	}

	foreach ( $calc as $add ) {
		$total += $add;
	}

	$next_ten = round($total, -1);
	if ($next_ten < $total) $next_ten += 10; // If the last number in $total was 5, round() returns the previous 10 so we have to set it manually to the next 10... by adding 10 :)
	return $this->refer . ($next_ten - $total);
}

how can i fix this calculation example. "Customer id +order number+date + check number= referal number

Store owner:
Bank details:
Bank name:
Bank account no:
Personal referral code: 000 000 mmddyy 0
"

I use zen cart 1.3.0.2 and payment method is same like "Dirbank" (i little fixed it) http://www.zen-cart.com/index.php?main_page=product_contrib_info&cPath=40_48&products_id=151

Can someone help me?