Bugzilla – Attachment 158342 Details for
Bug 31041
Cashup summary modal printing issue
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31041: Prevent duplicate display of cashup summary when printing
Bug-31041-Prevent-duplicate-display-of-cashup-summ.patch (text/plain), 2.77 KB, created by
ByWater Sandboxes
on 2023-11-03 15:02:19 UTC
(
hide
)
Description:
Bug 31041: Prevent duplicate display of cashup summary when printing
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2023-11-03 15:02:19 UTC
Size:
2.77 KB
patch
obsolete
>From 01c165f01e831662a877344a2cde34ec253d4d4d Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Thu, 2 Nov 2023 19:56:00 +0000 >Subject: [PATCH] Bug 31041: Prevent duplicate display of cashup summary when > printing > >To test: >1. Have POS on. >2. Have some registers and items for sale. Make some sales to 'Cashup'. >3. If you have enough enough lines in the table so that 'register.pl' would print on 2 or more pages, the summary will be duplicated that same number of time. > >If you are lazy like me and don't want to make that many transaction you can also add some content to the page like this: > >for (let i = 0; i < 100; i++) { > $('#register').append('<h1>TEST</h1>'); >} > >4. APPLY PATCH, clear browser cahche >5. Try printing again, you should only get one cashup summary when printing. > >Signed-off-by: Juliet Heltibridle <jheltibridle@rcplib.org> >--- > .../intranet-tmpl/prog/js/cashup_modal.js | 42 ++++++++++++++++++- > 1 file changed, 41 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/cashup_modal.js b/koha-tmpl/intranet-tmpl/prog/js/cashup_modal.js >index ad7bd6aa83..dceca2f07b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/cashup_modal.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/cashup_modal.js >@@ -55,6 +55,46 @@ $(document).ready(function() { > }); > > $('.printModal').click(function() { >- window.print(); >+ >+ let contents = $('#cashupSummaryModal .modal-body').html(); >+ let win = window.open('',''); >+ win.document.write(` >+ <style> >+ table { >+ background-color: #FFFFFF; >+ border-bottom: 1px solid #CCCCCC; >+ border-collapse: collapse; >+ border-left: 1px solid #CCCCCC; >+ margin: 3px 0 5px 0; >+ padding: 0; >+ width: 99%; >+ } >+ >+ td { >+ background-color: #FFF; >+ border-bottom: 1px solid #CCCCCC; >+ border-left: 0; >+ border-right: 1px solid #CCCCCC; >+ border-top: 0; >+ font-size: 12px; >+ padding: 5px 5px 5px 5px; >+ } >+ >+ th { >+ background-color: #E9E9E9; >+ border-bottom: 1px solid #CCCCCC; >+ border-left: 0; >+ border-right: 1px solid #CCCCCC; >+ border-top: 0; >+ font-size: 14px; >+ font-weight: bold; >+ padding: 5px 5px 5px 5px; >+ text-align: left; >+ } >+ </style> >+ `) >+ win.document.write( contents ); >+ win.print(); >+ win.close(); > }); > }); >-- >2.30.2
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 31041
:
158283
|
158342
|
158589
|
158590
|
158591
|
158592
|
158636
|
158644
|
158645
|
158646
|
158647