Overview
Tax features in OptiFlow:- Multiple tax types (VAT, sales tax, withholding, etc.)
- Multiple tax rates per transaction
- Exclusive and inclusive tax calculations
- Default taxes for products
- Tax reporting and compliance
- Multi-tax line items
Tax Types
OptiFlow supports different tax classifications:| Type | Description | Calculation | Use Case |
|---|---|---|---|
| ITBIS | Value Added Tax | Exclusive | Dominican Republic VAT (18%) |
| ISC | Selective Consumption Tax | Exclusive | Luxury goods, alcohol, tobacco |
| Withholding | Income Tax Withholding | Exclusive | Professional services withholding |
| Sales Tax | General Sales Tax | Exclusive/Inclusive | State/local sales taxes |
TaxType enum in app/Enums/TaxType.php
Exclusive vs. Inclusive Taxes
Exclusive Taxes (most common):- Tax is added to the subtotal
- Calculation: Subtotal + (Subtotal × Tax Rate) = Total
- Example: 100 × 18%) = $118
- Tax is already included in the price
- Calculation: Total ÷ (1 + Tax Rate) = Subtotal
- Example: 100 subtotal, $18 tax
Creating Tax Rates
Navigate to Tax Configuration
Go to Settings → Taxes → Create TaxReference:
TaxController::create() in app/Http/Controllers/TaxController.php:66Enter Tax Details
Required Fields:Name: Descriptive name for the tax
- Examples: “ITBIS 18%”, “ISC Alcoholes 10%”, “Retención 10%”
- Should clearly indicate the purpose and rate
- ITBIS (VAT)
- ISC (Selective Consumption)
- Withholding
- Sales Tax
- Other
- Enter as a number (e.g., 18 for 18%)
- Supports up to 2 decimal places (e.g., 7.5 for 7.5%)
- Can be 0 for exempt/zero-rated items
- Default taxes are pre-selected when creating invoices
- Useful for commonly applied taxes like standard VAT
Tax Configuration Examples
Dominican Republic Standard Setup
Setting Default Product Taxes
Assign default taxes to products for faster invoice creation:Select Default Tax
Choose the tax that typically applies to this product:
- Standard products: ITBIS 18%
- Alcohol/tobacco: ISC + ITBIS
- Exempt items: Exento (0%)
- Services: Withholding tax
Default taxes are suggestions only. Users can still modify or add taxes when creating invoices.
Applying Taxes to Invoices
Single Tax per Line Item
Most common scenario:- Create invoice
- Add product line item
- Tax auto-populates from product default
- Or manually select tax from dropdown
- Tax amount calculated: Quantity × Unit Price × Tax Rate
Multiple Taxes per Line Item
For complex scenarios (e.g., ISC + ITBIS on alcohol):Select Multiple Taxes
In the tax field:
- Click to open multi-select
- Select first tax (e.g., “ISC Alcoholes 10%”)
- Select second tax (e.g., “ITBIS 18%”)
- Both taxes apply
Tax Calculation
Taxes are calculated based on type:Exclusive taxes (most common):
- Both calculated on subtotal
- Example: $100 product
- ISC 10%: $10
- ITBIS 18%: $18
- Total: 10 + 128
- Second tax on subtotal + first tax
- Example: $100 product
- ISC 10%: 100)
- ITBIS 18%: 110)
- Total: 10 + 129.80
InvoiceController::create()
Tax Calculation Details
Line Item Tax Calculation
Invoice Total Calculation
- Calculate line subtotal (quantity × price)
- Apply line discount
- Calculate taxes on (subtotal - discount)
- Sum all lines for invoice totals
Viewing Tax Usage
Navigate to Tax Detail
Go to Settings → Taxes → Select a taxReference:
TaxController::show() in app/Http/Controllers/TaxController.php:88View Usage Statistics
Tax detail page shows:
- Number of products using this as default tax
- Number of invoice line items with this tax
- Number of quotation line items with this tax
- Total tax amount collected (if available)
Editing Tax Rates
Navigate to Tax
Go to Settings → Taxes → Select tax → EditReference:
TaxController::edit() in app/Http/Controllers/TaxController.php:101Check If In Use
System displays warning if tax is currently in use:If tax is in use:
- Safe to change: Name, default status
- Use caution: Rate (creates inconsistency in reporting)
- Not recommended: Type (may cause calculation issues)
Make Changes
Update fields as needed:
- Name: Safe to update
- Rate: Update if tax rate changed by government
- Default: Safe to toggle
- Type: Avoid changing if in use
Best Practice: Rate Changes
When tax rates change (e.g., government changes VAT from 18% to 20%):
This approach maintains clear audit trail and reporting.
Deleting Taxes
Navigate to Tax
Go to Settings → Taxes → Select tax → DeleteReference:
TaxController::destroy() in app/Http/Controllers/TaxController.php:125Validation Check
System checks if tax can be deleted:Cannot delete if:Solution:
- Tax is used on any invoice line items
- Tax is used on any quotation line items
- Tax is set as default on any products
- Remove tax from all products first
- Tax remains on historical invoices (preserved for records)
- Mark as inactive instead of deleting
Tax Reporting
Available Tax Reports
-
Tax Collection Report
- Navigate to Reports → Tax Reports → Tax Collection
- View tax collected by:
- Tax type
- Date range
- Customer
- Product category
-
Tax Liability Report
- Taxes owed to tax authorities
- Breakdown by tax type
- Filing period summary
-
Withholding Tax Report
- Withholding taxes collected
- By vendor/customer
- Compliance reporting format
-
Exempt Sales Report
- Zero-rated and exempt sales
- Justification tracking
Exporting Tax Data
Common Tax Scenarios
Scenario 1: Standard Product Sale (Dominican Republic)
Product: Electronics Tax: ITBIS 18% Calculation:- Subtotal: $1,000
- ITBIS 18%: $180
- Total: $1,180
Scenario 2: Alcohol Sale (Multiple Taxes)
Product: Wine Taxes: ISC 10% + ITBIS 18% Calculation:- Subtotal: $100
- ISC 10%: $10
- ITBIS 18%: $18
- Total: $128
Scenario 3: Professional Services (Withholding)
Service: Consulting Taxes: Service Fee + Withholding 10% Calculation:- Service Fee: $1,000
- Withholding 10%: $100 (retained by payer)
- Payment to Provider: $900
- Amount Due to Tax Authority: $100
Scenario 4: Exempt Sale
Product: Basic food items (exempt) Tax: Exento (0%) Calculation:- Subtotal: $50
- Tax: $0
- Total: $50
Compliance and Best Practices
Troubleshooting
Wrong Tax Amount on Invoice
Problem: Tax calculation appears incorrect Investigation:- Check if discount was applied (tax is on discounted amount)
- Verify correct tax rate was selected
- Check if multiple taxes are applied
- Review if tax is inclusive vs. exclusive
Cannot Delete Tax
Problem: “No se puede eliminar el impuesto porque está siendo utilizado” Solution:- Check products using this tax → update their default tax
- Tax remains on historical invoices (this is correct behavior)
- Consider making inactive instead of deleting
Tax Not Appearing in Dropdown
Problem: Created tax doesn’t show when creating invoice Cause: May be filtered by type or marked inactive Solution:- Verify tax is active
- Check if tax type is appropriate for the document
- Refresh the page
Incorrect Tax Report Totals
Problem: Tax report totals don’t match expectations Investigation:- Verify date range is correct
- Check workspace filter (multi-workspace environments)
- Ensure invoice statuses are included (paid vs. pending)
- Review if cancelled invoices are excluded
Advanced Configuration
Tax Exemptions
For customers exempt from certain taxes:- Create “Exempt” tax rate (0%)
- When creating invoice for exempt customer, select “Exempt” tax
- Document exemption reason in invoice notes
- Maintain exemption certificates on file
Reverse Charge
For B2B transactions where buyer collects tax:- Create “Reverse Charge” tax type (0%)
- Apply to invoice
- Note in invoice: “Reverse charge applies”
- Buyer remits tax to authority