+=cut
+
+sub AddImportBatch {
+ my ($params) = @_;
+
+ my (@fields, @vals);
+ foreach (qw( matcher_id template_id branchcode
+ overlay_action nomatch_action item_action
+ import_status batch_type file_name comments )) {
+ if (exists $params->{$_}) {
+ push @fields, $_;
+ push @vals, $params->{$_};
+ }
+ }
+ my $dbh = C4::Context->dbh;
+ $dbh->do("INSERT INTO import_batches (".join( ',', @fields).")
+ VALUES (".join( ',', map '?', @fields).")",
+ undef,
+ @vals);
+ return $dbh->{'mysql_insertid'};
+}
+
+=head2 GetImportBatch