https://github.com/exposedcat/clickup-invoice-generator
ClickUp PDF Invoice Generator
https://github.com/exposedcat/clickup-invoice-generator
clickup-api invoice-generator invoice-pdf invoices
Last synced: 11 months ago
JSON representation
ClickUp PDF Invoice Generator
- Host: GitHub
- URL: https://github.com/exposedcat/clickup-invoice-generator
- Owner: ExposedCat
- Created: 2024-07-08T21:01:25.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-02T13:36:25.000Z (over 1 year ago)
- Last Synced: 2025-08-09T03:23:16.149Z (11 months ago)
- Topics: clickup-api, invoice-generator, invoice-pdf, invoices
- Language: TypeScript
- Homepage:
- Size: 249 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## ClickUp Invoice Generator
#### Installation
```bash
npm install clickup-invoice-generator
```
### Working Example
See `example.ts` for fully functional example.
Copy `.env.example` to `.env` and run generator using
```bash
npm start
```
### Quick Start
#### Create PDF instance
```typescript
import { PDF } from 'clickup-invoice-generator';
const pdf = await new PDF().init();
```
#### Render details
```typescript
import { renderTopBar, renderHeaders, renderCredentials } from 'clickup-invoice-generator';
renderTopBar({ pdf, invoiceId });
renderHeaders({
pdf,
from: {
name: 'Jane Doe',
address: '123 Main Street',
country: 'Czech Republic',
postalCode: '123',
ICO: '123',
DIC: '123',
},
to: {
name: 'John Doe',
address: '123 Main Street',
country: 'United States',
postalCode: '123',
},
});
renderCredentials({
pdf,
credentials: {
bankName: 'Revolut',
iban: 'LT123123123',
bic: '123123',
variable: '123', // Invoice ID
},
});
```
#### Fetch tasks
```typescript
import { fetchTasks } from 'clickup-invoice-generator';
const tasks = await fetchTasks({
clickUp: {
privateKey: 'xxx',
teamId: 'xxx',
userId: 'xxx',
},
period: 'this', // 'last' for previous month
});
```
#### Render tasks and total
```typescript
import { renderTasks, renderTotal } from 'clickup-invoice-generator';
const total = renderTasks({
pdf,
tasks,
salary: {
currency: '$',
perHour: 40,
},
});
renderTotal({
promo: true, // Please use `renderPromo({ pdf })` elsewhere if you set `false` here
pdf,
total,
currency: '$',
});
```
#### Save PDF
```typescript
await pdf.save('invoice.pdf');
```
### UI
- TBD; only TS script available currently
### TODO
- Remove `dotenv`