Add business Finance hub with invoices and templates.
Ship invoice issue/list/templates under Finance, fix tenant theme reset and owner role badge, and show customers-joined charts by Persian months. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
722933dda9
commit
917b840ee5
@@ -34,3 +34,23 @@ export function isAllowedBusinessHost(hostname = window.location.hostname): bool
|
||||
export function getBusinessDomain(): string {
|
||||
return getBaseBusinessDomain()
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
export function getInvoicePublicUrlFallback(
|
||||
publicId: string,
|
||||
businessDomain = getBusinessDomain(),
|
||||
): string {
|
||||
const baseOverride = import.meta.env.VITE_INVOICE_PUBLIC_BASE_URL?.trim()
|
||||
if (baseOverride) {
|
||||
return `${baseOverride.replace(/\/$/, '')}/invoices/${publicId}`
|
||||
}
|
||||
const domain =
|
||||
import.meta.env.VITE_INVOICE_PUBLIC_DOMAIN?.trim() ||
|
||||
businessDomain.trim() ||
|
||||
'meshkee.com'
|
||||
return `https://${domain}/invoices/${publicId}`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user