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

sub set_hardware_info($;$) {
	my ( $idi, $kn ) = @_;
	content( my $info =
		  line_in 'Zusatzinfo' . ( !defined $idi && ' (optional)' ) . ': ' )
	  or return defined $idi ? () : 'NULL';
	$info = $info eq '-' ? 'NULL' : qquote $info;
	return $info unless defined $idi;
	log_update hardware => id => $idi, undef, 'info', undef,
		DoFn("select info from hardware WHERE id=$idi");
	Do "UPDATE hardware SET info=$info WHERE id=$idi";
}

1;
