Bug 19826: Add K::Acq::Budget(s) and K::Acq::Fund(s)
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 18 Dec 2017 14:25:00 +0000 (11:25 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 26 Dec 2017 15:05:51 +0000 (12:05 -0300)
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 <aleishaamohia@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha/Acquisition/Budget.pm [new file with mode: 0644]
Koha/Acquisition/Budgets.pm [new file with mode: 0644]
Koha/Acquisition/Fund.pm [new file with mode: 0644]
Koha/Acquisition/Funds.pm [new file with mode: 0644]

diff --git a/Koha/Acquisition/Budget.pm b/Koha/Acquisition/Budget.pm
new file mode 100644 (file)
index 0000000..3fea5de
--- /dev/null
@@ -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/Budgets.pm b/Koha/Acquisition/Budgets.pm
new file mode 100644 (file)
index 0000000..e9cae22
--- /dev/null
@@ -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;
diff --git a/Koha/Acquisition/Fund.pm b/Koha/Acquisition/Fund.pm
new file mode 100644 (file)
index 0000000..20cc26e
--- /dev/null
@@ -0,0 +1,40 @@
+package Koha::Acquisition::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::Fund object class
+
+=head1 API
+
+=head2 Internal methods
+
+=head3 _type
+
+=cut
+
+sub _type {
+    return 'Aqbudget';
+}
+
+1;
diff --git a/Koha/Acquisition/Funds.pm b/Koha/Acquisition/Funds.pm
new file mode 100644 (file)
index 0000000..4812ddf
--- /dev/null
@@ -0,0 +1,48 @@
+package Koha::Acquisition::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::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;