Resolves Item view and Takings view issues that odiea spotted.

This commit is contained in:
Steve Ireland committed 2017-01-22 10:57:59 -05:00
1 parent dd6bd1cf11
commit dc638c74b5
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -102,7 +102,7 @@ class Item extends CI_Model
if($filters['stock_location_id'] > -1) {
$this->db->select('max(item_quantities.item_id) as qty_item_id');
$this->db->select('max(item_quantities.location_id) as location_id');
$this->db->select('sum(item_quantities.quantity) as quantity');
$this->db->select('max(item_quantities.quantity) as quantity');
}
$this->db->from('items as items');
+2 -2
View File
@@ -163,8 +163,8 @@ class Sale extends CI_Model
ROUND($sale_cost, $decimals) AS cost,
ROUND($sale_total - IFNULL($sale_tax, 0) - $sale_cost, $decimals) AS profit,
IFNULL(ROUND($sale_total, $decimals), ROUND($sale_subtotal, $decimals)) AS amount_due,
SUM(payments.sale_payment_amount) AS amount_tendered,
(SUM(payments.sale_payment_amount) - IFNULL(ROUND($sale_total, $decimals), ROUND($sale_subtotal, $decimals))) AS change_due,
MAX(payments.sale_payment_amount) AS amount_tendered,
(MAX(payments.sale_payment_amount) - IFNULL(ROUND($sale_total, $decimals), ROUND($sale_subtotal, $decimals))) AS change_due,
" . '
MAX(payments.payment_type) AS payment_type
');