PluginProbe
Easy Invoice – Invoice Generator, PDF Quotes & Payments / 2.4.3
Easy Invoice – Invoice Generator, PDF Quotes & Payments v2.4.3
2.4.3 2.4.4 2.4.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 All 60 releases
← All changes | templates/quote-templates/legacy.php +73 -23 2.3.1 → 2.4.3 View file →
@@ -3,8 +3,11 @@
3 3 * Legacy Quote Template
4 4 * Clean, minimalist design with traditional business layout
5 5 */
6 6
7 +if ( ! defined( 'ABSPATH' ) ) {
8 + exit;
9 +}
7 10 $text_settings = \EasyInvoice\Helpers\TemplateTextHelper::getQuoteTextSettings();
8 11 $company_info = \EasyInvoice\Helpers\TemplateTextHelper::getCompanyInfo();
9 12 // Ensure a formatter is available for currency formatting
10 13 if (!isset($formatter) || !$formatter) {
@@ -263,9 +266,9 @@
263 266 font-size: 14px;
264 267 font-weight: 500;
265 268 }
266 269
267 -.template-legacy .quote-grand-total {
270 +.template-legacy .quote-totals .quote-grand-total {
268 271 background: #f8f9fa;
269 272 border-top: 1px solid #dddddd;
270 273 margin-top: 0;
271 274 padding-top: 14px;
@@ -271,9 +274,9 @@
271 274 padding-top: 14px;
272 275 }
273 276
274 277 .template-legacy .quote-grand-total .quote-total-label,
275 -.template-legacy .quote-grand-total .quote-total-value {
278 +.template-legacy .quote-totals .quote-grand-total .quote-total-value {
276 279 font-weight: 700;
277 280 font-size: 16px;
278 281 color: #000000;
279 282 }
@@ -318,26 +321,52 @@
318 321 .template-legacy .footer-company {
319 322 color: #9ca3af;
320 323 font-size: 13px;
321 324 }
325 +
326 +/* Shared polish: numbers line up, numeric headings sit over their figures. */
327 +.template-legacy .quote-items th + th { text-align: right; }
328 +.template-legacy .quote-items .item-quantity,
329 +.template-legacy .quote-items .item-price,
330 +.template-legacy .quote-items .item-adjust,
331 +.template-legacy .quote-items .item-total,
332 +.template-legacy .quote-total-value { font-variant-numeric: tabular-nums; white-space: nowrap; }
333 +.template-legacy .meta-value { white-space: nowrap; }
334 +.template-legacy .quote-items .item-adjust { text-align: right; }
335 +.template-legacy .client-contact { font-weight: 500; margin-bottom: 0.15em; }
336 +.template-legacy .client-tax-number,
337 +.template-legacy .company-tax-number { margin-top: 0.35em; }
338 +.template-legacy .quote-items .item-description { white-space: pre-line; }
339 +.template-legacy .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; }
340 +
341 +/* Legacy: keeps its ruled grid, with softer rules and the same type size as the other designs. */
342 +.template-legacy .quote-items th, .template-legacy .quote-items td { border-color: #e5e7eb !important; }
343 +.template-legacy .quote-items th { background: #f9fafb; font-size: 12px; letter-spacing: 0.08em; color: #374151; }
344 +.template-legacy .quote-meta, .template-legacy .meta-item { border-color: #e5e7eb !important; }
345 +.template-legacy .company-name { color: #111827; }
346 +.template-legacy .address-block h2 { font-size: 12px; letter-spacing: 0.12em; color: #6b7280; text-transform: uppercase; }
347 +.template-legacy .terms-section, .template-legacy .description-section { background: transparent; border: 0; border-top: 1px solid #e5e7eb; border-radius: 0; padding: 16px 0 0; }
348 +.template-legacy .terms-section h3 { font-size: 12px; letter-spacing: 0.12em; color: #6b7280; }
349 +.template-legacy .quote-header { margin-bottom: 24px; }
322 350 </style>
323 351
324 352 <div class="template-legacy">
325 353 <div class="quote-header">
326 354 <div class="company-info">
355 + <?php if (!empty($company_info['logo'])): ?>
327 356 <div class="company-logo">
328 - <?php if (!empty($company_info['logo'])): ?>
329 - <img src="<?php echo esc_url($company_info['logo']); ?>" alt="<?php echo esc_attr($company_info['name']); ?>" class="logo-image">
330 - <?php endif; ?>
357 + <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)">
331 358 </div>
359 + <?php endif; ?>
332 360 <div class="company-name"><?php echo esc_html($company_info['name']); ?></div>
333 361 <div class="company-details">
334 - <?php echo \EasyInvoice\Helpers\TemplateTextHelper::generateFromSection($company_info, false, 'details-only'); ?>
362 + <?php echo wp_kses_post(\EasyInvoice\Helpers\TemplateTextHelper::generateFromSection($company_info, false, 'details-only')); ?>
335 363 </div>
336 364 </div>
337 365
338 366 <div class="quote-title-section">
339 - <div class="quote-title"><?php echo esc_html($quote->getTitle() ?: __('Quote', 'easy-invoice')); ?></div>
367 + <?php $ei_kind = \EasyInvoice\Controllers\SettingsController::getTextQuote(); $ei_title = trim((string) $quote->getTitle()); ?>
368 + <div class="quote-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>
340 369 <div class="quote-meta">
341 370 <div class="meta-item">
342 371 <span class="meta-label"><?php echo esc_html($text_settings['quote_number']); ?></span>
343 372 <span class="meta-value"><?php echo esc_html($quote->getNumber()); ?></span>
@@ -357,22 +386,18 @@
357 386 </div>
358 387 </div>
359 388 </div>
360 389
390 + <?php $ei_client_html = \EasyInvoice\Helpers\TemplateTextHelper::generateClientBlock($quote); if ('' !== $ei_client_html) : ?>
361 391 <div class="address-section">
362 392 <div class="address-block">
363 393 <h2><?php echo esc_html($text_settings['to']); ?></h2>
364 394 <div class="address-content">
365 - <div class="client-name"><?php echo esc_html($quote->getCustomerName()); ?></div>
366 - <?php if ($quote->getCustomerAddress()): ?>
367 - <?php echo nl2br(esc_html($quote->getCustomerAddress())); ?><br>
368 - <?php endif; ?>
369 - <?php if ($quote->getCustomerEmail()): ?>
370 - <?php echo esc_html($quote->getCustomerEmail()); ?><br>
371 - <?php endif; ?>
395 + <?php echo wp_kses_post($ei_client_html); ?>
372 396 </div>
373 397 </div>
374 398 </div>
399 + <?php endif; ?>
375 400
376 401 <?php if ($quote->getDescription()): ?>
377 402 <div class="description-section">
378 403 <div class="description-content"><?php echo wp_kses_post($quote->getDescription()); ?></div>
@@ -378,8 +403,18 @@
378 403 <div class="description-content"><?php echo wp_kses_post($quote->getDescription()); ?></div>
379 404 </div>
380 405 <?php endif; ?>
381 406
407 + <?php
408 + // The adjustment column appears only when at least one line uses it.
409 + $ei_show_adjust = \EasyInvoice\Controllers\SettingsController::shouldShowQuoteAdjustField();
410 + if ($ei_show_adjust) {
411 + $ei_show_adjust = false;
412 + foreach ($quote->getItems() as $ei_item) {
413 + if ((float) $ei_item->getAdjustPercentage() != 0.0) { $ei_show_adjust = true; break; }
414 + }
415 + }
416 + ?>
382 417 <table class="quote-items">
383 418 <thead>
384 419 <tr>
385 420 <th><?php echo esc_html($text_settings['service']); ?></th>
@@ -384,15 +419,18 @@
384 419 <tr>
385 420 <th><?php echo esc_html($text_settings['service']); ?></th>
386 421 <th><?php echo esc_html($text_settings['qty']); ?></th>
387 422 <th><?php echo esc_html($text_settings['rate_price']); ?></th>
388 - <?php if (\EasyInvoice\Controllers\SettingsController::shouldShowQuoteAdjustField()): ?>
423 + <?php if ($ei_show_adjust): ?>
389 424 <th><?php echo esc_html($text_settings['adjust']); ?> (%)</th>
390 425 <?php endif; ?>
391 - <th><?php echo esc_html($text_settings['total']); ?></th>
426 + <th><?php echo esc_html($text_settings['line_total'] ?? $text_settings['total']); ?></th>
392 427 </tr>
393 428 </thead>
394 429 <tbody>
430 + <?php if (!$quote->getItems()) : ?>
431 + <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>
432 + <?php endif; ?>
395 433 <?php foreach ($quote->getItems() as $item): ?>
396 434 <tr>
397 435 <td class="item-name">
398 436 <div class="item-title"><?php echo esc_html($item->getName()); ?></div>
@@ -401,9 +439,9 @@
401 439 <?php endif; ?>
402 440 </td>
403 441 <td class="item-quantity"><?php echo esc_html($item->getQuantity() ?: '0'); ?></td>
404 442 <td class="item-price"><?php echo esc_html($formatter->format($item->getPrice())); ?></td>
405 - <?php if (\EasyInvoice\Controllers\SettingsController::shouldShowQuoteAdjustField()): ?>
443 + <?php if ($ei_show_adjust): ?>
406 444 <td class="item-adjust"><?php
407 445 $adjust_percentage = $item->getAdjustPercentage();
408 446 if ($adjust_percentage != 0) {
409 447 echo esc_html($adjust_percentage > 0 ? '+' : '') . esc_html($adjust_percentage) . '%';
@@ -418,9 +456,9 @@
418 456 </tbody>
419 457 </table>
420 458
421 459 <div class="quote-totals">
422 - <?php echo \EasyInvoice\Helpers\TemplateTextHelper::generateTotalsSection($quote, $text_settings, $formatter, 'quote'); ?>
460 + <?php echo wp_kses_post(\EasyInvoice\Helpers\TemplateTextHelper::generateTotalsSection($quote, $text_settings, $formatter, 'quote')); ?>
423 461 </div>
424 462
425 463 <?php
426 464 $terms_conditions = $quote->getTerms() ?: \EasyInvoice\Controllers\SettingsController::getQuoteTermsConditions();
@@ -426,9 +464,9 @@
426 464 $terms_conditions = $quote->getTerms() ?: \EasyInvoice\Controllers\SettingsController::getQuoteTermsConditions();
427 465 if ($terms_conditions):
428 466 ?>
429 467 <div class="terms-section">
430 - <h3>Terms & Conditions</h3>
468 + <h3><?php esc_html_e('Terms & Conditions', 'easy-invoice'); ?></h3>
431 469 <div class="terms-content">
432 470 <?php echo wp_kses_post($terms_conditions); ?>
433 471 </div>
434 472 </div>
@@ -433,11 +471,23 @@
433 471 </div>
434 472 </div>
435 473 <?php endif; ?>
436 474
475 + <?php
476 + /**
477 + * Fires inside the document card, after notes and terms and before the
478 + * footer text: attachments, the signature block, e-invoicing notes. Being
479 + * inside the card, it is part of what "Download as PDF" captures.
480 + *
481 + * @param object $document The quote model.
482 + * @param string $type 'quote'.
483 + */
484 + do_action('easy_invoice_document_body_after', $quote, 'quote');
485 +
486 + $ei_footer_text = \EasyInvoice\Helpers\TemplateTextHelper::footerText($quote, 'quote');
487 + if ('' !== trim(wp_strip_all_tags((string) $ei_footer_text))) :
488 + ?>
437 489 <div class="quote-footer">
438 - <p>This quote is valid for 30 days from the date of issue.</p>
439 - <div class="footer-company">
440 - Thanks for choosing <?php echo esc_html($company_info['name']); ?> | <?php echo esc_html($company_info['email'] ?? '[email protected]'); ?>
441 - </div>
490 + <p><?php echo wp_kses_post($ei_footer_text); ?></p>
442 491 </div>
492 + <?php endif; ?>
443 493 </div>