|
212 | 212 | --secondaryColor: {config.colors.secondary};" |
213 | 213 | > |
214 | 214 | <div class="dates"> |
215 | | - <p>Issued on: {formatDate(request?.contentData?.creationDate)}</p> |
216 | | - <p>Due by: {formatDate(request?.contentData?.paymentTerms?.dueDate)}</p> |
| 215 | + <p>Issued on: {formatDate(request?.contentData?.creationDate || "-")}</p> |
| 216 | + <p> |
| 217 | + Due by: {formatDate(request?.contentData?.paymentTerms?.dueDate || "-")} |
| 218 | + </p> |
217 | 219 | </div> |
218 | 220 | <h2 class="invoice-number"> |
219 | | - Invoice #{request?.contentData?.invoiceNumber} |
| 221 | + Invoice #{request?.contentData?.invoiceNumber || "-"} |
220 | 222 | <p class={`invoice-status ${isPaid ? "bg-green" : "bg-zinc"}`}> |
221 | 223 | {isPaid ? "Paid" : "Created"} |
222 | 224 | </p> |
223 | 225 | </h2> |
224 | 226 | <div class="invoice-address"> |
225 | 227 | <h2>From:</h2> |
226 | | - <p>{request?.payee?.value}</p> |
| 228 | + <p>{request?.payee?.value || "-"}</p> |
227 | 229 | </div> |
228 | 230 | {#if sellerInfo.length > 0} |
229 | 231 | <div class={`invoice-info bg-zinc-light`}> |
230 | 232 | {#each sellerInfo as { label, value }} |
231 | 233 | <p> |
232 | | - <span>{label}:</span> |
233 | | - {value} |
| 234 | + <span>{label || "-"}:</span> |
| 235 | + {value || "-"} |
234 | 236 | </p> |
235 | 237 | {/each} |
236 | 238 | </div> |
237 | 239 | {/if} |
238 | 240 | <div class="invoice-border"></div> |
239 | 241 | <div class="invoice-address"> |
240 | 242 | <h2>Billed to:</h2> |
241 | | - <p>{request?.payer?.value}</p> |
| 243 | + <p>{request?.payer?.value || "-"}</p> |
242 | 244 | </div> |
243 | 245 | {#if buyerInfo.length > 0} |
244 | 246 | <div class={`invoice-info bg-zinc-light`}> |
245 | 247 | {#each buyerInfo as { label, value }} |
246 | 248 | <p> |
247 | | - <span>{label}:</span> |
248 | | - {value} |
| 249 | + <span>{label || "-"}:</span> |
| 250 | + {value || "-"} |
249 | 251 | </p> |
250 | 252 | {/each} |
251 | 253 | </div> |
252 | 254 | {/if} |
253 | 255 |
|
254 | 256 | <h3 class="invoice-info-payment"> |
255 | 257 | <span style="font-weight: 500;">Payment Chain:</span> |
256 | | - {currency?.network} |
| 258 | + {currency?.network || "-"} |
257 | 259 | </h3> |
258 | 260 | <h3 class="invoice-info-payment"> |
259 | 261 | <span style="font-weight: 500;">Invoice Currency:</span> |
260 | | - {currency?.symbol} |
| 262 | + {currency?.symbol || "-"} |
261 | 263 | </h3> |
262 | 264 |
|
263 | 265 | {#if request?.contentData?.invoiceItems} |
|
279 | 281 | {#each firstItems as item, index (index)} |
280 | 282 | <tr class="table-row item-row"> |
281 | 283 | <th scope="row" class="item-description"> |
282 | | - <p class="truncate description-text">{item.name}</p> |
| 284 | + <p class="truncate description-text">{item.name || "-"}</p> |
283 | 285 | </th> |
284 | | - <td>{item.quantity}</td> |
285 | | - <td>{formatUnits(item.unitPrice, currency?.decimals ?? 18)}</td> |
286 | | - <td>{formatUnits(item.discount, currency?.decimals ?? 18)}</td> |
287 | | - <td>{Number(item.tax.amount)}</td> |
| 286 | + <td>{item.quantity || "-"}</td> |
| 287 | + <td |
| 288 | + >{item.unitPrice |
| 289 | + ? formatUnits(item.unitPrice, currency?.decimals ?? 18) |
| 290 | + : "-"}</td |
| 291 | + > |
| 292 | + <td |
| 293 | + >{item.discount |
| 294 | + ? formatUnits(item.discount, currency?.decimals ?? 18) |
| 295 | + : "-"}</td |
| 296 | + > |
| 297 | + <td>{Number(item.tax.amount || "-")}</td> |
288 | 298 | <td |
289 | 299 | >{truncateNumberString( |
290 | 300 | formatUnits( |
|
319 | 329 | <tr class="table-row item-row"> |
320 | 330 | <th scope="row" class="item-description"> |
321 | 331 | <p class="truncate description-text" style="margin: 4px 0;"> |
322 | | - {item.name} |
| 332 | + {item.name || "-"} |
323 | 333 | </p> |
324 | 334 | </th> |
325 | | - <td>{item.quantity}</td> |
| 335 | + <td>{item.quantity || "-"}</td> |
326 | 336 | <td |
327 | | - >{formatUnits(item.unitPrice, currency?.decimals ?? 18)}</td |
| 337 | + >{item.unitPrice |
| 338 | + ? formatUnits(item.unitPrice, currency?.decimals ?? 18) |
| 339 | + : "-"}</td |
328 | 340 | > |
329 | | - <td>{formatUnits(item.discount, currency?.decimals ?? 18)}</td |
| 341 | + <td |
| 342 | + >{item.discount |
| 343 | + ? formatUnits(item.discount, currency?.decimals ?? 18) |
| 344 | + : "-"}</td |
330 | 345 | > |
331 | | - <td>{Number(item.tax.amount)}</td> |
| 346 | + <td>{Number(item.tax.amount || "-")}</td> |
332 | 347 | <td |
333 | 348 | >{truncateNumberString( |
334 | 349 | formatUnits( |
|
351 | 366 | <div class="note-container"> |
352 | 367 | <p class="note-content"> |
353 | 368 | <span class="note-title">Memo:</span> <br /> |
354 | | - {request.contentData.note} |
| 369 | + {request.contentData.note || "-"} |
355 | 370 | </p> |
356 | 371 | </div> |
357 | 372 | {/if} |
358 | 373 | <div class="labels-container"> |
359 | 374 | {#if request?.contentData?.miscellaneous?.labels} |
360 | 375 | {#each request?.contentData?.miscellaneous?.labels as label, index (index)} |
361 | 376 | <div class="label"> |
362 | | - {label} |
| 377 | + {label || "-"} |
363 | 378 | </div> |
364 | 379 | {/each} |
365 | 380 | {/if} |
|
369 | 384 | {#if statuses.length > 0 && loading} |
370 | 385 | {#each statuses as status, index (index)} |
371 | 386 | <div class="status"> |
372 | | - {status} |
| 387 | + {status || "-"} |
373 | 388 | {#if (index === 0 && statuses.length === 2) || (index === 1 && statuses.length === 3)} |
374 | 389 | <i> |
375 | 390 | <Check /> |
|
0 commit comments