Polish public invoice layout: account grid, duration, and copy-to-clipboard.
Also preserve item description line breaks and use local ported invoice links in DEV. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
f21041b950
commit
2be3b3376d
@@ -39,6 +39,7 @@ export function getBusinessDomain(): string {
|
||||
* Fallback public invoice URL if the API response is missing `publicUrl`.
|
||||
* Prefer `invoice.publicUrl` returned by the API — this only covers edge cases.
|
||||
* Business invoices use the tenant domain (e.g. sanihome.ir), not meshkee.com.
|
||||
* Local/dev: public viewer lives on super-admin (`https://meshkee.app:5174`).
|
||||
*/
|
||||
export function getInvoicePublicUrlFallback(
|
||||
publicId: string,
|
||||
@@ -48,6 +49,13 @@ export function getInvoicePublicUrlFallback(
|
||||
if (baseOverride) {
|
||||
return `${baseOverride.replace(/\/$/, '')}/invoices/${publicId}`
|
||||
}
|
||||
if (import.meta.env.DEV) {
|
||||
const protocol = window.location.protocol === 'http:' ? 'http:' : 'https:'
|
||||
const host =
|
||||
import.meta.env.VITE_INVOICE_PUBLIC_DEV_HOST?.trim() || 'meshkee.app'
|
||||
const port = import.meta.env.VITE_INVOICE_PUBLIC_DEV_PORT?.trim() || '5174'
|
||||
return `${protocol}//${host}:${port}/invoices/${publicId}`
|
||||
}
|
||||
const domain =
|
||||
import.meta.env.VITE_INVOICE_PUBLIC_DOMAIN?.trim() ||
|
||||
businessDomain.trim() ||
|
||||
|
||||
Reference in New Issue
Block a user