Project Description
# BillingPie Tally TDL Integration - Summary
## Project Overview
BillingPie integration with Tally ERP to automatically sync and create sale vouchers from billing data through a TDL (Transaction Definition Language) file.
---
## Key Requirements
### **Configuration Setup**
- Load TDL file into Tally once during initialization
- Add "Billing Pie - Config" setting in Tally gateway right-bar section
- Users input and save:
- API URL
- API Token
### **Sync Functionality**
- Add "Sync - Billing Pie" option in Gateway > Transactions section (below Day Book)
- Calls API endpoint: `APIURL/integration/tally/sync` with API token
- Creates Sale Vouchers with current date (Option = true)
- Batch processing: 50 invoices per sync request
- Multiple sync calls needed for >50 pending invoices
### **Data Handling**
- **Input**: API returns pending invoices from BillingPie
- **Output**: Sale Vouchers created in Tally
- **Mapping**: Store BillingPie Order ID as reference in Tally for easy lookup and tracking
- **No Manual Creation**: Parties, Items, and Ledgers must already exist in Tally
### **Error Handling**
- Show error message if required entity not found: "X thing was not found in Tally"
- Test behavior for: missing parties, missing items, missing ledgers
- Determine strategy: fail entire batch vs. partial processing
### **Testing Approach**
- Mock PHP API: `http://localhost/tdl-dev/mock.php`
- Test cases:
- Successful voucher creation
- Missing party scenarios
- Missing item scenarios
- Mixed success/failure batches
- Mock API ignores token validation