| 1 |
<?php |
| 2 |
/** |
| 3 |
* Standard Quote Template - Clean SaaS Design |
| 4 |
* Clean, modern, and professional quote template |
| 5 |
*/ |
| 6 |
|
| 7 |
$text_settings = \EasyInvoice\Helpers\TemplateTextHelper::getQuoteTextSettings(); |
| 8 |
$company_info = \EasyInvoice\Helpers\TemplateTextHelper::getCompanyInfo(); |
| 9 |
// Ensure a formatter is available for currency formatting |
| 10 |
if (!isset($formatter) || !$formatter) { |
| 11 |
$formatter = new \EasyInvoice\Helpers\QuoteFormatter($quote ?? null); |
| 12 |
} |
| 13 |
?> |
| 14 |
<style> |
| 15 |
/* Standard Quote Template - Simple and Clean */ |
| 16 |
.template-standard { |
| 17 |
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; |
| 18 |
max-width: 800px; |
| 19 |
margin: 0 auto; |
| 20 |
padding: 2rem; |
| 21 |
background: #fff; |
| 22 |
color: #333; |
| 23 |
line-height: 1.5; |
| 24 |
} |
| 25 |
|
| 26 |
/* Header Section */ |
| 27 |
.template-standard .quote-header { |
| 28 |
display: flex; |
| 29 |
justify-content: space-between; |
| 30 |
margin-bottom: 2rem; |
| 31 |
padding-bottom: 1rem; |
| 32 |
border-bottom: 2px solid #eee; |
| 33 |
} |
| 34 |
|
| 35 |
.template-standard .company-info { |
| 36 |
flex: 1; |
| 37 |
} |
| 38 |
|
| 39 |
.template-standard .logo-image { |
| 40 |
max-height: 60px; |
| 41 |
max-width: 200px; |
| 42 |
margin-bottom: 1rem; |
| 43 |
} |
| 44 |
|
| 45 |
.template-standard .company-name { |
| 46 |
font-size: 1.5rem; |
| 47 |
font-weight: bold; |
| 48 |
margin-bottom: 0.5rem; |
| 49 |
} |
| 50 |
|
| 51 |
.template-standard .company-details { |
| 52 |
font-size: 0.9rem; |
| 53 |
color: #666; |
| 54 |
} |
| 55 |
|
| 56 |
.template-standard .quote-meta { |
| 57 |
text-align: right; |
| 58 |
min-width: 200px; |
| 59 |
} |
| 60 |
|
| 61 |
.template-standard .quote-title { |
| 62 |
font-size: 1.5rem; |
| 63 |
font-weight: bold; |
| 64 |
margin-bottom: 1rem; |
| 65 |
color: #2563eb; |
| 66 |
} |
| 67 |
|
| 68 |
.template-standard .meta-item { |
| 69 |
margin-bottom: 0.5rem; |
| 70 |
} |
| 71 |
|
| 72 |
.template-standard .meta-label { |
| 73 |
color: #666; |
| 74 |
font-size: 0.9rem; |
| 75 |
} |
| 76 |
|
| 77 |
.template-standard .meta-value { |
| 78 |
font-weight: 600; |
| 79 |
} |
| 80 |
|
| 81 |
/* Address Section */ |
| 82 |
.template-standard .address-section { |
| 83 |
margin-bottom: 2rem; |
| 84 |
} |
| 85 |
|
| 86 |
.template-standard .address-block { |
| 87 |
background: #f8f9fa; |
| 88 |
padding: 1rem; |
| 89 |
border-radius: 4px; |
| 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: 600; |
| 101 |
margin-bottom: 0.5rem; |
| 102 |
} |
| 103 |
|
| 104 |
.template-standard .address-content { |
| 105 |
font-size: 0.9rem; |
| 106 |
color: #666; |
| 107 |
} |
| 108 |
|
| 109 |
/* Quote Description */ |
| 110 |
.template-standard .quote-description { |
| 111 |
margin-bottom: 2rem; |
| 112 |
} |
| 113 |
|
| 114 |
.template-standard .description-content { |
| 115 |
color: #666; |
| 116 |
white-space: pre-wrap; |
| 117 |
} |
| 118 |
|
| 119 |
/* Quote Items Table */ |
| 120 |
.template-standard .quote-items { |
| 121 |
width: 100%; |
| 122 |
border-collapse: collapse; |
| 123 |
margin-bottom: 2rem; |
| 124 |
border: 1px solid #eee; |
| 125 |
} |
| 126 |
|
| 127 |
.template-standard .quote-items th { |
| 128 |
background: #2563eb; |
| 129 |
color: white; |
| 130 |
text-align: left; |
| 131 |
padding: 0.75rem; |
| 132 |
font-size: 0.9rem; |
| 133 |
} |
| 134 |
|
| 135 |
.template-standard .quote-items td { |
| 136 |
padding: 0.75rem; |
| 137 |
border-bottom: 1px solid #eee; |
| 138 |
} |
| 139 |
|
| 140 |
.template-standard .item-name .item-title { |
| 141 |
font-weight: normal; |
| 142 |
} |
| 143 |
|
| 144 |
.template-standard .item-description { |
| 145 |
font-size: 0.9rem; |
| 146 |
color: #666; |
| 147 |
margin-top: 0.25rem; |
| 148 |
font-weight: 300; |
| 149 |
} |
| 150 |
|
| 151 |
.template-standard .item-quantity, |
| 152 |
.template-standard .item-price, |
| 153 |
.template-standard .item-total { |
| 154 |
text-align: right; |
| 155 |
} |
| 156 |
|
| 157 |
/* Quote Totals */ |
| 158 |
.template-standard .quote-totals { |
| 159 |
margin-left: auto; |
| 160 |
width: 300px; |
| 161 |
margin-bottom: 2rem; |
| 162 |
} |
| 163 |
|
| 164 |
.template-standard .quote-total-row { |
| 165 |
display: flex; |
| 166 |
justify-content: space-between; |
| 167 |
padding: 0.5rem 0; |
| 168 |
border-bottom: 1px solid #eee; |
| 169 |
} |
| 170 |
|
| 171 |
.template-standard .quote-total-row:last-child { |
| 172 |
border-bottom: none; |
| 173 |
font-weight: bold; |
| 174 |
font-size: 1.1rem; |
| 175 |
margin-top: 0.5rem; |
| 176 |
padding-top: 0.5rem; |
| 177 |
border-top: 2px solid #2563eb; |
| 178 |
} |
| 179 |
|
| 180 |
/* Notes and Terms */ |
| 181 |
.template-standard .quote-notes, |
| 182 |
.template-standard .quote-terms { |
| 183 |
margin-top: 2rem; |
| 184 |
padding: 1rem; |
| 185 |
background: #f8f9fa; |
| 186 |
border-radius: 4px; |
| 187 |
} |
| 188 |
|
| 189 |
.template-standard .quote-notes h3, |
| 190 |
.template-standard .quote-terms h3 { |
| 191 |
font-size: 1rem; |
| 192 |
font-weight: 600; |
| 193 |
margin-bottom: 0.5rem; |
| 194 |
} |
| 195 |
|
| 196 |
.template-standard .notes-content, |
| 197 |
.template-standard .terms-content { |
| 198 |
font-size: 0.9rem; |
| 199 |
color: #666; |
| 200 |
} |
| 201 |
|
| 202 |
/* Footer */ |
| 203 |
.template-standard .quote-footer { |
| 204 |
margin-top: 2rem; |
| 205 |
padding-top: 1rem; |
| 206 |
text-align: center; |
| 207 |
border-top: 1px solid #eee; |
| 208 |
color: #666; |
| 209 |
font-size: 0.9rem; |
| 210 |
} |
| 211 |
|
| 212 |
/* Responsive Design */ |
| 213 |
@media (max-width: 768px) { |
| 214 |
.template-standard { |
| 215 |
padding: 1rem; |
| 216 |
} |
| 217 |
|
| 218 |
.template-standard .quote-header { |
| 219 |
flex-direction: column; |
| 220 |
} |
| 221 |
|
| 222 |
.template-standard .quote-meta { |
| 223 |
text-align: left; |
| 224 |
margin-top: 1rem; |
| 225 |
} |
| 226 |
|
| 227 |
.template-standard .quote-totals { |
| 228 |
width: 100%; |
| 229 |
} |
| 230 |
} |
| 231 |
</style> |
| 232 |
|
| 233 |
<div class="template template-standard"> |
| 234 |
<!-- Header --> |
| 235 |
<div class="quote-header"> |
| 236 |
<div class="company-info"> |
| 237 |
<div class="company-logo"> |
| 238 |
<?php if (!empty($company_info['logo'])): ?> |
| 239 |
<img src="<?php echo esc_url($company_info['logo']); ?>" alt="<?php echo esc_attr($company_info['name']); ?>" class="logo-image"> |
| 240 |
<?php endif; ?> |
| 241 |
</div> |
| 242 |
<div class="company-name"><?php echo esc_html($company_info['name']); ?></div> |
| 243 |
<div class="company-details"> |
| 244 |
<?php echo \EasyInvoice\Helpers\TemplateTextHelper::generateFromSection($company_info, false, 'details-only'); ?> |
| 245 |
</div> |
| 246 |
</div> |
| 247 |
|
| 248 |
<div class="quote-meta"> |
| 249 |
<div class="quote-title"><?php echo esc_html($quote->getTitle() ?: __('Quote', 'easy-invoice')); ?></div> |
| 250 |
<div class="meta-item"> |
| 251 |
<span class="meta-label"><?php echo esc_html($text_settings['quote_number']); ?></span> |
| 252 |
<span class="meta-value"><?php echo esc_html($quote->getNumber()); ?></span> |
| 253 |
</div> |
| 254 |
<div class="meta-item"> |
| 255 |
<span class="meta-label"><?php echo esc_html($text_settings['quote_date']); ?></span> |
| 256 |
<span class="meta-value"><?php echo esc_html(\EasyInvoice\Controllers\SettingsController::formatDate($quote->getIssueDate())); ?></span> |
| 257 |
</div> |
| 258 |
<div class="meta-item"> |
| 259 |
<span class="meta-label"><?php echo esc_html($text_settings['valid_until']); ?></span> |
| 260 |
<span class="meta-value"><?php echo esc_html(\EasyInvoice\Controllers\SettingsController::formatDate($quote->getExpiryDate())); ?></span> |
| 261 |
</div> |
| 262 |
</div> |
| 263 |
</div> |
| 264 |
|
| 265 |
<!-- Address Section --> |
| 266 |
<div class="address-section"> |
| 267 |
<div class="address-block"> |
| 268 |
<h2><?php echo esc_html($text_settings['to']); ?></h2> |
| 269 |
<div class="address-content"> |
| 270 |
<div class="client-name"><?php echo esc_html($quote->getCustomerName()); ?></div> |
| 271 |
<?php if ($quote->getCustomerAddress()): ?> |
| 272 |
<?php echo nl2br(esc_html($quote->getCustomerAddress())); ?><br> |
| 273 |
<?php endif; ?> |
| 274 |
<?php if ($quote->getCustomerEmail()): ?> |
| 275 |
<?php echo esc_html($quote->getCustomerEmail()); ?><br> |
| 276 |
<?php endif; ?> |
| 277 |
</div> |
| 278 |
</div> |
| 279 |
</div> |
| 280 |
|
| 281 |
<!-- Quote Description --> |
| 282 |
<?php if ($quote->getDescription()): ?> |
| 283 |
<div class="quote-description"> |
| 284 |
<div class="description-content"><?php echo wp_kses_post($quote->getDescription()); ?></div> |
| 285 |
</div> |
| 286 |
<?php endif; ?> |
| 287 |
|
| 288 |
<!-- Quote Items --> |
| 289 |
<table class="quote-items"> |
| 290 |
<thead> |
| 291 |
<tr> |
| 292 |
<th><?php echo esc_html($text_settings['service']); ?></th> |
| 293 |
<th><?php echo esc_html($text_settings['qty']); ?></th> |
| 294 |
<th><?php echo esc_html($text_settings['rate_price']); ?></th> |
| 295 |
<?php if (\EasyInvoice\Controllers\SettingsController::shouldShowQuoteAdjustField()): ?> |
| 296 |
<th><?php echo esc_html($text_settings['adjust']); ?> (%)</th> |
| 297 |
<?php endif; ?> |
| 298 |
<th><?php echo esc_html($text_settings['total']); ?></th> |
| 299 |
</tr> |
| 300 |
</thead> |
| 301 |
<tbody> |
| 302 |
<?php foreach ($quote->getItems() as $item): ?> |
| 303 |
<tr> |
| 304 |
<td class="item-name"> |
| 305 |
<div class="item-title"><?php echo esc_html($item->getName()); ?></div> |
| 306 |
<?php if ($item->getDescription()): ?> |
| 307 |
<div class="item-description"><?php echo esc_html($item->getDescription()); ?></div> |
| 308 |
<?php endif; ?> |
| 309 |
</td> |
| 310 |
<td class="item-quantity"><?php echo esc_html($item->getQuantity() ?: '0'); ?></td> |
| 311 |
<td class="item-price"><?php echo esc_html($formatter->format($item->getPrice())); ?></td> |
| 312 |
<?php if (\EasyInvoice\Controllers\SettingsController::shouldShowQuoteAdjustField()): ?> |
| 313 |
<td class="item-adjust"><?php |
| 314 |
$adjust_percentage = $item->getAdjustPercentage(); |
| 315 |
if ($adjust_percentage != 0) { |
| 316 |
echo esc_html($adjust_percentage > 0 ? '+' : '') . esc_html($adjust_percentage) . '%'; |
| 317 |
} else { |
| 318 |
echo esc_html__('—', 'easy-invoice'); |
| 319 |
} |
| 320 |
?></td> |
| 321 |
<?php endif; ?> |
| 322 |
<td class="item-total"><?php echo esc_html($formatter->format($item->getAmount())); ?></td> |
| 323 |
</tr> |
| 324 |
<?php endforeach; ?> |
| 325 |
</tbody> |
| 326 |
</table> |
| 327 |
|
| 328 |
<!-- Quote Totals --> |
| 329 |
<div class="quote-totals"> |
| 330 |
<?php echo \EasyInvoice\Helpers\TemplateTextHelper::generateTotalsSection($quote, $text_settings, $formatter, 'quote'); ?> |
| 331 |
</div> |
| 332 |
|
| 333 |
<!-- Notes --> |
| 334 |
<?php if ($quote->getNotes()): ?> |
| 335 |
<div class="quote-notes"> |
| 336 |
<h3><?php _e('Notes:', 'easy-invoice'); ?></h3> |
| 337 |
<div class="notes-content"> |
| 338 |
<?php echo wp_kses_post($quote->getNotes() ?: ''); ?> |
| 339 |
</div> |
| 340 |
</div> |
| 341 |
<?php endif; ?> |
| 342 |
|
| 343 |
<!-- Terms and Conditions --> |
| 344 |
<?php |
| 345 |
$terms_conditions = $quote->getTerms() ?: \EasyInvoice\Controllers\SettingsController::getQuoteTermsConditions(); |
| 346 |
if ($terms_conditions): |
| 347 |
?> |
| 348 |
<div class="quote-terms"> |
| 349 |
<h3><?php _e('Terms & Conditions:', 'easy-invoice'); ?></h3> |
| 350 |
<div class="terms-content"> |
| 351 |
<?php echo wp_kses_post($terms_conditions); ?> |
| 352 |
</div> |
| 353 |
</div> |
| 354 |
<?php endif; ?> |
| 355 |
|
| 356 |
<!-- Footer --> |
| 357 |
<div class="quote-footer"> |
| 358 |
<?php |
| 359 |
$footer_text = $quote->getFooterText(); |
| 360 |
if (!$footer_text) { |
| 361 |
$footer_text = \EasyInvoice\Controllers\SettingsController::getQuoteFooterText(); |
| 362 |
} |
| 363 |
?> |
| 364 |
<p><?php echo wp_kses_post($footer_text); ?></p> |
| 365 |
</div> |
| 366 |
</div> |
| 367 |
|