Files
opensourcepos/tests/Models
objecttothis c004a3f412 feat(items): add server-side "export all" download for items table
Add ability to export the items manage-table results (respecting
current search/filters/sort) to downloadable files in multiple
formats, instead of only the on-screen page.

- app/Controllers/Items.php: new getExportAll(format) endpoint that
  re-runs the current search/filter query, builds raw export rows via
  getItemExportRow(), times db/build/write phases for debug logging,
  and streams back either a PDF response or a generic file download.
- app/Helpers/export_helper.php (new): shared writer dispatch
  (generateExportFile) supporting csv, txt, json, xml, sql, xlsx and
  pdf formats, with per-format value coercion (currency/quantity/
  numeric columns), XLSX temp-file caching with stale-file sweeping,
  and SQL INSERT generation keyed off the target table name.
- app/Helpers/tabular_helper.php: add itemExportHeaders() (manage
  table columns minus UI-only icon columns) and getItemExportRow()
  (unformatted raw values for export consumers); rename
  expand_attribute_values() to expandAttributeValues() and add a
  $raw flag to skip locale decimal formatting for exports.
- app/Controllers/Reports.php: update call sites for the
  expandAttributeValues() rename.
- app/Config/Autoload.php: autoload new 'export' helper.
- app/Config/Mimes.php: register .sql mime type for export downloads.
- app/Controllers/Items.php: getSearch() now defaults missing
  'search' param to '' instead of null.

Signed-off-by: objecttothis <17935339+objecttothis@users.noreply.github.com>
2026-10-13 15:17:53 +04:00
..