Koha/t
Tomas Cohen Arazi 9d9ecdc49b
Bug 14251: Allow use of CSS in discharge letter
The discharge feature relies PDF::FromHTML which explicitly doesn't
handle CSS [1].

This patch makes it use the `weasyprint` command-line tool to generate
the PDF. This tool handles CSS correctly.

To test:
1. Install weasyprint:
   $ apt install weasyprint
2. Add some style to your DISCHARGE letter. I used:
<<today>>
<h1>Discharge confirmation</h1>
<p style="background-color: yellow;"><<branches.branchname>> certifies that the following borrower:<br>
<<borrowers.firstname>> <<borrowers.surname>> (cardnumber: <<borrowers.cardnumber>>)<br>
has returned all items.</p>
3. Have some non-latin chars on the patron name. I picked 'Henry
   Acevedo' and added 'Δοκιμή' as picked from bug 23589. Only to check no
   regressions.
4. Enable the 'UseDischarge' syspref
5. Go to Henry's detail page
6. Choose More > Discharge and Generate the discharge
=> SUCCESS:
   - Style is applied to the PDF
   - Greek characters are displayed correctly
7. Run the tests:
   $ kshell
  k$ prove -v t/db_dependent/Patron/Borrower_Discharge.t
=> SUCCESS: The rewritten tests pass!
8. Remove weasyprint:
   $ apt remove weasyprint
9. Repeat 7
=> SUCCESS: Tests pass, relevant test is skipped because of missing
            weasyprint
10. Sign off :-D

[1] https://metacpan.org/pod/PDF::FromHTML#CAVEATS

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-03-27 11:53:16 +02:00
..
Acquisition
Biblio
Budgets
Circulation
cypress Bug 33282: Feed an array of titles so that no dialog message appears 2023-03-24 09:12:56 +01:00
data Bug 28998: Add encryption_key to the config file 2022-05-04 05:18:31 -10:00
db_dependent Bug 14251: Allow use of CSS in discharge letter 2023-03-27 11:53:16 +02:00
edi_testfiles
etc
External
Koha Bug 32713: Unit tests 2023-03-16 16:12:26 -03:00
lib Bug 32353: Don't generate item group for holds in tests 2023-02-22 10:04:37 -03:00
Members
Number
Search Bug 23919: Add tests for biblioItems search by ISBN and ISSN with 2022-08-01 13:21:50 -03:00
Serials
SIP
Test
00-check-atomic-updates.t Bug 31108: rename ./t/00-check-atomic-updates.pl extension to *.t 2022-07-06 16:40:51 -03:00
00-deprecated.t
00-load.t
00-merge-conflict-markers.t
00-testcritic.t Bug 32349: Remove TEST_QA 2023-01-11 20:44:21 -03:00
00-valid-xml.t
Auth.t
Auth_with_shibboleth.t Bug 30646: Unit test for Auth_with_shibboleth 2022-10-03 14:02:40 -03:00
AuthoritiesMarc_MARC21.t Bug 31023: Unit tests 2022-09-07 13:52:35 -07:00
AuthoritiesMarc_UNIMARC.t
Barcodes_annual.t
Barcodes_EAN13.t
Barcodes_hbyymmincr.t
Barcodes_incremental.t
Biblio.t Bug 29697: Use flag embed_items 2022-07-22 15:24:11 -03:00
Biblio2.t
Budgets.t
Calendar.t
Charset.t
Circulation_barcodedecode.t Bug 30409: (QA follow-up) Avoid uninitialized variable warnings 2022-06-14 08:26:58 -03:00
ClassSortRoutine.t
ClassSortRoutine_Dewey.t
ClassSortRoutine_Generic.t
ClassSortRoutine_LCC.t
ClassSource.t
Context.t Bug 29744: (QA follow-up) Only consider PLACK_ENV for underscore 2022-09-23 12:05:05 -03:00
Contract.t
CookieManager.t Bug 31250: (QA follow-up) The future will be easier 2022-09-12 15:34:11 -03:00
Creators.t
DateUtils.t Bug 30717: (QA follow-up) Move to module 2022-05-13 15:41:55 -10:00
dummy.t
Edifact.t Bug 30135: (follow-up) Rename accessor in failing test 2022-04-14 11:43:43 +01:00
EdiInvoice.t
Ediorder.t Bug 31134: Mock EdifactLSQ for t/Edifact.t 2022-07-18 10:20:44 -03:00
Ediordrsp.t
EdiTransport.t
Form_MessagingPreferences.t
HtmlTags.t
ImportBatch.t
Installer_PerlModules.t Bug 30731: Unit tests 2022-06-01 16:15:25 -03:00
ItemCirculationAlertPreference.t
Koha.t
Koha_MetadataRecord.t Bug 30813: (follow-up) Fix tests import 2022-06-08 13:41:14 -03:00
Koha_SearchEngine_Elasticsearch_Browse.t
Koha_Template_Plugin_Cache.t
Koha_Template_Plugin_HtmlId.t
Koha_Template_Plugin_Koha.t Bug 31401: (QA follow-up) Remove Koha.ArePluginsEnabled, it is no longer needed 2022-09-07 13:55:37 -07:00
Koha_Util_FrameworkPlugin.t
Koha_Util_MARC.t
Koha_XSLT_HTTPS.t Bug 12758: Introduce Koha::XSLT::HTTPS 2022-11-09 09:52:17 -03:00
Labels.t
Labels_split_ccn.t Bug 30110: Fix concatenation during assignements 2022-03-24 14:22:10 -10:00
Labels_split_ddcn.t Bug 30110: Fix concatenation during assignements 2022-03-24 14:22:10 -10:00
Labels_split_lccn.t Bug 30110: Fix concatenation during assignements 2022-03-24 14:22:10 -10:00
Labels_split_Regex.t
Languages.t
Letters.t
Logger.t Bug 32979: Skip test if running as root 2023-02-20 09:44:16 -03:00
Makefile.t Bug 31528: (QA follow-up) Exclude .stylelintrc.json in Makefile.t 2022-10-03 09:54:34 -03:00
Matcher.t Bug 28290: (follow-up) Unit test 2022-09-07 13:50:37 -07:00
Members_Messaging.t
OpenLibrarySearch.t
Output.t
Output_JSONStream.t
Patron.t
Patroncards.t
Patroncards_Batch.t
Patroncards_Lib.t
Patroncards_Patroncard.t
Patroncards_Profile.t
Patroncards_Template.t
Prices.t Bug 29955: Move populate_order_with_prices to Koha namespace 2022-08-19 15:47:51 -03:00
RecordProcessor.t
Ris.t
Scheduler.t
Scrubber.t
Search.t Bug 29697: Fix t/Search.t 2022-07-25 09:33:36 -03:00
Search_PazPar2.t
SimpleMARC.t Bug 31644: (QA follow-up) Add two missing shebang lines 2022-10-24 11:53:19 -03:00
SMS.t
SocialData.t
Stats.t
SuggestionEngine.t
SuggestionEngine_AuthorityFile.t
template_filters.t
timezones.t
TmplToken.t
Token.t Bug 27849: (follow-up) Add test 2022-08-01 09:53:35 -03:00
XSLT.t