Koha/t/db_dependent
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 Bug 31649: Add unit tests 2022-10-11 10:00:08 -03:00
api/v1 Bug 33227: Remove invalid spec and adjust the code accordingly 2023-03-20 09:39:50 -03:00
Auth
AuthoritiesMarc
Authority Bug 19693: Add test sub to Merge.t 2022-10-24 17:20:25 -03:00
Biblio Bug 29697: Fix tests 2022-07-22 15:24:11 -03:00
Budgets Bug 27550: Add unit test for CloneBudgetHierarchy 2022-09-22 08:18:43 -03:00
Circulation Bug 31095: Remove GetDebarments from MarkIssueReturned.t 2023-01-31 10:19:39 -03:00
CourseReserves Bug 32351: Fix CourseItems.t 2022-11-30 15:58:18 -03:00
Creators
cronjobs
data Bug 29697: Fix t/db_dependent/Search.t 2022-07-25 10:16:48 -03:00
Exporter
Holds Bug 32455: Cleanup and expand ExpireReservesAutoFill.t 2023-02-07 10:26:03 -03:00
Illrequest Bug 30484: Add unit tests 2022-09-23 09:18:46 -03:00
Items Bug 31196: Remove 'default_value_for_mod_marc-' clear_from_cache calls 2022-10-25 11:16:57 -03:00
Koha Bug 32713: (QA follow-up) Tests now require more complex structures 2023-03-17 18:27:09 -03:00
Labels
LDAP
Letters Bug 32442: Add tests 2023-01-31 10:49:37 -03:00
Members
misc/translator
OAI Bug 29697: Replace some missing occurrences 2022-07-25 09:30:30 -03:00
Patron Bug 14251: Allow use of CSS in discharge letter 2023-03-27 11:53:16 +02:00
Record Bug 29697: Use flag embed_items 2022-07-22 15:24:11 -03:00
Reports
Reserves Bug 24860: (QA follow-up) Add unit tests to cover Koha::Holds::forced_hold_level 2022-11-04 19:40:14 -03:00
Search
selenium Bug 33263: Fix random failure in patrons_search.t 2023-03-17 09:59:03 -03:00
Serials
SIP Bug 32684: Implement SIP patron status field "too many items lost" 2023-03-14 08:49:29 -03:00
Template/Plugin Bug 31421: Add tests 2022-10-27 09:42:57 -03:00
Utils
www Bug 33020: (QA follow-up) POD and chmod 2023-02-27 11:33:50 -03:00
00-strict.t
01-test_dbic.t
Accounts.t
Acquisition.t Bug 25655: Store invoice price and currency even if no currency change 2023-03-06 13:57:53 -03:00
Amazon.t
ArticleRequests.t
AudioAlerts.t
Auth.t Bug 30624: Adjust number of tests 2023-03-13 15:23:15 -03:00
Auth_with_cas.t
Auth_with_ldap.t Bug 30646: Unit tests for Auth_with_ldap 2022-10-03 14:02:40 -03:00
AuthorisedValues.t Bug 32997: Add tests 2023-03-02 12:00:16 -03:00
AuthoritiesMarc.t
AuthoritiesMarc_GetTagsLabels.t
AuthUtils.t
BackgroundJob.t
Barcodes.t
Barcodes_ValueBuilder.t
Biblio.t Bug 33083: Add a generic class to handle methods for collections of records 2023-03-13 15:11:59 -03:00
Biblio_holdsqueue.t
Breeding.t
Budgets.t Bug 32351: Fix Budgets.t 2022-11-30 15:58:15 -03:00
Cache.t
Calendar.t
Charset.t
check_kohastructure.t
check_sysprefs.t
Circulation.t Bug 32878: (QA follow-up) Correct unit test 2023-03-14 10:55:25 -03:00
Circulation_holdsqueue.t
Clubs.t
Context.t Bug 32687: Get server version in Context::get_versions 2023-02-24 17:52:28 -03:00
Contract.t
CourseReserves.t
db_structure.t
DecreaseLoanHighHolds.t Bug 29102: Do not count patron's own hold against limits 2022-11-04 19:20:24 -03:00
Filter_MARC_ViewPolicy.t
Fines.t
FrameworkPlugin.t
Heading.t Bug 33100: (QA follow-up) Trivial QA fixes 2023-03-17 09:59:08 -03:00
Heading_MARC21.t
Hold.t Bug 14783: (QA follow-up) Rename method and move tests 2022-10-17 15:43:22 -03:00
Holds.t Bug 24860: (QA follow-up) Add unit tests to cover changes to Reserves.pm 2022-11-04 19:39:58 -03:00
HoldsQueue.t Bug 24860: (QA follow-up) Add unit tests to cover changes to HoldsQueue.pm 2022-11-04 19:39:58 -03:00
Holidays.t
Illcomments.t
Illrequestattributes.t
Illrequests.t Bug 32799: Rename ILLSTATUS authorised value category to ILL_STATUS_ALIAS 2023-02-27 13:08:10 -03:00
ILSDI_Services.t
ImportBatch.t Bug 32804: (QA follow-up) Typo ahs and fix ImportBatch.t 2023-03-17 09:59:12 -03:00
ImportExportFramework.t
Installer.t
Items.t Bug 32456: Unit tests 2022-12-27 10:42:19 -03:00
Koha.t
Koha_Database.t
Koha_Elasticsearch.t
Koha_ExternalContent_OverDrive.t
Koha_ExternalContent_RecordedBooks.t
Koha_MetadataRecord_Authority.t
Koha_Misc_Files.t
Languages.t
Letters.t Bug 31858: (QA follow-up) Fix number of tests 2023-03-10 11:15:21 -03:00
LibraryGroups.t
Linker_Default.t Bug 30280: Add Unit tests 2022-10-03 10:00:12 -03:00
Linker_FirstMatch.t
Log.t Bug 32057: (QA follow-up) Add a simple test 2023-03-14 08:49:34 -03:00
MarcModificationTemplates.t Bug 31644: (QA follow-up) Add two missing shebang lines 2022-10-24 11:53:19 -03:00
Members.t Bug 32351: Fix Members.t 2022-11-30 15:58:16 -03:00
Message.t
MungeMarcPrice.t
Overdues.t
Passwordrecovery.t Bug 31739: Password recovery from staff fails if previous expired reset-entry exists. 2022-10-24 14:12:16 -03:00
Patroncards.t
PatronLists.t
Patrons.t
Record.t
RecordProcessor_EmbedSeeFromHeadings.t
Reports.t
Reserves.t Bug 32455: Unit tests 2023-02-07 10:26:03 -03:00
rollingloans.t
RotatingCollections.t Bug 29144: Remove opac_info from a few tests 2022-09-16 09:55:20 -03:00
Search.t Bug 31471: Send multiple ISBN with 'OR' for FindDuplicate 2023-03-06 09:51:45 -03:00
Serials.t Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
Serials_2.t
Service.t
ShelfBrowser.t
Sitemapper.t
Stats.t
StockRotationItems.t
StockRotationRotas.t
StockRotationStages.t
SuggestionEngine_ExplodedTerms.t Bug 31069: Remove ExplodedTerms dependency on templates 2022-07-18 12:37:35 -03:00
Suggestions.t
sysprefs.t
TablesSettings.t
Tags.t Bug 31517: Remove unused get_tag function 2022-11-04 19:30:56 -03:00
Templates.t
TestBuilder.t Bug 32350: Add subtest for bad columns 2022-11-30 12:40:33 -03:00
Upload.t Bug 31598: Fix random failure on Jenkins for Upload.t 2022-09-22 08:07:01 -03:00
UsageStats.t
Virtualshelves.t Bug 30933: (follow-up) Consolidate transfer checks 2022-07-20 09:04:07 -03:00
XISBN.t
XSLT.t Bug 32268: Prevent XSLT.t to fail randomly 2022-11-18 12:04:28 -03:00
yaml.t
zebra_config.pl