Bugzilla – Attachment 89115 Details for
Bug 22809
Move "INVOICE" from template to a slip
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22809 - Move "INVOICE" from template to a slip
Bug-22809---Move-INVOICE-from-template-to-a-slip.patch (text/plain), 9.90 KB, created by
Kyle M Hall (khall)
on 2019-04-30 12:01:48 UTC
(
hide
)
Description:
Bug 22809 - Move "INVOICE" from template to a slip
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2019-04-30 12:01:48 UTC
Size:
9.90 KB
patch
obsolete
>From c1950887533145c8b98da68c7b3f432b7b32c847 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 30 Apr 2019 07:53:50 -0400 >Subject: [PATCH] Bug 22809 - Move "INVOICE" from template to a slip > >Just as bug 22761 moves the "Fee receipt" to the ACCOUNT_CREDIT slip, we need to move the "INVOICE" to an ACCOUNT_DEBIT slip. > >Test Plan: >1) Apply this patch set >2) Restart all the things >3) Use the "print" button beside a *fee* >4) You should not see any difference from before the patches were applied >--- > .../data/mysql/atomicupdate/bug_22809.perl | 61 +++++++++++++++++++ > .../mysql/en/mandatory/sample_notices.sql | 55 +++++++++++++++++ > .../prog/en/modules/members/printinvoice.tt | 54 +--------------- > members/printinvoice.pl | 22 +++++-- > 4 files changed, 133 insertions(+), 59 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_22809.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_22809.perl b/installer/data/mysql/atomicupdate/bug_22809.perl >new file mode 100644 >index 0000000000..cbee8090da >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_22809.perl >@@ -0,0 +1,61 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do(q{ >+INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`, `lang`) VALUES >+('circulation', 'ACCOUNT_DEBIT', '', 'Account fee', 0, 'Account fee', '<table> >+ [% IF ( LibraryName ) %] >+ <tr> >+ <th colspan="5" class="centerednames"> >+ <h3>[% LibraryName | html %]</h3> >+ </th> >+ </tr> >+ [% END %] >+ >+ <tr> >+ <th colspan="5" class="centerednames"> >+ <h2><u>INVOICE</u></h2> >+ </th> >+ </tr> >+ <tr> >+ <th colspan="5" class="centerednames"> >+ <h2>[% Branches.GetName( patron.branchcode ) | html %]</h2> >+ </th> >+ </tr> >+ <tr> >+ <th colspan="5" > >+ Bill to: [% patron.firstname | html %] [% patron.surname | html %] <br /> >+ Card number: [% patron.cardnumber | html %]<br /> >+ </th> >+ </tr> >+ <tr> >+ <th>Date</th> >+ <th>Description of charges</th> >+ <th>Note</th> >+ <th style="text-align:right;">Amount</th> >+ <th style="text-align:right;">Amount outstanding</th> >+ </tr> >+ >+ [% FOREACH account IN accounts %] >+ <tr class="highlight"> >+ <td>[% account.date | $KohaDates%]</td> >+ <td> >+ [% PROCESS account_type_description account=account %] >+ [%- IF account.description %], [% account.description | html %][% END %] >+ </td> >+ <td>[% account.note | html %]</td> >+ [% IF ( account.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amount | $Price %]</td> >+ [% IF ( account.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amountoutstanding | $Price %]</td> >+ </tr> >+ [% END %] >+ >+ <tfoot> >+ <tr> >+ <td colspan="4">Total outstanding dues as on date: </td> >+ [% IF ( totalcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% total | $Price %]</td> >+ </tr> >+ </tfoot> >+</table>', 'print', 'default'); >+ }); >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug XXXXX - description)\n"; >+} >diff --git a/installer/data/mysql/en/mandatory/sample_notices.sql b/installer/data/mysql/en/mandatory/sample_notices.sql >index 80b5fa0612..0f38c53b70 100644 >--- a/installer/data/mysql/en/mandatory/sample_notices.sql >+++ b/installer/data/mysql/en/mandatory/sample_notices.sql >@@ -233,5 +233,60 @@ INSERT INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title` > </tfoot> > </table>', 'print', 'default'); > >+INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`, `lang`) VALUES >+('circulation', 'ACCOUNT_DEBIT', '', 'Account fee', 0, 'Account fee', '<table> >+ [% IF ( LibraryName ) %] >+ <tr> >+ <th colspan="5" class="centerednames"> >+ <h3>[% LibraryName | html %]</h3> >+ </th> >+ </tr> >+ [% END %] >+ >+ <tr> >+ <th colspan="5" class="centerednames"> >+ <h2><u>INVOICE</u></h2> >+ </th> >+ </tr> >+ <tr> >+ <th colspan="5" class="centerednames"> >+ <h2>[% Branches.GetName( patron.branchcode ) | html %]</h2> >+ </th> >+ </tr> >+ <tr> >+ <th colspan="5" > >+ Bill to: [% patron.firstname | html %] [% patron.surname | html %] <br /> >+ Card number: [% patron.cardnumber | html %]<br /> >+ </th> >+ </tr> >+ <tr> >+ <th>Date</th> >+ <th>Description of charges</th> >+ <th>Note</th> >+ <th style="text-align:right;">Amount</th> >+ <th style="text-align:right;">Amount outstanding</th> >+ </tr> >+ >+ [% FOREACH account IN accounts %] >+ <tr class="highlight"> >+ <td>[% account.date | $KohaDates%]</td> >+ <td> >+ [% PROCESS account_type_description account=account %] >+ [%- IF account.description %], [% account.description | html %][% END %] >+ </td> >+ <td>[% account.note | html %]</td> >+ [% IF ( account.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amount | $Price %]</td> >+ [% IF ( account.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amountoutstanding | $Price %]</td> >+ </tr> >+ [% END %] >+ >+ <tfoot> >+ <tr> >+ <td colspan="4">Total outstanding dues as on date: </td> >+ [% IF ( totalcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% total | $Price %]</td> >+ </tr> >+ </tfoot> >+</table>', 'print', 'default'); >+ > INSERT INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`) VALUES > ('circulation', 'SR_SLIP', '', 'Stock rotation slip', 0, 'Stock rotation report', 'Stock rotation report for [% branch.name %]:\r\n\r\n[% IF branch.items.size %][% branch.items.size %] items to be processed for this branch.\r\n[% ELSE %]No items to be processed for this branch\r\n[% END %][% FOREACH item IN branch.items %][% IF item.reason != \'in-demand\' %]Title: [% item.title %]\r\nAuthor: [% item.author %]\r\nCallnumber: [% item.callnumber %]\r\nLocation: [% item.location %]\r\nBarcode: [% item.barcode %]\r\nOn loan?: [% item.onloan %]\r\nStatus: [% item.reason %]\r\nCurrent library: [% item.branch.branchname %] [% item.branch.branchcode %]\r\n\r\n[% END %][% END %]', 'email'); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt >index a28ac03e34..f4c25f4e30 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt >@@ -17,59 +17,7 @@ > <body id="printinvoice" class="pat"> > > <div id="receipt"> >-<!-- The table with the account items --> >-<table> >-[% IF ( LibraryName ) %] >- <tr> >- <th colspan="5" class="centerednames"> >- <h3>[% LibraryName | html %]</h3> >- </th> >- </tr> >-[% END %] >- <tr> >- <th colspan="5" class="centerednames"> >- <h2><u>INVOICE</u></h2> >- </th> >- </tr> >- <tr> >- <th colspan="5" class="centerednames"> >- <h2>[% Branches.GetName( patron.branchcode ) | html %]</h2> >- </th> >- </tr> >- <tr> >- <th colspan="5" > >- Bill to: [% patron.firstname | html %] [% patron.surname | html %] <br /> >- Card number: [% patron.cardnumber | html %]<br /> >- </th> >- </tr> >- <tr> >- <th>Date</th> >- <th>Description of charges</th> >- <th>Note</th> >- <th style="text-align:right;">Amount</th> >- <th style="text-align:right;">Amount outstanding</th> >- </tr> >- >- [% FOREACH account IN accounts %] >-<tr class="highlight"> >- <td>[% account.date | $KohaDates%]</td> >- <td> >- [% PROCESS account_type_description account=account %] >- [%- IF account.description %], [% account.description | html %][% END %] >- </td> >- <td>[% account.note | html %]</td> >- [% IF ( account.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amount | $Price %]</td> >- [% IF ( account.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amountoutstanding | $Price %]</td> >- </tr> >- >- [% END %] >-<tfoot> >- <tr> >- <td colspan="4">Total outstanding dues as on date: </td> >- [% IF ( totalcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% total | $Price %]</td> >- </tr> >- </tfoot> >-</table> >+ [% letter.content | evaltt %] > </div> > > [% MACRO jsinclude BLOCK %] >diff --git a/members/printinvoice.pl b/members/printinvoice.pl >index 81b5b9f54e..98ff1c50fd 100755 >--- a/members/printinvoice.pl >+++ b/members/printinvoice.pl >@@ -55,7 +55,8 @@ output_and_exit_if_error( $input, $cookie, $template, { module => 'members', log > > #get account details > my $total = $patron->account->balance; >-my $accountline = Koha::Account::Lines->find($accountlines_id)->unblessed; >+my $accountline_object = Koha::Account::Lines->find($accountlines_id); >+my $accountline = $accountline_object->unblessed; > > my $totalcredit; > if ( $total <= 0 ) { >@@ -85,12 +86,21 @@ my %row = ( > 'note' => $accountline->{'note'}, > ); > >+my @account_offsets = Koha::Account::Offsets->search( { debit_id => $accountline_object->id } ); >+ >+my $letter = C4::Letters::getletter( 'circulation', 'ACCOUNT_DEBIT', C4::Context::mybranch, 'print', $patron->lang ); >+ > $template->param( >- patron => $patron, >- finesview => 1, >- total => sprintf( "%.2f", $total ), >- totalcredit => $totalcredit, >- accounts => [$accountline], # FIXME There is always only 1 row! >+ letter => $letter, >+ patron => $patron, >+ library => C4::Context::mybranch, >+ offsets => \@account_offsets, >+ debit => $accountline_object, >+ >+ finesview => 1, >+ total => sprintf( "%.2f", $total ), >+ totalcredit => $totalcredit, >+ accounts => [$accountline], # FIXME There is always only 1 row! > ); > > output_html_with_http_headers $input, $cookie, $template->output; >-- >2.20.1 (Apple Git-117)
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 22809
:
89115
|
89155
|
89156
|
89229
|
89230
|
89231