Workflow

How to Handle Overpayment on a Simplified Invoice

Verified end to end. Demo run simplified-invoice-overpayment-20260519T225200Z created an FS total of 1.97, added a cash payment of 2.00, received troco:0.03, and saved finished document FS 9999/9.

Evidence Summary

Route
/vendas/fs/create
Final document
999900009 / FS 9999/9
Customer
[910] 100 Ouvidos Lda
Article line
AI-DEMO-20260519-021105, quantity 1, total 1.97
Payment
[NUM] Numerario amount 2.00; change 0.03
Evidence file
raw/playwright/workflows/latest-simplified-invoice-overpayment.json

Verified simplified invoice overpayment workflow

When to Use This

Use this when a customer pays a simplified invoice with more cash than the document total. OfficeGest accepts the payment because it covers the total, calculates the difference as change, and saves the FS as finished.

Step-by-Step

  1. Create the Simplified Invoice [FS] and confirm the final total.
  2. Click End to open the Payment modal.
  3. Select the payment method. The verified run used [NUM] Numerario.
  4. Enter the amount received from the customer. The verified run entered 2.00 against total 1.97.
  5. Click Save in the Payment modal.
  6. Confirm the final save dialog if OfficeGest asks.
  7. Check the FS list row. The document should be LIQ / Finished, with paid value equal to the document total.

Verified Behavior

CheckObserved result
Payment rowpayment&option=add created a NUM row with value 2.
Payment validationpayment&option=validate returned valid:true and troco:0.03.
Final savesaveDocument returned OKDOC and redirected to /vendas/fs/view/OTk5OTAwMDA5.
FS list resultFS 9999/9 was LIQ / Finished with total 1.97, ValorPago=1.97, and pending value 0.00.
Important distinctionThe entered payment row was 2.00, but the FS list paid value stayed equal to the document total, not the cash received.
Stock effectWarehouse 1 stock decreased from -28 to -29 after final save.

Backend Calls Observed

Action or endpointPurpose
payment&option=addAdds the cash row with the received amount.
payment&option=validateAccepts payment greater than the document total and returns the change value.
saveDocumentFinishes the FS after payment validation succeeds.
DT_List_Documentos&table=FactSimVerifies the finished simplified invoice row after save.

Raw evidence: raw/playwright/workflows/simplified-invoice-overpayment-20260519T225200Z.json. Screenshots: assets/screenshots/simplified-invoice-overpayment-20260519T225200Z-01-fr-line-before-payment.png through assets/screenshots/simplified-invoice-overpayment-20260519T225200Z-03-fr-list.png.