Bugzilla – Attachment 100020 Details for
Bug 23355
Add a 'cashup' process to accounts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23355: Rename staff_id for manager_id
Bug-23355-Rename-staffid-for-managerid.patch (text/plain), 3.60 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-03-03 14:11:11 UTC
(
hide
)
Description:
Bug 23355: Rename staff_id for manager_id
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-03-03 14:11:11 UTC
Size:
3.60 KB
patch
obsolete
>From 48a30a5849c3db6cda745eb81b9cbcccd5e23f5a Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 3 Mar 2020 10:50:44 -0300 >Subject: [PATCH] Bug 23355: Rename staff_id for manager_id > >This patch makes the parameter naming more consistent and also fixes the >tests (there was a missmatch on the parameter naming, and tests count >was incorrect). > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/Cash/Register.pm | 9 ++++++++- > pos/register.pl | 4 ++-- > t/db_dependent/Koha/Account/Line.t | 2 +- > t/db_dependent/Koha/Cash/Register.t | 6 +++--- > 4 files changed, 14 insertions(+), 7 deletions(-) > >diff --git a/Koha/Cash/Register.pm b/Koha/Cash/Register.pm >index a070c985b8..ac14db6d6c 100644 >--- a/Koha/Cash/Register.pm >+++ b/Koha/Cash/Register.pm >@@ -209,6 +209,13 @@ sub drop_default { > > =head3 add_cashup > >+ my $action = $cash_register->add_cashup( >+ { >+ manager_id => $logged_in_user->id, >+ amount => $cash_register->outstanding_accountlines->total >+ } >+ ); >+ > Add a new cashup action to the till, returns the added action. > > =cut >@@ -219,7 +226,7 @@ sub add_cashup { > my $rs = $self->_result->add_to_cash_register_actions( > { > code => 'CASHUP', >- manager_id => $params->{staff_id}, >+ manager_id => $params->{manager_id}, > amount => $params->{amount} > } > )->discard_changes; >diff --git a/pos/register.pl b/pos/register.pl >index 5002d9e0cd..6e2e73b75e 100755 >--- a/pos/register.pl >+++ b/pos/register.pl >@@ -73,8 +73,8 @@ else { > if ( $op eq 'cashup' ) { > $cash_register->add_cashup( > { >- staff_id => $logged_in_user->id, >- amount => $cash_register->outstanding_accountlines->total >+ manager_id => $logged_in_user->id, >+ amount => $cash_register->outstanding_accountlines->total > } > ); > } >diff --git a/t/db_dependent/Koha/Account/Line.t b/t/db_dependent/Koha/Account/Line.t >index d62a38d531..1c28f569c5 100644 >--- a/t/db_dependent/Koha/Account/Line.t >+++ b/t/db_dependent/Koha/Account/Line.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 8; >+use Test::More tests => 11; > use Test::Exception; > > use C4::Circulation qw/AddIssue AddReturn/; >diff --git a/t/db_dependent/Koha/Cash/Register.t b/t/db_dependent/Koha/Cash/Register.t >index 567e125b33..dbac2b2bac 100644 >--- a/t/db_dependent/Koha/Cash/Register.t >+++ b/t/db_dependent/Koha/Cash/Register.t >@@ -160,7 +160,7 @@ subtest 'cashup' => sub { > > ok( > $cashup1 = $register->add_cashup( >- { user_id => $patron->id, amount => '12.00' } >+ { manager_id => $patron->id, amount => '12.00' } > ), > 'call successfull' > ); >@@ -184,7 +184,7 @@ subtest 'cashup' => sub { > plan tests => 3; > > my $cashup2 = >- $register->add_cashup( { user_id => $patron->id, amount => '6.00' } ); >+ $register->add_cashup( { manager_id => $patron->id, amount => '6.00' } ); > > my $last_cashup = $register->last_cashup; > is( >@@ -220,7 +220,7 @@ subtest 'cashup' => sub { > is( $accountlines->count, 2, 'No cashup, all accountlines returned' ); > > my $cashup3 = >- $register->add_cashup( { user_id => $patron->id, amount => '2.50' } ); >+ $register->add_cashup( { manager_id => $patron->id, amount => '2.50' } ); > > $accountlines = $register->outstanding_accountlines; > is( $accountlines->count, 0, 'Cashup added, no accountlines returned' ); >-- >2.25.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 23355
:
92941
|
92942
|
92943
|
92944
|
92945
|
92946
|
92947
|
92948
|
92949
|
92950
|
92951
|
92952
|
92953
|
97031
|
97032
|
97033
|
97034
|
97035
|
97036
|
97037
|
97038
|
97039
|
97040
|
97041
|
97043
|
97044
|
97045
|
97046
|
97047
|
97048
|
97049
|
97050
|
97051
|
97052
|
97053
|
97054
|
97077
|
97078
|
97079
|
97080
|
97081
|
97082
|
97083
|
97084
|
97085
|
97086
|
97087
|
97088
|
97089
|
97706
|
97707
|
97708
|
97709
|
97710
|
97711
|
97712
|
97713
|
97714
|
97715
|
97716
|
97784
|
97785
|
97786
|
97787
|
97788
|
97789
|
97790
|
97791
|
97792
|
97793
|
97794
|
97816
|
97817
|
97818
|
97819
|
97820
|
97821
|
97822
|
97823
|
98026
|
98027
|
98028
|
98835
|
98836
|
98837
|
98838
|
98839
|
98840
|
98841
|
98842
|
100009
|
100010
|
100011
|
100012
|
100013
|
100014
|
100015
|
100016
|
100017
|
100018
|
100019
| 100020 |
100021
|
100030
|
100090
|
101685