use utf8;
use warnings; no warnings "redefine";
use strict;
use Loader qw(line_in log_update);
use Dbase::Help qw(Do DoFn);
use Dbase::Globals qw(bignum);

sub set_acct_bytes($$;$) {
	my($hash,$seq,$kn) = @_;
	my ( $id, $obytes ) =
	  DoFn("SELECT kunde, bytes FROM acct WHERE `hash` = $hash AND seq = $seq");

	my $bytes = line_in "Bytes: "; return undef unless $bytes =~ /^\d+$/;

	log_update("acct","hash",$hash,"seq",$seq,undef,"bytes",undef,$obytes);
	Do("UPDATE acct SET bytes=$bytes WHERE `hash` = $hash AND seq = $seq");

	if($id > 0) {
	    Do("update kunde set geaendert=UNIX_TIMESTAMP(NOW()) where id=$id");
	}
	($hash,$seq);
}

1;
