PluginProbe
Easy Invoice – Invoice Generator, PDF Quotes & Payments / 2.1.2
Easy Invoice – Invoice Generator, PDF Quotes & Payments v2.1.2
2.4.0 2.4.1 2.3.8 2.3.7 2.3.6 2.3.5 2.3.4 2.3.3 2.3.2 2.3.1 2.2.0 2.1.21 2.1.20 2.1.19 2.1.18 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.16 2.1.2 All 57 releases
easy-invoice / templates / invoice-view.php

invoice-view.php in Easy Invoice – Invoice Generator, PDF Quotes & Payments 2.1.2, at templates/invoice-view.php

32 lines 934 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // Enqueue PDF scripts
3 EasyInvoice\Includes\Helpers\PdfHelper::enqueuePdfScripts();
4 ?>
5
6 <div class="wrap">
7 <h1>Invoice #<?php echo esc_html($invoice->getNumber()); ?></h1>
8
9 <div class="invoice-actions">
10 <button type="button" class="button button-primary" id="generate-pdf">
11 Download PDF
12 </button>
13 </div>
14
15 <!-- Rest of your invoice view template -->
16 </div>
17
18 <script>
19 document.addEventListener('DOMContentLoaded', function() {
20 const generatePdfButton = document.getElementById('generate-pdf');
21
22 generatePdfButton.addEventListener('click', function() {
23 // Use the new PDF generator that captures HTML directly
24 if (typeof InvoicePdfGenerator !== 'undefined') {
25 const pdfGenerator = new InvoicePdfGenerator();
26 pdfGenerator.generatePDF();
27 } else {
28 alert('PDF generator not available');
29 }
30 });
31 });
32 </script>