Sales
Edit and Reconcile a Saved Sale
Editing a saved sale is a financial and inventory correction, not a display-only change. Posnic rebuilds the sale from the submitted cart, adjusts tracked stock by line differences, updates its register entry and can change the period used by reports.
- Menu path
- Home -> Sales History -> select sale -> Edit
- Verified from
- Posnic demo and current POS source reviewed on 2026-09-08
Technical source evidence
frontend/modules/sales_read.html saved-sale selection and detail pane, frontend/static/script/js/modules/js/sales.js showEdit editItems dataEdit submission success routing and manager approval retry, api/src/controllers/sales.controller.js update access validation audit and approval boundary, api/src/services/sale.service.js edit document rebuild stock deltas register update and transaction handling, demo.posnic.io populated saved-sale edit captured on 2026-09-11
Before You Edit
- Prefer correcting the cart before the original sale is saved.
- Use Edit only for a genuine correction to the same transaction; create a return or exchange when goods came back after completion.
- Locate the exact Bill # in Sales History and open its invoice pane.
- Verify customer, item lines, quantities, total, payment mode and status before selecting the pencil icon.
- Record the reason and obtain manager authorization according to shop policy, especially after money or goods have changed hands.
- Capture the original receipt or values when your audit policy requires before-and-after evidence.
Open the Edit Workspace
- Open Home, then Sales History.
- Search for the exact Bill # and select its row.
- Read the invoice pane and confirm it is not merely a similar total or customer.
- Select the Edit pencil. Sales Write permission is required.
- Wait for the customer and every saved item line to load.
- Confirm the heading says Edit Sale and the displayed total still matches the source bill before changing anything.
What You Can Change
| Area | Current edit behavior | Check before Update |
|---|---|---|
| Customer | The saved customer fields are repopulated and can be replaced through the customer picker. | Credit, wallet, GST identity and contact details belong to the intended customer. |
| Items | Add catalog items, remove existing lines or change quantities. | Every tracked-item difference moves stock after a successful update. |
| Price | The line pencil can change editable price values. | Price overrides are written to the sale audit when they differ from the original. |
| Discount | Line discount and extra discount controls are available. | A discount change is audited and can require manager approval. |
| Tax | Line tax is rebuilt through the normal sale calculation. | Confirm inclusive or exclusive treatment and the final tax amount. |
| Notes | Payment, sale and discount notes can be changed. | Write a concise correction reason without sensitive customer data. |
| Payment | PAY opens the normal tender flow and sends payment mode, multi-payment, partial balance, wallet and denomination values. | Reconcile against money already collected; editing the label does not reverse an external card or UPI transaction. |
| Date | The normal saved-sale date field is read-only and the existing value is submitted. | Reports using updated_date can still be affected because the record is rewritten with the submitted date value. |
Update the Sale
- Make the smallest required correction.
- Recheck each line's quantity, unit, price, discount, tax and total.
- Confirm customer and note fields.
- Select PAY and reconcile the complete tender state, even when the correction appears item-only.
- If Posnic requests manager approval for a discount, provide an authorized PIN or card; the browser retries the update once with that approval token.
- Complete Update and wait for a success response.
- Posnic clears its item cache and returns a normal saved-sale edit to Sales History.
- Reopen the same Bill # and verify the corrected invoice.
Stock Consequences
| Change | Tracked-stock action | Stock log when enabled |
|---|---|---|
| Increase an existing quantity | Subtract the positive quantity difference. | Edit Sale with Subtract and the bill reference. |
| Reduce an existing quantity | Add the quantity difference back. | Edit Sale with Add and the bill reference. |
| Add a new tracked item | Subtract its full submitted quantity. | Edit Sale with opening and closing balances. |
| Remove a tracked item | Add its old full quantity back. | Edit Sale records the cancelled line difference. |
| Untracked item | No inventory movement. | No tracked-stock adjustment is expected. |
Financial and Record Consequences
- The existing sale document is updated in place; the human-readable Bill # is retained.
- The sale process becomes Edit for a normal completed sale. A held sale is converted to Add, while dedicated KOT edit paths follow separate KOT rules.
- Server-side totals are recalculated from normalized submitted items, with payload totals used only as fallback when server values are unavailable.
- The linked register_sales entry is updated with the corrected total, discount, tax and payment information when a register ID is supplied.
- Customer partial-payment or wallet transaction data can also be updated when the sale belongs to that flow.
- The edit payload sets return totals, return tax, return discount and returned-item arrays back to empty or zero. Do not use Edit as a substitute for changing a completed return record.
- The update emits sync activity after the sale is saved so offline/cloud copies can receive the corrected transaction.
Permissions, Approval and Audit
| Control | Enforcement | Evidence |
|---|---|---|
| Open source bill | Sales Read permission. | The original invoice and Bill #. |
| Submit edit | Sales Write permission; missing permission returns 403. | Updated sale with the same record ID. |
| Discount change | Manager approval can be required by role policy. | Discount audit event and approval context. |
| Price change | Compared with the original sale on the server. | Price override audit event with changed lines. |
| Stock movement | Only tracked items move; detailed logging follows stock-management settings. | Inventory Logs with Edit Sale reference. |
| Register movement | Existing register entry is replaced when linked. | Register session and close reconciliation. |
Verify After Update
- Search the same Bill # in Sales History and open it.
- Compare customer, every line, subtotal, discount, tax, total and payment with the intended correction.
- Open Inventory Logs and verify one Explainable Edit Sale delta for every tracked item changed.
- Check the current register and payment reports for the corrected tender and amount.
- Check customer dues or wallet when partial payment or customer balance was involved.
- Check price-change and discount audit records when those values changed.
- Print or share a replacement receipt only after the corrected bill passes these checks.
Troubleshooting
| Problem | Check | Action |
|---|---|---|
| Edit pencil is absent or disabled | Sales Write permission and whether the record is already a return context | Ask an authorized role; do not work around access with a duplicate sale. |
| At least one valid sale item required | Whether every line was removed or became invalid | Keep the required corrected lines or use the return/void workflow. |
| Discount needs manager approval | Role discount policy and changed discount values | Obtain a valid manager approval and submit once. |
| Stock changed unexpectedly | Old versus new quantities, track_inventory and duplicate item lines | Reconcile Inventory Logs against the exact Bill # and each item delta. |
| Tender no longer matches the processor | Edited payment mode versus external card, UPI or gateway settlement | Correct the POS record under policy and reconcile the external transaction separately. |
| Return information disappeared | Whether Edit was used on a returned transaction | Use return-specific history and audit evidence; Edit resets return-specific fields in the submitted update. |
| Sale moved into a different report period | Which report filters date versus updated_date | Reconcile the original business date and the report's eligibility field. |
| Update succeeded but item search looks stale | Whether the client cache refreshed | Return to Sales History or reload; successful edits clear the item cache. |