Invoice automation for Japanese-style billing — on nothing but Google Workspace. Accepts invoice requests through a multilingual form, auto-generates PDF invoices (Qualified Invoice System and 源泉 withholding aware), and runs the approve/reject notification flow. No server, no SaaS, no database — one MIT-licensed Apps Script project. seikyusho(請求書)is Japanese for "invoice."
A fully automated invoice issuance system for accepting requests from contractors, freelancers, or any external party.
- Applicants simply fill out a multilingual form (Japanese / English / Traditional Chinese / Spanish)
- Administrators receive an email, then click "Approve" or "Reject" on the sheet
- PDF generation, numbering, tax calculation, email notifications, and Drive archiving are all automatic
Built entirely on Google Workspace — no external services, servers, or databases required.
- 🌐 Multilingual form (Japanese / English / Traditional Chinese / Spanish, switchable via URL param)
- 📄 3 PDF templates auto-selected (overseas resident / Japan w/o withholding / Japan with withholding)
- 🔢 Monthly sequential invoice numbering (e.g.,
202605-001) - 💴 Multi-currency (JPY / TWD / USD / EUR, extensible)
- 🧮 Automatic tax calculation (10% consumption tax, 10.21% / 20.42% withholding tax with 1M JPY threshold)
- 📧 3 types of automated emails:
- On submission → admin receives notification with PDF attached
- On approval → applicant receives approval notice (PDF attached, admin CC'd)
- On rejection → applicant receives rejection notice (admin CC'd)
- ✏️ Email content editable from sheet ({{INVOICE_NO}} / {{APPLICANT_NAME}} placeholders supported)
- 🧾 Japanese Qualified Invoice System (Invoice Seido) support (toggle registration number display)
- 🔁 Withholding tax can be added post-submission (changing the sheet auto-regenerates the PDF)
- 📂 PDFs auto-saved to a Drive folder (easy bulk sharing with accountants)
| File | Purpose |
|---|---|
appsscript.json |
Apps Script manifest (permissions, timezone) |
Setup.gs |
Initial setup, migrations, usage sheet generation |
Code.gs |
Form handler, PDF generation, mail sender, triggers |
index.html |
Applicant-facing web form |
style.html |
Form CSS (responsive) |
script.html |
Form JavaScript |
i18n.html |
Translation dictionary (日本語 / English / 繁體中文 / Español) |
- Google account (personal or Workspace)
- A browser (for the admin who sets it up)
- At least one email address to receive notifications
Three ways to deploy. The easiest is to copy. Prefer to install from the GitHub source — e.g. company policy or you'd rather not copy a third party's Sheet? Use the manual or clasp path instead. Either way, your data, PDFs and emails stay entirely inside your account.
🚀 Option A: Make a copy of the Google Sheet (easiest, ~1 min)
- Open Make a copy of the Google Sheet and click "Make a copy" — the whole system lands in your own Drive.
- Open your copy, then run the menu "請求書 → 🚀 初期セットアップ(最初に1回)" → authorize (Drive / Sheet / Mail / Trigger).
- Fill company info + notification email in the 設定 (Settings) sheet.
- Deploy → New deployment → Web app (Execute as: me / Access: anyone) → paste the
/execURL intoform_urlin Settings, then re-runpopulateUsageSheet. - Share the form URL with applicants.
🔒 The copied code is the same MIT-licensed code as on GitHub — no third-party server is involved.
📦 Option B: Manual copy/paste from the GitHub source (~20 min)
- Open Google Apps Script
- Click "New project"
- Rename it (e.g., "Invoice System")
Copy each file from this repo into the Apps Script editor (1:1):
| Local | Apps Script |
|---|---|
appsscript.json |
appsscript.json (enable "Show appsscript.json" in settings) |
Setup.gs |
New file "Setup" |
Code.gs |
Overwrite the default Code.gs |
index.html |
New HTML file "index" |
style.html |
New HTML file "style" |
script.html |
New HTML file "script" |
i18n.html |
New HTML file "i18n" |
💡 Recommended: Select
setupfrom the function dropdown → Run. It runs everything in this step (create sheet, wire triggers, generate the usage sheet) in the right order, idempotently. Grant permissions on first run (Drive / Sheet / Mail / Trigger scopes), then skip to Step 4.
Only if you prefer to run them individually:
runSetup— a spreadsheet is auto-created andSPREADSHEET_IDis saved to script propertiesinstallSheetMenuTrigger— enables the custom menuinstallStatusEditTrigger— wires approval/rejection/withholding-change auto-handlerspopulateUsageSheet— generates the "Usage" sheet
Open the spreadsheet, navigate to the 設定 (Settings) tab, and fill in fields (see Configuration).
notification_email (admin's address) is required.
- In Apps Script: Deploy → New deployment
- Type: Web app
- Settings:
- Execute as: Me
- Who has access: Anyone
- Copy the web app URL (ends in
/exec)
Set form_url to the URL from Step 5.
Run populateUsageSheet again — the URL will now appear in the guide.
Done 🎉
⚡ Option C: Push via clasp from the GitHub source (~5 min)
# Install clasp once
npm install -g @google/clasp
clasp login
# Clone & push
git clone https://github.com/CVERInc/seikyusho.git
cd seikyusho
clasp create --type standalone --title "Invoice System"
clasp push -f
# Then run setup() once in Apps Script, fill Settings, deploy as web appEdit these in the 設定 (Settings) sheet:
| key | Required | Description |
|---|---|---|
company_name_ja-JP |
✅ | Recipient name (Japanese) |
company_name_en-US |
Recipient name (English) | |
company_name_zh-TW |
Recipient name (Traditional Chinese / Taiwan) | |
company_name_es-ES |
Recipient name (Spanish) | |
company_address |
✅ | Registered address |
corporate_number |
Corporate number (13 digits, only if shown) | |
representative |
Representative name | |
notification_email |
✅ | Admin's notification email |
form_url |
Deployed web app URL (after deployment) | |
qualified_invoice_number |
Qualified invoice issuer number (T + 13 digits) | |
show_corporate_number |
Show corporate number on PDF (yes/no, default no) | |
email_subject_approved |
Subject for approval mail | |
email_body_approved |
Body for approval mail | |
email_subject_rejected |
Subject for rejection mail | |
email_body_rejected |
Body for rejection mail | |
consumption_tax_rate |
Consumption tax rate (default 0.10) | |
withholding_tax_rate |
Withholding tax rate (default 0.1021) | |
withholding_threshold |
Withholding tax threshold (default 1,000,000 JPY) | |
withholding_tax_rate_over |
Withholding rate above threshold (default 0.2042) | |
pdf_folder_id |
Drive folder ID for PDFs (auto-created) |
flowchart TD
A[Applicant submits the form] --> B[Logged on the sheet<br/>status: pending]
B --> C[Invoice number assigned]
C --> D[PDF auto-generated<br/>template picked by residency / withholding]
D --> E[Admin notified by email<br/>PDF attached]
E --> F{Admin decides}
F -->|approved| G[Approval mail to applicant<br/>PDF attached, admin CC'd]
F -->|rejected| H[Rejection mail to applicant<br/>admin CC'd]
F -->|withholding changed| I[PDF regenerated<br/>same number, old PDF trashed]
I --> F
In short: Applicant submits → Sheet logs as pending → PDF generated → Admin notified → Admin sets approved or rejected on sheet → Applicant gets corresponding email automatically.
Q1. Will I hit Apps Script quotas?
For typical usage (tens to hundreds per month), no. Workspace accounts allow 1,500 emails/day and Drive ops are effectively unlimited.
Q2. How do I change the PDF template layout?
Edit the TPL_海外 / TPL_源泉あり / TPL_源泉なし sheets directly.
Header positions (品名/数量/単価/金額/小計) are auto-detected, so you can move them freely.
Keep the {{APPLICANT_NAME}}, {{INVOICE_NO}}, etc. placeholders intact.
Q3. How do I customize email text?
Edit email_subject_approved / email_body_approved / email_subject_rejected / email_body_rejected in the Settings sheet. Changes apply immediately.
Use Cmd/Ctrl+Enter to insert line breaks within a cell.
Q4. Does it support the Japanese Qualified Invoice System (Invoice Seido)?
Yes. Fill qualified_invoice_number (T + 13 digits) and your PDF will show "登録番号: T..." at the bottom.
If you're not registered, leave show_corporate_number as no (the default) — no misleading numbers will appear.
Q5. How do I clean up test data?
In the spreadsheet menu: 請求書 → ❌ 全テストデータ削除. Submissions, counter, and Drive PDFs are cleared in one shot (with confirmation).
Issues and PRs welcome. See CONTRIBUTING.md for the full guide.
- 🐛 Bug reports → include reproduction steps
- 💡 Feature requests → Discussions or Issues
- 🌐 Translations → Adding a new language guide (8 steps)
- 💴 New currency → Adding a new currency guide
Built with ❤️ on Google Apps Script