Lines 46-54
Return the library linked to this cash register
Link Here
|
46 |
|
46 |
|
47 |
sub library { |
47 |
sub library { |
48 |
my ($self) = @_; |
48 |
my ($self) = @_; |
49 |
my $rs = $self->_result->branch; |
49 |
return Koha::Library->_new_from_dbic($self->_result->branch); |
50 |
return unless $rs; |
|
|
51 |
return Koha::Library->_new_from_dbic($rs); |
52 |
} |
50 |
} |
53 |
|
51 |
|
54 |
=head3 cashups |
52 |
=head3 cashups |
Lines 67-73
sub cashups {
Link Here
|
67 |
my $rs = |
65 |
my $rs = |
68 |
$self->_result->search_related( 'cash_register_actions', |
66 |
$self->_result->search_related( 'cash_register_actions', |
69 |
$merged_conditions, $attrs ); |
67 |
$merged_conditions, $attrs ); |
70 |
return unless $rs; |
68 |
|
71 |
return Koha::Cash::Register::Actions->_new_from_dbic($rs); |
69 |
return Koha::Cash::Register::Actions->_new_from_dbic($rs); |
72 |
} |
70 |
} |
73 |
|
71 |
|
Lines 100-106
sub accountlines {
Link Here
|
100 |
my ($self) = @_; |
98 |
my ($self) = @_; |
101 |
|
99 |
|
102 |
my $rs = $self->_result->accountlines; |
100 |
my $rs = $self->_result->accountlines; |
103 |
return unless $rs; |
|
|
104 |
return Koha::Account::Lines->_new_from_dbic($rs); |
101 |
return Koha::Account::Lines->_new_from_dbic($rs); |
105 |
} |
102 |
} |
106 |
|
103 |
|
Lines 136-142
sub outstanding_accountlines {
Link Here
|
136 |
my $rs = |
133 |
my $rs = |
137 |
$self->_result->search_related( 'accountlines', $merged_conditions, |
134 |
$self->_result->search_related( 'accountlines', $merged_conditions, |
138 |
$attrs ); |
135 |
$attrs ); |
139 |
return unless $rs; |
136 |
|
140 |
return Koha::Account::Lines->_new_from_dbic($rs); |
137 |
return Koha::Account::Lines->_new_from_dbic($rs); |
141 |
} |
138 |
} |
142 |
|
139 |
|
Lines 148-153
Local store method to prevent direct manipulation of the 'branch_default' field
Link Here
|
148 |
|
145 |
|
149 |
sub store { |
146 |
sub store { |
150 |
my ($self) = @_; |
147 |
my ($self) = @_; |
|
|
148 |
|
151 |
$self->_result->result_source->schema->txn_do( |
149 |
$self->_result->result_source->schema->txn_do( |
152 |
sub { |
150 |
sub { |
153 |
if ( $self->_result->is_column_changed('branch_default') ) { |
151 |
if ( $self->_result->is_column_changed('branch_default') ) { |
Lines 163-168
sub store {
Link Here
|
163 |
} |
161 |
} |
164 |
} |
162 |
} |
165 |
); |
163 |
); |
|
|
164 |
|
166 |
return $self; |
165 |
return $self; |
167 |
} |
166 |
} |
168 |
|
167 |
|
169 |
- |
|
|