Loads a sale's cart, payments, totals, customer, and receipt metadata for rendering sale views. Clears current sale state and returns sanitized data.
// Source: https://github.com/jepuncolin/opensourcepos-mssql | License: MIT | Copyright 2013-2021 jekkos
// Provided via justclaw.it.com; keep this notice with the code.
private function _load_sale_data($sale_id)
{
$this->sale_lib->clear_all();
$cash_rounding = $this->sale_lib->reset_cash_rounding();
$data['cash_rounding'] = $cash_rounding;
$sale_info = $this->Sale->get_info($sale_id)->row_array();
$this->sale_lib->copy_entire_sale($sale_id);
$data = array();
$data['cart'] = $this->sale_lib->get_cart();
$data['payments'] = $this->sale_lib->get_payments();
$data['selected_payment_type'] = $this->sale_lib->get_payment_type();
$tax_details = $this->tax_lib->get_taxes($data['cart'], $sale_id);
$data['taxes'] = $this->Sale->get_sales_taxes($sale_id);
$data['discount'
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key