From 479be9509f08ce3fa67af7775980105006b1e0e5 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 18 Dec 2017 11:25:00 -0300 Subject: [PATCH] [SIGNED-OFF] Bug 19826: Add K::Acq::Budget(s) and K::Acq::Budget::Fund(s) This patch introduces Koha::Object(s)-derived classes for budgets and funds (aqbudgetperiods and aqbudgets respectively). C4::Budgets already uses DBIC calls on those tables so transition should be easy on top of this. To test: - Check the referenced schema files are the right ones. - QA scripts shoudl be happy. - Sign off :-D Note: the POD coverage report throws a false negative result on singular classes which is trivially wrong. Signed-off-by: Aleisha Amohia --- Koha/Acquisition/Budget.pm | 40 +++++++++++++++++++++++++++++++++ Koha/Acquisition/Budget/Fund.pm | 40 +++++++++++++++++++++++++++++++++ Koha/Acquisition/Budget/Funds.pm | 48 ++++++++++++++++++++++++++++++++++++++++ Koha/Acquisition/Budgets.pm | 48 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 176 insertions(+) create mode 100644 Koha/Acquisition/Budget.pm create mode 100644 Koha/Acquisition/Budget/Fund.pm create mode 100644 Koha/Acquisition/Budget/Funds.pm create mode 100644 Koha/Acquisition/Budgets.pm diff --git a/Koha/Acquisition/Budget.pm b/Koha/Acquisition/Budget.pm new file mode 100644 index 0000000..3fea5de --- /dev/null +++ b/Koha/Acquisition/Budget.pm @@ -0,0 +1,40 @@ +package Koha::Acquisition::Budget; + +# 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 Koha::Database; + +use base qw(Koha::Object); + +=head1 NAME + +Koha::Acquisition::Budget object class + +=head1 API + +=head2 Internal methods + +=head3 _type + +=cut + +sub _type { + return 'Aqbudgetperiod'; +} + +1; diff --git a/Koha/Acquisition/Budget/Fund.pm b/Koha/Acquisition/Budget/Fund.pm new file mode 100644 index 0000000..969ba9d --- /dev/null +++ b/Koha/Acquisition/Budget/Fund.pm @@ -0,0 +1,40 @@ +package Koha::Acquisition::Budget::Fund; + +# 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 Koha::Database; + +use base qw(Koha::Object); + +=head1 NAME + +Koha::Acquisition::Budget::Fund object class + +=head1 API + +=head2 Internal methods + +=head3 _type + +=cut + +sub _type { + return 'Aqbudget'; +} + +1; diff --git a/Koha/Acquisition/Budget/Funds.pm b/Koha/Acquisition/Budget/Funds.pm new file mode 100644 index 0000000..f619ef7 --- /dev/null +++ b/Koha/Acquisition/Budget/Funds.pm @@ -0,0 +1,48 @@ +package Koha::Acquisition::Budget::Funds; + +# 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 Koha::Database; + +use base qw(Koha::Objects); + +=head1 NAME + +Koha::Acquisition::Budget::Funds object set class + +=head1 API + +=head2 Internal methods + +=head3 _type (internal) + +=cut + +sub _type { + return 'Aqbudget'; +} + +=head3 object_class (internal) + +=cut + +sub object_class { + return 'Koha::Acquisition::Fund'; +} + +1; diff --git a/Koha/Acquisition/Budgets.pm b/Koha/Acquisition/Budgets.pm new file mode 100644 index 0000000..e9cae22 --- /dev/null +++ b/Koha/Acquisition/Budgets.pm @@ -0,0 +1,48 @@ +package Koha::Acquisition::Budgets; + +# 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 Koha::Database; + +use base qw(Koha::Objects); + +=head1 NAME + +Koha::Acquisition::Budgets object set class + +=head1 API + +=head2 Internal methods + +=head3 _type (internal) + +=cut + +sub _type { + return 'Aqbudgetperiod'; +} + +=head3 object_class (internal) + +=cut + +sub object_class { + return 'Koha::Acquisition::Budget'; +} + +1; -- 2.1.4