Files
ds_quickbooks/nohup.out
T

1477 lines
98 KiB
Plaintext

INFO: 102.88.104.195:1167 - "POST /upload-multiple HTTP/1.1" 200 OK
INFO:__main__:Request: file_id=None user_location=None ai_rules=[AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "mkd"', action='SET_CATEGORY: technology'), AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "Maple"', action='SET_CATEGORY: Supercar')]
INFO:services.document_processor:This is the prompt:
Analyze this receipt image and extract the following information in JSON format.
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "mkd": Set category to "technology"
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "Maple": Set category to "Supercar"
JSON Format:
{
"vendor": "Store/company name",
"description": "Detailed description of items/services purchased",
"total_amount": 0.00,
"tax_amount": 0.00,
"date": "YYYY-MM-DD",
"category": "Check rules above first",
"confidence": 0.95,
"currency": "USD",
"location": "Province/State, Country",
"calculated_tax": 0.00,
"is_depreciable": false,
"name_of_asset": null,
"cca_rate": null,
"useful_life": null,
"residual_value": null,
"extraction_success": True
}
EXTRACTION Rules:
- Extract vendor name as it appears on receipt
- Extract description of items/services purchased (e.g., "Coffee and sandwich", "Gasoline", "Office supplies")
- Total amount should be the final total including tax
- Tax amount is separate tax line if available (if not clearly shown, calculate based on location)
- Date should be the date on the receipt
- Confidence score 0-1 based on how clear the receipt is
- Currency should be the currency used on the receipt (e.g., "USD", "EUR", "CAD")
LOCATION & TAX RULES:
- Extract location from receipt (look for store address, province/state, country)
- Format location as "Province/State, Country" (e.g., "Ontario, Canada" or "California, USA")
- If location not shown on receipt, return null for location (system will use user location as fallback)
TAX EXTRACTION RULES (IMPORTANT):
- If tax is EXPLICITLY shown on receipt (even if $0 or 0%), use that exact value:
* If receipt shows "Tax: $0", "Tax: $0.00", "Tax (0%)", or similar → set tax_amount to 0.00 and calculated_tax to null
* If receipt shows any other tax amount → set tax_amount to that value and calculated_tax to null
- If tax_amount is NOT shown or UNCLEAR on receipt, calculate it based on location:
* Ontario, Canada: 13% HST
* Quebec, Canada: 9.975% QST + 5% GST = 14.975% total
* British Columbia, Canada: 12% (5% GST + 7% PST)
* Alberta, Canada: 5% GST
* California, USA: ~7.25% (varies by locality)
* New York, USA: ~8.875% (varies by locality)
* Texas, USA: 6.25%
* For other locations, estimate based on typical rates
* Store calculated tax in "calculated_tax" field and set tax_amount to the calculated value
DEPRECIATION RULES:
- Determine if item is a depreciable asset (vehicles, machinery, equipment, computers, furniture, buildings)
- Set is_depreciable to true only for capital assets, false for consumables/services
- If is_depreciable is true, provide:
* name_of_asset: Specific name/model of the asset (e.g., "2024 Honda Accord", "Dell Laptop XPS 15", "Office Desk")
* cca_rate: CCA rate as decimal (e.g., 0.30 for 30%, 0.20 for 20%, 0.04 for 4%)
- Class 10 (Vehicles): 30%
- Class 8 (Furniture, equipment): 20%
- Class 50 (Computers, software): 55%
- Class 1 (Buildings): 4%
- Class 10.1 (Passenger vehicles >$30k): 30%
* useful_life: Expected years of use (e.g., 5 for computers, 8 for vehicles, 10 for furniture)
* residual_value: Estimated value at end of life (typically 10% of purchase price for equipment, 20% for vehicles)
- If is_depreciable is false, set name_of_asset, cca_rate, useful_life, and residual_value to null
Return only valid JSON.
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:__main__:Extracted receipt data: {'vendor': 'MAPLE LEAF MOTORS INC.', 'description': 'ROMATOKI', 'total_amount': 38531.87, 'tax_amount': 4432.87, 'date': '2025-10-07', 'category': 'Supercar', 'confidence': 0.95, 'currency': 'CAD', 'location': 'Ontario, Canada', 'calculated_tax': None, 'is_depreciable': True, 'name_of_asset': 'ROMATOKI', 'cca_rate': 0.3, 'useful_life': 8, 'residual_value': 7706.37, 'extraction_success': True}
INFO: 102.88.104.195:1167 - "POST /process/db3e3177-060e-410d-8595-a23db76ef26d HTTP/1.1" 200 OK
INFO: 102.88.104.195:1167 - "POST /upload-multiple HTTP/1.1" 200 OK
INFO:__main__:Request: file_id=None user_location=None ai_rules=[AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "mkd"', action='SET_CATEGORY: technology'), AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "Maple"', action='SET_CATEGORY: Supercar')]
INFO:services.document_processor:This is the prompt:
Analyze this receipt image and extract the following information in JSON format.
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "mkd": Set category to "technology"
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "Maple": Set category to "Supercar"
JSON Format:
{
"vendor": "Store/company name",
"description": "Detailed description of items/services purchased",
"total_amount": 0.00,
"tax_amount": 0.00,
"date": "YYYY-MM-DD",
"category": "Check rules above first",
"confidence": 0.95,
"currency": "USD",
"location": "Province/State, Country",
"calculated_tax": 0.00,
"is_depreciable": false,
"name_of_asset": null,
"cca_rate": null,
"useful_life": null,
"residual_value": null,
"extraction_success": True
}
EXTRACTION Rules:
- Extract vendor name as it appears on receipt
- Extract description of items/services purchased (e.g., "Coffee and sandwich", "Gasoline", "Office supplies")
- Total amount should be the final total including tax
- Tax amount is separate tax line if available (if not clearly shown, calculate based on location)
- Date should be the date on the receipt
- Confidence score 0-1 based on how clear the receipt is
- Currency should be the currency used on the receipt (e.g., "USD", "EUR", "CAD")
LOCATION & TAX RULES:
- Extract location from receipt (look for store address, province/state, country)
- Format location as "Province/State, Country" (e.g., "Ontario, Canada" or "California, USA")
- If location not shown on receipt, return null for location (system will use user location as fallback)
TAX EXTRACTION RULES (IMPORTANT):
- If tax is EXPLICITLY shown on receipt (even if $0 or 0%), use that exact value:
* If receipt shows "Tax: $0", "Tax: $0.00", "Tax (0%)", or similar → set tax_amount to 0.00 and calculated_tax to null
* If receipt shows any other tax amount → set tax_amount to that value and calculated_tax to null
- If tax_amount is NOT shown or UNCLEAR on receipt, calculate it based on location:
* Ontario, Canada: 13% HST
* Quebec, Canada: 9.975% QST + 5% GST = 14.975% total
* British Columbia, Canada: 12% (5% GST + 7% PST)
* Alberta, Canada: 5% GST
* California, USA: ~7.25% (varies by locality)
* New York, USA: ~8.875% (varies by locality)
* Texas, USA: 6.25%
* For other locations, estimate based on typical rates
* Store calculated tax in "calculated_tax" field and set tax_amount to the calculated value
DEPRECIATION RULES:
- Determine if item is a depreciable asset (vehicles, machinery, equipment, computers, furniture, buildings)
- Set is_depreciable to true only for capital assets, false for consumables/services
- If is_depreciable is true, provide:
* name_of_asset: Specific name/model of the asset (e.g., "2024 Honda Accord", "Dell Laptop XPS 15", "Office Desk")
* cca_rate: CCA rate as decimal (e.g., 0.30 for 30%, 0.20 for 20%, 0.04 for 4%)
- Class 10 (Vehicles): 30%
- Class 8 (Furniture, equipment): 20%
- Class 50 (Computers, software): 55%
- Class 1 (Buildings): 4%
- Class 10.1 (Passenger vehicles >$30k): 30%
* useful_life: Expected years of use (e.g., 5 for computers, 8 for vehicles, 10 for furniture)
* residual_value: Estimated value at end of life (typically 10% of purchase price for equipment, 20% for vehicles)
- If is_depreciable is false, set name_of_asset, cca_rate, useful_life, and residual_value to null
Return only valid JSON.
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:__main__:Extracted receipt data: {'vendor': 'Figma, Inc.', 'description': 'Professional Full seats (monthly) Jun 19 - Jul 19, 2025', 'total_amount': 27.0, 'tax_amount': 0.0, 'date': '2025-06-19', 'category': 'technology', 'confidence': 0.95, 'currency': 'CAD', 'location': 'Ontario, Canada', 'calculated_tax': None, 'is_depreciable': False, 'name_of_asset': None, 'cca_rate': None, 'useful_life': None, 'residual_value': None, 'extraction_success': True}
INFO: 102.88.104.195:1167 - "POST /process/f02ced44-bd42-4ea3-a01c-a507c61e7b09 HTTP/1.1" 200 OK
INFO: 102.88.104.195:1167 - "POST /upload-multiple HTTP/1.1" 200 OK
INFO:__main__:Request: file_id=None user_location=None ai_rules=[AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "mkd"', action='SET_CATEGORY: technology'), AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "Maple"', action='SET_CATEGORY: Supercar')]
INFO:services.document_processor:This is the prompt:
Analyze this receipt image and extract the following information in JSON format.
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "mkd": Set category to "technology"
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "Maple": Set category to "Supercar"
JSON Format:
{
"vendor": "Store/company name",
"description": "Detailed description of items/services purchased",
"total_amount": 0.00,
"tax_amount": 0.00,
"date": "YYYY-MM-DD",
"category": "Check rules above first",
"confidence": 0.95,
"currency": "USD",
"location": "Province/State, Country",
"calculated_tax": 0.00,
"is_depreciable": false,
"name_of_asset": null,
"cca_rate": null,
"useful_life": null,
"residual_value": null,
"extraction_success": True
}
EXTRACTION Rules:
- Extract vendor name as it appears on receipt
- Extract description of items/services purchased (e.g., "Coffee and sandwich", "Gasoline", "Office supplies")
- Total amount should be the final total including tax
- Tax amount is separate tax line if available (if not clearly shown, calculate based on location)
- Date should be the date on the receipt
- Confidence score 0-1 based on how clear the receipt is
- Currency should be the currency used on the receipt (e.g., "USD", "EUR", "CAD")
LOCATION & TAX RULES:
- Extract location from receipt (look for store address, province/state, country)
- Format location as "Province/State, Country" (e.g., "Ontario, Canada" or "California, USA")
- If location not shown on receipt, return null for location (system will use user location as fallback)
TAX EXTRACTION RULES (IMPORTANT):
- If tax is EXPLICITLY shown on receipt (even if $0 or 0%), use that exact value:
* If receipt shows "Tax: $0", "Tax: $0.00", "Tax (0%)", or similar → set tax_amount to 0.00 and calculated_tax to null
* If receipt shows any other tax amount → set tax_amount to that value and calculated_tax to null
- If tax_amount is NOT shown or UNCLEAR on receipt, calculate it based on location:
* Ontario, Canada: 13% HST
* Quebec, Canada: 9.975% QST + 5% GST = 14.975% total
* British Columbia, Canada: 12% (5% GST + 7% PST)
* Alberta, Canada: 5% GST
* California, USA: ~7.25% (varies by locality)
* New York, USA: ~8.875% (varies by locality)
* Texas, USA: 6.25%
* For other locations, estimate based on typical rates
* Store calculated tax in "calculated_tax" field and set tax_amount to the calculated value
DEPRECIATION RULES:
- Determine if item is a depreciable asset (vehicles, machinery, equipment, computers, furniture, buildings)
- Set is_depreciable to true only for capital assets, false for consumables/services
- If is_depreciable is true, provide:
* name_of_asset: Specific name/model of the asset (e.g., "2024 Honda Accord", "Dell Laptop XPS 15", "Office Desk")
* cca_rate: CCA rate as decimal (e.g., 0.30 for 30%, 0.20 for 20%, 0.04 for 4%)
- Class 10 (Vehicles): 30%
- Class 8 (Furniture, equipment): 20%
- Class 50 (Computers, software): 55%
- Class 1 (Buildings): 4%
- Class 10.1 (Passenger vehicles >$30k): 30%
* useful_life: Expected years of use (e.g., 5 for computers, 8 for vehicles, 10 for furniture)
* residual_value: Estimated value at end of life (typically 10% of purchase price for equipment, 20% for vehicles)
- If is_depreciable is false, set name_of_asset, cca_rate, useful_life, and residual_value to null
Return only valid JSON.
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:__main__:Extracted receipt data: {'vendor': 'Google LLC', 'description': 'Google Workspace', 'total_amount': 21.15, 'tax_amount': 2.43, 'date': '2025-05-31', 'category': 'cloud service', 'confidence': 0.95, 'currency': 'CAD', 'location': 'Ontario, Canada', 'calculated_tax': None, 'is_depreciable': False, 'name_of_asset': None, 'cca_rate': None, 'useful_life': None, 'residual_value': None, 'extraction_success': True}
INFO: 102.88.104.195:1167 - "POST /process/1a0f6d00-3fb2-4335-87ad-b50ea4a70c48 HTTP/1.1" 200 OK
INFO: 102.88.104.195:1167 - "POST /upload-multiple HTTP/1.1" 200 OK
INFO:__main__:Request: file_id=None user_location=None ai_rules=[AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "mkd"', action='SET_CATEGORY: technology'), AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "Maple"', action='SET_CATEGORY: Supercar')]
INFO:services.document_processor:This is the prompt:
Analyze this receipt image and extract the following information in JSON format.
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "mkd": Set category to "technology"
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "Maple": Set category to "Supercar"
JSON Format:
{
"vendor": "Store/company name",
"description": "Detailed description of items/services purchased",
"total_amount": 0.00,
"tax_amount": 0.00,
"date": "YYYY-MM-DD",
"category": "Check rules above first",
"confidence": 0.95,
"currency": "USD",
"location": "Province/State, Country",
"calculated_tax": 0.00,
"is_depreciable": false,
"name_of_asset": null,
"cca_rate": null,
"useful_life": null,
"residual_value": null,
"extraction_success": True
}
EXTRACTION Rules:
- Extract vendor name as it appears on receipt
- Extract description of items/services purchased (e.g., "Coffee and sandwich", "Gasoline", "Office supplies")
- Total amount should be the final total including tax
- Tax amount is separate tax line if available (if not clearly shown, calculate based on location)
- Date should be the date on the receipt
- Confidence score 0-1 based on how clear the receipt is
- Currency should be the currency used on the receipt (e.g., "USD", "EUR", "CAD")
LOCATION & TAX RULES:
- Extract location from receipt (look for store address, province/state, country)
- Format location as "Province/State, Country" (e.g., "Ontario, Canada" or "California, USA")
- If location not shown on receipt, return null for location (system will use user location as fallback)
TAX EXTRACTION RULES (IMPORTANT):
- If tax is EXPLICITLY shown on receipt (even if $0 or 0%), use that exact value:
* If receipt shows "Tax: $0", "Tax: $0.00", "Tax (0%)", or similar → set tax_amount to 0.00 and calculated_tax to null
* If receipt shows any other tax amount → set tax_amount to that value and calculated_tax to null
- If tax_amount is NOT shown or UNCLEAR on receipt, calculate it based on location:
* Ontario, Canada: 13% HST
* Quebec, Canada: 9.975% QST + 5% GST = 14.975% total
* British Columbia, Canada: 12% (5% GST + 7% PST)
* Alberta, Canada: 5% GST
* California, USA: ~7.25% (varies by locality)
* New York, USA: ~8.875% (varies by locality)
* Texas, USA: 6.25%
* For other locations, estimate based on typical rates
* Store calculated tax in "calculated_tax" field and set tax_amount to the calculated value
DEPRECIATION RULES:
- Determine if item is a depreciable asset (vehicles, machinery, equipment, computers, furniture, buildings)
- Set is_depreciable to true only for capital assets, false for consumables/services
- If is_depreciable is true, provide:
* name_of_asset: Specific name/model of the asset (e.g., "2024 Honda Accord", "Dell Laptop XPS 15", "Office Desk")
* cca_rate: CCA rate as decimal (e.g., 0.30 for 30%, 0.20 for 20%, 0.04 for 4%)
- Class 10 (Vehicles): 30%
- Class 8 (Furniture, equipment): 20%
- Class 50 (Computers, software): 55%
- Class 1 (Buildings): 4%
- Class 10.1 (Passenger vehicles >$30k): 30%
* useful_life: Expected years of use (e.g., 5 for computers, 8 for vehicles, 10 for furniture)
* residual_value: Estimated value at end of life (typically 10% of purchase price for equipment, 20% for vehicles)
- If is_depreciable is false, set name_of_asset, cca_rate, useful_life, and residual_value to null
Return only valid JSON.
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:__main__:Extracted receipt data: {'vendor': 'Figma, Inc.', 'description': 'Professional Full seats (monthly) Jun 19 - Jul 19, 2025', 'total_amount': 27.0, 'tax_amount': 0.0, 'date': '2025-06-19', 'category': 'technology', 'confidence': 0.95, 'currency': 'CAD', 'location': 'Ontario, Canada', 'calculated_tax': None, 'is_depreciable': False, 'name_of_asset': None, 'cca_rate': None, 'useful_life': None, 'residual_value': None, 'extraction_success': True}
INFO: 102.88.104.195:1167 - "POST /process/ff8f82fc-ea85-4422-8383-097df9991068 HTTP/1.1" 200 OK
INFO: 102.88.104.195:1167 - "POST /upload-multiple HTTP/1.1" 200 OK
INFO:__main__:Request: file_id=None user_location=None ai_rules=[AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "mkd"', action='SET_CATEGORY: technology'), AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "Maple"', action='SET_CATEGORY: Supercar')]
INFO:services.document_processor:This is the prompt:
Analyze this receipt image and extract the following information in JSON format.
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "mkd": Set category to "technology"
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "Maple": Set category to "Supercar"
JSON Format:
{
"vendor": "Store/company name",
"description": "Detailed description of items/services purchased",
"total_amount": 0.00,
"tax_amount": 0.00,
"date": "YYYY-MM-DD",
"category": "Check rules above first",
"confidence": 0.95,
"currency": "USD",
"location": "Province/State, Country",
"calculated_tax": 0.00,
"is_depreciable": false,
"name_of_asset": null,
"cca_rate": null,
"useful_life": null,
"residual_value": null,
"extraction_success": True
}
EXTRACTION Rules:
- Extract vendor name as it appears on receipt
- Extract description of items/services purchased (e.g., "Coffee and sandwich", "Gasoline", "Office supplies")
- Total amount should be the final total including tax
- Tax amount is separate tax line if available (if not clearly shown, calculate based on location)
- Date should be the date on the receipt
- Confidence score 0-1 based on how clear the receipt is
- Currency should be the currency used on the receipt (e.g., "USD", "EUR", "CAD")
LOCATION & TAX RULES:
- Extract location from receipt (look for store address, province/state, country)
- Format location as "Province/State, Country" (e.g., "Ontario, Canada" or "California, USA")
- If location not shown on receipt, return null for location (system will use user location as fallback)
TAX EXTRACTION RULES (IMPORTANT):
- If tax is EXPLICITLY shown on receipt (even if $0 or 0%), use that exact value:
* If receipt shows "Tax: $0", "Tax: $0.00", "Tax (0%)", or similar → set tax_amount to 0.00 and calculated_tax to null
* If receipt shows any other tax amount → set tax_amount to that value and calculated_tax to null
- If tax_amount is NOT shown or UNCLEAR on receipt, calculate it based on location:
* Ontario, Canada: 13% HST
* Quebec, Canada: 9.975% QST + 5% GST = 14.975% total
* British Columbia, Canada: 12% (5% GST + 7% PST)
* Alberta, Canada: 5% GST
* California, USA: ~7.25% (varies by locality)
* New York, USA: ~8.875% (varies by locality)
* Texas, USA: 6.25%
* For other locations, estimate based on typical rates
* Store calculated tax in "calculated_tax" field and set tax_amount to the calculated value
DEPRECIATION RULES:
- Determine if item is a depreciable asset (vehicles, machinery, equipment, computers, furniture, buildings)
- Set is_depreciable to true only for capital assets, false for consumables/services
- If is_depreciable is true, provide:
* name_of_asset: Specific name/model of the asset (e.g., "2024 Honda Accord", "Dell Laptop XPS 15", "Office Desk")
* cca_rate: CCA rate as decimal (e.g., 0.30 for 30%, 0.20 for 20%, 0.04 for 4%)
- Class 10 (Vehicles): 30%
- Class 8 (Furniture, equipment): 20%
- Class 50 (Computers, software): 55%
- Class 1 (Buildings): 4%
- Class 10.1 (Passenger vehicles >$30k): 30%
* useful_life: Expected years of use (e.g., 5 for computers, 8 for vehicles, 10 for furniture)
* residual_value: Estimated value at end of life (typically 10% of purchase price for equipment, 20% for vehicles)
- If is_depreciable is false, set name_of_asset, cca_rate, useful_life, and residual_value to null
Return only valid JSON.
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:__main__:Extracted receipt data: {'vendor': 'PAYPAL *BZABAWSKYJ', 'description': '', 'total_amount': 37.55, 'tax_amount': 0.0, 'date': '2024-05-22', 'category': 'cloud service', 'confidence': 0.95, 'currency': 'USD', 'location': None, 'calculated_tax': 0.0, 'is_depreciable': False, 'name_of_asset': None, 'cca_rate': None, 'useful_life': None, 'residual_value': None, 'extraction_success': True}
INFO: 102.88.104.195:1167 - "POST /process/85b41eb7-67fb-4079-8be3-e3676b1ab7c7 HTTP/1.1" 200 OK
INFO: 102.88.104.195:1167 - "POST /upload-multiple HTTP/1.1" 200 OK
INFO:__main__:Request: file_id=None user_location=None ai_rules=[AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "mkd"', action='SET_CATEGORY: technology'), AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "Maple"', action='SET_CATEGORY: Supercar')]
INFO:services.document_processor:This is the prompt:
Analyze this receipt image and extract the following information in JSON format.
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "mkd": Set category to "technology"
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "Maple": Set category to "Supercar"
JSON Format:
{
"vendor": "Store/company name",
"description": "Detailed description of items/services purchased",
"total_amount": 0.00,
"tax_amount": 0.00,
"date": "YYYY-MM-DD",
"category": "Check rules above first",
"confidence": 0.95,
"currency": "USD",
"location": "Province/State, Country",
"calculated_tax": 0.00,
"is_depreciable": false,
"name_of_asset": null,
"cca_rate": null,
"useful_life": null,
"residual_value": null,
"extraction_success": True
}
EXTRACTION Rules:
- Extract vendor name as it appears on receipt
- Extract description of items/services purchased (e.g., "Coffee and sandwich", "Gasoline", "Office supplies")
- Total amount should be the final total including tax
- Tax amount is separate tax line if available (if not clearly shown, calculate based on location)
- Date should be the date on the receipt
- Confidence score 0-1 based on how clear the receipt is
- Currency should be the currency used on the receipt (e.g., "USD", "EUR", "CAD")
LOCATION & TAX RULES:
- Extract location from receipt (look for store address, province/state, country)
- Format location as "Province/State, Country" (e.g., "Ontario, Canada" or "California, USA")
- If location not shown on receipt, return null for location (system will use user location as fallback)
TAX EXTRACTION RULES (IMPORTANT):
- If tax is EXPLICITLY shown on receipt (even if $0 or 0%), use that exact value:
* If receipt shows "Tax: $0", "Tax: $0.00", "Tax (0%)", or similar → set tax_amount to 0.00 and calculated_tax to null
* If receipt shows any other tax amount → set tax_amount to that value and calculated_tax to null
- If tax_amount is NOT shown or UNCLEAR on receipt, calculate it based on location:
* Ontario, Canada: 13% HST
* Quebec, Canada: 9.975% QST + 5% GST = 14.975% total
* British Columbia, Canada: 12% (5% GST + 7% PST)
* Alberta, Canada: 5% GST
* California, USA: ~7.25% (varies by locality)
* New York, USA: ~8.875% (varies by locality)
* Texas, USA: 6.25%
* For other locations, estimate based on typical rates
* Store calculated tax in "calculated_tax" field and set tax_amount to the calculated value
DEPRECIATION RULES:
- Determine if item is a depreciable asset (vehicles, machinery, equipment, computers, furniture, buildings)
- Set is_depreciable to true only for capital assets, false for consumables/services
- If is_depreciable is true, provide:
* name_of_asset: Specific name/model of the asset (e.g., "2024 Honda Accord", "Dell Laptop XPS 15", "Office Desk")
* cca_rate: CCA rate as decimal (e.g., 0.30 for 30%, 0.20 for 20%, 0.04 for 4%)
- Class 10 (Vehicles): 30%
- Class 8 (Furniture, equipment): 20%
- Class 50 (Computers, software): 55%
- Class 1 (Buildings): 4%
- Class 10.1 (Passenger vehicles >$30k): 30%
* useful_life: Expected years of use (e.g., 5 for computers, 8 for vehicles, 10 for furniture)
* residual_value: Estimated value at end of life (typically 10% of purchase price for equipment, 20% for vehicles)
- If is_depreciable is false, set name_of_asset, cca_rate, useful_life, and residual_value to null
Return only valid JSON.
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:__main__:Extracted receipt data: {'vendor': 'Eleven Labs Inc.', 'description': 'Pro Jun 10 - Jul 10, 2025', 'total_amount': 111.87, 'tax_amount': 12.87, 'date': '2025-06-10', 'category': 'cloud service', 'confidence': 0.95, 'currency': 'USD', 'location': 'New York, United States', 'calculated_tax': None, 'is_depreciable': False, 'name_of_asset': None, 'cca_rate': None, 'useful_life': None, 'residual_value': None, 'extraction_success': True}
INFO: 102.88.104.195:1167 - "POST /process/c5fd6b40-31d1-4447-8784-162682239234 HTTP/1.1" 200 OK
INFO: 199.241.139.243:17476 - "POST /upload-multiple HTTP/1.1" 200 OK
INFO:__main__:Request: file_id=None user_location=None ai_rules=[AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "mkd"', action='SET_CATEGORY: technology'), AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "Maple"', action='SET_CATEGORY: Supercar')]
INFO:services.document_processor:This is the prompt:
Analyze this receipt image and extract the following information in JSON format.
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "mkd": Set category to "technology"
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "Maple": Set category to "Supercar"
JSON Format:
{
"vendor": "Store/company name",
"description": "Detailed description of items/services purchased",
"total_amount": 0.00,
"tax_amount": 0.00,
"date": "YYYY-MM-DD",
"category": "Check rules above first",
"confidence": 0.95,
"currency": "USD",
"location": "Province/State, Country",
"calculated_tax": 0.00,
"is_depreciable": false,
"name_of_asset": null,
"cca_rate": null,
"useful_life": null,
"residual_value": null,
"extraction_success": True
}
EXTRACTION Rules:
- Extract vendor name as it appears on receipt
- Extract description of items/services purchased (e.g., "Coffee and sandwich", "Gasoline", "Office supplies")
- Total amount should be the final total including tax
- Tax amount is separate tax line if available (if not clearly shown, calculate based on location)
- Date should be the date on the receipt
- Confidence score 0-1 based on how clear the receipt is
- Currency should be the currency used on the receipt (e.g., "USD", "EUR", "CAD")
LOCATION & TAX RULES:
- Extract location from receipt (look for store address, province/state, country)
- Format location as "Province/State, Country" (e.g., "Ontario, Canada" or "California, USA")
- If location not shown on receipt, return null for location (system will use user location as fallback)
TAX EXTRACTION RULES (IMPORTANT):
- If tax is EXPLICITLY shown on receipt (even if $0 or 0%), use that exact value:
* If receipt shows "Tax: $0", "Tax: $0.00", "Tax (0%)", or similar → set tax_amount to 0.00 and calculated_tax to null
* If receipt shows any other tax amount → set tax_amount to that value and calculated_tax to null
- If tax_amount is NOT shown or UNCLEAR on receipt, calculate it based on location:
* Ontario, Canada: 13% HST
* Quebec, Canada: 9.975% QST + 5% GST = 14.975% total
* British Columbia, Canada: 12% (5% GST + 7% PST)
* Alberta, Canada: 5% GST
* California, USA: ~7.25% (varies by locality)
* New York, USA: ~8.875% (varies by locality)
* Texas, USA: 6.25%
* For other locations, estimate based on typical rates
* Store calculated tax in "calculated_tax" field and set tax_amount to the calculated value
DEPRECIATION RULES:
- Determine if item is a depreciable asset (vehicles, machinery, equipment, computers, furniture, buildings)
- Set is_depreciable to true only for capital assets, false for consumables/services
- If is_depreciable is true, provide:
* name_of_asset: Specific name/model of the asset (e.g., "2024 Honda Accord", "Dell Laptop XPS 15", "Office Desk")
* cca_rate: CCA rate as decimal (e.g., 0.30 for 30%, 0.20 for 20%, 0.04 for 4%)
- Class 10 (Vehicles): 30%
- Class 8 (Furniture, equipment): 20%
- Class 50 (Computers, software): 55%
- Class 1 (Buildings): 4%
- Class 10.1 (Passenger vehicles >$30k): 30%
* useful_life: Expected years of use (e.g., 5 for computers, 8 for vehicles, 10 for furniture)
* residual_value: Estimated value at end of life (typically 10% of purchase price for equipment, 20% for vehicles)
- If is_depreciable is false, set name_of_asset, cca_rate, useful_life, and residual_value to null
Return only valid JSON.
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:__main__:Extracted receipt data: {'vendor': 'MAPLE LEAF MOTORS INC.', 'description': 'ROMATOKI', 'total_amount': 38531.87, 'tax_amount': 4432.87, 'date': '2025-10-07', 'category': 'Supercar', 'confidence': 0.95, 'currency': 'CAD', 'location': 'Ontario, Canada', 'calculated_tax': None, 'is_depreciable': True, 'name_of_asset': 'ROMATOKI', 'cca_rate': 0.3, 'useful_life': 8, 'residual_value': 7706.37, 'extraction_success': True}
INFO: 199.241.139.243:17488 - "POST /process/63c105a3-9768-4582-b5fe-a333b2098aee HTTP/1.1" 200 OK
INFO: 199.241.139.243:17492 - "POST /upload-multiple HTTP/1.1" 200 OK
INFO:__main__:Request: file_id=None user_location=None ai_rules=[AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "mkd"', action='SET_CATEGORY: technology'), AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "Maple"', action='SET_CATEGORY: Supercar')]
INFO:services.document_processor:This is the prompt:
Analyze this receipt image and extract the following information in JSON format.
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "mkd": Set category to "technology"
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "Maple": Set category to "Supercar"
JSON Format:
{
"vendor": "Store/company name",
"description": "Detailed description of items/services purchased",
"total_amount": 0.00,
"tax_amount": 0.00,
"date": "YYYY-MM-DD",
"category": "Check rules above first",
"confidence": 0.95,
"currency": "USD",
"location": "Province/State, Country",
"calculated_tax": 0.00,
"is_depreciable": false,
"name_of_asset": null,
"cca_rate": null,
"useful_life": null,
"residual_value": null,
"extraction_success": True
}
EXTRACTION Rules:
- Extract vendor name as it appears on receipt
- Extract description of items/services purchased (e.g., "Coffee and sandwich", "Gasoline", "Office supplies")
- Total amount should be the final total including tax
- Tax amount is separate tax line if available (if not clearly shown, calculate based on location)
- Date should be the date on the receipt
- Confidence score 0-1 based on how clear the receipt is
- Currency should be the currency used on the receipt (e.g., "USD", "EUR", "CAD")
LOCATION & TAX RULES:
- Extract location from receipt (look for store address, province/state, country)
- Format location as "Province/State, Country" (e.g., "Ontario, Canada" or "California, USA")
- If location not shown on receipt, return null for location (system will use user location as fallback)
TAX EXTRACTION RULES (IMPORTANT):
- If tax is EXPLICITLY shown on receipt (even if $0 or 0%), use that exact value:
* If receipt shows "Tax: $0", "Tax: $0.00", "Tax (0%)", or similar → set tax_amount to 0.00 and calculated_tax to null
* If receipt shows any other tax amount → set tax_amount to that value and calculated_tax to null
- If tax_amount is NOT shown or UNCLEAR on receipt, calculate it based on location:
* Ontario, Canada: 13% HST
* Quebec, Canada: 9.975% QST + 5% GST = 14.975% total
* British Columbia, Canada: 12% (5% GST + 7% PST)
* Alberta, Canada: 5% GST
* California, USA: ~7.25% (varies by locality)
* New York, USA: ~8.875% (varies by locality)
* Texas, USA: 6.25%
* For other locations, estimate based on typical rates
* Store calculated tax in "calculated_tax" field and set tax_amount to the calculated value
DEPRECIATION RULES:
- Determine if item is a depreciable asset (vehicles, machinery, equipment, computers, furniture, buildings)
- Set is_depreciable to true only for capital assets, false for consumables/services
- If is_depreciable is true, provide:
* name_of_asset: Specific name/model of the asset (e.g., "2024 Honda Accord", "Dell Laptop XPS 15", "Office Desk")
* cca_rate: CCA rate as decimal (e.g., 0.30 for 30%, 0.20 for 20%, 0.04 for 4%)
- Class 10 (Vehicles): 30%
- Class 8 (Furniture, equipment): 20%
- Class 50 (Computers, software): 55%
- Class 1 (Buildings): 4%
- Class 10.1 (Passenger vehicles >$30k): 30%
* useful_life: Expected years of use (e.g., 5 for computers, 8 for vehicles, 10 for furniture)
* residual_value: Estimated value at end of life (typically 10% of purchase price for equipment, 20% for vehicles)
- If is_depreciable is false, set name_of_asset, cca_rate, useful_life, and residual_value to null
Return only valid JSON.
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:__main__:Extracted receipt data: {'vendor': 'Figma, Inc.', 'description': 'Professional Full seats (monthly) Jun 19 - Jul 19, 2025', 'total_amount': 27.0, 'tax_amount': 0.0, 'date': '2025-06-19', 'category': 'technology', 'confidence': 0.95, 'currency': 'CAD', 'location': 'Ontario, Canada', 'calculated_tax': None, 'is_depreciable': False, 'name_of_asset': None, 'cca_rate': None, 'useful_life': None, 'residual_value': None, 'extraction_success': True}
INFO: 199.241.139.243:17494 - "POST /process/7856d060-e28a-4a5f-8c15-8761a7d2640c HTTP/1.1" 200 OK
INFO: 199.241.139.243:17500 - "POST /upload-multiple HTTP/1.1" 200 OK
INFO:__main__:Request: file_id=None user_location=None ai_rules=[AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "mkd"', action='SET_CATEGORY: technology'), AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "Maple"', action='SET_CATEGORY: Supercar')]
INFO:services.document_processor:This is the prompt:
Analyze this receipt image and extract the following information in JSON format.
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "mkd": Set category to "technology"
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "Maple": Set category to "Supercar"
JSON Format:
{
"vendor": "Store/company name",
"description": "Detailed description of items/services purchased",
"total_amount": 0.00,
"tax_amount": 0.00,
"date": "YYYY-MM-DD",
"category": "Check rules above first",
"confidence": 0.95,
"currency": "USD",
"location": "Province/State, Country",
"calculated_tax": 0.00,
"is_depreciable": false,
"name_of_asset": null,
"cca_rate": null,
"useful_life": null,
"residual_value": null,
"extraction_success": True
}
EXTRACTION Rules:
- Extract vendor name as it appears on receipt
- Extract description of items/services purchased (e.g., "Coffee and sandwich", "Gasoline", "Office supplies")
- Total amount should be the final total including tax
- Tax amount is separate tax line if available (if not clearly shown, calculate based on location)
- Date should be the date on the receipt
- Confidence score 0-1 based on how clear the receipt is
- Currency should be the currency used on the receipt (e.g., "USD", "EUR", "CAD")
LOCATION & TAX RULES:
- Extract location from receipt (look for store address, province/state, country)
- Format location as "Province/State, Country" (e.g., "Ontario, Canada" or "California, USA")
- If location not shown on receipt, return null for location (system will use user location as fallback)
TAX EXTRACTION RULES (IMPORTANT):
- If tax is EXPLICITLY shown on receipt (even if $0 or 0%), use that exact value:
* If receipt shows "Tax: $0", "Tax: $0.00", "Tax (0%)", or similar → set tax_amount to 0.00 and calculated_tax to null
* If receipt shows any other tax amount → set tax_amount to that value and calculated_tax to null
- If tax_amount is NOT shown or UNCLEAR on receipt, calculate it based on location:
* Ontario, Canada: 13% HST
* Quebec, Canada: 9.975% QST + 5% GST = 14.975% total
* British Columbia, Canada: 12% (5% GST + 7% PST)
* Alberta, Canada: 5% GST
* California, USA: ~7.25% (varies by locality)
* New York, USA: ~8.875% (varies by locality)
* Texas, USA: 6.25%
* For other locations, estimate based on typical rates
* Store calculated tax in "calculated_tax" field and set tax_amount to the calculated value
DEPRECIATION RULES:
- Determine if item is a depreciable asset (vehicles, machinery, equipment, computers, furniture, buildings)
- Set is_depreciable to true only for capital assets, false for consumables/services
- If is_depreciable is true, provide:
* name_of_asset: Specific name/model of the asset (e.g., "2024 Honda Accord", "Dell Laptop XPS 15", "Office Desk")
* cca_rate: CCA rate as decimal (e.g., 0.30 for 30%, 0.20 for 20%, 0.04 for 4%)
- Class 10 (Vehicles): 30%
- Class 8 (Furniture, equipment): 20%
- Class 50 (Computers, software): 55%
- Class 1 (Buildings): 4%
- Class 10.1 (Passenger vehicles >$30k): 30%
* useful_life: Expected years of use (e.g., 5 for computers, 8 for vehicles, 10 for furniture)
* residual_value: Estimated value at end of life (typically 10% of purchase price for equipment, 20% for vehicles)
- If is_depreciable is false, set name_of_asset, cca_rate, useful_life, and residual_value to null
Return only valid JSON.
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:__main__:Extracted receipt data: {'vendor': 'Google LLC', 'description': 'Google Workspace', 'total_amount': 21.15, 'tax_amount': 2.43, 'date': '2025-05-31', 'category': 'cloud service', 'confidence': 0.95, 'currency': 'CAD', 'location': 'Ontario, Canada', 'calculated_tax': None, 'is_depreciable': False, 'name_of_asset': None, 'cca_rate': None, 'useful_life': None, 'residual_value': None, 'extraction_success': True}
INFO: 199.241.139.243:17504 - "POST /process/13531ba3-31fb-4ba5-b8e2-df9d78f51719 HTTP/1.1" 200 OK
INFO: 199.241.139.243:17516 - "POST /upload-multiple HTTP/1.1" 200 OK
INFO:__main__:Request: file_id=None user_location=None ai_rules=[AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "mkd"', action='SET_CATEGORY: technology'), AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "Maple"', action='SET_CATEGORY: Supercar')]
INFO:services.document_processor:This is the prompt:
Analyze this receipt image and extract the following information in JSON format.
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "mkd": Set category to "technology"
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "Maple": Set category to "Supercar"
JSON Format:
{
"vendor": "Store/company name",
"description": "Detailed description of items/services purchased",
"total_amount": 0.00,
"tax_amount": 0.00,
"date": "YYYY-MM-DD",
"category": "Check rules above first",
"confidence": 0.95,
"currency": "USD",
"location": "Province/State, Country",
"calculated_tax": 0.00,
"is_depreciable": false,
"name_of_asset": null,
"cca_rate": null,
"useful_life": null,
"residual_value": null,
"extraction_success": True
}
EXTRACTION Rules:
- Extract vendor name as it appears on receipt
- Extract description of items/services purchased (e.g., "Coffee and sandwich", "Gasoline", "Office supplies")
- Total amount should be the final total including tax
- Tax amount is separate tax line if available (if not clearly shown, calculate based on location)
- Date should be the date on the receipt
- Confidence score 0-1 based on how clear the receipt is
- Currency should be the currency used on the receipt (e.g., "USD", "EUR", "CAD")
LOCATION & TAX RULES:
- Extract location from receipt (look for store address, province/state, country)
- Format location as "Province/State, Country" (e.g., "Ontario, Canada" or "California, USA")
- If location not shown on receipt, return null for location (system will use user location as fallback)
TAX EXTRACTION RULES (IMPORTANT):
- If tax is EXPLICITLY shown on receipt (even if $0 or 0%), use that exact value:
* If receipt shows "Tax: $0", "Tax: $0.00", "Tax (0%)", or similar → set tax_amount to 0.00 and calculated_tax to null
* If receipt shows any other tax amount → set tax_amount to that value and calculated_tax to null
- If tax_amount is NOT shown or UNCLEAR on receipt, calculate it based on location:
* Ontario, Canada: 13% HST
* Quebec, Canada: 9.975% QST + 5% GST = 14.975% total
* British Columbia, Canada: 12% (5% GST + 7% PST)
* Alberta, Canada: 5% GST
* California, USA: ~7.25% (varies by locality)
* New York, USA: ~8.875% (varies by locality)
* Texas, USA: 6.25%
* For other locations, estimate based on typical rates
* Store calculated tax in "calculated_tax" field and set tax_amount to the calculated value
DEPRECIATION RULES:
- Determine if item is a depreciable asset (vehicles, machinery, equipment, computers, furniture, buildings)
- Set is_depreciable to true only for capital assets, false for consumables/services
- If is_depreciable is true, provide:
* name_of_asset: Specific name/model of the asset (e.g., "2024 Honda Accord", "Dell Laptop XPS 15", "Office Desk")
* cca_rate: CCA rate as decimal (e.g., 0.30 for 30%, 0.20 for 20%, 0.04 for 4%)
- Class 10 (Vehicles): 30%
- Class 8 (Furniture, equipment): 20%
- Class 50 (Computers, software): 55%
- Class 1 (Buildings): 4%
- Class 10.1 (Passenger vehicles >$30k): 30%
* useful_life: Expected years of use (e.g., 5 for computers, 8 for vehicles, 10 for furniture)
* residual_value: Estimated value at end of life (typically 10% of purchase price for equipment, 20% for vehicles)
- If is_depreciable is false, set name_of_asset, cca_rate, useful_life, and residual_value to null
Return only valid JSON.
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:__main__:Extracted receipt data: {'vendor': 'Figma, Inc.', 'description': 'Professional Full seats (monthly) Jun 19 - Jul 19, 2025', 'total_amount': 27.0, 'tax_amount': 0.0, 'date': '2025-06-19', 'category': 'technology', 'confidence': 0.95, 'currency': 'CAD', 'location': 'Ontario, Canada', 'calculated_tax': None, 'is_depreciable': False, 'name_of_asset': None, 'cca_rate': None, 'useful_life': None, 'residual_value': None, 'extraction_success': True}
INFO: 199.241.139.243:17528 - "POST /process/45cb4bac-e73c-4c4f-bed5-4af6cab3e993 HTTP/1.1" 200 OK
INFO: 199.241.139.243:17544 - "POST /upload-multiple HTTP/1.1" 200 OK
INFO:__main__:Request: file_id=None user_location=None ai_rules=[AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "mkd"', action='SET_CATEGORY: technology'), AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "Maple"', action='SET_CATEGORY: Supercar')]
INFO:services.document_processor:This is the prompt:
Analyze this receipt image and extract the following information in JSON format.
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "mkd": Set category to "technology"
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "Maple": Set category to "Supercar"
JSON Format:
{
"vendor": "Store/company name",
"description": "Detailed description of items/services purchased",
"total_amount": 0.00,
"tax_amount": 0.00,
"date": "YYYY-MM-DD",
"category": "Check rules above first",
"confidence": 0.95,
"currency": "USD",
"location": "Province/State, Country",
"calculated_tax": 0.00,
"is_depreciable": false,
"name_of_asset": null,
"cca_rate": null,
"useful_life": null,
"residual_value": null,
"extraction_success": True
}
EXTRACTION Rules:
- Extract vendor name as it appears on receipt
- Extract description of items/services purchased (e.g., "Coffee and sandwich", "Gasoline", "Office supplies")
- Total amount should be the final total including tax
- Tax amount is separate tax line if available (if not clearly shown, calculate based on location)
- Date should be the date on the receipt
- Confidence score 0-1 based on how clear the receipt is
- Currency should be the currency used on the receipt (e.g., "USD", "EUR", "CAD")
LOCATION & TAX RULES:
- Extract location from receipt (look for store address, province/state, country)
- Format location as "Province/State, Country" (e.g., "Ontario, Canada" or "California, USA")
- If location not shown on receipt, return null for location (system will use user location as fallback)
TAX EXTRACTION RULES (IMPORTANT):
- If tax is EXPLICITLY shown on receipt (even if $0 or 0%), use that exact value:
* If receipt shows "Tax: $0", "Tax: $0.00", "Tax (0%)", or similar → set tax_amount to 0.00 and calculated_tax to null
* If receipt shows any other tax amount → set tax_amount to that value and calculated_tax to null
- If tax_amount is NOT shown or UNCLEAR on receipt, calculate it based on location:
* Ontario, Canada: 13% HST
* Quebec, Canada: 9.975% QST + 5% GST = 14.975% total
* British Columbia, Canada: 12% (5% GST + 7% PST)
* Alberta, Canada: 5% GST
* California, USA: ~7.25% (varies by locality)
* New York, USA: ~8.875% (varies by locality)
* Texas, USA: 6.25%
* For other locations, estimate based on typical rates
* Store calculated tax in "calculated_tax" field and set tax_amount to the calculated value
DEPRECIATION RULES:
- Determine if item is a depreciable asset (vehicles, machinery, equipment, computers, furniture, buildings)
- Set is_depreciable to true only for capital assets, false for consumables/services
- If is_depreciable is true, provide:
* name_of_asset: Specific name/model of the asset (e.g., "2024 Honda Accord", "Dell Laptop XPS 15", "Office Desk")
* cca_rate: CCA rate as decimal (e.g., 0.30 for 30%, 0.20 for 20%, 0.04 for 4%)
- Class 10 (Vehicles): 30%
- Class 8 (Furniture, equipment): 20%
- Class 50 (Computers, software): 55%
- Class 1 (Buildings): 4%
- Class 10.1 (Passenger vehicles >$30k): 30%
* useful_life: Expected years of use (e.g., 5 for computers, 8 for vehicles, 10 for furniture)
* residual_value: Estimated value at end of life (typically 10% of purchase price for equipment, 20% for vehicles)
- If is_depreciable is false, set name_of_asset, cca_rate, useful_life, and residual_value to null
Return only valid JSON.
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:__main__:Extracted receipt data: {'vendor': 'Bzabaowskyj', 'description': 'Paypal *Bzabaowskyj* 4029357733 On', 'total_amount': 37.55, 'tax_amount': 0.0, 'date': '2024-05-22', 'category': 'cloud service', 'confidence': 0.95, 'currency': 'USD', 'location': None, 'calculated_tax': 0.0, 'is_depreciable': False, 'name_of_asset': None, 'cca_rate': None, 'useful_life': None, 'residual_value': None, 'extraction_success': True}
INFO: 199.241.139.243:17554 - "POST /process/568a856a-73ce-4078-95ec-81bb115ca4f1 HTTP/1.1" 200 OK
INFO: 199.241.139.243:46606 - "POST /upload-multiple HTTP/1.1" 200 OK
INFO:__main__:Request: file_id=None user_location=None ai_rules=[AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "mkd"', action='SET_CATEGORY: technology'), AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "Maple"', action='SET_CATEGORY: Supercar')]
INFO:services.document_processor:This is the prompt:
Analyze this receipt image and extract the following information in JSON format.
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "mkd": Set category to "technology"
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "Maple": Set category to "Supercar"
JSON Format:
{
"vendor": "Store/company name",
"description": "Detailed description of items/services purchased",
"total_amount": 0.00,
"tax_amount": 0.00,
"date": "YYYY-MM-DD",
"category": "Check rules above first",
"confidence": 0.95,
"currency": "USD",
"location": "Province/State, Country",
"calculated_tax": 0.00,
"is_depreciable": false,
"name_of_asset": null,
"cca_rate": null,
"useful_life": null,
"residual_value": null,
"extraction_success": True
}
EXTRACTION Rules:
- Extract vendor name as it appears on receipt
- Extract description of items/services purchased (e.g., "Coffee and sandwich", "Gasoline", "Office supplies")
- Total amount should be the final total including tax
- Tax amount is separate tax line if available (if not clearly shown, calculate based on location)
- Date should be the date on the receipt
- Confidence score 0-1 based on how clear the receipt is
- Currency should be the currency used on the receipt (e.g., "USD", "EUR", "CAD")
LOCATION & TAX RULES:
- Extract location from receipt (look for store address, province/state, country)
- Format location as "Province/State, Country" (e.g., "Ontario, Canada" or "California, USA")
- If location not shown on receipt, return null for location (system will use user location as fallback)
TAX EXTRACTION RULES (IMPORTANT):
- If tax is EXPLICITLY shown on receipt (even if $0 or 0%), use that exact value:
* If receipt shows "Tax: $0", "Tax: $0.00", "Tax (0%)", or similar → set tax_amount to 0.00 and calculated_tax to null
* If receipt shows any other tax amount → set tax_amount to that value and calculated_tax to null
- If tax_amount is NOT shown or UNCLEAR on receipt, calculate it based on location:
* Ontario, Canada: 13% HST
* Quebec, Canada: 9.975% QST + 5% GST = 14.975% total
* British Columbia, Canada: 12% (5% GST + 7% PST)
* Alberta, Canada: 5% GST
* California, USA: ~7.25% (varies by locality)
* New York, USA: ~8.875% (varies by locality)
* Texas, USA: 6.25%
* For other locations, estimate based on typical rates
* Store calculated tax in "calculated_tax" field and set tax_amount to the calculated value
DEPRECIATION RULES:
- Determine if item is a depreciable asset (vehicles, machinery, equipment, computers, furniture, buildings)
- Set is_depreciable to true only for capital assets, false for consumables/services
- If is_depreciable is true, provide:
* name_of_asset: Specific name/model of the asset (e.g., "2024 Honda Accord", "Dell Laptop XPS 15", "Office Desk")
* cca_rate: CCA rate as decimal (e.g., 0.30 for 30%, 0.20 for 20%, 0.04 for 4%)
- Class 10 (Vehicles): 30%
- Class 8 (Furniture, equipment): 20%
- Class 50 (Computers, software): 55%
- Class 1 (Buildings): 4%
- Class 10.1 (Passenger vehicles >$30k): 30%
* useful_life: Expected years of use (e.g., 5 for computers, 8 for vehicles, 10 for furniture)
* residual_value: Estimated value at end of life (typically 10% of purchase price for equipment, 20% for vehicles)
- If is_depreciable is false, set name_of_asset, cca_rate, useful_life, and residual_value to null
Return only valid JSON.
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:__main__:Extracted receipt data: {'vendor': 'Eleven Labs Inc.', 'description': 'Pro Jun 10 - Jul 10, 2025', 'total_amount': 111.87, 'tax_amount': 12.87, 'date': '2025-06-10', 'category': 'cloud service', 'confidence': 0.95, 'currency': 'USD', 'location': 'New York, United States', 'calculated_tax': None, 'is_depreciable': False, 'name_of_asset': None, 'cca_rate': None, 'useful_life': None, 'residual_value': None, 'extraction_success': True}
INFO: 199.241.139.243:46622 - "POST /process/11ae69f1-e664-48f9-8ee8-54df6817989e HTTP/1.1" 200 OK
INFO: 102.88.104.195:174 - "POST /upload-multiple HTTP/1.1" 200 OK
INFO:__main__:Request: file_id=None user_location=None ai_rules=[AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "mkd"', action='SET_CATEGORY: technology'), AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "Maple"', action='SET_CATEGORY: Supercar')]
INFO:services.document_processor:This is the prompt:
Analyze this receipt image and extract the following information in JSON format.
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "mkd": Set category to "technology"
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "Maple": Set category to "Supercar"
JSON Format:
{
"vendor": "Store/company name",
"description": "Detailed description of items/services purchased",
"total_amount": 0.00,
"tax_amount": 0.00,
"date": "YYYY-MM-DD",
"category": "Check rules above first",
"confidence": 0.95,
"currency": "USD",
"location": "Province/State, Country",
"calculated_tax": 0.00,
"is_depreciable": false,
"name_of_asset": null,
"cca_rate": null,
"useful_life": null,
"residual_value": null,
"extraction_success": True
}
EXTRACTION Rules:
- Extract vendor name as it appears on receipt
- Extract description of items/services purchased (e.g., "Coffee and sandwich", "Gasoline", "Office supplies")
- Total amount should be the final total including tax
- Tax amount is separate tax line if available (if not clearly shown, calculate based on location)
- Date should be the date on the receipt
- Confidence score 0-1 based on how clear the receipt is
- Currency should be the currency used on the receipt (e.g., "USD", "EUR", "CAD")
LOCATION & TAX RULES:
- Extract location from receipt (look for store address, province/state, country)
- Format location as "Province/State, Country" (e.g., "Ontario, Canada" or "California, USA")
- If location not shown on receipt, return null for location (system will use user location as fallback)
TAX EXTRACTION RULES (IMPORTANT):
- If tax is EXPLICITLY shown on receipt (even if $0 or 0%), use that exact value:
* If receipt shows "Tax: $0", "Tax: $0.00", "Tax (0%)", or similar → set tax_amount to 0.00 and calculated_tax to null
* If receipt shows any other tax amount → set tax_amount to that value and calculated_tax to null
- If tax_amount is NOT shown or UNCLEAR on receipt, calculate it based on location:
* Ontario, Canada: 13% HST
* Quebec, Canada: 9.975% QST + 5% GST = 14.975% total
* British Columbia, Canada: 12% (5% GST + 7% PST)
* Alberta, Canada: 5% GST
* California, USA: ~7.25% (varies by locality)
* New York, USA: ~8.875% (varies by locality)
* Texas, USA: 6.25%
* For other locations, estimate based on typical rates
* Store calculated tax in "calculated_tax" field and set tax_amount to the calculated value
DEPRECIATION RULES:
- Determine if item is a depreciable asset (vehicles, machinery, equipment, computers, furniture, buildings)
- Set is_depreciable to true only for capital assets, false for consumables/services
- If is_depreciable is true, provide:
* name_of_asset: Specific name/model of the asset (e.g., "2024 Honda Accord", "Dell Laptop XPS 15", "Office Desk")
* cca_rate: CCA rate as decimal (e.g., 0.30 for 30%, 0.20 for 20%, 0.04 for 4%)
- Class 10 (Vehicles): 30%
- Class 8 (Furniture, equipment): 20%
- Class 50 (Computers, software): 55%
- Class 1 (Buildings): 4%
- Class 10.1 (Passenger vehicles >$30k): 30%
* useful_life: Expected years of use (e.g., 5 for computers, 8 for vehicles, 10 for furniture)
* residual_value: Estimated value at end of life (typically 10% of purchase price for equipment, 20% for vehicles)
- If is_depreciable is false, set name_of_asset, cca_rate, useful_life, and residual_value to null
Return only valid JSON.
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:__main__:Extracted receipt data: {'vendor': 'MAPLE LEAF MOTORS INC.', 'description': 'ROMATOKI', 'total_amount': 38531.87, 'tax_amount': 4432.87, 'date': '2025-10-07', 'category': 'Supercar', 'confidence': 0.95, 'currency': 'CAD', 'location': 'Ontario, Canada', 'calculated_tax': None, 'is_depreciable': True, 'name_of_asset': 'ROMATOKI', 'cca_rate': 0.3, 'useful_life': 8, 'residual_value': 7706.37, 'extraction_success': True}
INFO: 102.88.104.195:174 - "POST /process/b066dac1-7f46-42b9-89ac-46690e9b6095 HTTP/1.1" 200 OK
INFO: 102.88.104.195:174 - "POST /upload-multiple HTTP/1.1" 200 OK
INFO:__main__:Request: file_id=None user_location=None ai_rules=[AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "mkd"', action='SET_CATEGORY: technology'), AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "Maple"', action='SET_CATEGORY: Supercar')]
INFO:services.document_processor:This is the prompt:
Analyze this receipt image and extract the following information in JSON format.
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "mkd": Set category to "technology"
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "Maple": Set category to "Supercar"
JSON Format:
{
"vendor": "Store/company name",
"description": "Detailed description of items/services purchased",
"total_amount": 0.00,
"tax_amount": 0.00,
"date": "YYYY-MM-DD",
"category": "Check rules above first",
"confidence": 0.95,
"currency": "USD",
"location": "Province/State, Country",
"calculated_tax": 0.00,
"is_depreciable": false,
"name_of_asset": null,
"cca_rate": null,
"useful_life": null,
"residual_value": null,
"extraction_success": True
}
EXTRACTION Rules:
- Extract vendor name as it appears on receipt
- Extract description of items/services purchased (e.g., "Coffee and sandwich", "Gasoline", "Office supplies")
- Total amount should be the final total including tax
- Tax amount is separate tax line if available (if not clearly shown, calculate based on location)
- Date should be the date on the receipt
- Confidence score 0-1 based on how clear the receipt is
- Currency should be the currency used on the receipt (e.g., "USD", "EUR", "CAD")
LOCATION & TAX RULES:
- Extract location from receipt (look for store address, province/state, country)
- Format location as "Province/State, Country" (e.g., "Ontario, Canada" or "California, USA")
- If location not shown on receipt, return null for location (system will use user location as fallback)
TAX EXTRACTION RULES (IMPORTANT):
- If tax is EXPLICITLY shown on receipt (even if $0 or 0%), use that exact value:
* If receipt shows "Tax: $0", "Tax: $0.00", "Tax (0%)", or similar → set tax_amount to 0.00 and calculated_tax to null
* If receipt shows any other tax amount → set tax_amount to that value and calculated_tax to null
- If tax_amount is NOT shown or UNCLEAR on receipt, calculate it based on location:
* Ontario, Canada: 13% HST
* Quebec, Canada: 9.975% QST + 5% GST = 14.975% total
* British Columbia, Canada: 12% (5% GST + 7% PST)
* Alberta, Canada: 5% GST
* California, USA: ~7.25% (varies by locality)
* New York, USA: ~8.875% (varies by locality)
* Texas, USA: 6.25%
* For other locations, estimate based on typical rates
* Store calculated tax in "calculated_tax" field and set tax_amount to the calculated value
DEPRECIATION RULES:
- Determine if item is a depreciable asset (vehicles, machinery, equipment, computers, furniture, buildings)
- Set is_depreciable to true only for capital assets, false for consumables/services
- If is_depreciable is true, provide:
* name_of_asset: Specific name/model of the asset (e.g., "2024 Honda Accord", "Dell Laptop XPS 15", "Office Desk")
* cca_rate: CCA rate as decimal (e.g., 0.30 for 30%, 0.20 for 20%, 0.04 for 4%)
- Class 10 (Vehicles): 30%
- Class 8 (Furniture, equipment): 20%
- Class 50 (Computers, software): 55%
- Class 1 (Buildings): 4%
- Class 10.1 (Passenger vehicles >$30k): 30%
* useful_life: Expected years of use (e.g., 5 for computers, 8 for vehicles, 10 for furniture)
* residual_value: Estimated value at end of life (typically 10% of purchase price for equipment, 20% for vehicles)
- If is_depreciable is false, set name_of_asset, cca_rate, useful_life, and residual_value to null
Return only valid JSON.
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:__main__:Extracted receipt data: {'vendor': 'Figma, Inc.', 'description': 'Professional Full seats (monthly) Jun 19 - Jul 19, 2025', 'total_amount': 27.0, 'tax_amount': 0.0, 'date': '2025-06-19', 'category': 'technology', 'confidence': 0.95, 'currency': 'CAD', 'location': 'Ontario, Canada', 'calculated_tax': None, 'is_depreciable': False, 'name_of_asset': None, 'cca_rate': None, 'useful_life': None, 'residual_value': None, 'extraction_success': True}
INFO: 102.88.104.195:174 - "POST /process/ffa33cc8-a74f-4349-8848-592913572700 HTTP/1.1" 200 OK
INFO: 102.88.104.195:174 - "POST /upload-multiple HTTP/1.1" 200 OK
INFO:__main__:Request: file_id=None user_location=None ai_rules=[AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "mkd"', action='SET_CATEGORY: technology'), AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "Maple"', action='SET_CATEGORY: Supercar')]
INFO:services.document_processor:This is the prompt:
Analyze this receipt image and extract the following information in JSON format.
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "mkd": Set category to "technology"
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "Maple": Set category to "Supercar"
JSON Format:
{
"vendor": "Store/company name",
"description": "Detailed description of items/services purchased",
"total_amount": 0.00,
"tax_amount": 0.00,
"date": "YYYY-MM-DD",
"category": "Check rules above first",
"confidence": 0.95,
"currency": "USD",
"location": "Province/State, Country",
"calculated_tax": 0.00,
"is_depreciable": false,
"name_of_asset": null,
"cca_rate": null,
"useful_life": null,
"residual_value": null,
"extraction_success": True
}
EXTRACTION Rules:
- Extract vendor name as it appears on receipt
- Extract description of items/services purchased (e.g., "Coffee and sandwich", "Gasoline", "Office supplies")
- Total amount should be the final total including tax
- Tax amount is separate tax line if available (if not clearly shown, calculate based on location)
- Date should be the date on the receipt
- Confidence score 0-1 based on how clear the receipt is
- Currency should be the currency used on the receipt (e.g., "USD", "EUR", "CAD")
LOCATION & TAX RULES:
- Extract location from receipt (look for store address, province/state, country)
- Format location as "Province/State, Country" (e.g., "Ontario, Canada" or "California, USA")
- If location not shown on receipt, return null for location (system will use user location as fallback)
TAX EXTRACTION RULES (IMPORTANT):
- If tax is EXPLICITLY shown on receipt (even if $0 or 0%), use that exact value:
* If receipt shows "Tax: $0", "Tax: $0.00", "Tax (0%)", or similar → set tax_amount to 0.00 and calculated_tax to null
* If receipt shows any other tax amount → set tax_amount to that value and calculated_tax to null
- If tax_amount is NOT shown or UNCLEAR on receipt, calculate it based on location:
* Ontario, Canada: 13% HST
* Quebec, Canada: 9.975% QST + 5% GST = 14.975% total
* British Columbia, Canada: 12% (5% GST + 7% PST)
* Alberta, Canada: 5% GST
* California, USA: ~7.25% (varies by locality)
* New York, USA: ~8.875% (varies by locality)
* Texas, USA: 6.25%
* For other locations, estimate based on typical rates
* Store calculated tax in "calculated_tax" field and set tax_amount to the calculated value
DEPRECIATION RULES:
- Determine if item is a depreciable asset (vehicles, machinery, equipment, computers, furniture, buildings)
- Set is_depreciable to true only for capital assets, false for consumables/services
- If is_depreciable is true, provide:
* name_of_asset: Specific name/model of the asset (e.g., "2024 Honda Accord", "Dell Laptop XPS 15", "Office Desk")
* cca_rate: CCA rate as decimal (e.g., 0.30 for 30%, 0.20 for 20%, 0.04 for 4%)
- Class 10 (Vehicles): 30%
- Class 8 (Furniture, equipment): 20%
- Class 50 (Computers, software): 55%
- Class 1 (Buildings): 4%
- Class 10.1 (Passenger vehicles >$30k): 30%
* useful_life: Expected years of use (e.g., 5 for computers, 8 for vehicles, 10 for furniture)
* residual_value: Estimated value at end of life (typically 10% of purchase price for equipment, 20% for vehicles)
- If is_depreciable is false, set name_of_asset, cca_rate, useful_life, and residual_value to null
Return only valid JSON.
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:__main__:Extracted receipt data: {'vendor': 'Google LLC', 'description': 'Google Workspace', 'total_amount': 21.15, 'tax_amount': 2.43, 'date': '2025-05-31', 'category': 'cloud service', 'confidence': 0.95, 'currency': 'CAD', 'location': 'Ontario, Canada', 'calculated_tax': None, 'is_depreciable': False, 'name_of_asset': None, 'cca_rate': None, 'useful_life': None, 'residual_value': None, 'extraction_success': True}
INFO: 102.88.104.195:174 - "POST /process/cdad9235-a8e8-45c4-ad84-16f8def25356 HTTP/1.1" 200 OK
INFO: 102.88.104.195:174 - "POST /upload-multiple HTTP/1.1" 200 OK
INFO:__main__:Request: file_id=None user_location=None ai_rules=[AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "mkd"', action='SET_CATEGORY: technology'), AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "Maple"', action='SET_CATEGORY: Supercar')]
INFO:services.document_processor:This is the prompt:
Analyze this receipt image and extract the following information in JSON format.
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "mkd": Set category to "technology"
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "Maple": Set category to "Supercar"
JSON Format:
{
"vendor": "Store/company name",
"description": "Detailed description of items/services purchased",
"total_amount": 0.00,
"tax_amount": 0.00,
"date": "YYYY-MM-DD",
"category": "Check rules above first",
"confidence": 0.95,
"currency": "USD",
"location": "Province/State, Country",
"calculated_tax": 0.00,
"is_depreciable": false,
"name_of_asset": null,
"cca_rate": null,
"useful_life": null,
"residual_value": null,
"extraction_success": True
}
EXTRACTION Rules:
- Extract vendor name as it appears on receipt
- Extract description of items/services purchased (e.g., "Coffee and sandwich", "Gasoline", "Office supplies")
- Total amount should be the final total including tax
- Tax amount is separate tax line if available (if not clearly shown, calculate based on location)
- Date should be the date on the receipt
- Confidence score 0-1 based on how clear the receipt is
- Currency should be the currency used on the receipt (e.g., "USD", "EUR", "CAD")
LOCATION & TAX RULES:
- Extract location from receipt (look for store address, province/state, country)
- Format location as "Province/State, Country" (e.g., "Ontario, Canada" or "California, USA")
- If location not shown on receipt, return null for location (system will use user location as fallback)
TAX EXTRACTION RULES (IMPORTANT):
- If tax is EXPLICITLY shown on receipt (even if $0 or 0%), use that exact value:
* If receipt shows "Tax: $0", "Tax: $0.00", "Tax (0%)", or similar → set tax_amount to 0.00 and calculated_tax to null
* If receipt shows any other tax amount → set tax_amount to that value and calculated_tax to null
- If tax_amount is NOT shown or UNCLEAR on receipt, calculate it based on location:
* Ontario, Canada: 13% HST
* Quebec, Canada: 9.975% QST + 5% GST = 14.975% total
* British Columbia, Canada: 12% (5% GST + 7% PST)
* Alberta, Canada: 5% GST
* California, USA: ~7.25% (varies by locality)
* New York, USA: ~8.875% (varies by locality)
* Texas, USA: 6.25%
* For other locations, estimate based on typical rates
* Store calculated tax in "calculated_tax" field and set tax_amount to the calculated value
DEPRECIATION RULES:
- Determine if item is a depreciable asset (vehicles, machinery, equipment, computers, furniture, buildings)
- Set is_depreciable to true only for capital assets, false for consumables/services
- If is_depreciable is true, provide:
* name_of_asset: Specific name/model of the asset (e.g., "2024 Honda Accord", "Dell Laptop XPS 15", "Office Desk")
* cca_rate: CCA rate as decimal (e.g., 0.30 for 30%, 0.20 for 20%, 0.04 for 4%)
- Class 10 (Vehicles): 30%
- Class 8 (Furniture, equipment): 20%
- Class 50 (Computers, software): 55%
- Class 1 (Buildings): 4%
- Class 10.1 (Passenger vehicles >$30k): 30%
* useful_life: Expected years of use (e.g., 5 for computers, 8 for vehicles, 10 for furniture)
* residual_value: Estimated value at end of life (typically 10% of purchase price for equipment, 20% for vehicles)
- If is_depreciable is false, set name_of_asset, cca_rate, useful_life, and residual_value to null
Return only valid JSON.
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:__main__:Extracted receipt data: {'vendor': 'Figma, Inc.', 'description': 'Professional Full seats (monthly) Jun 19 - Jul 19, 2025', 'total_amount': 27.0, 'tax_amount': 0.0, 'date': '2025-06-19', 'category': 'technology', 'confidence': 0.95, 'currency': 'CAD', 'location': 'Ontario, Canada', 'calculated_tax': None, 'is_depreciable': False, 'name_of_asset': None, 'cca_rate': None, 'useful_life': None, 'residual_value': None, 'extraction_success': True}
INFO: 102.88.104.195:174 - "POST /process/beba5f48-d7db-4797-94bf-5b08ff939b4a HTTP/1.1" 200 OK
INFO: 102.88.104.195:174 - "POST /upload-multiple HTTP/1.1" 200 OK
INFO:__main__:Request: file_id=None user_location=None ai_rules=[AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "mkd"', action='SET_CATEGORY: technology'), AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "Maple"', action='SET_CATEGORY: Supercar')]
INFO:services.document_processor:This is the prompt:
Analyze this receipt image and extract the following information in JSON format.
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "mkd": Set category to "technology"
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "Maple": Set category to "Supercar"
JSON Format:
{
"vendor": "Store/company name",
"description": "Detailed description of items/services purchased",
"total_amount": 0.00,
"tax_amount": 0.00,
"date": "YYYY-MM-DD",
"category": "Check rules above first",
"confidence": 0.95,
"currency": "USD",
"location": "Province/State, Country",
"calculated_tax": 0.00,
"is_depreciable": false,
"name_of_asset": null,
"cca_rate": null,
"useful_life": null,
"residual_value": null,
"extraction_success": True
}
EXTRACTION Rules:
- Extract vendor name as it appears on receipt
- Extract description of items/services purchased (e.g., "Coffee and sandwich", "Gasoline", "Office supplies")
- Total amount should be the final total including tax
- Tax amount is separate tax line if available (if not clearly shown, calculate based on location)
- Date should be the date on the receipt
- Confidence score 0-1 based on how clear the receipt is
- Currency should be the currency used on the receipt (e.g., "USD", "EUR", "CAD")
LOCATION & TAX RULES:
- Extract location from receipt (look for store address, province/state, country)
- Format location as "Province/State, Country" (e.g., "Ontario, Canada" or "California, USA")
- If location not shown on receipt, return null for location (system will use user location as fallback)
TAX EXTRACTION RULES (IMPORTANT):
- If tax is EXPLICITLY shown on receipt (even if $0 or 0%), use that exact value:
* If receipt shows "Tax: $0", "Tax: $0.00", "Tax (0%)", or similar → set tax_amount to 0.00 and calculated_tax to null
* If receipt shows any other tax amount → set tax_amount to that value and calculated_tax to null
- If tax_amount is NOT shown or UNCLEAR on receipt, calculate it based on location:
* Ontario, Canada: 13% HST
* Quebec, Canada: 9.975% QST + 5% GST = 14.975% total
* British Columbia, Canada: 12% (5% GST + 7% PST)
* Alberta, Canada: 5% GST
* California, USA: ~7.25% (varies by locality)
* New York, USA: ~8.875% (varies by locality)
* Texas, USA: 6.25%
* For other locations, estimate based on typical rates
* Store calculated tax in "calculated_tax" field and set tax_amount to the calculated value
DEPRECIATION RULES:
- Determine if item is a depreciable asset (vehicles, machinery, equipment, computers, furniture, buildings)
- Set is_depreciable to true only for capital assets, false for consumables/services
- If is_depreciable is true, provide:
* name_of_asset: Specific name/model of the asset (e.g., "2024 Honda Accord", "Dell Laptop XPS 15", "Office Desk")
* cca_rate: CCA rate as decimal (e.g., 0.30 for 30%, 0.20 for 20%, 0.04 for 4%)
- Class 10 (Vehicles): 30%
- Class 8 (Furniture, equipment): 20%
- Class 50 (Computers, software): 55%
- Class 1 (Buildings): 4%
- Class 10.1 (Passenger vehicles >$30k): 30%
* useful_life: Expected years of use (e.g., 5 for computers, 8 for vehicles, 10 for furniture)
* residual_value: Estimated value at end of life (typically 10% of purchase price for equipment, 20% for vehicles)
- If is_depreciable is false, set name_of_asset, cca_rate, useful_life, and residual_value to null
Return only valid JSON.
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:__main__:Extracted receipt data: {'vendor': 'Bzabaowskyj', 'description': 'Paypal *Bzabaowskyj* 4029357733 On', 'total_amount': 37.55, 'tax_amount': 0.0, 'date': '2024-05-22', 'category': 'cloud service', 'confidence': 0.95, 'currency': 'USD', 'location': None, 'calculated_tax': 0.0, 'is_depreciable': False, 'name_of_asset': None, 'cca_rate': None, 'useful_life': None, 'residual_value': None, 'extraction_success': True}
INFO: 102.88.104.195:174 - "POST /process/4756524a-1118-433b-a0e7-ff2c5a1cc0b7 HTTP/1.1" 200 OK
INFO: 102.88.104.195:174 - "POST /upload-multiple HTTP/1.1" 200 OK
INFO:__main__:Request: file_id=None user_location=None ai_rules=[AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "mkd"', action='SET_CATEGORY: technology'), AIRules(condition='Vendor CONTAINS "aws"', action='SET_CATEGORY: cloud service'), AIRules(condition='Vendor CONTAINS "Maple"', action='SET_CATEGORY: Supercar')]
INFO:services.document_processor:This is the prompt:
Analyze this receipt image and extract the following information in JSON format.
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "mkd": Set category to "technology"
If the Vendor name contains "aws": Set category to "cloud service"
If the Vendor name contains "Maple": Set category to "Supercar"
JSON Format:
{
"vendor": "Store/company name",
"description": "Detailed description of items/services purchased",
"total_amount": 0.00,
"tax_amount": 0.00,
"date": "YYYY-MM-DD",
"category": "Check rules above first",
"confidence": 0.95,
"currency": "USD",
"location": "Province/State, Country",
"calculated_tax": 0.00,
"is_depreciable": false,
"name_of_asset": null,
"cca_rate": null,
"useful_life": null,
"residual_value": null,
"extraction_success": True
}
EXTRACTION Rules:
- Extract vendor name as it appears on receipt
- Extract description of items/services purchased (e.g., "Coffee and sandwich", "Gasoline", "Office supplies")
- Total amount should be the final total including tax
- Tax amount is separate tax line if available (if not clearly shown, calculate based on location)
- Date should be the date on the receipt
- Confidence score 0-1 based on how clear the receipt is
- Currency should be the currency used on the receipt (e.g., "USD", "EUR", "CAD")
LOCATION & TAX RULES:
- Extract location from receipt (look for store address, province/state, country)
- Format location as "Province/State, Country" (e.g., "Ontario, Canada" or "California, USA")
- If location not shown on receipt, return null for location (system will use user location as fallback)
TAX EXTRACTION RULES (IMPORTANT):
- If tax is EXPLICITLY shown on receipt (even if $0 or 0%), use that exact value:
* If receipt shows "Tax: $0", "Tax: $0.00", "Tax (0%)", or similar → set tax_amount to 0.00 and calculated_tax to null
* If receipt shows any other tax amount → set tax_amount to that value and calculated_tax to null
- If tax_amount is NOT shown or UNCLEAR on receipt, calculate it based on location:
* Ontario, Canada: 13% HST
* Quebec, Canada: 9.975% QST + 5% GST = 14.975% total
* British Columbia, Canada: 12% (5% GST + 7% PST)
* Alberta, Canada: 5% GST
* California, USA: ~7.25% (varies by locality)
* New York, USA: ~8.875% (varies by locality)
* Texas, USA: 6.25%
* For other locations, estimate based on typical rates
* Store calculated tax in "calculated_tax" field and set tax_amount to the calculated value
DEPRECIATION RULES:
- Determine if item is a depreciable asset (vehicles, machinery, equipment, computers, furniture, buildings)
- Set is_depreciable to true only for capital assets, false for consumables/services
- If is_depreciable is true, provide:
* name_of_asset: Specific name/model of the asset (e.g., "2024 Honda Accord", "Dell Laptop XPS 15", "Office Desk")
* cca_rate: CCA rate as decimal (e.g., 0.30 for 30%, 0.20 for 20%, 0.04 for 4%)
- Class 10 (Vehicles): 30%
- Class 8 (Furniture, equipment): 20%
- Class 50 (Computers, software): 55%
- Class 1 (Buildings): 4%
- Class 10.1 (Passenger vehicles >$30k): 30%
* useful_life: Expected years of use (e.g., 5 for computers, 8 for vehicles, 10 for furniture)
* residual_value: Estimated value at end of life (typically 10% of purchase price for equipment, 20% for vehicles)
- If is_depreciable is false, set name_of_asset, cca_rate, useful_life, and residual_value to null
Return only valid JSON.
INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK"
INFO:__main__:Extracted receipt data: {'vendor': 'Eleven Labs Inc.', 'description': 'Pro Jun 10 - Jul 10, 2025', 'total_amount': 111.87, 'tax_amount': 12.87, 'date': '2025-06-10', 'category': 'cloud service', 'confidence': 0.95, 'currency': 'USD', 'location': 'New York, United States', 'calculated_tax': None, 'is_depreciable': False, 'name_of_asset': None, 'cca_rate': None, 'useful_life': None, 'residual_value': None, 'extraction_success': True}
INFO: 102.88.104.195:174 - "POST /process/da8b53da-c5c4-43df-9ea1-3765c7ad73df HTTP/1.1" 200 OK