Bugzilla – Attachment 48595 Details for
Bug 15084
Move the currency related code to Koha::Acquisition::Currenc[y|ies]
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15084: Make sure the previous active currency is marked as inactive
Bug-15084-Make-sure-the-previous-active-currency-i.patch (text/plain), 1.32 KB, created by
Jonathan Druart
on 2016-03-03 08:42:04 UTC
(
hide
)
Description:
Bug 15084: Make sure the previous active currency is marked as inactive
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-03-03 08:42:04 UTC
Size:
1.32 KB
patch
obsolete
>From b3fd75770deae0a71a1802a15579e68d148ac2d5 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 29 Oct 2015 15:31:39 +0000 >Subject: [PATCH] Bug 15084: Make sure the previous active currency is marked > as inactive > >On inserting an active currency, others should be marked as inactive. >We can only have 1 active currency at the same time. > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > Koha/Acquisition/Currency.pm | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > >diff --git a/Koha/Acquisition/Currency.pm b/Koha/Acquisition/Currency.pm >index dd34cc2..da0bcd2 100644 >--- a/Koha/Acquisition/Currency.pm >+++ b/Koha/Acquisition/Currency.pm >@@ -33,6 +33,26 @@ Koha::Acquisition::Currency - Koha Acquisition Currency Object class > > =cut > >+=head3 store >+ >+=cut >+ >+sub store { >+ my ( $self ) = @_; >+ my $result; >+ $self->_result->result_source->schema->txn_do( sub { >+ if ( $self->active ) { >+ my @currencies = Koha::Acquisition::Currencies->search; >+ for my $currency ( @currencies ) { >+ $currency->active(0); >+ $currency->store; >+ } >+ } >+ $result = $self->SUPER::store; >+ }); >+ return $result; >+} >+ > =head3 type > > =cut >-- >2.7.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15084
:
44162
|
44163
|
44164
|
44165
|
44166
|
44167
|
44168
|
45690
|
45691
|
45692
|
45693
|
45694
|
45695
|
45696
|
45759
|
45761
|
45807
|
45808
|
45809
|
45810
|
45811
|
45812
|
45813
|
45814
|
47213
|
47214
|
47215
|
47216
|
47217
|
47218
|
47219
|
47220
|
47221
|
48594
| 48595 |
48596
|
48597
|
48598
|
48599
|
48600
|
48601
|
48602
|
48603
|
48703
|
48747
|
48772
|
48783
|
48858