pacioli 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +340 -0
- package/config/freelancer.example.json +16 -0
- package/customers/acme-corp.json +7 -0
- package/customers/demo-company.json +7 -0
- package/customers/test-customer.json +7 -0
- package/examples/invoice-auto.json +34 -0
- package/examples/invoice.json +34 -0
- package/examples/quotation-auto.json +34 -0
- package/examples/quotation.json +34 -0
- package/examples/receipt-auto.json +37 -0
- package/examples/receipt.json +37 -0
- package/package.json +58 -0
- package/src/cli.ts +111 -0
- package/src/commands/generate.ts +286 -0
- package/src/commands/init.ts +372 -0
- package/src/generator.ts +275 -0
- package/src/index.ts +250 -0
- package/src/metadata.ts +174 -0
- package/src/utils.ts +110 -0
- package/src/validator.ts +322 -0
- package/templates/invoice.html +389 -0
- package/templates/quotation.html +389 -0
- package/templates/receipt.html +397 -0
package/README.md
ADDED
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
# Pacioli - Professional Financial Documents for Freelancers
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
> Named after **Luca Pacioli** (1494), the father of modern accounting and bookkeeping
|
|
6
|
+
|
|
7
|
+
Generate professional invoices, quotations, and receipts in seconds. Beautiful A4 PDFs with automatic Thai numbering, tax calculations, and customizable templates.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- **Zero configuration** - Start generating documents in 30 seconds with `bunx pacioli init`
|
|
12
|
+
- **Auto-numbering** - Sequential document numbers that reset monthly (INV-202511-001, INV-202511-002, etc.)
|
|
13
|
+
- **Thai tax support** - Automatic withholding tax and VAT calculations
|
|
14
|
+
- **Beautiful templates** - Professional HTML/CSS templates for each document type
|
|
15
|
+
- **Customizable** - Edit templates to match your branding
|
|
16
|
+
- **Customer database** - Reusable customer JSON files, no duplication
|
|
17
|
+
- **Bun-native** - Lightning fast with Bun runtime
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
### Using bunx (No Installation Required)
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# Create a new project directory
|
|
25
|
+
mkdir my-invoices && cd my-invoices
|
|
26
|
+
|
|
27
|
+
# Initialize with templates and examples
|
|
28
|
+
bunx pacioli init
|
|
29
|
+
|
|
30
|
+
# Configure your profile (one-time setup)
|
|
31
|
+
cp config/freelancer.example.json config/freelancer.json
|
|
32
|
+
# Edit config/freelancer.json with your information
|
|
33
|
+
|
|
34
|
+
# Generate your first invoice
|
|
35
|
+
bunx pacioli generate invoice examples/invoice-auto.json --customer customers/acme-corp.json
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
That's it! Your PDF is ready in `output/invoice-INV-202511-001.pdf`
|
|
39
|
+
|
|
40
|
+
### Installation (Optional)
|
|
41
|
+
|
|
42
|
+
If you use this frequently, install globally:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
bun install -g pacioli
|
|
46
|
+
|
|
47
|
+
# Now use without bunx prefix
|
|
48
|
+
pacioli init
|
|
49
|
+
pacioli generate invoice data.json --customer customer.json
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Usage
|
|
53
|
+
|
|
54
|
+
### Initialize New Project
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pacioli init
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Creates:
|
|
61
|
+
- `templates/` - HTML templates (invoice, quotation, receipt)
|
|
62
|
+
- `examples/` - Sample JSON files to get started
|
|
63
|
+
- `customers/` - Customer database directory
|
|
64
|
+
- `config/` - Your freelancer profile
|
|
65
|
+
- `output/` - Generated PDFs
|
|
66
|
+
- `.metadata.json` - Auto-numbering state
|
|
67
|
+
|
|
68
|
+
### Generate Documents
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# Invoice (for billing completed work)
|
|
72
|
+
pacioli generate invoice data/invoice.json --customer customers/acme-corp.json
|
|
73
|
+
|
|
74
|
+
# Quotation (for price estimates before work begins)
|
|
75
|
+
pacioli generate quotation data/quote.json --customer customers/demo-company.json
|
|
76
|
+
|
|
77
|
+
# Receipt (for payment confirmation)
|
|
78
|
+
pacioli generate receipt data/receipt.json --customer customers/test-customer.json
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Auto-Numbering
|
|
82
|
+
|
|
83
|
+
Set `"documentNumber": "auto"` in your JSON file:
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"documentNumber": "auto",
|
|
88
|
+
"issueDate": "2024-11-12",
|
|
89
|
+
...
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Pacioli generates sequential numbers that reset each month:
|
|
94
|
+
- First invoice in Nov 2024: `INV-202411-001`
|
|
95
|
+
- Second invoice: `INV-202411-002`
|
|
96
|
+
- First invoice in Dec 2024: `INV-202412-001` (counter resets)
|
|
97
|
+
|
|
98
|
+
### Customer Database
|
|
99
|
+
|
|
100
|
+
Store customer data separately for reusability:
|
|
101
|
+
|
|
102
|
+
**customers/acme-corp.json:**
|
|
103
|
+
```json
|
|
104
|
+
{
|
|
105
|
+
"name": "นาย ทดสอบ ตัวอย่าง",
|
|
106
|
+
"company": "บริษัท เดโมนิค จำกัด",
|
|
107
|
+
"address": "เลขที่ 456 ถ. สาทร กรุงเทพมหานคร 10120",
|
|
108
|
+
"taxId": "0-1055-12345-67-8",
|
|
109
|
+
"phone": "02-111-2222"
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Use this customer file for all their invoices/receipts - update once, use everywhere.
|
|
114
|
+
|
|
115
|
+
## Document Types
|
|
116
|
+
|
|
117
|
+
### Invoice
|
|
118
|
+
- For billing completed work
|
|
119
|
+
- Includes due date and optional payment terms
|
|
120
|
+
- Tax type: Usually "withholding" (deducted from total)
|
|
121
|
+
|
|
122
|
+
### Quotation
|
|
123
|
+
- For price estimates before work begins
|
|
124
|
+
- Includes validity period
|
|
125
|
+
- Tax type: Usually "vat" (added to total)
|
|
126
|
+
- Optional payment terms for outlining milestones
|
|
127
|
+
|
|
128
|
+
### Receipt
|
|
129
|
+
- For payment confirmation
|
|
130
|
+
- Shows payment date, method, and reference number
|
|
131
|
+
- Optional payment terms for context
|
|
132
|
+
|
|
133
|
+
## Configuration
|
|
134
|
+
|
|
135
|
+
### Freelancer Profile
|
|
136
|
+
|
|
137
|
+
Create `config/freelancer.json`:
|
|
138
|
+
|
|
139
|
+
```json
|
|
140
|
+
{
|
|
141
|
+
"name": "นายสมชาย ใจดี",
|
|
142
|
+
"title": "Full-Stack Developer",
|
|
143
|
+
"email": "somchai@example.com",
|
|
144
|
+
"phone": "081-234-5678",
|
|
145
|
+
"address": "123 ถนนสุขุมวิท กรุงเทพมหานคร 10110",
|
|
146
|
+
"taxId": "1-2345-67890-12-3",
|
|
147
|
+
"bankInfo": {
|
|
148
|
+
"bankName": "ธนาคารกสิกรไทย",
|
|
149
|
+
"accountName": "นายสมชาย ใจดี",
|
|
150
|
+
"accountNumber": "123-4-56789-0",
|
|
151
|
+
"branch": "สาขาสีลม"
|
|
152
|
+
},
|
|
153
|
+
"signature": "config/signature.png"
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Document Data Format
|
|
158
|
+
|
|
159
|
+
**Invoice Example:**
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"documentNumber": "auto",
|
|
163
|
+
"issueDate": "2024-11-12",
|
|
164
|
+
"dueDate": "2024-11-30",
|
|
165
|
+
"items": [
|
|
166
|
+
{
|
|
167
|
+
"description": "Website Development",
|
|
168
|
+
"quantity": 1,
|
|
169
|
+
"unit": "โครงการ",
|
|
170
|
+
"unitPrice": 50000
|
|
171
|
+
}
|
|
172
|
+
],
|
|
173
|
+
"taxType": "withholding",
|
|
174
|
+
"taxRate": 0.03,
|
|
175
|
+
"taxLabel": "หัก ณ ที่จ่าย 3%",
|
|
176
|
+
"paymentTerms": [
|
|
177
|
+
"ชำระเต็มจำนวนภายใน 30 วัน",
|
|
178
|
+
"โอนเงินเข้าบัญชีธนาคาร"
|
|
179
|
+
],
|
|
180
|
+
"notes": "ขอบคุณที่ใช้บริการครับ"
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
See `examples/` directory after running `pacioli init` for complete examples.
|
|
185
|
+
|
|
186
|
+
## Customization
|
|
187
|
+
|
|
188
|
+
### Edit Templates
|
|
189
|
+
|
|
190
|
+
After initialization, templates are copied to your project:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
templates/
|
|
194
|
+
├── invoice.html # Dark blue theme
|
|
195
|
+
├── quotation.html # Purple theme
|
|
196
|
+
└── receipt.html # Green theme
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Edit these HTML files to:
|
|
200
|
+
- Change colors and fonts
|
|
201
|
+
- Add your logo
|
|
202
|
+
- Modify layout
|
|
203
|
+
- Add custom fields
|
|
204
|
+
|
|
205
|
+
Templates use `{{placeholder}}` syntax for data injection.
|
|
206
|
+
|
|
207
|
+
### Tax Calculations
|
|
208
|
+
|
|
209
|
+
**Withholding Tax** (common for freelancers in Thailand):
|
|
210
|
+
```
|
|
211
|
+
Total = Subtotal - (Subtotal × Tax Rate)
|
|
212
|
+
```
|
|
213
|
+
Example: 50,000 - (50,000 × 0.03) = 48,500 THB
|
|
214
|
+
|
|
215
|
+
**VAT** (Value Added Tax):
|
|
216
|
+
```
|
|
217
|
+
Total = Subtotal + (Subtotal × Tax Rate)
|
|
218
|
+
```
|
|
219
|
+
Example: 50,000 + (50,000 × 0.07) = 53,500 THB
|
|
220
|
+
|
|
221
|
+
## Advanced Usage
|
|
222
|
+
|
|
223
|
+
### Custom Output Path
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
pacioli generate invoice data.json --customer customer.json --output custom/path.pdf
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### Alternative Profile
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
pacioli generate invoice data.json --customer customer.json --profile config/freelancer-alt.json
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### Force Overwrite During Init
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
pacioli init --force
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## Optional: Luca AI Assistant
|
|
242
|
+
|
|
243
|
+
This tool also includes **Luca**, an AI assistant for [Claude Code](https://claude.com/claude-code) that generates documents through natural conversation:
|
|
244
|
+
|
|
245
|
+
```
|
|
246
|
+
@luca I need an invoice for the web design project I just finished for ABC Company
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Luca will:
|
|
250
|
+
- Ask you the right questions
|
|
251
|
+
- Create the JSON files
|
|
252
|
+
- Generate the PDF
|
|
253
|
+
- Draft a professional email template
|
|
254
|
+
|
|
255
|
+
Perfect for those who prefer conversation over command-line.
|
|
256
|
+
|
|
257
|
+
## Development
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
# Clone repository
|
|
261
|
+
git clone https://github.com/peerasak-u/pacioli.git
|
|
262
|
+
cd pacioli
|
|
263
|
+
|
|
264
|
+
# Install dependencies
|
|
265
|
+
bun install
|
|
266
|
+
|
|
267
|
+
# Run locally
|
|
268
|
+
bun run src/cli.ts init
|
|
269
|
+
bun run src/cli.ts generate invoice examples/invoice.json --customer customers/acme-corp.json
|
|
270
|
+
|
|
271
|
+
# Link for global testing
|
|
272
|
+
bun link
|
|
273
|
+
pacioli init
|
|
274
|
+
|
|
275
|
+
# Run tests
|
|
276
|
+
bun test
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
## Publishing to npm/Bun
|
|
280
|
+
|
|
281
|
+
```bash
|
|
282
|
+
# Login to npm
|
|
283
|
+
npm login
|
|
284
|
+
|
|
285
|
+
# Publish
|
|
286
|
+
bun publish
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
After publishing, users can run:
|
|
290
|
+
```bash
|
|
291
|
+
bunx pacioli init
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
## Requirements
|
|
295
|
+
|
|
296
|
+
- **Bun** ≥ 1.0.0
|
|
297
|
+
- **Puppeteer** (installed automatically)
|
|
298
|
+
|
|
299
|
+
## Project Structure
|
|
300
|
+
|
|
301
|
+
```
|
|
302
|
+
pacioli/
|
|
303
|
+
├── src/
|
|
304
|
+
│ ├── cli.ts # Main CLI entry point
|
|
305
|
+
│ ├── commands/
|
|
306
|
+
│ │ ├── init.ts # Init command
|
|
307
|
+
│ │ └── generate.ts # Generate command
|
|
308
|
+
│ ├── generator.ts # PDF generation
|
|
309
|
+
│ ├── validator.ts # JSON validation
|
|
310
|
+
│ ├── metadata.ts # Auto-numbering system
|
|
311
|
+
│ └── utils.ts # Helper functions
|
|
312
|
+
├── templates/ # HTML templates
|
|
313
|
+
├── examples/ # Sample JSON files
|
|
314
|
+
├── customers/ # Sample customer database
|
|
315
|
+
├── config/ # Configuration examples
|
|
316
|
+
└── package.json # Package metadata
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
## Why "Pacioli"?
|
|
320
|
+
|
|
321
|
+
Luca Pacioli (1445-1517) was an Italian mathematician and Franciscan friar who published the first comprehensive book on double-entry bookkeeping in 1494. His work, *Summa de arithmetica*, laid the foundation for modern accounting and is still used today. Pacioli's system of debits and credits revolutionized commerce and enabled the Renaissance banking system.
|
|
322
|
+
|
|
323
|
+
This tool honors his legacy by making financial document generation accessible to modern freelancers and small businesses.
|
|
324
|
+
|
|
325
|
+
## License
|
|
326
|
+
|
|
327
|
+
MIT License - see LICENSE file for details
|
|
328
|
+
|
|
329
|
+
## Contributing
|
|
330
|
+
|
|
331
|
+
Contributions welcome! Please open an issue or pull request.
|
|
332
|
+
|
|
333
|
+
## Support
|
|
334
|
+
|
|
335
|
+
- **Issues**: https://github.com/peerasak-u/pacioli/issues
|
|
336
|
+
- **Discussions**: https://github.com/peerasak-u/pacioli/discussions
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
Made with ❤️ for freelancers everywhere
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "นาย สมชาย ดีมี",
|
|
3
|
+
"title": "Web Developer & Designer",
|
|
4
|
+
"email": "somchai@email.com",
|
|
5
|
+
"phone": "08-9999-8888",
|
|
6
|
+
"address": "เลขที่ 123 ซ. เพชรบุรี 45 เขตราชเทวี กรุงเทพมหานคร 10400",
|
|
7
|
+
"taxId": "1-2345-67890-12-3",
|
|
8
|
+
"_comment_signature": "Optional: Path to signature image (PNG/JPG). Leave blank or remove to add signature later with PDF editor",
|
|
9
|
+
"signature": "config/signature.png",
|
|
10
|
+
"_comment_phone": "Optional: Phone number can be omitted if not needed",
|
|
11
|
+
"bankInfo": {
|
|
12
|
+
"bankName": "ธนาคารกรุงเทพ",
|
|
13
|
+
"accountName": "นาย สมชาย ดีมี",
|
|
14
|
+
"accountNumber": "123-456-789-0"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"documentNumber": "auto",
|
|
3
|
+
"issueDate": "2024-10-15",
|
|
4
|
+
"dueDate": "2024-10-30",
|
|
5
|
+
"items": [
|
|
6
|
+
{
|
|
7
|
+
"description": "บริการให้คำปรึกษาเทคโนโลยี",
|
|
8
|
+
"quantity": 15,
|
|
9
|
+
"unit": "ชม.",
|
|
10
|
+
"unitPrice": 750.00
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"description": "ออกแบบ UI/UX สำหรับ 3 หน้าจอ",
|
|
14
|
+
"quantity": 3,
|
|
15
|
+
"unit": "หน้า",
|
|
16
|
+
"unitPrice": 2500.00
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"description": "พัฒนาปลั๊กอิน WordPress",
|
|
20
|
+
"quantity": 1,
|
|
21
|
+
"unit": "โปรเจค",
|
|
22
|
+
"unitPrice": 35000.00
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"taxRate": 0.03,
|
|
26
|
+
"taxType": "withholding",
|
|
27
|
+
"taxLabel": "หักภาษี ณ ที่จ่าย (3%)",
|
|
28
|
+
"paymentTerms": [
|
|
29
|
+
"เริ่มงาน: 30%",
|
|
30
|
+
"จบ Phase 1: 30%",
|
|
31
|
+
"จบงาน: 40%"
|
|
32
|
+
],
|
|
33
|
+
"notes": "ขอบคุณที่ใช้บริการ | หากมีคำถามกรุณาติดต่อ"
|
|
34
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"documentNumber": "INV-2024-001",
|
|
3
|
+
"issueDate": "2024-10-15",
|
|
4
|
+
"dueDate": "2024-10-30",
|
|
5
|
+
"items": [
|
|
6
|
+
{
|
|
7
|
+
"description": "บริการให้คำปรึกษาเทคโนโลยี",
|
|
8
|
+
"quantity": 15,
|
|
9
|
+
"unit": "ชม.",
|
|
10
|
+
"unitPrice": 750.00
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"description": "ออกแบบ UI/UX สำหรับ 3 หน้าจอ",
|
|
14
|
+
"quantity": 3,
|
|
15
|
+
"unit": "หน้า",
|
|
16
|
+
"unitPrice": 2500.00
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"description": "พัฒนาปลั๊กอิน WordPress",
|
|
20
|
+
"quantity": 1,
|
|
21
|
+
"unit": "โปรเจค",
|
|
22
|
+
"unitPrice": 35000.00
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"taxRate": 0.03,
|
|
26
|
+
"taxType": "withholding",
|
|
27
|
+
"taxLabel": "หักภาษี ณ ที่จ่าย (3%)",
|
|
28
|
+
"paymentTerms": [
|
|
29
|
+
"เริ่มงาน: 30%",
|
|
30
|
+
"จบ Phase 1: 30%",
|
|
31
|
+
"จบงาน: 40%"
|
|
32
|
+
],
|
|
33
|
+
"notes": "ขอบคุณที่ใช้บริการ | หากมีคำถามกรุณาติดต่อ"
|
|
34
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"documentNumber": "auto",
|
|
3
|
+
"issueDate": "2024-10-15",
|
|
4
|
+
"validUntil": "2024-11-15",
|
|
5
|
+
"items": [
|
|
6
|
+
{
|
|
7
|
+
"description": "พัฒนาระบบจัดการสต็อกสินค้า",
|
|
8
|
+
"quantity": 1,
|
|
9
|
+
"unit": "ระบบ",
|
|
10
|
+
"unitPrice": 120000.00
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"description": "ฝึกอบรมการใช้งานระบบ",
|
|
14
|
+
"quantity": 2,
|
|
15
|
+
"unit": "วัน",
|
|
16
|
+
"unitPrice": 8000.00
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"description": "บำรุงรักษาระบบ (1 ปี)",
|
|
20
|
+
"quantity": 12,
|
|
21
|
+
"unit": "เดือน",
|
|
22
|
+
"unitPrice": 5000.00
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"taxRate": 0.07,
|
|
26
|
+
"taxType": "vat",
|
|
27
|
+
"taxLabel": "ภาษีมูลค่าเพิ่ม 7%",
|
|
28
|
+
"paymentTerms": [
|
|
29
|
+
"ลงนามสัญญา: 40%",
|
|
30
|
+
"ส่งมอบระบบ: 40%",
|
|
31
|
+
"หลังฝึกอบรม: 20%"
|
|
32
|
+
],
|
|
33
|
+
"notes": "ราคานี้มีผลถึงวันที่ระบุ | เมื่อได้รับการอนุมัติจะเริ่มดำเนินการภายใน 7 วัน"
|
|
34
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"documentNumber": "QT-2024-001",
|
|
3
|
+
"issueDate": "2024-10-15",
|
|
4
|
+
"validUntil": "2024-11-15",
|
|
5
|
+
"items": [
|
|
6
|
+
{
|
|
7
|
+
"description": "พัฒนาระบบจัดการสต็อกสินค้า",
|
|
8
|
+
"quantity": 1,
|
|
9
|
+
"unit": "ระบบ",
|
|
10
|
+
"unitPrice": 120000.00
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"description": "ฝึกอบรมการใช้งานระบบ",
|
|
14
|
+
"quantity": 2,
|
|
15
|
+
"unit": "วัน",
|
|
16
|
+
"unitPrice": 8000.00
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"description": "บำรุงรักษาระบบ (1 ปี)",
|
|
20
|
+
"quantity": 12,
|
|
21
|
+
"unit": "เดือน",
|
|
22
|
+
"unitPrice": 5000.00
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"taxRate": 0.07,
|
|
26
|
+
"taxType": "vat",
|
|
27
|
+
"taxLabel": "ภาษีมูลค่าเพิ่ม 7%",
|
|
28
|
+
"paymentTerms": [
|
|
29
|
+
"ลงนามสัญญา: 40%",
|
|
30
|
+
"ส่งมอบระบบ: 40%",
|
|
31
|
+
"หลังฝึกอบรม: 20%"
|
|
32
|
+
],
|
|
33
|
+
"notes": "ราคานี้มีผลถึงวันที่ระบุ | เมื่อได้รับการอนุมัติจะเริ่มดำเนินการภายใน 7 วัน"
|
|
34
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"documentNumber": "auto",
|
|
3
|
+
"issueDate": "2024-10-15",
|
|
4
|
+
"paymentDate": "2024-10-15",
|
|
5
|
+
"paymentMethod": "โอนเงิน",
|
|
6
|
+
"referenceNumber": "INV-2024-001",
|
|
7
|
+
"items": [
|
|
8
|
+
{
|
|
9
|
+
"description": "บริการให้คำปรึกษาเทคโนโลยี",
|
|
10
|
+
"quantity": 15,
|
|
11
|
+
"unit": "ชม.",
|
|
12
|
+
"unitPrice": 750.00
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"description": "ออกแบบ UI/UX สำหรับ 3 หน้าจอ",
|
|
16
|
+
"quantity": 3,
|
|
17
|
+
"unit": "หน้า",
|
|
18
|
+
"unitPrice": 2500.00
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"description": "พัฒนาปลั๊กอิน WordPress",
|
|
22
|
+
"quantity": 1,
|
|
23
|
+
"unit": "โปรเจค",
|
|
24
|
+
"unitPrice": 35000.00
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"taxRate": 0.03,
|
|
28
|
+
"taxType": "withholding",
|
|
29
|
+
"taxLabel": "หักภาษี ณ ที่จ่าย (3%)",
|
|
30
|
+
"paidAmount": 52137.50,
|
|
31
|
+
"paymentTerms": [
|
|
32
|
+
"งวดที่ 1 (เริ่มงาน): 30% - ชำระแล้ว",
|
|
33
|
+
"งวดที่ 2 (ส่งมอบ UI): 30% - ชำระแล้ว",
|
|
34
|
+
"งวดที่ 3 (ส่งมอบงาน): 40% - นี่คือใบเสร็จสำหรับงวดนี้"
|
|
35
|
+
],
|
|
36
|
+
"notes": "ได้รับเงินเรียบร้อยแล้ว ขอบคุณที่ใช้บริการ"
|
|
37
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"documentNumber": "REC-2024-001",
|
|
3
|
+
"issueDate": "2024-10-15",
|
|
4
|
+
"paymentDate": "2024-10-15",
|
|
5
|
+
"paymentMethod": "โอนเงิน",
|
|
6
|
+
"referenceNumber": "INV-2024-001",
|
|
7
|
+
"items": [
|
|
8
|
+
{
|
|
9
|
+
"description": "บริการให้คำปรึกษาเทคโนโลยี",
|
|
10
|
+
"quantity": 15,
|
|
11
|
+
"unit": "ชม.",
|
|
12
|
+
"unitPrice": 750.00
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"description": "ออกแบบ UI/UX สำหรับ 3 หน้าจอ",
|
|
16
|
+
"quantity": 3,
|
|
17
|
+
"unit": "หน้า",
|
|
18
|
+
"unitPrice": 2500.00
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"description": "พัฒนาปลั๊กอิน WordPress",
|
|
22
|
+
"quantity": 1,
|
|
23
|
+
"unit": "โปรเจค",
|
|
24
|
+
"unitPrice": 35000.00
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"taxRate": 0.03,
|
|
28
|
+
"taxType": "withholding",
|
|
29
|
+
"taxLabel": "หักภาษี ณ ที่จ่าย (3%)",
|
|
30
|
+
"paidAmount": 52137.50,
|
|
31
|
+
"paymentTerms": [
|
|
32
|
+
"งวดที่ 1 (เริ่มงาน): 30% - ชำระแล้ว",
|
|
33
|
+
"งวดที่ 2 (ส่งมอบ UI): 30% - ชำระแล้ว",
|
|
34
|
+
"งวดที่ 3 (ส่งมอบงาน): 40% - นี่คือใบเสร็จสำหรับงวดนี้"
|
|
35
|
+
],
|
|
36
|
+
"notes": "ได้รับเงินเรียบร้อยแล้ว ขอบคุณที่ใช้บริการ"
|
|
37
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pacioli",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "CLI tool for generating professional financial documents (invoices, quotations, receipts) for freelancers. Named after Luca Pacioli, father of accounting.",
|
|
5
|
+
"author": "Peerasak Unsakon <clonezer@gmail.com>",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"invoice",
|
|
9
|
+
"quotation",
|
|
10
|
+
"receipt",
|
|
11
|
+
"pdf",
|
|
12
|
+
"freelance",
|
|
13
|
+
"accounting",
|
|
14
|
+
"financial-documents",
|
|
15
|
+
"cli",
|
|
16
|
+
"bun"
|
|
17
|
+
],
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "https://github.com/peerasak-u/luca.git"
|
|
21
|
+
},
|
|
22
|
+
"homepage": "https://github.com/peerasak-u/luca#readme",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/peerasak-u/luca/issues"
|
|
25
|
+
},
|
|
26
|
+
"bin": {
|
|
27
|
+
"pacioli": "./src/cli.ts"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"src",
|
|
31
|
+
"templates",
|
|
32
|
+
"examples",
|
|
33
|
+
"customers",
|
|
34
|
+
"config",
|
|
35
|
+
"README.md",
|
|
36
|
+
"LICENSE"
|
|
37
|
+
],
|
|
38
|
+
"module": "src/cli.ts",
|
|
39
|
+
"type": "module",
|
|
40
|
+
"engines": {
|
|
41
|
+
"bun": ">=1.0.0"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"dev": "bun run src/cli.ts",
|
|
45
|
+
"generate": "bun run src/index.ts",
|
|
46
|
+
"test": "bun test",
|
|
47
|
+
"test:watch": "bun test --watch"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"puppeteer": "^22.0.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@types/bun": "latest"
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"typescript": "^5"
|
|
57
|
+
}
|
|
58
|
+
}
|