| 1 |
<?php |
| 2 |
/** |
| 3 |
* Modern Template - Sleek SaaS Design |
| 4 |
* Modern, sleek, and contemporary 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 |
/* Modern Template - Sleek SaaS Design */ |
| 16 |
:root { |
| 17 |
--primary-color: #6366f1; |
| 18 |
--primary-light: #818cf8; |
| 19 |
--primary-dark: #4f46e5; |
| 20 |
--secondary-color: #8b5cf6; |
| 21 |
--accent-color: #06b6d4; |
| 22 |
--success-color: #10b981; |
| 23 |
--warning-color: #f59e0b; |
| 24 |
--error-color: #ef4444; |
| 25 |
--text-primary: #0f172a; |
| 26 |
--text-secondary: #475569; |
| 27 |
--text-muted: #64748b; |
| 28 |
--border-color: #e2e8f0; |
| 29 |
--border-light: #f1f5f9; |
| 30 |
--background-primary: #ffffff; |
| 31 |
--background-secondary: #f8fafc; |
| 32 |
--background-accent: #f1f5f9; |
| 33 |
|
| 34 |
--font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; |
| 35 |
--font-family-heading: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; |
| 36 |
|
| 37 |
--font-size-xs: 0.75rem; |
| 38 |
--font-size-sm: 0.875rem; |
| 39 |
--font-size-base: 1rem; |
| 40 |
--font-size-lg: 1.125rem; |
| 41 |
--font-size-xl: 1.25rem; |
| 42 |
--font-size-2xl: 1.5rem; |
| 43 |
--font-size-3xl: 1.875rem; |
| 44 |
--font-size-4xl: 2.25rem; |
| 45 |
|
| 46 |
--spacing-1: 0.25rem; |
| 47 |
--spacing-2: 0.5rem; |
| 48 |
--spacing-3: 0.75rem; |
| 49 |
--spacing-4: 1rem; |
| 50 |
--spacing-5: 1.25rem; |
| 51 |
--spacing-6: 1.5rem; |
| 52 |
--spacing-8: 2rem; |
| 53 |
--spacing-10: 2.5rem; |
| 54 |
--spacing-12: 3rem; |
| 55 |
--spacing-16: 4rem; |
| 56 |
--spacing-20: 5rem; |
| 57 |
|
| 58 |
--radius-sm: 0.375rem; |
| 59 |
--radius-md: 0.5rem; |
| 60 |
--radius-lg: 0.75rem; |
| 61 |
--radius-xl: 1rem; |
| 62 |
--radius-2xl: 1.5rem; |
| 63 |
|
| 64 |
--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05); |
| 65 |
--shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); |
| 66 |
--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); |
| 67 |
--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); |
| 68 |
--shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25); |
| 69 |
} |
| 70 |
|
| 71 |
.template-modern { |
| 72 |
font-family: var(--font-family); |
| 73 |
background: var(--background-primary); |
| 74 |
color: var(--text-primary); |
| 75 |
max-width: 1000px; |
| 76 |
margin: 0 auto; |
| 77 |
padding: var(--spacing-8); |
| 78 |
box-shadow: var(--shadow-2xl); |
| 79 |
border-radius: var(--radius-2xl); |
| 80 |
line-height: 1.6; |
| 81 |
position: relative; |
| 82 |
overflow: hidden; |
| 83 |
} |
| 84 |
|
| 85 |
.template-modern::before { |
| 86 |
content: ''; |
| 87 |
position: absolute; |
| 88 |
top: 0; |
| 89 |
left: 0; |
| 90 |
right: 0; |
| 91 |
height: 6px; |
| 92 |
background: var(--primary-color); |
| 93 |
} |
| 94 |
|
| 95 |
/* Header Section */ |
| 96 |
.template-modern .invoice-header { |
| 97 |
display: grid; |
| 98 |
grid-template-columns: 1fr auto; |
| 99 |
gap: var(--spacing-8); |
| 100 |
margin-bottom: var(--spacing-12); |
| 101 |
padding: var(--spacing-8); |
| 102 |
background: var(--background-secondary); |
| 103 |
border-radius: var(--radius-xl); |
| 104 |
border: 1px solid var(--border-color); |
| 105 |
position: relative; |
| 106 |
} |
| 107 |
|
| 108 |
.template-modern .company-info { |
| 109 |
display: flex; |
| 110 |
flex-direction: column; |
| 111 |
gap: var(--spacing-4); |
| 112 |
} |
| 113 |
|
| 114 |
.template-modern .company-logo { |
| 115 |
margin-bottom: 0; |
| 116 |
} |
| 117 |
|
| 118 |
.template-modern .logo-image { |
| 119 |
max-height: 60px; |
| 120 |
max-width: 200px; |
| 121 |
object-fit: contain; |
| 122 |
filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15)); |
| 123 |
} |
| 124 |
|
| 125 |
.template-modern .company-name { |
| 126 |
font-family: var(--font-family-heading); |
| 127 |
font-size: var(--font-size-2xl); |
| 128 |
font-weight: 700; |
| 129 |
color: var(--text-primary); |
| 130 |
margin-bottom: var(--spacing-3); |
| 131 |
line-height: 1.2; |
| 132 |
} |
| 133 |
|
| 134 |
.template-modern .company-details { |
| 135 |
color: var(--text-secondary); |
| 136 |
font-size: var(--font-size-sm); |
| 137 |
line-height: 1.5; |
| 138 |
} |
| 139 |
|
| 140 |
.template-modern .invoice-meta { |
| 141 |
display: flex; |
| 142 |
flex-direction: column; |
| 143 |
gap: var(--spacing-4); |
| 144 |
background: var(--background-primary); |
| 145 |
padding: var(--spacing-6); |
| 146 |
border-radius: var(--radius-lg); |
| 147 |
border: 1px solid var(--border-color); |
| 148 |
box-shadow: var(--shadow-md); |
| 149 |
min-width: 300px; |
| 150 |
} |
| 151 |
|
| 152 |
.template-modern .invoice-title { |
| 153 |
font-family: var(--font-family-heading); |
| 154 |
font-size: var(--font-size-2xl); |
| 155 |
font-weight: 700; |
| 156 |
color: var(--primary-color); |
| 157 |
margin-bottom: var(--spacing-4); |
| 158 |
text-align: center; |
| 159 |
text-transform: uppercase; |
| 160 |
letter-spacing: -0.025em; |
| 161 |
} |
| 162 |
|
| 163 |
.template-modern .meta-item { |
| 164 |
display: flex; |
| 165 |
justify-content: space-between; |
| 166 |
align-items: center; |
| 167 |
padding: var(--spacing-3) 0; |
| 168 |
border-bottom: 1px solid var(--border-light); |
| 169 |
} |
| 170 |
|
| 171 |
.template-modern .meta-item:last-child { |
| 172 |
border-bottom: none; |
| 173 |
} |
| 174 |
|
| 175 |
.template-modern .meta-label { |
| 176 |
font-size: var(--font-size-sm); |
| 177 |
color: var(--text-secondary); |
| 178 |
font-weight: 500; |
| 179 |
} |
| 180 |
|
| 181 |
.template-modern .meta-value { |
| 182 |
font-size: var(--font-size-base); |
| 183 |
color: var(--text-primary); |
| 184 |
font-weight: 600; |
| 185 |
} |
| 186 |
|
| 187 |
/* Address Section */ |
| 188 |
.template-modern .address-section { |
| 189 |
display: grid; |
| 190 |
grid-template-columns: 1fr 1fr; |
| 191 |
gap: var(--spacing-8); |
| 192 |
margin-bottom: var(--spacing-12); |
| 193 |
} |
| 194 |
|
| 195 |
.template-modern .address-block { |
| 196 |
background: var(--background-secondary); |
| 197 |
padding: var(--spacing-6); |
| 198 |
border-radius: var(--radius-lg); |
| 199 |
border: 1px solid var(--border-color); |
| 200 |
position: relative; |
| 201 |
overflow: hidden; |
| 202 |
} |
| 203 |
|
| 204 |
.template-modern .address-block::before { |
| 205 |
content: ''; |
| 206 |
position: absolute; |
| 207 |
top: 0; |
| 208 |
left: 0; |
| 209 |
right: 0; |
| 210 |
height: 3px; |
| 211 |
background: var(--primary-color); |
| 212 |
} |
| 213 |
|
| 214 |
.template-modern .address-block h2 { |
| 215 |
font-family: var(--font-family-heading); |
| 216 |
font-size: var(--font-size-lg); |
| 217 |
font-weight: 600; |
| 218 |
color: var(--text-primary); |
| 219 |
margin-bottom: var(--spacing-4); |
| 220 |
text-transform: uppercase; |
| 221 |
letter-spacing: 0.05em; |
| 222 |
} |
| 223 |
|
| 224 |
.template-modern .client-name { |
| 225 |
font-weight: 600; |
| 226 |
color: var(--text-primary); |
| 227 |
font-size: var(--font-size-base); |
| 228 |
margin-bottom: var(--spacing-2); |
| 229 |
} |
| 230 |
|
| 231 |
.template-modern .address-content { |
| 232 |
color: var(--text-secondary); |
| 233 |
font-size: var(--font-size-sm); |
| 234 |
line-height: 1.5; |
| 235 |
} |
| 236 |
|
| 237 |
/* Invoice Items Table */ |
| 238 |
.template-modern .invoice-items { |
| 239 |
width: 100%; |
| 240 |
border-collapse: separate; |
| 241 |
border-spacing: 0; |
| 242 |
margin-bottom: var(--spacing-12); |
| 243 |
background: var(--background-primary); |
| 244 |
border-radius: var(--radius-xl); |
| 245 |
overflow: hidden; |
| 246 |
box-shadow: var(--shadow-xl); |
| 247 |
border: 1px solid var(--border-color); |
| 248 |
} |
| 249 |
|
| 250 |
.template-modern .invoice-items th { |
| 251 |
background: var(--primary-color); |
| 252 |
color: white; |
| 253 |
font-weight: 600; |
| 254 |
text-align: left; |
| 255 |
padding: var(--spacing-5) var(--spacing-6); |
| 256 |
font-size: var(--font-size-sm); |
| 257 |
text-transform: uppercase; |
| 258 |
letter-spacing: 0.05em; |
| 259 |
} |
| 260 |
|
| 261 |
.template-modern .invoice-items td { |
| 262 |
padding: var(--spacing-5) var(--spacing-6); |
| 263 |
border-bottom: 1px solid var(--border-light); |
| 264 |
vertical-align: top; |
| 265 |
} |
| 266 |
|
| 267 |
.template-modern .invoice-items tr:last-child td { |
| 268 |
border-bottom: none; |
| 269 |
} |
| 270 |
|
| 271 |
.template-modern .invoice-items tr:hover { |
| 272 |
background: var(--background-accent); |
| 273 |
} |
| 274 |
|
| 275 |
.template-modern .item-name .item-title { |
| 276 |
font-weight: 600; |
| 277 |
color: var(--text-primary); |
| 278 |
margin-bottom: var(--spacing-1); |
| 279 |
} |
| 280 |
|
| 281 |
.template-modern .item-description { |
| 282 |
color: var(--text-muted); |
| 283 |
font-size: var(--font-size-sm); |
| 284 |
line-height: 1.4; |
| 285 |
font-weight: normal; |
| 286 |
} |
| 287 |
|
| 288 |
.template-modern .item-quantity, |
| 289 |
.template-modern .item-price, |
| 290 |
.template-modern .item-total { |
| 291 |
text-align: right; |
| 292 |
font-weight: 500; |
| 293 |
color: var(--text-primary); |
| 294 |
} |
| 295 |
|
| 296 |
/* Invoice Totals */ |
| 297 |
.template-modern .invoice-totals { |
| 298 |
margin-left: auto; |
| 299 |
width: 400px; |
| 300 |
background: var(--background-secondary); |
| 301 |
padding: var(--spacing-8); |
| 302 |
border-radius: var(--radius-xl); |
| 303 |
border: 1px solid var(--border-color); |
| 304 |
box-shadow: var(--shadow-lg); |
| 305 |
position: relative; |
| 306 |
} |
| 307 |
|
| 308 |
.template-modern .invoice-totals::before { |
| 309 |
content: ''; |
| 310 |
position: absolute; |
| 311 |
top: 0; |
| 312 |
left: 0; |
| 313 |
right: 0; |
| 314 |
height: 3px; |
| 315 |
background: var(--primary-color); |
| 316 |
border-radius: var(--radius-xl) var(--radius-xl) 0 0; |
| 317 |
} |
| 318 |
|
| 319 |
.template-modern .invoice-total-row { |
| 320 |
display: flex; |
| 321 |
justify-content: space-between; |
| 322 |
align-items: center; |
| 323 |
padding: var(--spacing-3) 0; |
| 324 |
border-bottom: 1px solid var(--border-light); |
| 325 |
} |
| 326 |
|
| 327 |
.template-modern .invoice-total-row:last-child { |
| 328 |
border-bottom: none; |
| 329 |
} |
| 330 |
|
| 331 |
.template-modern .invoice-total-label { |
| 332 |
font-weight: 500; |
| 333 |
color: var(--text-secondary); |
| 334 |
} |
| 335 |
|
| 336 |
.template-modern .invoice-total-value { |
| 337 |
font-weight: 600; |
| 338 |
color: var(--text-primary); |
| 339 |
} |
| 340 |
|
| 341 |
.template-modern .invoice-totals .invoice-grand-total { |
| 342 |
font-size: var(--font-size-xl); |
| 343 |
font-weight: 700; |
| 344 |
color: var(--primary-color); |
| 345 |
border-top: 2px solid var(--primary-color); |
| 346 |
padding-top: var(--spacing-4); |
| 347 |
margin-top: var(--spacing-4); |
| 348 |
} |
| 349 |
|
| 350 |
/* Notes Section */ |
| 351 |
.template-modern .invoice-notes { |
| 352 |
margin-top: var(--spacing-12); |
| 353 |
padding: var(--spacing-8); |
| 354 |
background: var(--background-accent); |
| 355 |
border-radius: var(--radius-xl); |
| 356 |
border-left: 4px solid var(--primary-color); |
| 357 |
box-shadow: var(--shadow-md); |
| 358 |
} |
| 359 |
|
| 360 |
.template-modern .invoice-notes h3 { |
| 361 |
font-family: var(--font-family-heading); |
| 362 |
font-size: var(--font-size-lg); |
| 363 |
font-weight: 600; |
| 364 |
color: var(--text-primary); |
| 365 |
margin-bottom: var(--spacing-4); |
| 366 |
} |
| 367 |
|
| 368 |
.template-modern .notes-content { |
| 369 |
color: var(--text-secondary); |
| 370 |
line-height: 1.6; |
| 371 |
} |
| 372 |
|
| 373 |
/* Terms and Conditions Section */ |
| 374 |
.template-modern .invoice-terms { |
| 375 |
margin-top: var(--spacing-12); |
| 376 |
padding: var(--spacing-8); |
| 377 |
background: var(--background-secondary); |
| 378 |
border-radius: var(--radius-xl); |
| 379 |
border: 1px solid var(--border-color); |
| 380 |
box-shadow: var(--shadow-md); |
| 381 |
} |
| 382 |
|
| 383 |
.template-modern .invoice-terms h3 { |
| 384 |
font-family: var(--font-family-heading); |
| 385 |
font-size: var(--font-size-lg); |
| 386 |
font-weight: 600; |
| 387 |
color: var(--text-primary); |
| 388 |
margin-bottom: var(--spacing-4); |
| 389 |
} |
| 390 |
|
| 391 |
.template-modern .terms-content { |
| 392 |
color: var(--text-secondary); |
| 393 |
line-height: 1.6; |
| 394 |
} |
| 395 |
|
| 396 |
/* Footer */ |
| 397 |
.template-modern .invoice-footer { |
| 398 |
margin-top: var(--spacing-12); |
| 399 |
padding: var(--spacing-6); |
| 400 |
text-align: center; |
| 401 |
background: var(--background-secondary); |
| 402 |
border-radius: var(--radius-lg); |
| 403 |
border: 1px solid var(--border-color); |
| 404 |
} |
| 405 |
|
| 406 |
.template-modern .invoice-footer p { |
| 407 |
margin: 0; |
| 408 |
color: var(--text-secondary); |
| 409 |
font-size: var(--font-size-sm); |
| 410 |
} |
| 411 |
|
| 412 |
/* Responsive Design */ |
| 413 |
@media (max-width: 768px) { |
| 414 |
.template-modern { |
| 415 |
padding: var(--spacing-4); |
| 416 |
} |
| 417 |
|
| 418 |
.template-modern .invoice-header { |
| 419 |
grid-template-columns: 1fr; |
| 420 |
gap: var(--spacing-6); |
| 421 |
} |
| 422 |
|
| 423 |
.template-modern .invoice-meta { |
| 424 |
min-width: auto; |
| 425 |
} |
| 426 |
|
| 427 |
.template-modern .address-section { |
| 428 |
grid-template-columns: 1fr; |
| 429 |
gap: var(--spacing-6); |
| 430 |
} |
| 431 |
|
| 432 |
.template-modern .invoice-totals { |
| 433 |
width: 100%; |
| 434 |
} |
| 435 |
} |
| 436 |
|
| 437 |
/* Shared polish: numbers line up, numeric headings sit over their figures. */ |
| 438 |
.template-modern .invoice-items th + th { text-align: right; } |
| 439 |
.template-modern .invoice-items .item-quantity, |
| 440 |
.template-modern .invoice-items .item-price, |
| 441 |
.template-modern .invoice-items .item-adjust, |
| 442 |
.template-modern .invoice-items .item-total, |
| 443 |
.template-modern .invoice-total-value { font-variant-numeric: tabular-nums; white-space: nowrap; } |
| 444 |
.template-modern .meta-value { white-space: nowrap; } |
| 445 |
.template-modern .invoice-items .item-adjust { text-align: right; } |
| 446 |
.template-modern .client-contact { font-weight: 500; margin-bottom: 0.15em; } |
| 447 |
.template-modern .client-tax-number, |
| 448 |
.template-modern .company-tax-number { margin-top: 0.35em; } |
| 449 |
.template-modern .invoice-items .item-description { white-space: pre-line; } |
| 450 |
.template-modern .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; } |
| 451 |
|
| 452 |
/* Modern: one card in the header instead of a card inside a panel; lighter shadows; tighter rhythm. */ |
| 453 |
.template-modern .invoice-header { background: transparent; border: 0; padding: 0 0 var(--spacing-6); margin-bottom: var(--spacing-8); border-bottom: 1px solid var(--border-color); border-radius: 0; } |
| 454 |
.template-modern .invoice-meta { box-shadow: var(--shadow-sm); gap: 0; padding: var(--spacing-5) var(--spacing-6); } |
| 455 |
.template-modern .invoice-title { margin-bottom: var(--spacing-2); } |
| 456 |
.template-modern .meta-item { padding: var(--spacing-2) 0; } |
| 457 |
.template-modern .meta-item:last-child { border-bottom: 0; } |
| 458 |
.template-modern .address-section { margin-bottom: var(--spacing-8); } |
| 459 |
.template-modern .address-block { padding: var(--spacing-5); } |
| 460 |
.template-modern .address-block h2 { font-size: var(--font-size-xs); letter-spacing: 0.14em; color: var(--text-muted); margin-bottom: var(--spacing-2); } |
| 461 |
.template-modern .invoice-items { box-shadow: var(--shadow-sm); margin-bottom: var(--spacing-8); border: 1px solid var(--border-color); } |
| 462 |
.template-modern .invoice-items th { padding: var(--spacing-3) var(--spacing-5); font-size: var(--font-size-xs); letter-spacing: 0.1em; } |
| 463 |
.template-modern .invoice-items td { padding: var(--spacing-4) var(--spacing-5); } |
| 464 |
.template-modern .invoice-items tr:hover { background: transparent; } |
| 465 |
.template-modern .invoice-totals { box-shadow: var(--shadow-sm); padding: var(--spacing-5) var(--spacing-6); width: 360px; } |
| 466 |
.template-modern .invoice-total-row { padding: var(--spacing-2) 0; } |
| 467 |
.template-modern .invoice-totals .invoice-grand-total { padding-top: var(--spacing-3); margin-top: var(--spacing-2); } |
| 468 |
.template-modern .invoice-notes, .template-modern .invoice-terms { margin-top: var(--spacing-8); padding: var(--spacing-5) var(--spacing-6); box-shadow: none; } |
| 469 |
.template-modern .invoice-notes h3, .template-modern .invoice-terms h3 { font-size: var(--font-size-xs); text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-muted); margin-bottom: var(--spacing-2); } |
| 470 |
.template-modern .invoice-footer { margin-top: var(--spacing-8); background: transparent; border: 0; border-top: 1px solid var(--border-color); border-radius: 0; padding: var(--spacing-5) 0 0; color: var(--text-muted); } |
| 471 |
.template-modern .invoice-totals .invoice-paid-row .invoice-total-value { color: var(--success-color, #047857); } |
| 472 |
.template-modern .invoice-totals .invoice-balance-due { font-weight: 700; } |
| 473 |
.template-modern .invoice-totals .invoice-balance-due .invoice-total-label { color: inherit; font-weight: 700; } |
| 474 |
.template-modern .meta-amount-due .meta-value { font-weight: 700; font-size: 1.08em; } |
| 475 |
</style> |
| 476 |
|
| 477 |
<div class="template template-modern"> |
| 478 |
<div class="invoice-header"> |
| 479 |
<div class="company-info"> |
| 480 |
<?php if (!empty($company_info['logo'])): ?> |
| 481 |
<div class="company-logo"> |
| 482 |
<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)"> |
| 483 |
</div> |
| 484 |
<?php endif; ?> |
| 485 |
<div class="company-name"><?php echo esc_html($company_info['name']); ?></div> |
| 486 |
<div class="company-details"> |
| 487 |
<?php echo wp_kses_post(\EasyInvoice\Helpers\TemplateTextHelper::generateFromSection($company_info, false, 'details-only')); ?> |
| 488 |
</div> |
| 489 |
</div> |
| 490 |
|
| 491 |
<div class="invoice-meta"> |
| 492 |
<?php $ei_kind = \EasyInvoice\Helpers\TemplateTextHelper::documentKind($invoice); $ei_title = trim((string) $invoice->getTitle()); ?> |
| 493 |
<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> |
| 494 |
<div class="meta-item"> |
| 495 |
<span class="meta-label"><?php echo esc_html($text_settings['invoice_number']); ?></span> |
| 496 |
<span class="meta-value"><?php echo esc_html($invoice->getNumber()); ?></span> |
| 497 |
</div> |
| 498 |
<div class="meta-item"> |
| 499 |
<span class="meta-label"><?php echo esc_html($text_settings['invoice_date']); ?></span> |
| 500 |
<span class="meta-value"><?php echo esc_html(\EasyInvoice\Controllers\SettingsController::formatDate($invoice->getIssueDate())); ?></span> |
| 501 |
</div> |
| 502 |
<?php if (empty($ei_is_credit_note)) : ?> |
| 503 |
<div class="meta-item"> |
| 504 |
<span class="meta-label"><?php echo esc_html($text_settings['due_date']); ?></span> |
| 505 |
<span class="meta-value"><?php echo esc_html(\EasyInvoice\Controllers\SettingsController::formatDate($invoice->getDueDate())); ?></span> |
| 506 |
</div> |
| 507 |
<?php endif; ?> |
| 508 |
<?php if (empty($ei_is_credit_note)) : ?> |
| 509 |
<div class="meta-item meta-amount-due"> |
| 510 |
<span class="meta-label"><?php echo esc_html($text_settings['total_due']); ?></span> |
| 511 |
<span class="meta-value"><?php echo esc_html($formatter->format(\EasyInvoice\Helpers\TemplateTextHelper::amountDue($invoice))); ?></span> |
| 512 |
</div> |
| 513 |
<?php endif; ?> |
| 514 |
</div> |
| 515 |
</div> |
| 516 |
|
| 517 |
<?php $ei_client_html = \EasyInvoice\Helpers\TemplateTextHelper::generateClientBlock($invoice); if ('' !== $ei_client_html) : ?> |
| 518 |
<div class="address-section"> |
| 519 |
<div class="address-block"> |
| 520 |
<h2><?php echo esc_html($text_settings['to']); ?></h2> |
| 521 |
<div class="address-content"> |
| 522 |
<?php echo wp_kses_post($ei_client_html); ?> |
| 523 |
</div> |
| 524 |
</div> |
| 525 |
</div> |
| 526 |
<?php endif; ?> |
| 527 |
|
| 528 |
<?php |
| 529 |
// The adjustment column appears only when at least one line uses it. |
| 530 |
$ei_show_adjust = \EasyInvoice\Controllers\SettingsController::shouldShowInvoiceAdjustField(); |
| 531 |
if ($ei_show_adjust) { |
| 532 |
$ei_show_adjust = false; |
| 533 |
foreach ($invoice->getItems() as $ei_item) { |
| 534 |
if ((float) $ei_item->getAdjustPercentage() != 0.0) { $ei_show_adjust = true; break; } |
| 535 |
} |
| 536 |
} |
| 537 |
?> |
| 538 |
<table class="invoice-items"> |
| 539 |
<thead> |
| 540 |
<tr> |
| 541 |
<th><?php echo esc_html($text_settings['service']); ?></th> |
| 542 |
<th><?php echo esc_html($text_settings['qty']); ?></th> |
| 543 |
<th><?php echo esc_html($text_settings['rate_price']); ?></th> |
| 544 |
<?php if ($ei_show_adjust): ?> |
| 545 |
<th><?php echo esc_html($text_settings['adjust']); ?> (%)</th> |
| 546 |
<?php endif; ?> |
| 547 |
<th><?php echo esc_html($text_settings['line_total'] ?? $text_settings['total']); ?></th> |
| 548 |
</tr> |
| 549 |
</thead> |
| 550 |
<tbody> |
| 551 |
<?php if (!$invoice->getItems()) : ?> |
| 552 |
<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> |
| 553 |
<?php endif; ?> |
| 554 |
<?php foreach ($invoice->getItems() as $item): ?> |
| 555 |
<tr> |
| 556 |
<td class="item-name"> |
| 557 |
<div class="item-title"><?php echo esc_html($item->getName()); ?></div> |
| 558 |
<?php if ($item->getDescription()): ?> |
| 559 |
<div class="item-description"><?php echo esc_html($item->getDescription()); ?></div> |
| 560 |
<?php endif; ?> |
| 561 |
</td> |
| 562 |
<td class="item-quantity"><?php echo esc_html($item->getQuantity() ?: '0'); ?></td> |
| 563 |
<td class="item-price"><?php echo esc_html($formatter->format($item->getPrice())); ?></td> |
| 564 |
<?php if ($ei_show_adjust): ?> |
| 565 |
<td class="item-adjust"><?php |
| 566 |
$adjust_percentage = $item->getAdjustPercentage(); |
| 567 |
if ($adjust_percentage != 0) { |
| 568 |
echo esc_html($adjust_percentage > 0 ? '+' : '') . esc_html($adjust_percentage) . '%'; |
| 569 |
} else { |
| 570 |
echo esc_html__('—', 'easy-invoice'); |
| 571 |
} |
| 572 |
?></td> |
| 573 |
<?php endif; ?> |
| 574 |
<td class="item-total"><?php echo esc_html($formatter->format($item->getAmount())); ?></td> |
| 575 |
</tr> |
| 576 |
<?php endforeach; ?> |
| 577 |
</tbody> |
| 578 |
</table> |
| 579 |
|
| 580 |
<div class="invoice-totals"> |
| 581 |
<?php echo wp_kses_post(\EasyInvoice\Helpers\TemplateTextHelper::generateTotalsSection($invoice, $text_settings, $formatter, 'invoice')); ?> |
| 582 |
</div> |
| 583 |
|
| 584 |
<?php if ($invoice->getNotes()): ?> |
| 585 |
<div class="invoice-notes"> |
| 586 |
<h3><?php esc_html_e('Notes', 'easy-invoice'); ?></h3> |
| 587 |
<div class="notes-content"> |
| 588 |
<?php echo wp_kses_post($invoice->getNotes() ?: ''); ?> |
| 589 |
</div> |
| 590 |
</div> |
| 591 |
<?php endif; ?> |
| 592 |
|
| 593 |
<?php |
| 594 |
$terms_conditions = empty($ei_is_credit_note) ? ($invoice->getTerms() ?: \EasyInvoice\Controllers\SettingsController::getInvoiceTermsConditions()) : ''; |
| 595 |
if ($terms_conditions): |
| 596 |
?> |
| 597 |
<div class="invoice-terms"> |
| 598 |
<h3><?php esc_html_e('Terms & Conditions', 'easy-invoice'); ?></h3> |
| 599 |
<div class="terms-content"> |
| 600 |
<?php echo wp_kses_post($terms_conditions); ?> |
| 601 |
</div> |
| 602 |
</div> |
| 603 |
<?php endif; ?> |
| 604 |
|
| 605 |
<?php |
| 606 |
/** |
| 607 |
* Fires inside the document card, after notes and terms and before the |
| 608 |
* footer text: attachments, the signature block, e-invoicing notes. Being |
| 609 |
* inside the card, it is part of what "Download as PDF" captures. |
| 610 |
* |
| 611 |
* @param object $document The invoice model. |
| 612 |
* @param string $type 'invoice'. |
| 613 |
*/ |
| 614 |
do_action('easy_invoice_document_body_after', $invoice, 'invoice'); |
| 615 |
|
| 616 |
$ei_footer_text = \EasyInvoice\Helpers\TemplateTextHelper::footerText($invoice, 'invoice'); |
| 617 |
if ('' !== trim(wp_strip_all_tags((string) $ei_footer_text))) : |
| 618 |
?> |
| 619 |
<div class="invoice-footer"> |
| 620 |
<p><?php echo wp_kses_post($ei_footer_text); ?></p> |
| 621 |
</div> |
| 622 |
<?php endif; ?> |
| 623 |
</div> |
| 624 |
|