use POSIX qw(strftime);
use Test::More tests => 87;
+use Koha::Database;
BEGIN {
use_ok('C4::Acquisition');
);
}
+
+my $schema = Koha::Database->new()->schema();
+$schema->storage->txn_begin();
+
my $dbh = C4::Context->dbh;
-$dbh->{AutoCommit} = 0;
$dbh->{RaiseError} = 1;
# Creating some orders
ok((not defined GetBiblio($order4->{biblionumber})), "biblio does not exist anymore");
# End of tests for DelOrder
-$dbh->rollback;
+$schema->storage->txn_rollback();
use C4::Budgets;
use t::lib::Mocks;
+use Koha::Database;
use Koha::DateUtils;
use Koha::Acquisition::Order;
use MARC::Record;
+my $schema = Koha::Database->new()->schema();
+$schema->storage->txn_begin();
my $dbh = C4::Context->dbh;
$dbh->{RaiseError} = 1;
-$dbh->{AutoCommit} = 0;
my $booksellerid1 = C4::Bookseller::AddBookseller(
{
my $item2 = C4::Items::GetItem( $itemnumber2 );
is( $item2->{notforloan}, 0, "The notforloan value has been updated with '9'" );
-$dbh->rollback;
+$schema->storage->txn_rollback();
use C4::Bookseller qw( AddBookseller );
use C4::Budgets qw( AddBudget );
use C4::Context;
-
+use Koha::Database;
use Koha::Acquisition::Order;
+my $schema = Koha::Database->new()->schema();
+$schema->storage->txn_begin();
+
my $dbh = C4::Context->dbh;
-$dbh->{AutoCommit} = 0;
$dbh->{RaiseError} = 1;
my $supplierid = C4::Bookseller::AddBookseller(
is( scalar(@$baskets), 1, 'Basket is closed, test allbasket parameter');
-$dbh->rollback
+$schema->storage->txn_rollback();
use C4::Biblio;
use C4::Bookseller;
use C4::Budgets;
-
+use Koha::Database;
use Koha::Acquisition::Order;
use MARC::Record;
#Start transaction
+my $schema = Koha::Database->new()->schema();
+$schema->storage->txn_begin();
my $dbh = C4::Context->dbh;
-$dbh->{AutoCommit} = 0;
$dbh->{RaiseError} = 1;
my $booksellerid = C4::Bookseller::AddBookseller(
is(scalar(@orders), 2, '2 orders on biblionumber 2');
#End transaction
-$dbh->rollback;
+$schema->storage->txn_rollback();
done_testing;
use Koha::Acquisition::Order;
use Koha::Acquisition::Bookseller;
+use Koha::Database;
use Test::More tests => 24;
use_ok('C4::Acquisition');
}
+my $schema = Koha::Database->new()->schema();
+$schema->storage->txn_begin();
my $dbh = C4::Context->dbh;
-$dbh->{AutoCommit} = 0;
$dbh->{RaiseError} = 1;
$dbh->do(q{DELETE FROM aqinvoices});
is_deeply( \@invoices_linked_to_subscriptions, [], "GetInvoices return linked_to_subscriptions: there is no invoices linked to subscriptions yet" );
END {
- $dbh and $dbh->rollback;
+ $dbh and $schema->storage->txn_rollback();
}
use C4::Bookseller;
use C4::Budgets;
use MARC::Record;
+use Koha::Database;
use Koha::DateUtils qw( dt_from_string output_pref );
use Koha::Acquisition::Order;
+my $schema = Koha::Database->new()->schema();
+$schema->storage->txn_begin();
my $dbh = C4::Context->dbh;
-$dbh->{AutoCommit} = 0;
$dbh->{RaiseError} = 1;
my $booksellerid = C4::Bookseller::AddBookseller(
$order = Koha::Acquisition::Order->fetch({ ordernumber => $ordernumber });
is( $order->{quantityreceived}, 0, 'Koha::Acquisition::Order->insert set quantityreceivedto 0 if undef is given' );
is( $order->{entrydate}, output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }), 'Koha::Acquisition::Order->insert set entrydate to today' );
+
+$schema->storage->txn_rollback();
\ No newline at end of file
use_ok('C4::Serials');
use Koha::Acquisition::Order;
+use Koha::Database;
# Start transaction
+my $schema = Koha::Database->new()->schema();
+$schema->storage->txn_begin();
my $dbh = C4::Context->dbh;
-$dbh->{AutoCommit} = 0;
$dbh->{RaiseError} = 1;
my $booksellerid = C4::Bookseller::AddBookseller(
is(scalar(@invoices_linked_to_subscriptions), 1, 'GetInvoices() can identify invoices that are linked to a subscription');
# Cleanup
-$dbh->rollback;
+$schema->storage->txn_rollback();
use C4::Biblio;
use C4::Bookseller;
use C4::Letters;
-
+use Koha::Database;
use Koha::Acquisition::Order;
+my $schema = Koha::Database->new()->schema();
+$schema->storage->txn_begin();
my $dbh = C4::Context->dbh;
$dbh->{RaiseError} = 1;
-$dbh->{AutoCommit} = 0;
# Creating some orders
my $booksellerid = C4::Bookseller::AddBookseller(
$messages = C4::Letters::GetQueuedMessages({ borrowernumber => $borrowernumber });
is( scalar( @$messages ), 1, 'The letter has been sent to message queue on receiving the order');
+
+$schema->storage->txn_rollback();
use C4::Items;
use C4::Bookseller;
use C4::Budgets;
+use Koha::Database;
use Koha::DateUtils;
use Koha::Acquisition::Order;
use MARC::Record;
+my $schema = Koha::Database->new()->schema();
+$schema->storage->txn_begin();
+
my $dbh = C4::Context->dbh;
$dbh->{RaiseError} = 1;
-$dbh->{AutoCommit} = 0;
my $booksellerid1 = C4::Bookseller::AddBookseller(
{
is ( $order->{ordernumber}, $newordernumber, 'Regression test Bug 11549: After a transfer, receive and cancel the receive should be possible.' );
is ( $order->{basketno}, $basketno2, 'Regression test Bug 11549: The order still exist in the basket where the transfer has been done.');
-$dbh->rollback;
+$schema->storage->txn_rollback();
use C4::Bookseller;
use C4::Budgets;
use C4::Context;
-
+use Koha::Database;
use Koha::Acquisition::Order;
# Start transaction
+my $schema = Koha::Database->new()->schema();
+$schema->storage->txn_begin();
+
my $dbh = C4::Context->dbh;
-$dbh->{AutoCommit} = 0;
$dbh->{RaiseError} = 1;
$dbh->do(q{
is ( scalar( map { $_->{orderstatus} eq 'ordered' ? 1 : () } @orders ), 0, "No order are ordered, the basket is reopen" );
is ( scalar( map { $_->{orderstatus} eq 'new' ? 1 : () } @orders ), 2, "2 orders are new, the basket is reopen" );
-$dbh->rollback;
+$schema->storage->txn_rollback();