$self->controller->track_progress(phase => 'saving data', progress => 0); # scale from 45..95%;
- my $dbh = $data->[0]{object}->db;
+ my $dbh = $data->[0]{object}->db->dbh;
my $last_index = $#$data;
my $chunk_size = 100; # one transaction and progress update every 100 objects
my $data = $params{data} || $self->controller->data;
foreach my $entry (@{ $data }) {
- my ($trans_id) = selectrow_query($::form, $::form->get_standard_dbh, qq|SELECT nextval('id')|);
+ my ($trans_id) = selectrow_query($::form,$entry->{object}->db->dbh, qq|SELECT nextval('id')|);
$entry->{object}->trans_id($trans_id);
}
$object->chargenumber);
push @values, $object->bestbefore if $bestbefore_val_cnt;
- my ($stocked_qty) = selectrow_query($::form, $::form->get_standard_dbh, $query, @values);
+ my ($stocked_qty) = selectrow_query($::form, $object->db->dbh, $query, @values);
return $stocked_qty;
}