Bugzilla – Attachment 68954 Details for
Bug 10021
Remove dead code related to notifys
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10021: Drop columns notify_id and notify_level from accountlines
Bug-10021-Drop-columns-notifyid-and-notifylevel-fr.patch (text/plain), 21.78 KB, created by
Marcel de Rooy
on 2017-11-06 09:16:16 UTC
(
hide
)
Description:
Bug 10021: Drop columns notify_id and notify_level from accountlines
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-11-06 09:16:16 UTC
Size:
21.78 KB
patch
obsolete
>From 7385fa657b54ae917454ba599cbe105b62d64627 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 18 Oct 2017 10:43:17 -0300 >Subject: [PATCH] Bug 10021: Drop columns notify_id and notify_level from > accountlines >Content-Type: text/plain; charset=utf-8 > >It appears that has never worked. >Could someone confirm? > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Accounts.pm | 15 +----- > C4/Members.pm | 46 ------------------ > C4/Overdues.pm | 56 ---------------------- > circ/branchoverdues.pl | 38 --------------- > installer/data/mysql/kohastructure.sql | 2 - > .../prog/en/modules/circ/branchoverdues.tt | 16 +++---- > .../intranet-tmpl/prog/en/modules/members/pay.tt | 4 -- > .../prog/en/modules/members/paycollect.tt | 8 ---- > members/pay.pl | 17 ------- > members/paycollect.pl | 4 -- > 10 files changed, 7 insertions(+), 199 deletions(-) > >diff --git a/C4/Accounts.pm b/C4/Accounts.pm >index 0717215..b84627b 100644 >--- a/C4/Accounts.pm >+++ b/C4/Accounts.pm >@@ -266,24 +266,13 @@ should be the empty string. > # > > sub manualinvoice { >- my ( $borrowernumber, $itemnum, $desc, $type, $amount, $note, $skip_notify ) = @_; >+ my ( $borrowernumber, $itemnum, $desc, $type, $amount, $note ) = @_; > my $manager_id = 0; > $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; > my $dbh = C4::Context->dbh; >- my $notifyid = 0; > my $insert; > my $accountno = getnextacctno($borrowernumber); > my $amountleft = $amount; >- $skip_notify //= 0; >- >- if ( ( $type eq 'L' ) >- or ( $type eq 'F' ) >- or ( $type eq 'A' ) >- or ( $type eq 'N' ) >- or ( $type eq 'M' ) ) >- { >- $notifyid = 1 unless $skip_notify; >- } > > my $accountline = Koha::Account::Line->new( > { >@@ -295,7 +284,6 @@ sub manualinvoice { > accounttype => $type, > amountoutstanding => $amountleft, > itemnumber => $itemnum || undef, >- notify_id => $notifyid, > note => $note, > manager_id => $manager_id, > } >@@ -318,7 +306,6 @@ sub manualinvoice { > description => $desc, > accounttype => $type, > amountoutstanding => $amountleft, >- notify_id => $notifyid, > note => $note, > itemnumber => $itemnum, > manager_id => $manager_id, >diff --git a/C4/Members.pm b/C4/Members.pm >index 2031485..d8985bc 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -68,7 +68,6 @@ BEGIN { > &GetNoticeEmailAddress > > &GetMemberAccountRecords >- &GetBorNotifyAcctRecord > > &GetBorrowersToExpunge > >@@ -814,51 +813,6 @@ sub GetMemberAccountBalance { > return ( $total, $total - $other_charges, $other_charges); > } > >-=head2 GetBorNotifyAcctRecord >- >- ($total, $acctlines, $count) = &GetBorNotifyAcctRecord($params,$notifyid); >- >-Looks up accounting data for the patron with the given borrowernumber per file number. >- >-C<&GetBorNotifyAcctRecord> returns a three-element array. C<$acctlines> is a >-reference-to-array, where each element is a reference-to-hash; the >-keys are the fields of the C<accountlines> table in the Koha database. >-C<$count> is the number of elements in C<$acctlines>. C<$total> is the >-total amount outstanding for all of the account lines. >- >-=cut >- >-sub GetBorNotifyAcctRecord { >- my ( $borrowernumber, $notifyid ) = @_; >- my $dbh = C4::Context->dbh; >- my @acctlines; >- my $numlines = 0; >- my $sth = $dbh->prepare( >- "SELECT * >- FROM accountlines >- WHERE borrowernumber=? >- AND notify_id=? >- AND amountoutstanding != '0' >- ORDER BY notify_id,accounttype >- "); >- >- $sth->execute( $borrowernumber, $notifyid ); >- my $total = 0; >- while ( my $data = $sth->fetchrow_hashref ) { >- if ( $data->{itemnumber} ) { >- my $item = Koha::Items->find( $data->{itemnumber} ); >- my $biblio = $item->biblio; >- $data->{biblionumber} = $biblio->biblionumber; >- $data->{title} = $biblio->title; >- } >- $acctlines[$numlines] = $data; >- $numlines++; >- $total += int(100 * $data->{'amountoutstanding'}); >- } >- $total /= 100; >- return ( $total, \@acctlines, $numlines ); >-} >- > sub checkcardnumber { > my ( $cardnumber, $borrowernumber ) = @_; > >diff --git a/C4/Overdues.pm b/C4/Overdues.pm >index b315511..6b75e38 100644 >--- a/C4/Overdues.pm >+++ b/C4/Overdues.pm >@@ -50,8 +50,6 @@ BEGIN { > &CalcFine > &Getoverdues > &checkoverdues >- &NumberNotifyId >- &AmountNotify > &UpdateFine > &GetFine > &get_chargeable_units >@@ -701,58 +699,6 @@ sub GetFine { > return 0; > } > >-=head2 NumberNotifyId >- >- (@notify) = &NumberNotifyId($borrowernumber); >- >-Returns amount for all file per borrowers >-C<@notify> array contains all file per borrowers >- >-C<$notify_id> contains the file number for the borrower number nad item number >- >-=cut >- >-sub NumberNotifyId{ >- my ($borrowernumber)=@_; >- my $dbh = C4::Context->dbh; >- my $query=qq| SELECT distinct(notify_id) >- FROM accountlines >- WHERE borrowernumber=?|; >- my @notify; >- my $sth = $dbh->prepare($query); >- $sth->execute($borrowernumber); >- while ( my ($numberofnotify) = $sth->fetchrow ) { >- push( @notify, $numberofnotify ); >- } >- return (@notify); >-} >- >-=head2 AmountNotify >- >- ($totalnotify) = &AmountNotify($notifyid); >- >-Returns amount for all file per borrowers >-C<$notifyid> is the file number >- >-C<$totalnotify> contains amount of a file >- >-C<$notify_id> contains the file number for the borrower number and item number >- >-=cut >- >-sub AmountNotify{ >- my ($notifyid,$borrowernumber)=@_; >- my $dbh = C4::Context->dbh; >- my $query=qq| SELECT sum(amountoutstanding) >- FROM accountlines >- WHERE notify_id=? AND borrowernumber = ?|; >- my $sth=$dbh->prepare($query); >- $sth->execute($notifyid,$borrowernumber); >- my $totalnotify=$sth->fetchrow; >- $sth->finish; >- return ($totalnotify); >-} >- > =head2 GetItems > > ($items) = &GetItems($itemnumber); >@@ -840,8 +786,6 @@ sub GetOverduesForBranch { > items.location, > items.itemnumber, > itemtypes.description, >- accountlines.notify_id, >- accountlines.notify_level, > accountlines.amountoutstanding > FROM accountlines > LEFT JOIN issues ON issues.itemnumber = accountlines.itemnumber >diff --git a/circ/branchoverdues.pl b/circ/branchoverdues.pl >index 1430caa..29aad88 100755 >--- a/circ/branchoverdues.pl >+++ b/circ/branchoverdues.pl >@@ -35,27 +35,6 @@ use Data::Dumper; > this module is a new interface, allow to the librarian to check all items on overdues (based on the acountlines type 'FU' ) > this interface is filtered by branches (automatically), and by location (optional) .... > >- FIXME for this time, we have only four methods to notify : >- - mail : work with a batch programm >- - letter : for us, the letters are generated by an open-office program >- - phone : Simple method, when the method 'phone' is selected, we consider, that the borrower as been notified, and the notify send date is implemented >- - considered lost : for us if the document is on the third overduelevel, >- >- FIXME the methods are actually hardcoded for the levels : (maybe can be improved by a new possibility in overduerule) >- >- level 1 : three methods are possible : - mail, letter, phone >- level 2 : only one method is possible : - letter >- level 3 : only methode is possible : - Considered Lost >- >- the documents displayed on this interface, are checked on three points >- - 1) the document must be on accountlines (Type 'FU') >- - 2) item issues is not returned >- - 3) this item as not been already notify >- >- FIXME: who is the author? >- FIXME: No privisions (i.e. "actions") for handling notices are implemented. >- FIXME: This is linked as "Overdue Fines" but the relationship to fines in GetOverduesForBranch is more complicated than that. >- > =cut > > my $input = new CGI; >@@ -77,7 +56,6 @@ my $borrowernumber = $input->param('borrowernumber'); > my $itemnumber = $input->param('itemnumber'); > my $method = $input->param('method'); > my $overduelevel = $input->param('overduelevel'); >-my $notifyId = $input->param('notifyId'); > my $location = $input->param('location'); > > # FIXME: better check that borrowernumber is defined and valid. >@@ -118,22 +96,6 @@ foreach my $num (@getoverdues) { > $overdueforbranch{'itemnumber'} = $num->{'itemnumber'}; > $overdueforbranch{'cardnumber'} = $num->{'cardnumber'}; > >- # now we add on the template, the differents values of notify_level >- # FIXME: numerical comparison, not string eq. >- if ( $num->{'notify_level'} eq '1' ) { >- $overdueforbranch{'overdue1'} = 1; >- $overdueforbranch{'overdueLevel'} = 1; >- } >- elsif ( $num->{'notify_level'} eq '2' ) { >- $overdueforbranch{'overdue2'} = 1; >- $overdueforbranch{'overdueLevel'} = 2; >- } >- elsif ( $num->{'notify_level'} eq '3' ) { >- $overdueforbranch{'overdue3'} = 1; >- $overdueforbranch{'overdueLevel'} = 3; >- } >- $overdueforbranch{'notify_id'} = $num->{'notify_id'}; >- > push( @overduesloop, \%overdueforbranch ); > } > >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index eb4d146..09deebd 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -2711,8 +2711,6 @@ CREATE TABLE `accountlines` ( > `amountoutstanding` decimal(28,6) default NULL, > `lastincrement` decimal(28,6) default NULL, > `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, >- `notify_id` int(11) NOT NULL default 0, >- `notify_level` int(2) NOT NULL default 0, > `note` text NULL default NULL, > `manager_id` int(11) NULL, > PRIMARY KEY (`accountlines_id`), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchoverdues.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchoverdues.tt >index 5a50369..2753bed 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchoverdues.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchoverdues.tt >@@ -75,22 +75,22 @@ > <td align="center"> > [% IF ( overduesloo.overdue1 ) %] > [% IF ( overduesloo.borroweremail ) %] >- <a href="branchoverdues.pl?action=add&borrowernumber=[% overduesloo.borrowernumber %]&itemnumber=[% overduesloo.itemnumber %]&method=mail&location=[% overduesloo.location %]&overduelevel=[% overduesloo.overdueLevel %]&notifyId=[% overduesloo.notify_id %]">Mail</a> >+ <a href="branchoverdues.pl?action=add&borrowernumber=[% overduesloo.borrowernumber %]&itemnumber=[% overduesloo.itemnumber %]&method=mail&location=[% overduesloo.location %]&overduelevel=[% overduesloo.overdueLevel %]">Mail</a> > [% ELSE %] > Mail > [% END %] > | >- <a href="branchoverdues.pl?action=add&borrowernumber=[% overduesloo.borrowernumber %]&itemnumber=[% overduesloo.itemnumber %]&method=phone&location=[% overduesloo.location %]&overduelevel=[% overduesloo.overdueLevel %]&notifyId=[% overduesloo.notify_id %]">Phone</a> >+ <a href="branchoverdues.pl?action=add&borrowernumber=[% overduesloo.borrowernumber %]&itemnumber=[% overduesloo.itemnumber %]&method=phone&location=[% overduesloo.location %]&overduelevel=[% overduesloo.overdueLevel %]">Phone</a> > | >- <a href="branchoverdues.pl?action=add&borrowernumber=[% overduesloo.borrowernumber %]&itemnumber=[% overduesloo.itemnumber %]&method=letter&location=[% overduesloo.location %]&overduelevel=[% overduesloo.overdueLevel %]&notifyId=[% overduesloo.notify_id %]">Notice</a> >+ <a href="branchoverdues.pl?action=add&borrowernumber=[% overduesloo.borrowernumber %]&itemnumber=[% overduesloo.itemnumber %]&method=letter&location=[% overduesloo.location %]&overduelevel=[% overduesloo.overdueLevel %]">Notice</a> > [% END %] > > [% IF ( overduesloo.overdue2 ) %] >- <a href="branchoverdues.pl?action=add&borrowernumber=[% overduesloo.borrowernumber %]&itemnumber=[% overduesloo.itemnumber %]&method=letter&location=[% overduesloo.location %]&overduelevel=[% overduesloo.overdueLevel %]&notifyId=[% overduesloo.notify_id %]">Notice</a> >+ <a href="branchoverdues.pl?action=add&borrowernumber=[% overduesloo.borrowernumber %]&itemnumber=[% overduesloo.itemnumber %]&method=letter&location=[% overduesloo.location %]&overduelevel=[% overduesloo.overdueLevel %]">Notice</a> > [% END %] > > [% IF ( overduesloo.overdue3 ) %] >- <a href="branchoverdues.pl?action=add&borrowernumber=[% overduesloo.borrowernumber %]&itemnumber=[% overduesloo.itemnumber %]&method=lost&location=[% overduesloo.location %]&overduelevel=[% overduesloo.overdueLevel %]&notifyId=[% overduesloo.notify_id %]">Considered lost</a> >+ <a href="branchoverdues.pl?action=add&borrowernumber=[% overduesloo.borrowernumber %]&itemnumber=[% overduesloo.itemnumber %]&method=lost&location=[% overduesloo.location %]&overduelevel=[% overduesloo.overdueLevel %]">Considered lost</a> > [% END %] > > </td> >@@ -110,7 +110,6 @@ > <th>Borrower</th> > <th>Location</th> > <th>Overdue status</th> >- <th>Notified by</th> > <th>Cancel</th> > </tr> > [% FOREACH todayoverduesloo IN todayoverduesloop %] >@@ -150,12 +149,9 @@ > [% END %] > </b> > </td> >- <td align="center"> >- <b>[% todayoverduesloo.notify_method %]</b> >- </td> > > <td> >- <a href="branchoverdues.pl?action=remove&borrowernumber=[% todayoverduesloo.borrowernumber %]&itemnumber=[% todayoverduesloo.itemnumber %]&method=phone&location=[% todayoverduesloo.location %]&notify_date=[% todayoverduesloo.notify_date %]">Cancel notification</a> >+ <a href="branchoverdues.pl?action=remove&borrowernumber=[% todayoverduesloo.borrowernumber %]&itemnumber=[% todayoverduesloo.itemnumber %]&method=phone&location=[% todayoverduesloo.location %]">Cancel notification</a> > </td> > </tr> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >index ead4ce4..243f777 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >@@ -112,8 +112,6 @@ function enableCheckboxActions(){ > <input type="hidden" name="accountlines_id[% line.accountlines_id %]" value="[% line.accountlines_id %]" /> > <input type="hidden" name="amountoutstanding[% line.accountlines_id %]" value="[% line.amountoutstanding %]" /> > <input type="hidden" name="borrowernumber[% line.accountlines_id %]" value="[% line.borrowernumber %]" /> >- <input type="hidden" name="notify_id[% line.accountlines_id %]" value="[% line.notify_id %]" /> >- <input type="hidden" name="notify_level[% line.accountlines_id %]" value="[% line.notify_level %]" /> > <input type="hidden" name="totals[% line.accountlines_id %]" value="[% line.totals %]" /> > </td> > <td> >@@ -145,8 +143,6 @@ function enableCheckboxActions(){ > </td> > <td><input type="text" name="payment_note_[% line.accountlines_id %]" /></td> > <td>[% line.accounttype %]</td> >- <td>[% line.notify_id %]</td> >- <td>[% line.notify_level %]</td> > <td class="debit" style="text-align: right;">[% line.amount | $Price %]</td> > <td class="debit" style="text-align: right;">[% line.amountoutstanding | $Price %]</td> > </tr> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >index 12b2c4b..4dc541e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >@@ -107,8 +107,6 @@ function moneyFormat(textObj) { > <input type="hidden" name="itemnumber" id="itemnumber" value="[% itemnumber %]" /> > <input type="hidden" name="description" id="description" value="[% description %]" /> > <input type="hidden" name="accounttype" id="accounttype" value="[% accounttype %]" /> >- <input type="hidden" name="notify_id" id="notify_id" value="[% notify_id %]" /> >- <input type="hidden" name="notify_level" id="notify_level" value="[% notify_level %]" /> > <input type="hidden" name="amount" id="amount" value="[% amount %]" /> > <input type="hidden" name="amountoutstanding" id="amountoutstanding" value="[% amountoutstanding %]" /> > <input type="hidden" name="accountlines_id" id="accountlines_id" value="[% accountlines_id %]" /> >@@ -134,8 +132,6 @@ function moneyFormat(textObj) { > [% individual_description %] > </td> > <td>[% accounttype %]</td> >- <td>[% notify_id %]</td> >- <td>[% notify_level %]</td> > <td class="debit">[% amount | format('%.2f') %]</td> > <td class="debit">[% amountoutstanding | format('%.2f') %]</td> > </tr></tbody> >@@ -164,8 +160,6 @@ function moneyFormat(textObj) { > <input type="hidden" name="itemnumber" id="itemnumber" value="[% itemnumber %]" /> > <input type="hidden" name="description" id="description" value="[% description %]" /> > <input type="hidden" name="accounttype" id="accounttype" value="[% accounttype %]" /> >- <input type="hidden" name="notify_id" id="notify_id" value="[% notify_id %]" /> >- <input type="hidden" name="notify_level" id="notify_level" value="[% notify_level %]" /> > <input type="hidden" name="amount" id="amount" value="[% amount %]" /> > <input type="hidden" name="amountoutstanding" id="amountoutstanding" value="[% amountoutstanding %]" /> > <input type="hidden" name="accountlines_id" id="accountlines_id" value="[% accountlines_id %]" /> >@@ -184,8 +178,6 @@ function moneyFormat(textObj) { > <tbody><tr> > <td>[% description %] [% title %]</td> > <td>[% accounttype %]</td> >- <td>[% notify_id %]</td> >- <td>[% notify_level %]</td> > <td class="debit">[% amount | format('%.2f') %]</td> > <td class="debit">[% amountoutstanding | format('%.2f') %]</td> > </tr></tbody> >diff --git a/members/pay.pl b/members/pay.pl >index 70e45e2..6d60556 100755 >--- a/members/pay.pl >+++ b/members/pay.pl >@@ -134,21 +134,6 @@ sub add_accounts_to_template { > > my ( $total, undef, undef ) = GetMemberAccountRecords($borrowernumber); > my $accounts = []; >- my @notify = NumberNotifyId($borrowernumber); >- >- my $notify_groups = []; >- for my $notify_id (@notify) { >- my ( $acct_total, $accountlines, undef ) = >- GetBorNotifyAcctRecord( $borrowernumber, $notify_id ); >- if ( @{$accountlines} ) { >- my $totalnotify = AmountNotify( $notify_id, $borrowernumber ); >- push @{$accounts}, >- { accountlines => $accountlines, >- notify => $notify_id, >- total => $totalnotify, >- }; >- } >- } > borrower_add_additional_fields($borrower); > > $template->param(%$borrower); >@@ -196,8 +181,6 @@ sub redirect_to_paycollect { > $redirect .= get_for_redirect( 'description', "description$line_no", 0 ); > $redirect .= get_for_redirect( 'title', "title$line_no", 0 ); > $redirect .= get_for_redirect( 'itemnumber', "itemnumber$line_no", 0 ); >- $redirect .= get_for_redirect( 'notify_id', "notify_id$line_no", 0 ); >- $redirect .= get_for_redirect( 'notify_level', "notify_level$line_no", 0 ); > $redirect .= get_for_redirect( 'accountlines_id', "accountlines_id$line_no", 0 ); > $redirect .= q{&} . 'payment_note' . q{=} . uri_escape_utf8( scalar $input->param("payment_note_$line_no") ); > $redirect .= '&remote_user='; >diff --git a/members/paycollect.pl b/members/paycollect.pl >index 9ec3077..b4ea12b 100755 >--- a/members/paycollect.pl >+++ b/members/paycollect.pl >@@ -86,8 +86,6 @@ if ( $individual || $writeoff ) { > my $itemnumber = $input->param('itemnumber'); > my $description = $input->param('description'); > my $title = $input->param('title'); >- my $notify_id = $input->param('notify_id'); >- my $notify_level = $input->param('notify_level'); > $total_due = $amountoutstanding; > $template->param( > accounttype => $accounttype, >@@ -97,8 +95,6 @@ if ( $individual || $writeoff ) { > title => $title, > itemnumber => $itemnumber, > individual_description => $description, >- notify_id => $notify_id, >- notify_level => $notify_level, > payment_note => $payment_note, > ); > } elsif ($select_lines) { >-- >2.1.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 10021
:
54194
|
68262
|
68263
|
68419
|
68420
|
68421
|
68422
|
68477
|
68478
|
68479
|
68480
|
68505
|
68506
|
68793
|
68794
|
68795
|
68796
|
68797
|
68798
|
68920
|
68953
| 68954 |
68955
|
68956
|
68957
|
68958
|
68959
|
69695
|
69696
|
69698