Skip to main content

Credit Note / Product Return

Use this feature to create a credit note from an invoice, either with a physical product return or as a financial-only credit. The same rules apply in Mobile and POS Terminal; only the screen layout differs.

Where to open it

AppEntry point
MobileCreditNoteListCreditNoteDetail, or the return action from an invoice
POS TerminalcreditNote split-pane menu, or Open product return from invoice detail

The list is scoped to the selected branchId and whGrpCode. It supports search, status filtering, refresh, and pagination. Has product return is enabled by default and sends isReturn=1; turn it off to include financial-only credit notes.

End-to-end return flow

  1. Open an invoice and start a product-return draft. The system copies invoice/customer/company/warehouse context, the responsible salesperson, and the invoice items. Existing credit notes also reload their linked invoice so that the source-item picker remains available.
  2. Select Reason 1. This is required before an item can be added and before the document can be saved.
  3. Select an item from the invoice. The source quantity, price, amount, UOM, warehouse, tax, and weight settings seed the credit-note item.
  4. Set the return type, returned quantity (qtyCN), and credit amount (priceCN). The client blocks a return quantity higher than the source item quantity and a credit amount higher than the source item amount.
  5. Save the item. The first item save creates the document as DRAFT when necessary; subsequent saves refresh the document and totals.
  6. For a physical return (isReturn = 1), an authorized warehouse user selects a Lot/Batch under Location. The choices come directly from GET /api/invoices/{invoiceId}?includeLot=true, specifically the matching invoice item's lots data. No /api/products/lot request is made and no current warehouse-stock availability is checked.
  7. Selecting a Lot sends one lot record to the credit-note item: { lotNo, qty: qtyCN }. Therefore the recorded return quantity always follows the credit-note item, not the invoice-lot display quantity. If several invoice lines share a product code, the displayed lot quantities are combined by Lot number only for selection.
  8. Add evidence images after the document exists, where permitted. Save or forward the document according to the role and status rules below.
  9. Before B1 submission, every physical-return item must have a selected Lot and at least one of warehouse checks Q1/Q2/Q3 must be checked. Temperature is recorded as document data but has no additional client-side range validation.

Lot and return rules

RuleClient behavior
Invoice sourceInvoice detail is requested with includeLot=true.
Lot pickerUses invoice.items[].lots; each lotNo is displayed as a Batch, with its invoice quantity.
Stock checkNot performed for this return flow. A return is not blocked because current stock is lower than qtyCN.
Quantity sent for a selected lotExactly the credit-note item qtyCN.
Physical returnisReturn = 1; a Lot is mandatory before B1 submission.
Financial-only creditisReturn = 0; no Location/Lot requirement before B1 submission.
Source-item validationqtyCN must not exceed source qty; priceCN must not exceed source amount.
Multiple lotsThe current UI selects one Lot per credit-note item and sends one-element lots payload.

Status and save behavior

The client displays these statuses: DRAFT, NEW, WAITINGCN, INVUPDATE, RECEIVED, APPROVED/APPROVE, CANCELED, and ERRORRECEIVED.

Actor / actionResult or guard
Initial save of a new documentCreates DRAFT.
Non-warehouse save with a physical-return itemUpdates to WAITINGCN.
Non-warehouse save without a physical-return itemUpdates to NEW.
Warehouse save from WAITINGCNUpdates to INVUPDATE.
Warehouse save from INVUPDATERemains INVUPDATE.
Warehouse save from another statusBlocked with a prompt to wait for warehouse processing.
B1 submitCalls the B1 endpoint, then updates the document to RECEIVED on success.
Already sent to B1Submission is blocked when datetimeToB1 is present.
Received documentEditing actions are read-only/disabled.

Permissions

All department values below are deptCode. The B1 user-code overrides are 012142, 012570, 012544, 012051, and 012566.

CapabilityPermission and conditions
Open the Credit Note menu (Mobile/POS Terminal)-2, 1, 2, 3, 4, 7, 8, 9, 12, 13, 16, 20, 21, 22, 23, 27, 28, 29, or the configured menu user-code override.
Create from the Mobile list-2, 1, 2, 4, 7, 8, 9, 12, 16, 22, 28, 29.
Save document7, 8, 9, 12, 22, 28, 29, and status must be DRAFT, NEW, WAITINGCN, or INVUPDATE.
Add itemDocument is not RECEIVED and current user is the document owner.
Edit item quantity/amountNot RECEIVED, document owner, and 7, 12, 22, 28, 29.
Delete itemNot RECEIVED and document owner.
Select Location/LotNot RECEIVED, physical-return item, and 12, 22, 28 at any branch. Departments 20 and 23 also have this permission when the selected branch has isMain = false; B1 user-code overrides remain allowed. Ownership is not required.
Warehouse inspection fields8, 9, 12, 22, 28, 29; Q1/Q2/Q3 and temperature become read-only after RECEIVED.
Add/delete image evidenceDocument already exists and is not RECEIVED.
Send to B1Document exists, is not RECEIVED, caller is 8, 9, 12, 20, 22, 23, 28, 29 or B1 user-code override, datetimeToB1 is empty, required Lots are set, and at least one of Q1/Q2/Q3 is selected when there is a physical return.
Delete document from the listNever when RECEIVED, APPROVED, or APPROVE. Otherwise it is allowed to cancel departments -2, 1, 2, 4, 12, 22, 28; for DRAFT/NEW the owner may delete; for WAITINGCN/INVUPDATE deletion is allowed. Confirmation is always required.

API map

OperationAPI/client service
ListGET /api/credit-notes via getCreditNotes, with branch/warehouse scope and optional status, search, and isReturn
Credit-note detailGET /api/credit-notes/{creditNoteId}
Source invoice and LotsGET /api/invoices/{invoiceId}?includeLot=true
Create/update headerPOST/PUT /api/credit-notes
Create/update/delete item/api/credit-notes/{creditNoteId}/items
Save selected LotPUT /api/credit-notes/{creditNoteId}/items/{itemId}/lots with lots: [{ lotNo, qty }]
Image evidenceCredit-note file upload/delete endpoints
B1Credit-note post-to-B1 endpoint, followed by a status update to RECEIVED

Mobile and POS Terminal parity

Both clients use the same source-invoice Lots, item validation, status transitions, B1 gates, and department/user overrides. Mobile presents a stack and modals; POS Terminal presents the CreditNoteDetailForm inside the split pane. POS Terminal keeps sourceInvoiceItems when a persisted credit note is opened so that its Lot picker uses the same invoice payload.