Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BPAY Image on each page of Invoice - Add option for 1st page only #10

Open
bakkbone opened this issue Oct 28, 2022 · 5 comments
Open

BPAY Image on each page of Invoice - Add option for 1st page only #10

bakkbone opened this issue Oct 28, 2022 · 5 comments

Comments

@bakkbone
Copy link
Contributor

Hi again all

Once again I'm not sure if this is behaviour as intended or a bug but should the image be displaying on every page of the PDF? We based our template layout off it appearing on the first page only but I notice it's appearing on all pages

File Permissions
File / Directory Name File Type Status Permission Level Action
/modules/gateways/bpay.php PHP (Hypertext Preprocessor) Found 0644
/modules/gateways/bpay/arial.ttf TTF (TrueType Font) Found 0644
bpay_mgr_hooks.php (Addon folder) PHP (Hypertext Preprocessor) Found 0644
/includes/hooks/bpay_mgr_inc.php PHP (Hypertext Preprocessor) Found 0644
Customers (Gateway folder) Directory Found 0755
Invoices (Gateway folder) Directory Found 0755

System Environment
Environment Type Result
Operating System (OS) Linux
Web Server (Software) Apache
WHMCS Version 8.5.1
IonCube Version 12...2
BPAY Manager: Addon Version 2.1.9
BPAY Manager: Hooks Version 2.1.9
BPAY Gateway: Version 2.1.9

PHP 7.4 running on Ubuntu 20.04

@lsthompson
Copy link
Member

Thanks for raising this. I'll check, though can see every page as being valid - especially if you consider placing the BPAY info in the footer.

@bakkbone
Copy link
Contributor Author

I can see a case for that - but in our case (as with many in telecommunications which is what we're using WHMCS for), we would either include it with customer details at the start or in a payment stub which need only appear once - so, either the first or last page. And the first page is easier to control in this environment than the last.

@lsthompson lsthompson changed the title Image on every page BPAY Image on each page of Invoice - Add option for 1st page only Oct 28, 2022
@lsthompson
Copy link
Member

Fair call. Sounds like a configuration option for multi-page would be wise to accommodate.

Have renamed the issue and will give this some time in November, worst case December.

It should have had more time by now - we've had major projects to get out by year end.

@lsthompson lsthompson added the good first issue Good for newcomers label Jan 16, 2023
@lsthompson
Copy link
Member

lsthompson commented Jan 16, 2023

We're leaning towards changing the behaviour to do 1st-page-only by default & potentially only that way.

In most cases we'd imagine it would be ideal to have it be single-instance. Will explore this soon.

function insertInvoiceFunc($replace = false){
    $insertString = '///////////////////////////////////////////////////////////////////////////
/// START: BPAY GENERATOR
///////////////////////////////////////////////////////////////////////////
    if (file_exists(ROOTDIR."/modules/gateways/bpay.php")) {
        require_once(ROOTDIR."/modules/gateways/bpay.php");
        $output = BPAY_PDF($clientsdetails["id"],$invoicenum);

        $pagecount = $pdf->getNumPages();
        for($i = 1; $i <= $pagecount; $i++){
            $pdf->setPage($i);
            if($output["mode"] == 1){
                $pdf->Image(ROOTDIR."/modules/gateways/bpay/customers/".$clientsdetails["id"].".jpg",$output["Xaxis"],$output["Yaxis"],$output["size"]);
            }else if($output["mode"] == 2){
                $pdf->Image(ROOTDIR."/modules/gateways/bpay/invoices/".$invoicenum.".jpg",$output["Xaxis"],$output["Yaxis"],$output["size"]);
            }
        }
    }
///////////////////////////////////////////////////////////////////////////
/// END: BPAY GENERATOR
///////////////////////////////////////////////////////////////////////////';

The above starts (currently) at L2223 in bpay_mgr.php - you can see the page # increment to loop through.

@lsthompson
Copy link
Member

The default behaviour is changing to include the BPAY image on the first page of invoices only.

Current plan is to include this change in the next release which should be published this week.

(If there's enough push to re-include the old functionality, we may add an option for all pages)

@lsthompson lsthompson removed the good first issue Good for newcomers label Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants