Step-by-Step
- Open
/vendas/ft/createand select the billing customer. - Add at least one invoice line so the document has a temporary table line.
- In the invoice header, use Fidelizacao / Cartao de Fidelizacao.
- Enter the loyalty card number in
#fideliz_Cartao. - Click the lookup button
#fideliz_Cartao_btn. - Review the returned loyalty account, available points, and whether the card discount button becomes available.
- If discounting is available, use the Cartao discount-line modal and enter the points to discount before reviewing totals.
Verified Behavior
| Check | Observed result |
|---|---|
| Route | /vendas/ft/create |
| Card lookup request | action=fidelizBuscaCartao, num=509031862, tipomov=C, tipoterc_prop=C, and codterc_prop=910. |
| Lookup response | success:true, account id 13, card id 10, owner customer 910, state A, and qtd_pontos=0. |
| Discount probe | fidelizacao&option=add_discount_card_line returned succeeded:false because the demo parameters do not have Artigo para descontos configured. |
| Temporary document rows | The invoice still had the original single article line after the failed discount probe. |
| Safety boundary | No saveDocument, saveRascunho, print, payment, or delete-document request was submitted. |
This verifies card selection and the current discount boundary in the demo tenant. A full loyalty discount application requires both points on the card and a configured loyalty discount article in Configuracoes > Parametros > Fidelizacao.
Backend Calls Observed
| Action or endpoint | Purpose |
|---|---|
fidelizBuscaCartao | Checks the loyalty card against the selected customer and returns account/card metadata plus available points. |
fidelizacao&option=add_discount_card_line | Attempts to create the loyalty discount line from the selected card, customer, temporary document table, total, and requested points. |
listaTabDocumento | Reloads the temporary document lines used to confirm the failed discount probe did not add a row. |
Raw evidence: raw/playwright/workflows/sales-invoice-loyalty-card-20260520T025748Z.json. Screenshots: assets/screenshots/sales-invoice-loyalty-card-20260520T025748Z-01-create-page.png through assets/screenshots/sales-invoice-loyalty-card-20260520T025748Z-04-loyalty-discount-boundary.png.