@@ -, +, @@ confirm that the modal prints as expected accross multiple pages without duplications or data lose. transactions'. This will lengthen the page significantly correct number of pages is printed and contain the correct content. --- populate_cashups.pl | 46 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 populate_cashups.pl --- a/populate_cashups.pl +++ a/populate_cashups.pl @@ -0,0 +1,46 @@ +#!/usr/bin/perl + +use Modern::Perl; + +use Koha::Database; +use t::lib::TestBuilder; + +my $builder = t::lib::TestBuilder->new; +my $manager = $builder->build_object( { class => 'Koha::Patrons' } ); +my $register = Koha::Cash::Registers->find({ name => 'TEST' }); +for ( 1..10 ) { + my $patron = $builder->build_object({ class => 'Koha::Patrons' }); + my $account = $patron->account; + for ( 1..10 ) { + my $debit_type = $builder->build_object( + { + class => 'Koha::Account::DebitTypes' + } + ); + my $debit = $account->add_debit( + { + amount => 1 + int(rand(100 - 1)), + type => $debit_type->code, + interface => 'cron' + } + ); + $debit->date( \'NOW() - INTERVAL FLOOR(1 + RAND() * 60) MINUTE' )->store; + my $payment = $account->pay( + { + cash_register => $register->id, + amount => $debit->amount, + credit_type => 'PAYMENT', + lines => [$debit] + } + ); + } +} + +my $cashup = $register->add_cashup( + { + manager_id => $manager->id, + amount => 0 + int(rand(1000 - 1)) + } +); + +print "Cashups added\n" --