Bugzilla – Attachment 81859 Details for
Bug 21604
Cannot add/edit funds, cannot add budgets
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21604: Fix add/edit fund/budget
Bug-21604-Fix-addedit-fundbudget.patch (text/plain), 2.00 KB, created by
Marcel de Rooy
on 2018-11-02 06:51:08 UTC
(
hide
)
Description:
Bug 21604: Fix add/edit fund/budget
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2018-11-02 06:51:08 UTC
Size:
2.00 KB
patch
obsolete
>From 4097829d55b9b0630a9c7131693e55f9d262b946 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 18 Oct 2018 18:10:19 -0300 >Subject: [PATCH] Bug 21604: Fix add/edit fund/budget >Content-Type: text/plain; charset=utf-8 > >[Strict SQL modes context] > >For insert aqbudgetperiods: >Incorrect integer value: '' for column 'budget_period_id' > >For insert/update aqbudgets >Incorrect integer value: '' for column 'budget_owner_id' >Incorrect decimal value: '' for column 'budget_encumb' > >Test plan: >Add/edit budgets and funds > >A good example of why we should use Koha::Object for all our objects > >Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Budgets.pm | 5 +++++ > 1 file changed, 5 insertions(+) > >diff --git a/C4/Budgets.pm b/C4/Budgets.pm >index b97e19d..6c7e946 100644 >--- a/C4/Budgets.pm >+++ b/C4/Budgets.pm >@@ -134,6 +134,7 @@ sub AddBudgetPeriod { > my ($budgetperiod) = @_; > return unless($budgetperiod->{budget_period_startdate} && $budgetperiod->{budget_period_enddate}); > >+ undef $budgetperiod->{budget_period_id}; > my $resultset = Koha::Database->new()->schema->resultset('Aqbudgetperiod'); > return $resultset->create($budgetperiod)->id; > } >@@ -633,6 +634,8 @@ sub AddBudget { > my ($budget) = @_; > return unless ($budget); > >+ undef $budget->{budget_encumb} if $budget->{budget_encumb} eq ''; >+ undef $budget->{budget_owner_id} if $budget->{budget_owner_id} eq ''; > my $resultset = Koha::Database->new()->schema->resultset('Aqbudget'); > return $resultset->create($budget)->id; > } >@@ -643,6 +646,8 @@ sub ModBudget { > my $result = Koha::Database->new()->schema->resultset('Aqbudget')->find($budget); > return unless($result); > >+ undef $budget->{budget_encumb} if $budget->{budget_encumb} eq ''; >+ undef $budget->{budget_owner_id} if $budget->{budget_owner_id} eq ''; > $result = $result->update($budget); > return $result->in_storage; > } >-- >2.1.4
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 21604
:
80885
|
80959
|
81858
| 81859