Reports

Review Restaurant Sales by Table

Tablewise Report groups completed KOT sale lines by table for one branch and date range. Expand a table to see the contributing sale IDs and item lines; use it for floor and shift reconciliation, not as a list of currently occupied tables.

Menu path
Reports -> Sales -> KOT Reports -> Tablewise Report
Verified from
Posnic demo and current POS source reviewed on 2026-09-08
Technical source evidence

frontend/modules/kotReport.html Tablewise Report tab and table selector, frontend/static/script/js/modules/js/report_kot.js applyTablewiseReportFilter grouping expansion and totals, frontend/static/script/js/modules/js/report_kot.js loadTablewiseTables configured and historical table options, api/src/controllers/sales.controller.js kotTablewiseDetails Report Read boundary, api/src/repositories/sale.repository.js kotTablewiseDetailsPage filters aggregation and calculations, demo.posnic.io KOT Tablewise Report captured on 2026-09-11

KOT Tablewise ReportLive demo captured 2026-09-11. The selected Tablewise Report tab says No Records when no KOT-proceeded sale with a non-empty table number matches the first selected branch and sale-date range.

What This Report Means

QuestionAnswerUse instead when needed
Does it show tables occupied now?No. It reports matching saved KOT sales in the selected sale-date range.Use the active KOT table screen for current occupancy and order state.
Does one row mean one sale?No. The outer row groups all returned sale lines by table number.Expand the row to separate Sale IDs and their item lines.
Can it combine branches?No. The current view sends only the first selected branch.Run each branch separately and retain a clearly named result.
Does it include takeaway?The API requires a non-empty table number, and the browser also skips table number TA.Use Sales Summary or Sales History for takeaway activity.

Run the Report

  1. Open Reports, then Sales.
  2. Open KOT Reports and select Tablewise Report.
  3. Open Filter and choose the sale-date range.
  4. Select one branch. Although the branch control allows multiple selections, this report uses only the first selected branch.
  5. Optionally select one or more table numbers. Leave the table selector on All to include every eligible table.
  6. Select Apply.
  7. Select the plus icon beside a table to expand its sale and item detail.
  8. Reconcile the expanded Sale IDs in Sales History before signing off financial differences.

How the Table Selector Is Built

  • The selector is shown only while Tablewise Report is active.
  • Posnic first loads table values configured in Settings -> Tables.
  • It then adds table numbers found in Daily Sales for the selected branch and date range.
  • Duplicate table labels are removed case-insensitively.
  • Changing the branch or date rebuilds the choices and clears the previous table selection.
  • Selecting All removes individual selections; selecting an individual table removes All.
  • A configured table can appear in the selector even when it has no matching KOT sale in the chosen period.

Which Sales Appear

RuleCurrent behaviorOperational meaning
KOT flagwas_kot_proceeded must be true.Ordinary counter sales are excluded.
Sale processOnly Add, Edit and PartialReturn are eligible.Partial returns can contribute lines; interpret totals with the source sale.
DateThe sale date field is filtered from start through end of day in the shop timezone.The report does not use updated_date for eligibility.
BranchExactly one branch ObjectId is queried from the first selected value.Run branches separately; the table has no branch column.
Tabletable_number must exist and cannot be null or empty; optional selected labels are exact matches.Inconsistent spelling or case can split what staff consider the same physical table.
TakeawayThe browser discards a returned table label of TA.TA is not included in visible table groups or totals.
AccessReport Read permission must be exactly true.An authorization failure is not an empty report.

Read the Table Summary

ColumnWhat it showsCalculation or caveat
Table NoThe persisted table_number used to group matching lines.It is a label, not a current occupancy indicator.
AmountThe sum of each returned line Amount multiplied by its grouped Qty.The API line Amount is a reconstructed pre-tax/base amount; verify unusual tax or discount cases against the receipt.
DiscountSummed item-level discount values.Bill-level extra discount is not included here.
TaxSummed reconstructed line tax.Tax is recalculated from stored line total minus amount after item discount.
TotalAmount minus item Discount plus Tax.This is a browser subtotal and is separate from Total Amount.
Extra DiscountPersisted sale_extra_discount counted once per Sale ID.It is de-duplicated so a multi-line sale does not repeat the bill discount.
Total AmountSum of stored line totals minus de-duplicated extra discounts, floored at zero per table.Compare this with expanded sale totals and receipts; round-off is tracked in code but not shown in this table.

Expand a Table

  • Select the plus icon in the first column; selecting elsewhere on the row does not trigger the explicit handler.
  • The inner table groups returned lines by Sale ID.
  • Date, Sale ID, Extra Discount, Pax and Total Amount are shown once across that sale's item rows.
  • Each item row shows Item Name, Qty, Amount, Discount and Tax.
  • The expanded sale Total Amount uses the saved sales_total when it is positive; otherwise the browser falls back to the sum of returned item totals.
  • The API also returns order type and payment details, but this Tablewise renderer does not display them.
  • Select the minus icon to collapse the detail.

Understand Scope and Totals

  • The API returns the complete matching list without report pagination; the browser groups the full response in memory.
  • The footer totals only the visible, non-TA table groups built from that response.
  • The outer serial number counts displayed table groups, while the inner serial number counts distinct Sale IDs within one table.
  • Items are grouped by sale ID, item ID, item name and item price, so repeated item lines can be combined when those keys match.
  • Results are sorted by table number, updated date, sale ID and item name, even though eligibility uses the sale date.
  • A blank table number is excluded by the API before rendering.

Export and Audit Limitations

  • Tablewise Report has no dedicated export, print, PDF or email control in its tab.
  • The page-level PDF, CSV, Excel and Email controls belong to the KOT Sales Summary workflow and should not be assumed to export the expanded Tablewise grid.
  • Preserve source receipts or Sales History evidence when a durable table-level audit is required.
  • The table does not display branch, operator, customer, payment mode, return status or current table occupancy.
  • Table and item text is inserted into generated HTML without explicit escaping in this renderer; restrict names to trusted business data.
  • For accounting close, reconcile Tablewise totals with Day-End, payment reports and source receipts rather than using this report alone.

Troubleshooting

ProblemCheckAction
No Records appearsFirst selected branch, sale-date range, was_kot_proceeded, eligible process and non-empty table numberTest with a known completed table KOT in the same scope.
Expected branch is missingOrder of selected branch valuesSelect and run one branch only.
A table is in the selector but has no rowWhether it is merely configured or lacks an eligible KOT saleWiden the date range or verify the source sale.
Takeaway is missingWhether table_number is TA or blankUse Sales Summary or Sales History.
Total differs from receiptsPartialReturn records, item tax type, item discount, extra discount and fallback sale totalExpand Sale IDs and reconcile each receipt before using the summary.
Plus icon does not expandWhether the icon in the first column was selectedSelect the plus-circle itself and wait for the detail row.
Need a CSV of the table gridAvailable controls in the active tabUse source reports or a controlled print capture; do not assume the page-level CSV represents Tablewise.