export type GetApiReportsPettyCashesPcrPcrUidArgs = {pcr_uid: number}; export type GetApiReportsPettyCashesPcrPcrUidOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * View petty cash transactions report by counter * * GET /reports/petty_cashes/pcr/{pcr_uid} */ export const getApiReportsPettyCashesPcrPcrUid = async (args: GetApiReportsPettyCashesPcrPcrUidArgs, options?: GetApiReportsPettyCashesPcrPcrUidOptions) => { const {baseUrl = "http://api.gostarmartbus.com/api", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/reports/petty_cashes/pcr/${encodeURIComponent(String(args.pcr_uid))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };