nfse_calculate
Calculate taxes before issuing, without issuing a document, reserving credits or creating a DPS. By default it is for an NFS-e (amount, service_code...). With type "nfe" or "nfce" it previews the taxes of goods for a Simples Nacional company: send company_id and the nfe object with items[] {ncm, cfop, quantity, unitPrice, origin?, tax? {csosn, pCredSN?}} (recipient and payments are not needed). Per item it returns vTotTrib and approximateTaxes (Lei 12.741/2012, IBPT table of the UF of the issuer: federal, state, municipal, total, percent, source, version), icmsSn with the credit of CSOSN 101 (pCredSN, vCredICMSSN; the company rate comes from its NF-e settings) and ibsCbs (null while the NF-e does not require it), then totals and warnings. An NCM missing in the IBPT table gives a warning and no vTotTrib: Arquivix Notas never guesses a rate. Issuing and validating fill the same values in the note; values sent in the item win.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "nfse_calculate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nfe | No | Only with type "nfe" or "nfce": items[] {ncm, cfop, quantity, unitPrice, discount?, freight?, insurance?, other?, vTotTrib?, origin?, tax? {csosn, origin?, pCredSN?, vCredICMSSN?}}, same fields as the note; recipient and payments are optional here. | |
| type | No | What to calculate: "nfse" (default, a service), "nfe" (goods, model 55) or "nfce" (sale to the consumer, model 65). | nfse |
| amount | No | Valor do serviço em reais, ex.: 1500.00. | |
| deduction | No | Deduction from the ISS tax base in BRL, declared by the issuer. | |
| company_id | No | UUID da empresa emissora. | |
| description | No | Descrição do serviço (opcional). | |
| service_code | No | Código de serviço cTribNac com 6 dígitos, ex.: "010101"; padrão o da empresa. | |
| company_tax_id | No | CNPJ da empresa emissora, só dígitos; alternativa a company_id. | |
| competence_date | No | Data de competência AAAA-MM-DD; padrão hoje (horário de Brasília). | |
| municipality_code | No | Código IBGE do município com 7 dígitos, ex.: "2304400"; padrão o da empresa. |