Bug 33393

Summary: Modify sentence above the order table in English 1-page order PDF
Product: Koha Reporter: Alex Buckley <alexbuckley>
Component: AcquisitionsAssignee: Alex Buckley <alexbuckley>
Status: Pushed to main --- QA Contact: Kyle M Hall <kyle>
Severity: enhancement    
Priority: P5 - low CC: david, kyle, m.de.rooy
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: Sponsored Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00
Bug Depends on: 33340    
Bug Blocks:    
Attachments: Bug 33393: Add system preference
Bug 33393: Enable libraries to configure their own text in the 1-Page order PDF
Bug 33393: Enable libraries to configure their own text in the 1-Page order PDF
Custom text (highlighted yellow) that can be set in the 1PageOrderPDFText syspref with bug 33393 applied
Bug 33393: Enable libraries to configure their own text in the 1-Page order PDF
Bug 33393: Add note to system preference explaining text length
Bug 33393: Add system preference
Bug 33393: Enable libraries to configure their own text in the 1-Page order PDF
Bug 33393: Add note to system preference explaining text length
Bug 33393: Add system preference
Bug 33393: Enable libraries to configure their own text in the 1-Page order PDF
Bug 33393: Add note to system preference explaining text length
Bug 33393: tidy layout1page.pm

Description Alex Buckley 2023-04-03 00:59:02 UTC
It would nice if libraries could edit the 'Order number must appear on all related correspondence, shipping papers and invoices. Notify us immediately if
you are unable to supply item(s).' line in the English 1-page order PDF to wording relevant to their library.
Comment 1 Alex Buckley 2023-04-03 03:37:52 UTC
Created attachment 149076 [details] [review]
Bug 33393: Add system preference

Sponsored-by: Pymble Ladies' College
Comment 2 Alex Buckley 2023-04-03 03:38:09 UTC
Created attachment 149077 [details] [review]
Bug 33393: Enable libraries to configure their own text in the 1-Page order PDF

Test plan:
1) Apply patches and restart services
2) Upgrade Koha schema:
sudo koha-upgrade-schema <instance>
3) Go to Koha Administration -> Libraries. Ensure Library A has an
address, phone and fax.
4) Go to Koha Administration -> System preferences. Search for
OrderPdfFormat. Set this to English 1-page layout option.
5) Go to Acquisitions. Use an existing vendor or create a new one.
Ensure the vendor has a postal address, phone, fax and accout number.
6) Create a basket for this vendor. Add many orders to this basket, for
example 25 items (this is to make the Order PDF cover multiple pages).
7) Close the basket and add it to a basket group of the same name.
8) Edit the basket group. Add an address in the delivery place, and a
delivery comment. Check the box to close the basket group and Save.
9) Click the button to Export as PDF.
10) View the exported PDF. Confirm the PDF is multiple pages long. If it
is not then re-open the basketgroup and add more orders to the basket
and repeat steps 7, 8, and 9
11) If the PDF is multiple pages long then confirm:
- The text "Order number must appear on all related correspondence, shipping papers and invoices. Notify us immediately if you are unable to supply item(s)." appears above the order table.
- The page numbers at the bottom of the first page are not obscured by
the order table.
- That the order table starts near the top of the second page, and not
half way down.
12) Change content in the '1PageOrderPDFText' syspref (use the Enter key
    to split text over multiple lines) and save
13) Back in the Acquisitions module click the button to Export as PDF
14) View the exported PDF. Confirm the following:
- Text text above the order table has changed.
- The page numbers at the bottom of the first page are not obscrued by
the order table.
- That the order table starts near the top of the second page and not
halfway down.

Sponsored-by: Pymble Ladies' College
Comment 3 Alex Buckley 2023-04-03 04:37:12 UTC
Created attachment 149078 [details] [review]
Bug 33393: Enable libraries to configure their own text in the 1-Page order PDF

Test plan:
1) Apply patches and restart services
2) Upgrade Koha schema:
sudo koha-upgrade-schema <instance>
3) Go to Koha Administration -> Libraries. Ensure Library A has an
address, phone and fax.
4) Go to Koha Administration -> System preferences. Search for
OrderPdfFormat. Set this to English 1-page layout option.
5) Go to Acquisitions. Use an existing vendor or create a new one.
Ensure the vendor has a postal address, phone, fax and accout number.
6) Create a basket for this vendor. Add many orders to this basket, for
example 25 items (this is to make the Order PDF cover multiple pages).
7) Close the basket and add it to a basket group of the same name.
8) Edit the basket group. Add an address in the delivery place, and a
delivery comment. Check the box to close the basket group and Save.
9) Click the button to Export as PDF.
10) View the exported PDF. Confirm the PDF is multiple pages long. If it
is not then re-open the basketgroup and add more orders to the basket
and repeat steps 7, 8, and 9
11) If the PDF is multiple pages long then confirm:
- The text "Order number must appear on all related correspondence, shipping papers and invoices. Notify us immediately if you are unable to supply item(s)." appears above the order table.
- The page numbers at the bottom of the first page are not obscured by
the order table.
- That the order table starts near the top of the second page, and not
half way down.
12) Change content in the '1PageOrderPDFText' syspref (use the Enter key
    to split text over multiple lines) and save
13) Back in the Acquisitions module click the button to Export as PDF
14) View the exported PDF. Confirm the following:
- The text above the order table is what you saved in the
1PageOrderPDFText system preference
- The page numbers at the bottom of the first page are not obscrued by
the order table.
- That the order table starts near the top of the second page and not
halfway down.
15) Empty the 1PageOrderPDFText system preference and save
16) Back in the Acquisitions module click te button to Export as PDF
17) View the exported PDF and confirm the line of text between the
Tel/Fax line and the order table has been removed.

Sponsored-by: Pymble Ladies' College
Comment 4 Alex Buckley 2023-04-03 04:39:15 UTC
Created attachment 149079 [details]
Custom text (highlighted yellow) that can be set in the 1PageOrderPDFText syspref with bug 33393 applied
Comment 5 David Nind 2023-04-03 20:52:14 UTC
Created attachment 149106 [details] [review]
Bug 33393: Enable libraries to configure their own text in the 1-Page order PDF

Test plan:
1) Apply patches and restart services
2) Upgrade Koha schema:
sudo koha-upgrade-schema <instance>
3) Go to Koha Administration -> Libraries. Ensure Library A has an
address, phone and fax.
4) Go to Koha Administration -> System preferences. Search for
OrderPdfFormat. Set this to English 1-page layout option.
5) Go to Acquisitions. Use an existing vendor or create a new one.
Ensure the vendor has a postal address, phone, fax and accout number.
6) Create a basket for this vendor. Add many orders to this basket, for
example 25 items (this is to make the Order PDF cover multiple pages).
7) Close the basket and add it to a basket group of the same name.
8) Edit the basket group. Add an address in the delivery place, and a
delivery comment. Check the box to close the basket group and Save.
9) Click the button to Export as PDF.
10) View the exported PDF. Confirm the PDF is multiple pages long. If it
is not then re-open the basketgroup and add more orders to the basket
and repeat steps 7, 8, and 9
11) If the PDF is multiple pages long then confirm:
- The text "Order number must appear on all related correspondence, shipping papers and invoices. Notify us immediately if you are unable to supply item(s)." appears above the order table.
- The page numbers at the bottom of the first page are not obscured by
the order table.
- That the order table starts near the top of the second page, and not
half way down.
12) Change content in the '1PageOrderPDFText' syspref (use the Enter key
    to split text over multiple lines) and save
13) Back in the Acquisitions module click the button to Export as PDF
14) View the exported PDF. Confirm the following:
- The text above the order table is what you saved in the
1PageOrderPDFText system preference
- The page numbers at the bottom of the first page are not obscrued by
the order table.
- That the order table starts near the top of the second page and not
halfway down.
15) Empty the 1PageOrderPDFText system preference and save
16) Back in the Acquisitions module click te button to Export as PDF
17) View the exported PDF and confirm the line of text between the
Tel/Fax line and the order table has been removed.

Sponsored-by: Pymble Ladies' College
Signed-off-by: David Nind <david@davidnind.com>
Comment 6 David Nind 2023-04-03 20:55:38 UTC
Hi Alex.

This works well.

My only comment would be to add a hint or note to the 1PageOrderPDFText system preference about the length of the text.

I added multiple long paragraphs and the text was cut off where the order table starts, and does not display the delivery comment.

David
Comment 7 Alex Buckley 2023-04-13 04:49:24 UTC
(In reply to David Nind from comment #6)
> Hi Alex.
> 
> This works well.
> 
> My only comment would be to add a hint or note to the 1PageOrderPDFText
> system preference about the length of the text.
> 
> I added multiple long paragraphs and the text was cut off where the order
> table starts, and does not display the delivery comment.
> 
> David

Hi David, 

That is a great idea. Thanks for that. I will add a follow-up patch with that addition.

Alex
Comment 8 Alex Buckley 2023-05-02 05:58:12 UTC
Created attachment 150497 [details] [review]
Bug 33393: Add note to system preference explaining text length

Sponsored-by: Pymble Ladies' College
Comment 9 Alex Buckley 2023-05-02 06:01:04 UTC
Hi David, 

I have attached a patchset adding a note to the system preference description noting to keep the text length to 3 lines. 

Is that what you had in mind?

Thanks,
Alex
Comment 10 David Nind 2023-05-02 17:01:45 UTC
Created attachment 150524 [details] [review]
Bug 33393: Add system preference

Sponsored-by: Pymble Ladies' College
Signed-off-by: David Nind <david@davidnind.com>
Comment 11 David Nind 2023-05-02 17:01:48 UTC
Created attachment 150525 [details] [review]
Bug 33393: Enable libraries to configure their own text in the 1-Page order PDF

Test plan:
1) Apply patches and restart services
2) Upgrade Koha schema:
sudo koha-upgrade-schema <instance>
3) Go to Koha Administration -> Libraries. Ensure Library A has an
address, phone and fax.
4) Go to Koha Administration -> System preferences. Search for
OrderPdfFormat. Set this to English 1-page layout option.
5) Go to Acquisitions. Use an existing vendor or create a new one.
Ensure the vendor has a postal address, phone, fax and accout number.
6) Create a basket for this vendor. Add many orders to this basket, for
example 25 items (this is to make the Order PDF cover multiple pages).
7) Close the basket and add it to a basket group of the same name.
8) Edit the basket group. Add an address in the delivery place, and a
delivery comment. Check the box to close the basket group and Save.
9) Click the button to Export as PDF.
10) View the exported PDF. Confirm the PDF is multiple pages long. If it
is not then re-open the basketgroup and add more orders to the basket
and repeat steps 7, 8, and 9
11) If the PDF is multiple pages long then confirm:
- The text "Order number must appear on all related correspondence, shipping papers and invoices. Notify us immediately if you are unable to supply item(s)." appears above the order table.
- The page numbers at the bottom of the first page are not obscured by
the order table.
- That the order table starts near the top of the second page, and not
half way down.
12) Change content in the '1PageOrderPDFText' syspref (use the Enter key
    to split text over multiple lines) and save
13) Back in the Acquisitions module click the button to Export as PDF
14) View the exported PDF. Confirm the following:
- The text above the order table is what you saved in the
1PageOrderPDFText system preference
- The page numbers at the bottom of the first page are not obscrued by
the order table.
- That the order table starts near the top of the second page and not
halfway down.
15) Empty the 1PageOrderPDFText system preference and save
16) Back in the Acquisitions module click te button to Export as PDF
17) View the exported PDF and confirm the line of text between the
Tel/Fax line and the order table has been removed.

Sponsored-by: Pymble Ladies' College
Signed-off-by: David Nind <david@davidnind.com>
Comment 12 David Nind 2023-05-02 17:01:51 UTC
Created attachment 150526 [details] [review]
Bug 33393: Add note to system preference explaining text length

Sponsored-by: Pymble Ladies' College
Signed-off-by: David Nind <david@davidnind.com>
Comment 13 David Nind 2023-05-02 17:02:33 UTC
(In reply to Alex Buckley from comment #9)
> Hi David, 
> 
> I have attached a patchset adding a note to the system preference
> description noting to keep the text length to 3 lines. 
> 
> Is that what you had in mind?
> 
> Thanks,
> Alex

That looks fine to me. Thanks Alex!
Comment 14 Alex Buckley 2023-05-02 21:55:16 UTC
(In reply to David Nind from comment #13)
> (In reply to Alex Buckley from comment #9)
> > Hi David, 
> > 
> > I have attached a patchset adding a note to the system preference
> > description noting to keep the text length to 3 lines. 
> > 
> > Is that what you had in mind?
> > 
> > Thanks,
> > Alex
> 
> That looks fine to me. Thanks Alex!

Thanks so much David!
Comment 15 Marcel de Rooy 2023-07-14 07:01:33 UTC
+    my $ordersentences = C4::Context->preference("1PageOrderPDFText");

Sorry, Alex. But we should not add text blocks into preferences. We now have HTML blocks etc. to do this better and allow for translation.

Failed QA
Comment 16 Katrin Fischer 2023-07-14 21:01:14 UTC
(In reply to Marcel de Rooy from comment #15)
> +    my $ordersentences = C4::Context->preference("1PageOrderPDFText");
> 
> Sorry, Alex. But we should not add text blocks into preferences. We now have
> HTML blocks etc. to do this better and allow for translation.
> 
> Failed QA

To be fair: the PDF files are one language only, they aren't tanslatable and you only use one at a time per global preference. And the WYSIWG editor could create issues with the PDF.
Comment 17 Marcel de Rooy 2023-07-17 08:15:23 UTC
(In reply to Katrin Fischer from comment #16)
> (In reply to Marcel de Rooy from comment #15)
> > +    my $ordersentences = C4::Context->preference("1PageOrderPDFText");
> > 
> > Sorry, Alex. But we should not add text blocks into preferences. We now have
> > HTML blocks etc. to do this better and allow for translation.
> > 
> > Failed QA
> 
> To be fair: the PDF files are one language only, they aren't tanslatable and
> you only use one at a time per global preference. And the WYSIWG editor
> could create issues with the PDF.

Well, you can solve it in several ways. Small template file? But we should not add a preference imo.
Comment 18 Katrin Fischer 2023-07-17 09:49:57 UTC
(In reply to Marcel de Rooy from comment #17)
> (In reply to Katrin Fischer from comment #16)
> > (In reply to Marcel de Rooy from comment #15)
> > > +    my $ordersentences = C4::Context->preference("1PageOrderPDFText");
> > > 
> > > Sorry, Alex. But we should not add text blocks into preferences. We now have
> > > HTML blocks etc. to do this better and allow for translation.
> > > 
> > > Failed QA
> > 
> > To be fair: the PDF files are one language only, they aren't tanslatable and
> > you only use one at a time per global preference. And the WYSIWG editor
> > could create issues with the PDF.
> 
> Well, you can solve it in several ways. Small template file? But we should
> not add a preference imo.

A server side file won't really work for the use case. 

I am not a fan of "enhancing" the PDF templates - I think it's a dead end. But I don't see as we haven't formally deprecated them, how it can block this and a preference makes the most sense. You can't use TT or anything there, it's all very custom as the text and contents are placed by the .pm in an .odt template.
Comment 19 Marcel de Rooy 2023-07-17 10:16:10 UTC
Well, let me step aside for this QA turn :)
Comment 20 Katrin Fischer 2023-07-17 10:57:40 UTC
Alex, maybe we (I...) should let you argue this one.
Comment 21 Marcel de Rooy 2023-09-29 08:45:32 UTC
(In reply to Katrin Fischer from comment #20)
> Alex, maybe we (I...) should let you argue this one.

Moving this to In discussion. And inviting Alex to reply on earlier comments.
Comment 22 Alex Buckley 2023-10-23 18:23:26 UTC
Hi Marcel and Katrin, 

Thanks both for your comments. 

I have thought on both of them.

I agree that I am not a fan of enhancing the PDF files, especially since it is possible for the user to add a message much too long for the PDF file, and get the problem that David noted in comment #6

However, if a library wants to change the wording of the pdf, as is the use case her, I don't see what other options there are. 

I agree with Katrin that trying to use the HTML customisations WYSIWG editor could create problems with the pdf - for example if users try to add tables, images, fonts.

I suppose one possible workaround could be to shift this to being a notice and so it could be edited from the notices and slips interface. What are your thoughts on that? Then no WYSIWG editor is involved. 

Alex
Comment 23 Marcel de Rooy 2023-10-25 11:43:54 UTC
My current thought would be: I do not oppose this as a workaround with commitment to follow up and improve.
Comment 24 Katrin Fischer 2023-10-29 15:04:20 UTC
(In reply to Marcel de Rooy from comment #23)
> My current thought would be: I do not oppose this as a workaround with
> commitment to follow up and improve.

Hi Marcel, what would you ask for as follow-up/improvements here in order to pass?
Comment 25 Alex Buckley 2023-10-29 15:09:18 UTC
(In reply to Katrin Fischer from comment #24)
> (In reply to Marcel de Rooy from comment #23)
> > My current thought would be: I do not oppose this as a workaround with
> > commitment to follow up and improve.
> 
> Hi Marcel, what would you ask for as follow-up/improvements here in order to
> pass?

Hi Katrin and Marcel, 

Thanks for your replies. 

Yes, Marcel if you wouldn't mind noting what you would want as follow-ups/improvements here that would be helpful so we can raise them with our sponsoring library.

Thanks so much,
Alex
Comment 26 Marcel de Rooy 2023-10-30 08:15:49 UTC
(In reply to Katrin Fischer from comment #24)
> (In reply to Marcel de Rooy from comment #23)
> > My current thought would be: I do not oppose this as a workaround with
> > commitment to follow up and improve.
> 
> Hi Marcel, what would you ask for as follow-up/improvements here in order to
> pass?

Actually nothing here. See comment23.
Comment 27 Marcel de Rooy 2023-10-30 08:16:53 UTC
Back to Signed Off
Comment 28 Marcel de Rooy 2023-10-30 08:17:54 UTC
(In reply to Alex Buckley from comment #25)
> Yes, Marcel if you wouldn't mind noting what you would want as
> follow-ups/improvements here that would be helpful so we can raise them with
> our sponsoring library.

Please reconstruct from earlier discussion. Not having this sharp right now.
Comment 29 Alex Buckley 2023-10-31 14:11:37 UTC
(In reply to Marcel de Rooy from comment #28)
> (In reply to Alex Buckley from comment #25)
> > Yes, Marcel if you wouldn't mind noting what you would want as
> > follow-ups/improvements here that would be helpful so we can raise them with
> > our sponsoring library.
> 
> Please reconstruct from earlier discussion. Not having this sharp right now.

Thanks will reconstruct.
Comment 30 Kyle M Hall 2024-03-15 11:51:39 UTC
Created attachment 163214 [details] [review]
Bug 33393: Add system preference

Sponsored-by: Pymble Ladies' College
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 31 Kyle M Hall 2024-03-15 11:51:56 UTC
Created attachment 163215 [details] [review]
Bug 33393: Enable libraries to configure their own text in the 1-Page order PDF

Test plan:
1) Apply patches and restart services
2) Upgrade Koha schema:
sudo koha-upgrade-schema <instance>
3) Go to Koha Administration -> Libraries. Ensure Library A has an
address, phone and fax.
4) Go to Koha Administration -> System preferences. Search for
OrderPdfFormat. Set this to English 1-page layout option.
5) Go to Acquisitions. Use an existing vendor or create a new one.
Ensure the vendor has a postal address, phone, fax and accout number.
6) Create a basket for this vendor. Add many orders to this basket, for
example 25 items (this is to make the Order PDF cover multiple pages).
7) Close the basket and add it to a basket group of the same name.
8) Edit the basket group. Add an address in the delivery place, and a
delivery comment. Check the box to close the basket group and Save.
9) Click the button to Export as PDF.
10) View the exported PDF. Confirm the PDF is multiple pages long. If it
is not then re-open the basketgroup and add more orders to the basket
and repeat steps 7, 8, and 9
11) If the PDF is multiple pages long then confirm:
- The text "Order number must appear on all related correspondence, shipping papers and invoices. Notify us immediately if you are unable to supply item(s)." appears above the order table.
- The page numbers at the bottom of the first page are not obscured by
the order table.
- That the order table starts near the top of the second page, and not
half way down.
12) Change content in the '1PageOrderPDFText' syspref (use the Enter key
    to split text over multiple lines) and save
13) Back in the Acquisitions module click the button to Export as PDF
14) View the exported PDF. Confirm the following:
- The text above the order table is what you saved in the
1PageOrderPDFText system preference
- The page numbers at the bottom of the first page are not obscrued by
the order table.
- That the order table starts near the top of the second page and not
halfway down.
15) Empty the 1PageOrderPDFText system preference and save
16) Back in the Acquisitions module click te button to Export as PDF
17) View the exported PDF and confirm the line of text between the
Tel/Fax line and the order table has been removed.

Sponsored-by: Pymble Ladies' College
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 32 Kyle M Hall 2024-03-15 11:51:58 UTC
Created attachment 163216 [details] [review]
Bug 33393: Add note to system preference explaining text length

Sponsored-by: Pymble Ladies' College
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 33 Kyle M Hall 2024-03-15 11:52:00 UTC
Created attachment 163217 [details] [review]
Bug 33393: tidy layout1page.pm

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 34 Kyle M Hall 2024-03-15 11:54:18 UTC
While I tend to agree PDF generation isn't the greatest, this is a minor enhancement and it was far too onerous to ask to replace an entire subsystem to add such a small enhancement. Let's get this in!
Comment 35 Alex Buckley 2024-03-21 20:38:32 UTC
(In reply to Kyle M Hall from comment #34)
> While I tend to agree PDF generation isn't the greatest, this is a minor
> enhancement and it was far too onerous to ask to replace an entire subsystem
> to add such a small enhancement. Let's get this in!

Thank you very much Kyle.
Comment 36 Katrin Fischer 2024-04-19 17:45:04 UTC
I am going to push this as is with a tiny follow up to explain that this only works for English 1-page. I think it would have been great to adapt all the available notices as this won't be usable for libraries relying on the German or French translations. Maybe I can persuade you to do a follow-up?
Comment 37 Katrin Fischer 2024-04-19 17:50:47 UTC
I think we should also not set a text on update - this would be a surprising change. Updated the database update accordingly.
Comment 38 Katrin Fischer 2024-04-19 17:55:47 UTC
Pushed for 24.05!

Well done everyone, thank you!