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/minimalist.php +92 -27 2.3.1 → 2.4.3 View file →
@@ -3,8 +3,11 @@
3 3 * Minimalist Quote Template - Clean & Simple Design
4 4 * Minimalist, clean, and simple quote template
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
10 13 if (!isset($formatter) || !$formatter) {
@@ -266,9 +269,9 @@
266 269 font-weight: 600;
267 270 color: var(--text-primary);
268 271 }
269 272
270 -.template-minimalist .quote-grand-total {
273 +.template-minimalist .quote-totals .quote-grand-total {
271 274 font-size: var(--font-size-lg);
272 275 font-weight: 700;
273 276 color: var(--text-primary);
274 277 border-top: 2px solid var(--border-color);
@@ -365,26 +368,70 @@
365 368 .template-minimalist .quote-totals {
366 369 width: 100%;
367 370 }
368 371 }
372 +
373 +/* Shared polish: numbers line up, numeric headings sit over their figures. */
374 +.template-minimalist .quote-items th + th { text-align: right; }
375 +.template-minimalist .quote-items .item-quantity,
376 +.template-minimalist .quote-items .item-price,
377 +.template-minimalist .quote-items .item-adjust,
378 +.template-minimalist .quote-items .item-total,
379 +.template-minimalist .quote-total-value { font-variant-numeric: tabular-nums; white-space: nowrap; }
380 +.template-minimalist .meta-value { white-space: nowrap; }
381 +.template-minimalist .quote-items .item-adjust { text-align: right; }
382 +.template-minimalist .client-contact { font-weight: 500; margin-bottom: 0.15em; }
383 +.template-minimalist .client-tax-number,
384 +.template-minimalist .company-tax-number { margin-top: 0.35em; }
385 +.template-minimalist .quote-items .item-description { white-space: pre-line; }
386 +.template-minimalist .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; }
387 +
388 +/* Minimalist: hairlines only — no filled panels anywhere. */
389 +.template-minimalist .quote-header { margin-bottom: var(--spacing-8); padding-bottom: var(--spacing-6); border-bottom: 1px solid var(--border-color); }
390 +.template-minimalist .address-section { margin-bottom: var(--spacing-8); }
391 +.template-minimalist .address-block h2 { font-size: var(--font-size-xs); text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-muted); font-weight: 600; margin-bottom: var(--spacing-2); }
392 +.template-minimalist .quote-items { border: 0; margin-bottom: var(--spacing-6); }
393 +.template-minimalist .quote-items th { background: transparent; color: var(--text-muted); font-size: var(--font-size-xs); text-transform: uppercase; letter-spacing: 0.12em; padding: var(--spacing-2) var(--spacing-3); border-bottom: 1px solid var(--text-primary); }
394 +.template-minimalist .quote-items td { padding: var(--spacing-4) var(--spacing-3); }
395 +.template-minimalist .quote-items th:first-child, .template-minimalist .quote-items td:first-child { padding-left: 0; }
396 +.template-minimalist .quote-items th:last-child, .template-minimalist .quote-items td:last-child { padding-right: 0; }
397 +.template-minimalist .quote-totals { background: transparent; border: 0; padding: 0; width: 320px; }
398 +.template-minimalist .quote-total-row { padding: var(--spacing-2) 0; border-bottom: 1px solid var(--border-light); }
399 +.template-minimalist .quote-totals .quote-grand-total { border-top: 1px solid var(--text-primary); border-bottom: 0; margin-top: var(--spacing-1); padding-top: var(--spacing-3); font-size: var(--font-size-lg); }
400 +.template-minimalist .quote-totals .quote-grand-total .quote-total-value { font-size: var(--font-size-xl); }
401 +.template-minimalist .quote-notes, .template-minimalist .quote-terms { background: transparent; border: 0; border-top: 1px solid var(--border-light); border-radius: 0; padding: var(--spacing-5) 0 0; margin-top: var(--spacing-6); }
402 +.template-minimalist .quote-notes h3, .template-minimalist .quote-terms h3 { font-size: var(--font-size-xs); text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-muted); font-weight: 600; margin-bottom: var(--spacing-2); border: 0; padding: 0; }
403 +.template-minimalist .quote-footer { background: transparent; border: 0; border-top: 1px solid var(--border-light); padding: var(--spacing-4) 0 0; margin-top: var(--spacing-8); color: var(--text-muted); font-size: var(--font-size-sm); }
404 +.template-minimalist { padding: var(--spacing-12) var(--spacing-10); }
405 +.template-minimalist .quote-header { display: block; text-align: center; border-bottom: 0; padding-bottom: 0; }
406 +.template-minimalist .company-info { margin-bottom: var(--spacing-6); }
407 +.template-minimalist .company-logo { display: flex; justify-content: center; }
408 +.template-minimalist .company-details { max-width: 420px; margin: 0 auto; }
409 +.template-minimalist .quote-meta { text-align: center; min-width: 0; max-width: 360px; margin: 0 auto; border-top: 1px solid var(--text-primary); border-bottom: 1px solid var(--text-primary); padding: var(--spacing-4) 0; }
410 +.template-minimalist .quote-title { font-size: var(--font-size-2xl); font-weight: 500; letter-spacing: 0.02em; margin-bottom: var(--spacing-3); }
411 +.template-minimalist .meta-item { justify-content: space-between; border-bottom: 0; padding: var(--spacing-1) 0; margin: 0; }
412 +.template-minimalist .meta-label { text-transform: uppercase; letter-spacing: 0.12em; font-size: var(--font-size-xs); color: var(--text-muted); }
413 +.template-minimalist .address-section { margin-top: var(--spacing-8); }
414 +@media (max-width: 640px) { .template-minimalist { padding: var(--spacing-6) var(--spacing-4); } }
369 415 </style>
370 416
371 417 <div class="template template-minimalist">
372 418 <div class="quote-header">
373 419 <div class="company-info">
420 + <?php if (!empty($company_info['logo'])): ?>
374 421 <div class="company-logo">
375 - <?php if (!empty($company_info['logo'])): ?>
376 - <img src="<?php echo esc_url($company_info['logo']); ?>" alt="<?php echo esc_attr($company_info['name']); ?>" class="logo-image">
377 - <?php endif; ?>
422 + <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)">
378 423 </div>
424 + <?php endif; ?>
379 425 <div class="company-name"><?php echo esc_html($company_info['name']); ?></div>
380 426 <div class="company-details">
381 - <?php echo \EasyInvoice\Helpers\TemplateTextHelper::generateFromSection($company_info, false, 'details-only'); ?>
427 + <?php echo wp_kses_post(\EasyInvoice\Helpers\TemplateTextHelper::generateFromSection($company_info, false, 'details-only')); ?>
382 428 </div>
383 429 </div>
384 430
385 431 <div class="quote-meta">
386 - <div class="quote-title"><?php echo esc_html($quote->getTitle() ?: __('Quote', 'easy-invoice')); ?></div>
432 + <?php $ei_kind = \EasyInvoice\Controllers\SettingsController::getTextQuote(); $ei_title = trim((string) $quote->getTitle()); ?>
433 + <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>
387 434 <div class="meta-item">
388 435 <span class="meta-label"><?php echo esc_html($text_settings['quote_number']); ?></span>
389 436 <span class="meta-value"><?php echo esc_html($quote->getNumber()); ?></span>
390 437 </div>
@@ -398,22 +445,18 @@
398 445 </div>
399 446 </div>
400 447 </div>
401 448
449 + <?php $ei_client_html = \EasyInvoice\Helpers\TemplateTextHelper::generateClientBlock($quote); if ('' !== $ei_client_html) : ?>
402 450 <div class="address-section">
403 451 <div class="address-block">
404 452 <h2><?php echo esc_html($text_settings['to']); ?></h2>
405 453 <div class="address-content">
406 - <div class="client-name"><?php echo esc_html($quote->getCustomerName()); ?></div>
407 - <?php if ($quote->getCustomerAddress()): ?>
408 - <?php echo nl2br(esc_html($quote->getCustomerAddress())); ?><br>
409 - <?php endif; ?>
410 - <?php if ($quote->getCustomerEmail()): ?>
411 - <?php echo esc_html($quote->getCustomerEmail()); ?><br>
412 - <?php endif; ?>
454 + <?php echo wp_kses_post($ei_client_html); ?>
413 455 </div>
414 456 </div>
415 457 </div>
458 + <?php endif; ?>
416 459
417 460 <?php if ($quote->getDescription()): ?>
418 461 <div class="quote-description" style="margin-bottom: 1.5rem;">
419 462 <div class="description-content" style="color:#6b7280; line-height:1.6; font-size:0.875rem; white-space:pre-wrap;">
@@ -421,8 +464,18 @@
421 464 </div>
422 465 </div>
423 466 <?php endif; ?>
424 467
468 + <?php
469 + // The adjustment column appears only when at least one line uses it.
470 + $ei_show_adjust = \EasyInvoice\Controllers\SettingsController::shouldShowQuoteAdjustField();
471 + if ($ei_show_adjust) {
472 + $ei_show_adjust = false;
473 + foreach ($quote->getItems() as $ei_item) {
474 + if ((float) $ei_item->getAdjustPercentage() != 0.0) { $ei_show_adjust = true; break; }
475 + }
476 + }
477 + ?>
425 478 <table class="quote-items">
426 479 <thead>
427 480 <tr>
428 481 <th><?php echo esc_html($text_settings['service']); ?></th>
@@ -427,15 +480,18 @@
427 480 <tr>
428 481 <th><?php echo esc_html($text_settings['service']); ?></th>
429 482 <th><?php echo esc_html($text_settings['qty']); ?></th>
430 483 <th><?php echo esc_html($text_settings['rate_price']); ?></th>
431 - <?php if (\EasyInvoice\Controllers\SettingsController::shouldShowQuoteAdjustField()): ?>
484 + <?php if ($ei_show_adjust): ?>
432 485 <th><?php echo esc_html($text_settings['adjust']); ?> (%)</th>
433 486 <?php endif; ?>
434 - <th><?php echo esc_html($text_settings['total']); ?></th>
487 + <th><?php echo esc_html($text_settings['line_total'] ?? $text_settings['total']); ?></th>
435 488 </tr>
436 489 </thead>
437 490 <tbody>
491 + <?php if (!$quote->getItems()) : ?>
492 + <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>
493 + <?php endif; ?>
438 494 <?php foreach ($quote->getItems() as $item): ?>
439 495 <tr>
440 496 <td class="item-name">
441 497 <div class="item-title"><?php echo esc_html($item->getName()); ?></div>
@@ -444,9 +500,9 @@
444 500 <?php endif; ?>
445 501 </td>
446 502 <td class="item-quantity"><?php echo esc_html($item->getQuantity() ?: '0'); ?></td>
447 503 <td class="item-price"><?php echo esc_html($formatter->format($item->getPrice())); ?></td>
448 - <?php if (\EasyInvoice\Controllers\SettingsController::shouldShowQuoteAdjustField()): ?>
504 + <?php if ($ei_show_adjust): ?>
449 505 <td class="item-adjust"><?php
450 506 $adjust_percentage = $item->getAdjustPercentage();
451 507 if ($adjust_percentage != 0) {
452 508 echo esc_html($adjust_percentage > 0 ? '+' : '') . esc_html($adjust_percentage) . '%';
@@ -461,14 +517,14 @@
461 517 </tbody>
462 518 </table>
463 519
464 520 <div class="quote-totals">
465 - <?php echo \EasyInvoice\Helpers\TemplateTextHelper::generateTotalsSection($quote, $text_settings, $formatter, 'quote'); ?>
521 + <?php echo wp_kses_post(\EasyInvoice\Helpers\TemplateTextHelper::generateTotalsSection($quote, $text_settings, $formatter, 'quote')); ?>
466 522 </div>
467 523
468 524 <?php if ($quote->getNotes()): ?>
469 525 <div class="quote-notes">
470 - <h3><?php _e('Notes:', 'easy-invoice'); ?></h3>
526 + <h3><?php esc_html_e('Notes', 'easy-invoice'); ?></h3>
471 527 <div class="notes-content">
472 528 <?php echo wp_kses_post($quote->getNotes() ?: ''); ?>
473 529 </div>
474 530 </div>
@@ -478,9 +534,9 @@
478 534 $terms_conditions = $quote->getTerms() ?: \EasyInvoice\Controllers\SettingsController::getQuoteTermsConditions();
479 535 if ($terms_conditions):
480 536 ?>
481 537 <div class="quote-terms">
482 - <h3><?php _e('Terms & Conditions:', 'easy-invoice'); ?></h3>
538 + <h3><?php esc_html_e('Terms & Conditions', 'easy-invoice'); ?></h3>
483 539 <div class="terms-content">
484 540 <?php echo wp_kses_post($terms_conditions); ?>
485 541 </div>
486 542 </div>
@@ -485,14 +541,23 @@
485 541 </div>
486 542 </div>
487 543 <?php endif; ?>
488 544
545 + <?php
546 + /**
547 + * Fires inside the document card, after notes and terms and before the
548 + * footer text: attachments, the signature block, e-invoicing notes. Being
549 + * inside the card, it is part of what "Download as PDF" captures.
550 + *
551 + * @param object $document The quote model.
552 + * @param string $type 'quote'.
553 + */
554 + do_action('easy_invoice_document_body_after', $quote, 'quote');
555 +
556 + $ei_footer_text = \EasyInvoice\Helpers\TemplateTextHelper::footerText($quote, 'quote');
557 + if ('' !== trim(wp_strip_all_tags((string) $ei_footer_text))) :
558 + ?>
489 559 <div class="quote-footer">
490 - <?php
491 - $footer_text = $quote->getFooterText();
492 - if (!$footer_text) {
493 - $footer_text = \EasyInvoice\Controllers\SettingsController::getQuoteFooterText();
494 - }
495 - ?>
496 - <p><?php echo wp_kses_post($footer_text); ?></p>
560 + <p><?php echo wp_kses_post($ei_footer_text); ?></p>
497 561 </div>
498 -</div>
562 + <?php endif; ?>
563 +</div>