Bugzilla – Attachment 80959 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), 1.90 KB, created by
Pierre-Marc Thibault
on 2018-10-19 19:42:39 UTC
(
hide
)
Description:
Bug 21604: Fix add/edit fund/budget
Filename:
MIME Type:
Creator:
Pierre-Marc Thibault
Created:
2018-10-19 19:42:39 UTC
Size:
1.90 KB
patch
obsolete
>From 158284f54bdad02b1647b880179e957dc4f4d1d8 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 > >[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> >--- > 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.7.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