|
Lines 291-296
sub start_cashup {
Link Here
|
| 291 |
|
291 |
|
| 292 |
my $expected_amount = abs( $self->outstanding_accountlines->total( { payment_type => [ 'CASH', 'SIP00' ] } ) ); |
292 |
my $expected_amount = abs( $self->outstanding_accountlines->total( { payment_type => [ 'CASH', 'SIP00' ] } ) ); |
| 293 |
|
293 |
|
|
|
294 |
# Prevent starting a cashup when there are no cash transactions |
| 295 |
unless ( $expected_amount > 0 ) { |
| 296 |
Koha::Exceptions::Object::BadValue->throw( |
| 297 |
error => "Cannot start cashup with zero cash transactions", |
| 298 |
type => 'amount', |
| 299 |
value => $expected_amount |
| 300 |
); |
| 301 |
} |
| 302 |
|
| 294 |
# Create the CASHUP_START action using centralized exception handling |
303 |
# Create the CASHUP_START action using centralized exception handling |
| 295 |
my $schema = $self->_result->result_source->schema; |
304 |
my $schema = $self->_result->result_source->schema; |
| 296 |
my $rs = $schema->safe_do( |
305 |
my $rs = $schema->safe_do( |