Forums / Addon Admin Tools / All Invoices Report [support]

All Invoices Report [support]

Views: 21,186

Results 81 to 84 of 84
27 Feb 2023, 4:30 PM
#81
spyderrobotics avatar

spyderrobotics

New Zenner

Join Date:
Oct 2007
Posts:
75
Plugin Contributions:
0

All Invoices Report [support]

I have 2.6 installed on 1.5.7c and after generating a report and choosing to print it the print job always adds a blank page at the end. Does this under edge and chrome. When you are viewing the webpage there is no extra blank page. Does not matter which printer or save to pdf is selected. Preview shows it and it will print the blank. I looked into the code and noticed in the admin\includes\templates\tpl_all_invoices.php in the foreach loop it adds the page break at the end of each loop. I am guessing ideally it would either do a page break at the beginning of each loop (but have a condition to skip for the first loop) or check if it was the last record and if not then add the page break otherwise skip it. Just playing around I commented the page break at the end of the loop and instead inserted it into the beginning. This fixed the problem and even though there is an immediate page break it doesn't seem to add it to the print job. So the beginning of my loop looks like (line 63):

foreach($pending_orders as $oID) {
$order = new order( (int)$oID);
?>
<div style="page-break-before: always;"></div>
27 Feb 2023, 5:14 PM
#82
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,110
Plugin Contributions:
56

Re: All Invoices Report [support]

spyderrobotics:

I have 2.6 installed on 1.5.7c and after generating a report and choosing to print it the print job always adds a blank page at the end. Does this under edge and chrome. When you are viewing the webpage there is no extra blank page. Does not matter which printer or save to pdf is selected. Preview shows it and it will print the blank. I looked into the code and noticed in the admin\includes\templates\tpl_all_invoices.php in the foreach loop it adds the page break at the end of each loop. I am guessing ideally it would either do a page break at the beginning of each loop (but have a condition to skip for the first loop) or check if it was the last record and if not then add the page break otherwise skip it. Just playing around I commented the page break at the end of the loop and instead inserted it into the beginning. This fixed the problem and even though there is an immediate page break it doesn't seem to add it to the print job. So the beginning of my loop looks like (line 63):

foreach($pending_orders as $oID) {
$order = new order( (int)$oID);
?>

<div style="page-break-before: always;"></div> ``` I'll give that a look, no guarantee on timeframe at this point. GitHub tracking issue: <https://github.com/lat9/all_invoices/issues/12>
1 Sep 2024, 6:22 PM
#83
foghead avatar

foghead

New Zenner

Join Date:
Dec 2021
Location:
Tennessee
Posts:
43
Plugin Contributions:
0

Re: All Invoices Report [support]

I have installed All Invoices on a new install of Zen Cart 2.01 running PHP 8.3 When I try to open it from admin I get and Http error 500.
Is it possible to make this work on my current install? I have relied on this for years now and have no idea what would give the same results.

1 Sep 2024, 7:46 PM
#84
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,110
Plugin Contributions:
56

Re: All Invoices Report [support]

Foghead:

I have installed All Invoices on a new install of Zen Cart 2.01 running PHP 8.3 When I try to open it from admin I get and Http error 500.
Is it possible to make this work on my current install? I have relied on this for years now and have no idea what would give the same results.
As I've noted in other forum threads, I've not had the chance (as you've seen) to update this for zc200 and later. It's relatively low on my priority list right now as I'm addressing paying client's requests and trying to get some of the base Zen Cart 2.1.0 processing working correctly.