Bugzilla – Attachment 100088 Details for
Bug 24081
Add a 'discount' process to accounts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24081: Add DISCOUNT to the allowed 'reduce' types
Bug-24081-Add-DISCOUNT-to-the-allowed-reduce-types.patch (text/plain), 1.54 KB, created by
Martin Renvoize (ashimema)
on 2020-03-04 08:49:29 UTC
(
hide
)
Description:
Bug 24081: Add DISCOUNT to the allowed 'reduce' types
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-03-04 08:49:29 UTC
Size:
1.54 KB
patch
obsolete
>From c839c8b4e72a71deec9b9cdb9f4d79ccf88d4bdb Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 9 Jan 2020 14:14:34 +0000 >Subject: [PATCH] Bug 24081: Add DISCOUNT to the allowed 'reduce' types > >This patch adds the DISCOUNT type to the handled types list in the >reduce method introduced in bug 23442 > >Signed-off-by: Michal Denar <black23@gmail.com> >--- > Koha/Account/Line.pm | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm >index d77e3509a1..546fc8457a 100644 >--- a/Koha/Account/Line.pm >+++ b/Koha/Account/Line.pm >@@ -291,6 +291,7 @@ debts. > Reduction type may be one of: > > * REFUND >+* DISCOUNT > > Returns the reduction accountline (which will be a credit) > >@@ -339,14 +340,14 @@ sub reduce { > "Amount to reduce ($params->{amount}) is higher than original amount ($original)" > ) unless ( $original >= $params->{amount} ); > my $reduced = >- $self->credits( { credit_type_code => [ 'REFUND' ] } )->total; >+ $self->credits( { credit_type_code => [ 'DISCOUNT', 'REFUND' ] } )->total; > Koha::Exceptions::ParameterTooHigh->throw( error => > "Combined reduction ($params->{amount} + $reduced) is higher than original amount (" > . abs($original) > . ")" ) > unless ( $original >= ( $params->{amount} + abs($reduced) ) ); > >- my $status = { 'REFUND' => 'REFUNDED' }; >+ my $status = { 'REFUND' => 'REFUNDED', 'DISCOUNT' => 'DISCOUNTED' }; > > my $reduction; > $self->_result->result_source->schema->txn_do( >-- >2.20.1
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 24081
:
97090
|
97091
|
100044
|
100045
|
100046
|
100074
|
100075
|
100076
|
100084
|
100085
|
100086
|
100087
|
100088
|
100089
|
100111
|
100112
|
100113
|
100114