PluginProbe
Easy Invoice – Invoice Generator, PDF Quotes & Payments / 2.4.1
Easy Invoice – Invoice Generator, PDF Quotes & Payments v2.4.1
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-templates / standard.php

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

414 lines 16.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Standard Template - Clean SaaS Design
4 * Clean, modern, and professional invoice template
5 */
6
7 if ( ! defined( 'ABSPATH' ) ) {
8 exit;
9 }
10 $text_settings = \EasyInvoice\Helpers\TemplateTextHelper::forDocument(\EasyInvoice\Helpers\TemplateTextHelper::getInvoiceTextSettings(), $invoice);
11 $ei_is_credit_note = \EasyInvoice\Helpers\TemplateTextHelper::isCreditNote($invoice);
12 $company_info = \EasyInvoice\Helpers\TemplateTextHelper::getCompanyInfo();
13 ?>
14 <style>
15 /* Standard Template - Clean and Simple Design */
16 .template-standard {
17 font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
18 background: #ffffff;
19 color: #333333;
20 max-width: 800px;
21 margin: 0 auto;
22 padding: 2rem;
23 line-height: 1.5;
24 }
25
26 /* Header Section */
27 .template-standard .invoice-header {
28 display: flex;
29 justify-content: space-between;
30 align-items: flex-start;
31 margin-bottom: 2rem;
32 padding-bottom: 1rem;
33 border-bottom: 1px solid #e0e0e0;
34 }
35
36 .template-standard .company-info {
37 flex: 1;
38 }
39
40 .template-standard .company-logo {
41 margin-bottom: 1rem;
42 }
43
44 .template-standard .logo-image {
45 max-height: 50px;
46 max-width: 180px;
47 object-fit: contain;
48 }
49
50 .template-standard .company-name {
51 font-size: 1.5rem;
52 font-weight: 600;
53 margin-bottom: 0.5rem;
54 }
55
56 .template-standard .company-details {
57 color: #666666;
58 font-size: 0.9rem;
59 line-height: 1.4;
60 }
61
62 .template-standard .invoice-meta {
63 text-align: right;
64 min-width: 200px;
65 }
66
67 .template-standard .invoice-title {
68 font-size: 1.75rem;
69 font-weight: 600;
70 color: #333333;
71 margin-bottom: 1rem;
72 }
73
74 .template-standard .meta-item {
75 margin-bottom: 0.5rem;
76 }
77
78 .template-standard .meta-label {
79 color: #666666;
80 font-size: 0.9rem;
81 }
82
83 .template-standard .meta-value {
84 font-weight: 500;
85 }
86
87 /* Address Section */
88 .template-standard .address-section {
89 margin-bottom: 2rem;
90 }
91
92 .template-standard .address-block h2 {
93 font-size: 1rem;
94 font-weight: 600;
95 margin-bottom: 0.5rem;
96 text-transform: uppercase;
97 }
98
99 .template-standard .client-name {
100 font-weight: 500;
101 margin-bottom: 0.25rem;
102 }
103
104 .template-standard .address-content {
105 color: #666666;
106 font-size: 0.9rem;
107 }
108
109 /* Invoice Items Table */
110 .template-standard .invoice-items {
111 width: 100%;
112 border-collapse: collapse;
113 margin-bottom: 2rem;
114 border: 1px solid #e0e0e0;
115 }
116
117 .template-standard .invoice-items th {
118 background: #f5f5f5;
119 color: #333333;
120 font-weight: 600;
121 text-align: left;
122 padding: 0.75rem;
123 font-size: 0.9rem;
124 }
125
126 .template-standard .invoice-items td {
127 padding: 0.75rem;
128 border-bottom: 1px solid #e0e0e0;
129 vertical-align: top;
130 }
131
132 .template-standard .item-name .item-title {
133 font-weight: 500;
134 }
135
136 .template-standard .item-description {
137 color: #666666;
138 font-size: 0.9rem;
139 margin-top: 0.25rem;
140 font-weight: 300;
141 }
142
143 .template-standard .item-quantity,
144 .template-standard .item-price,
145 .template-standard .item-total {
146 text-align: right;
147 }
148
149 /* Invoice Totals */
150 .template-standard .invoice-totals {
151 margin-left: auto;
152 width: 300px;
153 margin-bottom: 2rem;
154 }
155
156 .template-standard .invoice-total-row {
157 display: flex;
158 justify-content: space-between;
159 padding: 0.5rem 0;
160 }
161
162 .template-standard .invoice-total-label {
163 color: #666666;
164 }
165
166 .template-standard .invoice-totals .invoice-grand-total {
167 font-weight: 600;
168 border-top: 2px solid #333333;
169 padding-top: 0.5rem;
170 margin-top: 0.5rem;
171 }
172
173 /* Notes and Terms */
174 .template-standard .invoice-notes,
175 .template-standard .invoice-terms {
176 margin-top: 2rem;
177 font-size: 0.9rem;
178 color: #666666;
179 }
180
181 .template-standard .invoice-notes h3,
182 .template-standard .invoice-terms h3 {
183 font-size: 1rem;
184 font-weight: 600;
185 color: #333333;
186 margin-bottom: 0.5rem;
187 }
188
189 /* Footer */
190 .template-standard .invoice-footer {
191 margin-top: 2rem;
192 padding-top: 1rem;
193 border-top: 1px solid #e0e0e0;
194 text-align: center;
195 color: #666666;
196 font-size: 0.9rem;
197 }
198
199 /* Responsive Design */
200 @media (max-width: 768px) {
201 .template-standard {
202 padding: 1rem;
203 }
204
205 .template-standard .invoice-header {
206 flex-direction: column;
207 }
208
209 .template-standard .invoice-meta {
210 text-align: left;
211 margin-top: 1rem;
212 }
213
214 .template-standard .invoice-totals {
215 width: 100%;
216 }
217 }
218
219 /* Shared polish: numbers line up, numeric headings sit over their figures. */
220 .template-standard .invoice-items th + th { text-align: right; }
221 .template-standard .invoice-items .item-quantity,
222 .template-standard .invoice-items .item-price,
223 .template-standard .invoice-items .item-adjust,
224 .template-standard .invoice-items .item-total,
225 .template-standard .invoice-total-value { font-variant-numeric: tabular-nums; white-space: nowrap; }
226 .template-standard .meta-value { white-space: nowrap; }
227 .template-standard .invoice-items .item-adjust { text-align: right; }
228 .template-standard .client-contact { font-weight: 500; margin-bottom: 0.15em; }
229 .template-standard .client-tax-number,
230 .template-standard .company-tax-number { margin-top: 0.35em; }
231 .template-standard .invoice-items .item-description { white-space: pre-line; }
232 .template-standard .document-kind { display: block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted, #8a8a8a); font-family: var(--font-family-body, inherit); font-style: normal; margin-bottom: 0.3em; line-height: 1.2; }
233
234 /* Standard: ink on white, one rule per section, nothing boxed. */
235 .template-standard { color: #1f2937; }
236 .template-standard .invoice-header { border-bottom: 2px solid #1f2937; padding-bottom: 1.5rem; margin-bottom: 1.75rem; align-items: flex-start; }
237 .template-standard .company-name { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.01em; color: #111827; }
238 .template-standard .company-details, .template-standard .address-content, .template-standard .meta-label, .template-standard .invoice-total-label { color: #6b7280; }
239 .template-standard .invoice-title { font-size: 1.625rem; font-weight: 700; letter-spacing: -0.015em; color: #111827; margin-bottom: 0.75rem; }
240 .template-standard .meta-item { display: flex; justify-content: flex-end; gap: 1rem; margin-bottom: 0.35rem; font-size: 0.9rem; }
241 .template-standard .meta-value { font-weight: 600; color: #111827; }
242 .template-standard .address-block { background: transparent; padding: 0; border: 0; }
243 .template-standard .address-block h2 { font-size: 0.72rem; letter-spacing: 0.14em; color: #6b7280; margin-bottom: 0.5rem; }
244 .template-standard .client-name { font-weight: 600; color: #111827; font-size: 1rem; }
245 .template-standard .invoice-items { border: 0; margin-bottom: 1.25rem; }
246 .template-standard .invoice-items th { background: transparent; color: #6b7280; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; padding: 0.6rem 0.5rem; border-bottom: 1px solid #1f2937; }
247 .template-standard .invoice-items td { padding: 0.8rem 0.5rem; border-bottom: 1px solid #e5e7eb; color: #1f2937; }
248 .template-standard .invoice-items th:first-child, .template-standard .invoice-items td:first-child { padding-left: 0; }
249 .template-standard .invoice-items th:last-child, .template-standard .invoice-items td:last-child { padding-right: 0; }
250 .template-standard .item-name .item-title { font-weight: 600; color: #111827; }
251 .template-standard .item-description { font-weight: 400; color: #6b7280; font-size: 0.85rem; }
252 .template-standard .invoice-totals { width: 320px; margin-bottom: 1.5rem; }
253 .template-standard .invoice-total-row { padding: 0.45rem 0; border-bottom: 1px solid #e5e7eb; font-size: 0.95rem; }
254 .template-standard .invoice-total-value { font-weight: 600; color: #111827; }
255 .template-standard .invoice-totals .invoice-grand-total { border-top: 2px solid #1f2937; border-bottom: 0; margin-top: 0.25rem; padding-top: 0.75rem; font-size: 1.125rem; }
256 .template-standard .invoice-totals .invoice-grand-total .invoice-total-label { color: #111827; font-weight: 700; }
257 .template-standard .invoice-totals .invoice-grand-total .invoice-total-value { font-size: 1.25rem; font-weight: 700; }
258 .template-standard .invoice-notes, .template-standard .invoice-terms { background: transparent; padding: 1.25rem 0 0; margin-top: 1.25rem; border: 0; border-top: 1px solid #e5e7eb; border-radius: 0; color: #4b5563; font-size: 0.9rem; }
259 .template-standard .invoice-notes h3, .template-standard .invoice-terms h3 { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: #6b7280; font-weight: 600; margin-bottom: 0.5rem; }
260 .template-standard .invoice-footer { border-top: 1px solid #e5e7eb; color: #6b7280; font-size: 0.85rem; }
261 .template-standard .invoice-totals .invoice-paid-row .invoice-total-value { color: var(--success-color, #047857); }
262 .template-standard .invoice-totals .invoice-balance-due { font-weight: 700; }
263 .template-standard .invoice-totals .invoice-balance-due .invoice-total-label { color: inherit; font-weight: 700; }
264 .template-standard .meta-amount-due .meta-value { font-weight: 700; font-size: 1.08em; }
265 </style>
266
267 <div class="template template-standard">
268 <div class="invoice-header">
269 <div class="company-info">
270 <?php if (!empty($company_info['logo'])): ?>
271 <div class="company-logo">
272 <img src="<?php echo esc_url($company_info['logo']); ?>" alt="<?php echo esc_attr($company_info['name']); ?>" class="logo-image" onerror="this.parentNode.parentNode.removeChild(this.parentNode)">
273 </div>
274 <?php endif; ?>
275 <div class="company-name"><?php echo esc_html($company_info['name']); ?></div>
276 <div class="company-details">
277 <?php echo wp_kses_post(\EasyInvoice\Helpers\TemplateTextHelper::generateFromSection($company_info, false, 'details-only')); ?>
278 </div>
279 </div>
280
281 <div class="invoice-meta">
282 <?php $ei_kind = \EasyInvoice\Helpers\TemplateTextHelper::documentKind($invoice); $ei_title = trim((string) $invoice->getTitle()); ?>
283 <div class="invoice-title"><?php if ('' !== $ei_title && 0 !== strcasecmp($ei_title, $ei_kind)) : ?><span class="document-kind"><?php echo esc_html($ei_kind); ?></span><?php endif; ?><?php echo esc_html('' !== $ei_title ? $ei_title : $ei_kind); ?></div>
284 <div class="meta-item">
285 <span class="meta-label"><?php echo esc_html($text_settings['invoice_number']); ?></span>
286 <span class="meta-value"><?php echo esc_html($invoice->getNumber()); ?></span>
287 </div>
288 <div class="meta-item">
289 <span class="meta-label"><?php echo esc_html($text_settings['invoice_date']); ?></span>
290 <span class="meta-value"><?php echo esc_html(\EasyInvoice\Controllers\SettingsController::formatDate($invoice->getIssueDate())); ?></span>
291 </div>
292 <?php if (empty($ei_is_credit_note)) : ?>
293 <div class="meta-item">
294 <span class="meta-label"><?php echo esc_html($text_settings['due_date']); ?></span>
295 <span class="meta-value"><?php echo esc_html(\EasyInvoice\Controllers\SettingsController::formatDate($invoice->getDueDate())); ?></span>
296 </div>
297 <?php endif; ?>
298 <?php if (empty($ei_is_credit_note)) : ?>
299 <div class="meta-item meta-amount-due">
300 <span class="meta-label"><?php echo esc_html($text_settings['total_due']); ?></span>
301 <span class="meta-value"><?php echo esc_html($formatter->format(\EasyInvoice\Helpers\TemplateTextHelper::amountDue($invoice))); ?></span>
302 </div>
303 <?php endif; ?>
304 </div>
305 </div>
306
307 <?php $ei_client_html = \EasyInvoice\Helpers\TemplateTextHelper::generateClientBlock($invoice); if ('' !== $ei_client_html) : ?>
308 <div class="address-section">
309 <div class="address-block">
310 <h2><?php echo esc_html($text_settings['to']); ?></h2>
311 <div class="address-content">
312 <?php echo wp_kses_post($ei_client_html); ?>
313 </div>
314 </div>
315 </div>
316 <?php endif; ?>
317
318 <?php
319 // The adjustment column appears only when at least one line uses it.
320 $ei_show_adjust = \EasyInvoice\Controllers\SettingsController::shouldShowInvoiceAdjustField();
321 if ($ei_show_adjust) {
322 $ei_show_adjust = false;
323 foreach ($invoice->getItems() as $ei_item) {
324 if ((float) $ei_item->getAdjustPercentage() != 0.0) { $ei_show_adjust = true; break; }
325 }
326 }
327 ?>
328 <table class="invoice-items">
329 <thead>
330 <tr>
331 <th><?php echo esc_html($text_settings['service']); ?></th>
332 <th><?php echo esc_html($text_settings['qty']); ?></th>
333 <th><?php echo esc_html($text_settings['rate_price']); ?></th>
334 <?php if ($ei_show_adjust): ?>
335 <th><?php echo esc_html($text_settings['adjust']); ?> (%)</th>
336 <?php endif; ?>
337 <th><?php echo esc_html($text_settings['line_total'] ?? $text_settings['total']); ?></th>
338 </tr>
339 </thead>
340 <tbody>
341 <?php if (!$invoice->getItems()) : ?>
342 <tr class="no-items"><td colspan="<?php echo $ei_show_adjust ? 5 : 4; ?>" style="text-align:center;color:#9ca3af;padding:18px;"><?php esc_html_e('No items yet.', 'easy-invoice'); ?></td></tr>
343 <?php endif; ?>
344 <?php foreach ($invoice->getItems() as $item): ?>
345 <tr>
346 <td class="item-name">
347 <div class="item-title"><?php echo esc_html($item->getName()); ?></div>
348 <?php if ($item->getDescription()): ?>
349 <div class="item-description"><?php echo esc_html($item->getDescription()); ?></div>
350 <?php endif; ?>
351 </td>
352 <td class="item-quantity"><?php echo esc_html($item->getQuantity() ?: '0'); ?></td>
353 <td class="item-price"><?php echo esc_html($formatter->format($item->getPrice())); ?></td>
354 <?php if ($ei_show_adjust): ?>
355 <td class="item-adjust"><?php
356 $adjust_percentage = $item->getAdjustPercentage();
357 if ($adjust_percentage != 0) {
358 echo esc_html($adjust_percentage > 0 ? '+' : '') . esc_html($adjust_percentage) . '%';
359 } else {
360 echo esc_html__('', 'easy-invoice');
361 }
362 ?></td>
363 <?php endif; ?>
364 <td class="item-total"><?php echo esc_html($formatter->format($item->getAmount())); ?></td>
365 </tr>
366 <?php endforeach; ?>
367 </tbody>
368 </table>
369
370 <div class="invoice-totals">
371 <?php echo wp_kses_post(\EasyInvoice\Helpers\TemplateTextHelper::generateTotalsSection($invoice, $text_settings, $formatter, 'invoice')); ?>
372 </div>
373
374 <?php if ($invoice->getNotes()): ?>
375 <div class="invoice-notes">
376 <h3><?php esc_html_e('Notes', 'easy-invoice'); ?></h3>
377 <div class="notes-content">
378 <?php echo wp_kses_post($invoice->getNotes() ?: ''); ?>
379 </div>
380 </div>
381 <?php endif; ?>
382
383 <?php
384 $terms_conditions = empty($ei_is_credit_note) ? ($invoice->getTerms() ?: \EasyInvoice\Controllers\SettingsController::getInvoiceTermsConditions()) : '';
385 if ($terms_conditions):
386 ?>
387 <div class="invoice-terms">
388 <h3><?php esc_html_e('Terms & Conditions', 'easy-invoice'); ?></h3>
389 <div class="terms-content">
390 <?php echo wp_kses_post($terms_conditions); ?>
391 </div>
392 </div>
393 <?php endif; ?>
394
395 <?php
396 /**
397 * Fires inside the document card, after notes and terms and before the
398 * footer text: attachments, the signature block, e-invoicing notes. Being
399 * inside the card, it is part of what "Download as PDF" captures.
400 *
401 * @param object $document The invoice model.
402 * @param string $type 'invoice'.
403 */
404 do_action('easy_invoice_document_body_after', $invoice, 'invoice');
405
406 $ei_footer_text = \EasyInvoice\Helpers\TemplateTextHelper::footerText($invoice, 'invoice');
407 if ('' !== trim(wp_strip_all_tags((string) $ei_footer_text))) :
408 ?>
409 <div class="invoice-footer">
410 <p><?php echo wp_kses_post($ei_footer_text); ?></p>
411 </div>
412 <?php endif; ?>
413 </div>
414