HEX
Server: LiteSpeed
System: Linux s12873.lon1.stableserver.net 5.14.0-611.11.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Dec 3 09:47:37 EST 2025 x86_64
User: jairicem (1242)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: /home/jairicem/4pfxclusive.ng/app/logs/log-2021-06-04.php
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>

ERROR - 2021-06-04 16:48:16 --> Query error: Unknown column 'sma_categorie.id' in 'field list' - Invalid query: SELECT sma_categorie.id as cid, sma_categories.code, sma_categories.name, SUM( COALESCE( PCosts.purchasedQty, 0 ) ) as PurchasedQty, SUM( COALESCE( PSales.soldQty, 0 ) ) as SoldQty, SUM( COALESCE( PCosts.totalPurchase, 0 ) ) as TotalPurchase, SUM( COALESCE( PSales.totalSale, 0 ) ) as TotalSales, (SUM( COALESCE( PSales.totalSale, 0 ) )- SUM( COALESCE( PCosts.totalPurchase, 0 ) ) ) as Profit
FROM `sma_categories`
LEFT JOIN ( SELECT sp.category_id as category, SUM( si.quantity ) soldQty, SUM( si.subtotal ) totalSale from sma_products sp
                left JOIN sma_sale_items si ON sp.id = si.product_id
                left join sma_sales s ON s.id = si.sale_id  GROUP BY sp.category_id ) PSales ON `sma_categories`.`id` = `PSales`.`category`
LEFT JOIN ( SELECT pp.category_id as category, SUM( pi.quantity ) purchasedQty, SUM( pi.subtotal ) totalPurchase from sma_products pp
                left JOIN sma_purchase_items pi ON pp.id = pi.product_id
                left join sma_purchases p ON p.id = pi.purchase_id  GROUP BY pp.category_id ) PCosts ON `sma_categories`.`id` = `PCosts`.`category`
WHERE parent_id is NULL
GROUP BY `sma_categories`.`id`, `sma_categories`.`code`, `sma_categories`.`name`, `PSales`.`SoldQty`, `PSales`.`totalSale`, `PCosts`.`purchasedQty`, `PCosts`.`totalPurchase`
ORDER BY `sma_categories`.`code` ASC
 LIMIT 10