Skip to content

feat: 報價單功能改善 + 註冊流程優化#2

Merged
zhenheco merged 3 commits intomainfrom
feature/quotation-enhancements
Dec 11, 2025
Merged

feat: 報價單功能改善 + 註冊流程優化#2
zhenheco merged 3 commits intomainfrom
feature/quotation-enhancements

Conversation

@zhenheco
Copy link
Copy Markdown
Owner

Summary

  • 報價單新增四項功能:稅金開關、整體折扣、自訂品項、附件照片上傳
  • 修正註冊流程:偵測已存在帳號並顯示適當提示

Changes

報價單功能

  • 稅金可選擇性顯示(show_tax 欄位)
  • 整體優惠折抵(稅前折扣)
  • 自訂品項輸入(不需選擇既有產品)
  • 報價單附件照片上傳

註冊流程

  • 偵測已存在的 email(透過 identities.length === 0
  • 顯示通用錯誤訊息引導用戶登入或使用忘記密碼

Database Migration

  • 已執行 migrations/041_quotation_enhancements.sql
  • 已建立 quotation-images Storage bucket

Test plan

  • 報價單稅金開關功能測試
  • 整體折扣計算測試
  • 自訂品項輸入測試
  • 圖片上傳 API 測試
  • 註冊重複 email 偵測測試

🤖 Generated with Claude Code

zhenheco and others added 3 commits December 11, 2025 22:32
根據客戶反饋實作四項功能改善:

1. 稅金可選擇性顯示
   - 新增 show_tax 欄位,用戶可選擇是否在 PDF 顯示稅金

2. 整體優惠折抵(稅前折扣)
   - 新增 discount_amount 和 discount_description 欄位
   - 計算邏輯:小計 → 折扣 → 折後小計 → 計稅 → 總計

3. 自訂品項輸入
   - 品項可手動輸入名稱和價格,不需選擇既有產品
   - UI 切換「選擇產品」和「自訂品項」模式

4. 報價單附件照片
   - 新增 quotation_images 資料表
   - 支援多張照片上傳(JPG/PNG,最大 5MB)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
當用戶嘗試用 email 註冊,但該 email 已透過 Google OAuth 註冊過時,
Supabase 會回傳空的 identities 陣列。現在會偵測此情況並顯示適當提示,
引導用戶使用登入或「忘記密碼」功能。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
將「可能透過 Google 登入」改為通用訊息,因為無法確定用戶原本的註冊方式。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@zhenheco zhenheco merged commit 0589ba0 into main Dec 11, 2025
2 of 3 checks passed
@zhenheco zhenheco deleted the feature/quotation-enhancements branch December 11, 2025 15:07
zhenheco added a commit that referenced this pull request Mar 7, 2026
* feat: 報價單功能改善 - 稅金開關、整體折扣、自訂品項、附件照片

根據客戶反饋實作四項功能改善:

1. 稅金可選擇性顯示
   - 新增 show_tax 欄位,用戶可選擇是否在 PDF 顯示稅金

2. 整體優惠折抵(稅前折扣)
   - 新增 discount_amount 和 discount_description 欄位
   - 計算邏輯:小計 → 折扣 → 折後小計 → 計稅 → 總計

3. 自訂品項輸入
   - 品項可手動輸入名稱和價格,不需選擇既有產品
   - UI 切換「選擇產品」和「自訂品項」模式

4. 報價單附件照片
   - 新增 quotation_images 資料表
   - 支援多張照片上傳(JPG/PNG,最大 5MB)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: 偵測已存在帳號並提示使用登入或忘記密碼

當用戶嘗試用 email 註冊,但該 email 已透過 Google OAuth 註冊過時,
Supabase 會回傳空的 identities 陣列。現在會偵測此情況並顯示適當提示,
引導用戶使用登入或「忘記密碼」功能。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: 修正註冊錯誤訊息,移除對 Google 的特定提及

將「可能透過 Google 登入」改為通用訊息,因為無法確定用戶原本的註冊方式。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: zhenheco <ace@zhenhe-co.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant