Bugzilla – Attachment 127439 Details for
Bug 28374
Convert pos/printreceipt.pl to use GetPreparedLetter
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28374: Update existing notices
Bug-28374-Update-existing-notices.patch (text/plain), 5.20 KB, created by
David Nind
on 2021-11-08 11:34:33 UTC
(
hide
)
Description:
Bug 28374: Update existing notices
Filename:
MIME Type:
Creator:
David Nind
Created:
2021-11-08 11:34:33 UTC
Size:
5.20 KB
patch
obsolete
>From afbea32f27d8a55c9f75af18164497b9a11d080c Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 5 Nov 2021 14:53:39 +0000 >Subject: [PATCH] Bug 28374: Update existing notices > >This patch updates the default slip to include KohaDates, Branches and >Price plugins as required and prepends the same to existing notices at >upgrade time. We also, switch the HTML flag on. > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../data/mysql/atomicupdate/bug_28374.pl | 35 +++++++++++++++++++ > .../mysql/en/mandatory/sample_notices.yml | 23 ++++++------ > 2 files changed, 48 insertions(+), 10 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_28374.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_28374.pl b/installer/data/mysql/atomicupdate/bug_28374.pl >new file mode 100644 >index 0000000000..bc03104d55 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_28374.pl >@@ -0,0 +1,35 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "28374", >+ description => "Update point of sale print receipt", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ >+ $dbh->do(q{ >+ UPDATE letter SET content = CONCAT('[% USE KohaDates %][% USE Branches %][% USE Price %]', content), is_html = 1 WHERE code = 'RECEIPT'; >+ }); >+ say $out "Added KohaDates, Branches and Price plugins"; >+ >+ $dbh->do(q{ >+ UPDATE letter SET content = REPLACE(content, 'payment.', 'credit.') WHERE code = 'RECEIPT'; >+ }); >+ say $out "Replaced 'payment' with 'credit' param in RECEIPT template"; >+ >+ $dbh->do(q{ >+ UPDATE letter SET content = REPLACE(content, 'offsets', 'credit.debits') WHERE code = 'RECEIPT'; >+ }); >+ say $out "Replaced 'offsets' with 'credit.debits' param in RECEIPT template"; >+ >+ $dbh->do(q{ >+ UPDATE letter SET content = REPLACE(content, 'offset', 'debit') WHERE code = 'RECEIPT'; >+ }); >+ say $out "Replaced 'offset' with 'debit' param in RECEIPT template"; >+ >+ $dbh->do(q{ >+ UPDATE letter SET content = REPLACE(content, 'debit.debit', 'debit') WHERE code = 'RECEIPT'; >+ }); >+ say $out "Replaced 'debit.debit' with 'debit' param in RECEIPT template"; >+ }, >+} >diff --git a/installer/data/mysql/en/mandatory/sample_notices.yml b/installer/data/mysql/en/mandatory/sample_notices.yml >index e95df89a87..ed95bfb4fb 100644 >--- a/installer/data/mysql/en/mandatory/sample_notices.yml >+++ b/installer/data/mysql/en/mandatory/sample_notices.yml >@@ -1113,11 +1113,14 @@ tables: > code: RECEIPT > branchcode: "" > name: "Point of sale receipt" >- is_html: 0 >+ is_html: 1 > title: "Receipt" > message_transport_type: print > lang: default > content: >+ - "[% USE KohaDates %]" >+ - "[% USE Branches %]" >+ - "[% USE Price %]" > - "[% PROCESS \"accounts.inc\" %]" > - "<table>" > - "[% IF ( LibraryName ) %]" >@@ -1129,24 +1132,24 @@ tables: > - "[% END %]" > - " <tr>" > - " <th colspan=\"2\" class=\"centerednames\">" >- - " <h2>[% Branches.GetName( payment.branchcode ) | html %]</h2>" >+ - " <h2>[% Branches.GetName( credit.branchcode ) | html %]</h2>" > - " </th>" > - " </tr>" > - "<tr>" > - " <th colspan=\"2\" class=\"centerednames\">" >- - " <h3>[% payment.date | $KohaDates %]</h3>" >+ - " <h3>[% credit.date | $KohaDates %]</h3>" > - "</tr>" > - "<tr>" > - " <td>Transaction ID: </td>" >- - " <td>[% payment.accountlines_id %]</td>" >+ - " <td>[% credit.accountlines_id %]</td>" > - "</tr>" > - "<tr>" > - " <td>Operator ID: </td>" >- - " <td>[% payment.manager_id %]</td>" >+ - " <td>[% credit.manager_id %]</td>" > - "</tr>" > - "<tr>" > - " <td>Payment type: </td>" >- - " <td>[% payment.payment_type %]</td>" >+ - " <td>[% credit.payment_type %]</td>" > - "</tr>" > - " <tr></tr>" > - " <tr>" >@@ -1160,17 +1163,17 @@ tables: > - " <th>Amount</th>" > - " </tr>" > - "" >- - " [% FOREACH offset IN offsets %]" >+ - " [% FOREACH debit IN credit.debits %]" > - " <tr>" >- - " <td>[% PROCESS account_type_description account=offset.debit %]</td>" >- - " <td>[% offset.amount * -1 | $Price %]</td>" >+ - " <td>[% PROCESS account_type_description account=debit %]</td>" >+ - " <td>[% debit.amount * -1 | $Price %]</td>" > - " </tr>" > - " [% END %]" > - "" > - "<tfoot>" > - " <tr class=\"highlight\">" > - " <td>Total: </td>" >- - " <td>[% payment.amount * -1| $Price %]</td>" >+ - " <td>[% credit.amount * -1| $Price %]</td>" > - " </tr>" > - " <tr>" > - " <td>Tendered: </td>" >-- >2.20.1
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 28374
:
121116
|
121117
|
122613
|
127367
|
127368
|
127415
|
127434
|
127435
|
127438
|
127439
|
127549
|
127550
|
127551