Add page for calculating paypal invoice taxes

This commit is contained in:
2025-07-30 18:53:10 +02:00
parent 186513a724
commit 25b0fe1c05
10 changed files with 577 additions and 136 deletions

View File

@@ -0,0 +1,29 @@
import { countries } from "country-data-list"
import { check_response, get_endpoint } from "./PixeldrainAPI"
export const country_name = (country: string) => {
if (country !== "" && countries[country] !== undefined) {
return countries[country].emoji + " " + country + " (" + countries[country].name + ")"
}
return "🌐 Other"
}
export type Invoice = {
id: string
time: string
amount: number
vat: number
processing_fee: number
country: string
payment_gateway: string
payment_method: string
status: string
}
export const get_admin_invoices = async (year: number, month: number) => {
return await check_response(
await fetch(
get_endpoint() + "/admin/invoices/" + year + "-" + ("00" + (month)).slice(-2)
)
) as Invoice[]
};