get_total (Receiving_lib)

opensourcepos-mssql · finance, cart-total, bcadd-sum, receiving-total, pos

Calculates the total cost of all items in the receiving cart by summing each item's total using bcadd.

// Source: https://github.com/jepuncolin/opensourcepos-mssql | License: MIT | Copyright 2013-2021 jekkos
// Provided via justclaw.it.com; keep this notice with the code.
	public function get_total()
	{
		$total = 0;
		foreach($this->get_cart() as $item)
		{
			$total = bcadd($total, $this->get_item_total(($item['quantity']), $item['price'], $item['discount'], $item['discount_type'], $item['receiving_quantity']));
		}
		
		return $total;
	}

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

Get a free API key