Bugzilla – Attachment 121961 Details for
Bug 22435
Clarify account_offset types by converting them to clear codes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22435: Use 'CREATE' offset type in Koha::Account
Bug-22435-Use-CREATE-offset-type-in-KohaAccount.patch (text/plain), 3.17 KB, created by
Victor Grousset/tuxayo
on 2021-06-15 07:33:02 UTC
(
hide
)
Description:
Bug 22435: Use 'CREATE' offset type in Koha::Account
Filename:
MIME Type:
Creator:
Victor Grousset/tuxayo
Created:
2021-06-15 07:33:02 UTC
Size:
3.17 KB
patch
obsolete
>From a341d3918ba9e7046dec7b7fb3b6e3b304242189 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 16 Mar 2021 17:12:07 +0000 >Subject: [PATCH] Bug 22435: Use 'CREATE' offset type in Koha::Account > >This patch updates the Koha::Account methods for adding debits and >credits to use the 'CREATE' offset type for the creation record. > >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> >--- > Koha/Account.pm | 35 +++-------------------------------- > 1 file changed, 3 insertions(+), 32 deletions(-) > >diff --git a/Koha/Account.pm b/Koha/Account.pm >index bd4af13a2d..b3d73a7f76 100644 >--- a/Koha/Account.pm >+++ b/Koha/Account.pm >@@ -64,7 +64,6 @@ Koha::Account->new( { patron_id => $borrowernumber } )->pay( > library_id => $branchcode, > lines => $lines, # Arrayref of Koha::Account::Line objects to pay > credit_type => $type, # credit_type_code code >- offset_type => $offset_type, # offset type code > item_id => $itemnumber, # pass the itemnumber if this is a credit pertianing to a specific item (i.e LOST_FOUND) > } > ); >@@ -244,8 +243,8 @@ sub add_credit { > my $account_offset = Koha::Account::Offset->new( > { > credit_id => $line->id, >- type => $Koha::Account::offset_type->{$credit_type} // $Koha::Account::offset_type->{CREDIT}, >- amount => $amount >+ type => 'CREATE', >+ amount => $amount > } > )->store(); > >@@ -461,7 +460,6 @@ sub add_debit { > my $transaction_type = $params->{transaction_type}; > my $item_id = $params->{item_id}; > my $issue_id = $params->{issue_id}; >- my $offset_type = $Koha::Account::offset_type->{$debit_type} // 'Manual Debit'; > > my $line; > my $schema = Koha::Database->new->schema; >@@ -498,7 +496,7 @@ sub add_debit { > my $account_offset = Koha::Account::Offset->new( > { > debit_id => $line->id, >- type => $offset_type, >+ type => 'CREATE', > amount => $amount > } > )->store(); >@@ -776,33 +774,6 @@ sub reconcile_balance { > > 1; > >-=head2 Name mappings >- >-=head3 $offset_type >- >-=cut >- >-our $offset_type = { >- 'CREDIT' => 'Manual Credit', >- 'FORGIVEN' => 'Writeoff', >- 'LOST_FOUND' => 'Lost Item Found', >- 'OVERPAYMENT' => 'Overpayment', >- 'PAYMENT' => 'Payment', >- 'WRITEOFF' => 'Writeoff', >- 'ACCOUNT' => 'Account Fee', >- 'ACCOUNT_RENEW' => 'Account Fee', >- 'RESERVE' => 'Reserve Fee', >- 'PROCESSING' => 'Processing Fee', >- 'LOST' => 'Lost Item', >- 'RENT' => 'Rental Fee', >- 'RENT_DAILY' => 'Rental Fee', >- 'RENT_RENEW' => 'Rental Fee', >- 'RENT_DAILY_RENEW' => 'Rental Fee', >- 'OVERDUE' => 'OVERDUE', >- 'RESERVE_EXPIRED' => 'Hold Expired', >- 'PAYOUT' => 'PAYOUT', >-}; >- > =head1 AUTHORS > > =encoding utf8 >-- >2.32.0
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 22435
:
118340
|
118341
|
118541
|
118542
|
118543
|
118544
|
118545
|
118546
|
118547
|
120040
|
120041
|
120042
|
120043
|
120044
|
120045
|
120046
|
120963
|
120964
|
120965
|
120966
|
120967
|
120968
|
120969
|
120970
|
120979
|
120980
|
120981
|
120982
|
120983
|
120984
|
120985
|
120986
|
120987
|
120988
|
120989
|
120990
|
120991
|
121004
|
121005
|
121006
|
121007
|
121008
|
121009
|
121010
|
121011
|
121012
|
121013
|
121014
|
121015
|
121016
|
121028
|
121757
|
121758
|
121759
|
121760
|
121761
|
121762
|
121763
|
121764
|
121765
|
121766
|
121767
|
121768
|
121769
|
121960
|
121961
|
121962
|
121963
|
121964
|
121965
|
121966
|
121967
|
121968
|
121969
|
121970
|
121971
|
121972
|
122148
|
122149
|
122150
|
122151
|
122152
|
122153
|
122154
|
122155
|
122156
|
122157
|
122158
|
122159
|
122160
|
122161
|
122235
|
122236
|
122237
|
122238
|
122239
|
122240
|
122241
|
122242
|
122243
|
122244
|
122245
|
122246
|
122247
|
122248
|
122249
|
122250
|
122251
|
122252
|
122253
|
122256
|
122257
|
122258
|
122259
|
122260
|
122261
|
122262
|
122263
|
122264
|
122265
|
122266
|
122267
|
122268
|
122269
|
122270
|
122271
|
122272
|
122273
|
122274
|
122553
|
122554
|
122555
|
122556
|
122557
|
122558
|
122559
|
122560
|
122561
|
122562
|
122563
|
122564
|
122565
|
122566
|
122567
|
122568
|
122569
|
122570
|
122571
|
122586
|
122899
|
122900
|
122901
|
122902
|
122903
|
122904
|
122905
|
122906
|
122907
|
122908
|
122909
|
122910
|
122911
|
122912
|
122913
|
122914
|
122915
|
122916
|
122917
|
122918
|
122937
|
123423
|
123424
|
123425
|
123426
|
123427
|
123428
|
123429
|
123430
|
123431
|
123432
|
123433
|
123434
|
123435
|
123436
|
123437
|
123438
|
123439
|
123440
|
123441
|
123442
|
123443