From 05964317c107dd379c07ad09e5c97360a7162c9b Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 23 Apr 2019 14:39:44 -0400 Subject: [PATCH] Bug 22761: Add notice based on existing template Signed-off-by: Michal Denar Signed-off-by: Michal Denar Signed-off-by: Kyle M Hall --- .../data/mysql/atomicupdate/bug_22761.perl | 58 ++++++++++++++++++ .../mysql/en/mandatory/sample_notices.sql | 61 +++++++++++++++++-- 2 files changed, 115 insertions(+), 4 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_22761.perl diff --git a/installer/data/mysql/atomicupdate/bug_22761.perl b/installer/data/mysql/atomicupdate/bug_22761.perl new file mode 100644 index 0000000000..ac313c23ee --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_22761.perl @@ -0,0 +1,58 @@ +$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_CREDIT', '', 'Account payment', 0, 'Account payment', ' +[% IF ( LibraryName ) %] + + + +[% END %] + + + + + + + + + + + + + + + + + [% FOREACH account IN accounts %] + + + + + [% IF ( account.amountcredit ) %] + + + [% END %] + + + + [% IF ( totalcredit ) %] + + +
+

[% LibraryName | html %]

+
+

Fee receipt

+
+

[% Branches.GetName( patron.branchcode ) | html %]

+
+ Received with thanks from [% patron.firstname | html %] [% patron.surname | html %]
+ Card number: [% patron.cardnumber | html %]
+
DateDescription of chargesNoteAmount
[% account.date | $KohaDates %] + [% PROCESS account_type_description account=account %] + [%- IF account.description %], [% account.description | html %][% END %] + [% account.note | html %][% ELSE %][% END %][% account.amount | $Price %]
Total outstanding dues as on date: [% ELSE %][% END %][% total | $Price %]
', '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 4d37f9c71d..80b5fa0612 100644 --- a/installer/data/mysql/en/mandatory/sample_notices.sql +++ b/installer/data/mysql/en/mandatory/sample_notices.sql @@ -176,9 +176,62 @@ INSERT INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title` ('circulation', 'AR_SLIP', '', 'Article request - print slip', 0, 'Article request', 'Article request:\r\n\r\n<> <> (<>),\r\n\r\nTitle: <>\r\nBarcode: <>\r\n\r\nArticle requested:\r\nTitle: <>\r\nAuthor: <>\r\nVolume: <>\r\nIssue: <>\r\nDate: <>\r\nPages: <>\r\nChapters: <>\r\nNotes: <>\r\n', 'print'), ('circulation', 'AR_PROCESSING', '', 'Article request - processing', 0, 'Article request processing', 'Dear <> <> (<>),\r\n\r\nWe are now processing your request for an article from <> (<>).\r\n\r\nArticle requested:\r\nTitle: <>\r\nAuthor: <>\r\nVolume: <>\r\nIssue: <>\r\nDate: <>\r\nPages: <>\r\nChapters: <>\r\nNotes: <>\r\n\r\nThank you!', 'email'), ('circulation', 'CHECKOUT_NOTE', '', 'Checkout note on item set by patron', '0', 'Checkout note', '<> <> has added a note to the item <> - <> (<>).','email'); -INSERT INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`, `lang`) - VALUES - ('circulation', 'ACCOUNT_PAYMENT', '', 'Account payment', 0, 'Account payment', '[%- USE Price -%]\r\nA payment of [% credit.amount * -1 | $Price %] has been applied to your account.\r\n\r\nThis payment affected the following fees:\r\n[%- FOREACH o IN offsets %]\r\nDescription: [% o.debit.description %]\r\nAmount paid: [% o.amount * -1 | $Price %]\r\nAmount remaining: [% o.debit.amountoutstanding | $Price %]\r\n[% END %]', 'email', 'default'), - ('circulation', 'ACCOUNT_WRITEOFF', '', 'Account writeoff', 0, 'Account writeoff', '[%- USE Price -%]\r\nAn account writeoff of [% credit.amount * -1 | $Price %] has been applied to your account.\r\n\r\nThis writeoff affected the following fees:\r\n[%- FOREACH o IN offsets %]\r\nDescription: [% o.debit.description %]\r\nAmount paid: [% o.amount * -1 | $Price %]\r\nAmount remaining: [% o.debit.amountoutstanding | $Price %]\r\n[% END %]', 'email', 'default'); + +INSERT INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`, `lang`) VALUES +('circulation', 'ACCOUNT_PAYMENT', '', 'Account payment', 0, 'Account payment', '[%- USE Price -%]\r\nA payment of [% credit.amount * -1 | $Price %] has been applied to your account.\r\n\r\nThis payment affected the following fees:\r\n[%- FOREACH o IN offsets %]\r\nDescription: [% o.debit.description %]\r\nAmount paid: [% o.amount * -1 | $Price %]\r\nAmount remaining: [% o.debit.amountoutstanding | $Price %]\r\n[% END %]', 'email', 'default'), +('circulation', 'ACCOUNT_WRITEOFF', '', 'Account writeoff', 0, 'Account writeoff', '[%- USE Price -%]\r\nAn account writeoff of [% credit.amount * -1 | $Price %] has been applied to your account.\r\n\r\nThis writeoff affected the following fees:\r\n[%- FOREACH o IN offsets %]\r\nDescription: [% o.debit.description %]\r\nAmount paid: [% o.amount * -1 | $Price %]\r\nAmount remaining: [% o.debit.amountoutstanding | $Price %]\r\n[% END %]', 'email', 'default'); + +INSERT INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`, `lang`) VALUES +('circulation', 'ACCOUNT_CREDIT', '', 'Account payment', 0, 'Account payment', ' +[% IF ( LibraryName ) %] + + + +[% END %] + + + + + + + + + + + + + + + + + [% FOREACH account IN accounts %] + + + + + [% IF ( account.amountcredit ) %] + + + [% END %] + + + + [% IF ( totalcredit ) %] + + +
+

[% LibraryName | html %]

+
+

Fee receipt

+
+

[% Branches.GetName( patron.branchcode ) | html %]

+
+ Received with thanks from [% patron.firstname | html %] [% patron.surname | html %]
+ Card number: [% patron.cardnumber | html %]
+
DateDescription of chargesNoteAmount
[% account.date | $KohaDates %] + [% PROCESS account_type_description account=account %] + [%- IF account.description %], [% account.description | html %][% END %] + [% account.note | html %][% ELSE %][% END %][% account.amount | $Price %]
Total outstanding dues as on date: [% ELSE %][% END %][% total | $Price %]
', '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'); -- 2.20.1 (Apple Git-117)