Bugzilla – Attachment 48594 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: Add Koha::Acquisition::Currenc[y|ies] classes
Bug-15084-Add-KohaAcquisitionCurrencyies-classes.patch (text/plain), 4.87 KB, created by
Jonathan Druart
on 2016-03-03 08:42:00 UTC
(
hide
)
Description:
Bug 15084: Add Koha::Acquisition::Currenc[y|ies] classes
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-03-03 08:42:00 UTC
Size:
4.87 KB
patch
obsolete
>From c7c34e0deb268c6bb126f0d6835dd533029ea0ca Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 29 Oct 2015 11:43:17 +0000 >Subject: [PATCH] Bug 15084: Add Koha::Acquisition::Currenc[y|ies] classes > >The first step of this patch set is to move the business logic code from >admin/currencies.pl to Koha::Acquisition::Currenc[y|ies]. > >Then a foreign key will be created on aqorders.currency as we want to >assure data integrity. Note that a aqbooksellers.currency also exists >but is never used. It could be removed in another bug report. >This update has to care about possible breaking relation. For instance >an old order has been made using a currency which is now deleted. To be >sure the update process won't break a new column currency.archived is >created and leave open the door for a further improvement (marked a >currency as archived from the interface: this won't be provided by this >enhancement). >These archived currencies won't appear on the interface for newly >created items (order/suggestion). > >Once this is done it becomes easy to remove the subroutine from >C4::Budgets: GetCurrencies and GetCurrency. >ConvertCurrency will also be removed but is not used anymore. > >Note that none of these subroutines were covered by tests. Now they are. > >Test plan: >0/ Don't apply this patch >1/ Create a temporary currency and an order using it >2/ Remove the currency from your CLI >3/ Apply the patch and execute the DB entry >4/ Note that the currency is inserted and marked as archived. >5/ Edit the previous order and confirm that the correct currency is >still selected. >It won't never be displayed anywhere else. >6/ Test the admin script: on admin/currency.pl add/remove/edit >currencies. >You could not have 2 active currencies at the same time. >7/ Then on the different scripts of the acquisition module, focus on the >currencies values and create a new order, receive it. >Create/edit a suggestion > >Other changes must be checked by the QAer. > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > Koha/Acquisition/Currencies.pm | 50 ++++++++++++++++++++++++++++++++++++++++++ > Koha/Acquisition/Currency.pm | 44 +++++++++++++++++++++++++++++++++++++ > 2 files changed, 94 insertions(+) > create mode 100644 Koha/Acquisition/Currencies.pm > create mode 100644 Koha/Acquisition/Currency.pm > >diff --git a/Koha/Acquisition/Currencies.pm b/Koha/Acquisition/Currencies.pm >new file mode 100644 >index 0000000..7f506a7 >--- /dev/null >+++ b/Koha/Acquisition/Currencies.pm >@@ -0,0 +1,50 @@ >+package Koha::Acquisition::Currencies; >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use Modern::Perl; >+ >+use Carp; >+ >+use Koha::Database; >+ >+use Koha::Acquisition::Currency; >+ >+use base qw(Koha::Objects); >+ >+=head1 NAME >+ >+Koha::Acquisition::Currencies - Koha Acquisition Currency Object set class >+ >+=head1 API >+ >+=head2 Class Methods >+ >+=cut >+ >+=head3 type >+ >+=cut >+ >+sub type { >+ return 'Currency'; >+} >+ >+sub object_class { >+ return 'Koha::Acquisition::Currency'; >+} >+ >+1; >diff --git a/Koha/Acquisition/Currency.pm b/Koha/Acquisition/Currency.pm >new file mode 100644 >index 0000000..dd34cc2 >--- /dev/null >+++ b/Koha/Acquisition/Currency.pm >@@ -0,0 +1,44 @@ >+package Koha::Acquisition::Currency; >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use Modern::Perl; >+ >+use Carp; >+ >+use Koha::Database; >+ >+use base qw(Koha::Object); >+ >+=head1 NAME >+ >+Koha::Acquisition::Currency - Koha Acquisition Currency Object class >+ >+=head1 API >+ >+=head2 Class Methods >+ >+=cut >+ >+=head3 type >+ >+=cut >+ >+sub type { >+ return 'Currency'; >+} >+ >+1; >-- >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