Workflow

How to Use a Loyalty Card on a Sales Invoice

Verified up to the discount boundary. Demo run sales-invoice-loyalty-card-20260520T025748Z selected customer [910] 100 Ouvidos Lda, added one temporary FT line, looked up loyalty card 509031862, confirmed the active loyalty account, and stopped at the configured discount-line boundary without issuing the invoice.

Step-by-Step

  1. Open /vendas/ft/create and select the billing customer.
  2. Add at least one invoice line so the document has a temporary table line.
  3. In the invoice header, use Fidelizacao / Cartao de Fidelizacao.
  4. Enter the loyalty card number in #fideliz_Cartao.
  5. Click the lookup button #fideliz_Cartao_btn.
  6. Review the returned loyalty account, available points, and whether the card discount button becomes available.
  7. If discounting is available, use the Cartao discount-line modal and enter the points to discount before reviewing totals.

Verified Behavior

CheckObserved result
Route/vendas/ft/create
Card lookup requestaction=fidelizBuscaCartao, num=509031862, tipomov=C, tipoterc_prop=C, and codterc_prop=910.
Lookup responsesuccess:true, account id 13, card id 10, owner customer 910, state A, and qtd_pontos=0.
Discount probefidelizacao&option=add_discount_card_line returned succeeded:false because the demo parameters do not have Artigo para descontos configured.
Temporary document rowsThe invoice still had the original single article line after the failed discount probe.
Safety boundaryNo 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 endpointPurpose
fidelizBuscaCartaoChecks the loyalty card against the selected customer and returns account/card metadata plus available points.
fidelizacao&option=add_discount_card_lineAttempts to create the loyalty discount line from the selected card, customer, temporary document table, total, and requested points.
listaTabDocumentoReloads 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.