Bugzilla – Attachment 82815 Details for
Bug 21896
Add Koha::Account::reconcile_balance
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[18.05.x] Bug 21896: (QA follow-up) Document and Test for FIFO behaviour
1805x-Bug-21896-QA-follow-up-Document-and-Test-for.patch (text/plain), 2.57 KB, created by
Tomás Cohen Arazi (tcohen)
on 2018-11-30 20:11:55 UTC
(
hide
)
Description:
[18.05.x] Bug 21896: (QA follow-up) Document and Test for FIFO behaviour
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2018-11-30 20:11:55 UTC
Size:
2.57 KB
patch
obsolete
>From 3de43a5793cf485b0f932f032dae5beefb9da827 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 29 Nov 2018 13:49:27 +0000 >Subject: [PATCH] [18.05.x] Bug 21896: (QA follow-up) Document and Test for > FIFO behaviour > >A short dicussion lead to the decision to make it explictly clear that >this method will implicitly apply credits against debits in a 'First In >First Out' manor, meaning oldest outstanding debits will be paid off >first. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/Account.pm | 4 +++- > Koha/Account/Line.pm | 8 ++++++++ > Koha/Schema/Result/Accountline.pm | 7 ++++++- > t/db_dependent/Koha/Account.t | 2 +- > 4 files changed, 18 insertions(+), 3 deletions(-) > >diff --git a/Koha/Account.pm b/Koha/Account.pm >index 5a8f555725..1a1bed5426 100644 >--- a/Koha/Account.pm >+++ b/Koha/Account.pm >@@ -496,7 +496,9 @@ sub non_issues_charges { > > $account->reconcile_balance(); > >-Find outstanding credits and use them to pay outstanding debits >+Find outstanding credits and use them to pay outstanding debits. >+Currently, this implicitly uses the 'First In First Out' rule for >+applying credits against debits. > > =cut > >diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm >index b28f5cf386..90bbb94265 100644 >--- a/Koha/Account/Line.pm >+++ b/Koha/Account/Line.pm >@@ -241,4 +241,12 @@ sub _type { > return 'Accountline'; > } > >+=head3 object_class (internal) >+ >+=cut >+ >+sub object_class { >+ return 'Koha::Account::Line'; >+} >+ > 1; >diff --git a/Koha/Schema/Result/Accountline.pm b/Koha/Schema/Result/Accountline.pm >index 378c14a08e..2545995e99 100644 >--- a/Koha/Schema/Result/Accountline.pm >+++ b/Koha/Schema/Result/Accountline.pm >@@ -239,6 +239,11 @@ __PACKAGE__->belongs_to( > # Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-05-16 17:00:24 > # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pygYYKxFDRLX97PyeUeLvg > >+sub koha_objects_class { >+ 'Koha::Account::Lines'; >+} >+sub koha_object_class { >+ 'Koha::Account::Line'; >+} > >-# You can replace this text with custom content, and it will be preserved on regeneration > 1; >diff --git a/t/db_dependent/Koha/Account.t b/t/db_dependent/Koha/Account.t >index d4121c6cc2..849bc78e50 100755 >--- a/t/db_dependent/Koha/Account.t >+++ b/t/db_dependent/Koha/Account.t >@@ -235,7 +235,7 @@ subtest 'reconcile_balance' => sub { > $schema->storage->txn_rollback; > }; > >- subtest 'same debit than credit' => sub { >+ subtest 'same debit as credit' => sub { > > plan tests => 6; > >-- >2.19.2
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 21896
:
82684
|
82685
|
82688
|
82689
|
82690
|
82691
|
82692
|
82701
|
82702
|
82703
|
82720
|
82721
|
82722
|
82735
|
82736
|
82737
|
82738
|
82739
|
82740
|
82742
|
82811
|
82812
|
82813
|
82814
| 82815 |
82820