_load_sale_data

ospos · pos, sale-data-loading, receipt-rendering

Loads sale details, cart, payments, taxes, totals, customer, and receipt config into a cleaned array for rendering sale documents.

// Source: https://github.com/Pmbamungu/ospos | 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'] = $this->sale

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key