Sale Invoice
Sale Invoices are simplified invoices for B2C retail transactions where buyer tax information is not required.
Overview
| Attribute | Value |
|---|---|
| Service | SaleInvoiceService |
| Tax Deductible | No |
| Buyer Info | Optional |
| CQT Submission | Required |
When to Use
- Retail sales to individual consumers
- Customer doesn't need tax deduction
- Quick checkout scenarios
- Anonymous sales
Required Fields
typescript
{
// Seller (your company)
seller: {
taxCode: '0123456789',
name: 'Your Company',
address: '123 Street',
},
// Buyer (optional for sale invoices)
buyer: {
name: 'Walk-in Customer', // Can be generic
},
// Invoice details
invoiceDate: new Date(),
currencyCode: 'VND',
// Items
items: [
{
itemName: 'Product',
quantity: 1,
unitPrice: 50000,
amount: 50000,
},
],
// Totals
totalAmount: 50000,
totalPayment: 50000,
}Create Sale Invoice
typescript
import { SaleInvoiceService } from '@nx-3rd/iiapi';
const invoice = await this.saleInvoiceService.create({
seller: {
taxCode: process.env.COMPANY_TAX_CODE,
name: process.env.COMPANY_NAME,
address: process.env.COMPANY_ADDRESS,
},
buyer: {
name: customerName || 'Khách lẻ', // Walk-in customer
},
invoiceDate: new Date(),
currencyCode: 'VND',
items: cartItems.map(item => ({
itemName: item.name,
unitName: item.unit || 'Cái',
quantity: item.quantity,
unitPrice: item.price,
amount: item.quantity * item.price,
})),
totalAmount: cartTotal,
totalPayment: cartTotal,
paymentMethod: 'CASH',
});Difference from VAT Invoice
| Aspect | VAT Invoice | Sale Invoice |
|---|---|---|
| Buyer tax code | Required | Not required |
| Tax deductible | Yes | No |
| VAT breakdown | Detailed | Simplified |
| Use case | B2B | B2C retail |