reports
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
session_start();
|
||||
require '../../../assets/utils/db_auth.php';
|
||||
require '../../../assets/utils/classes/Reports.php';
|
||||
|
||||
$month = $data['month'] ?? date('Y-m');
|
||||
$report = new Reports($pdo2, $company_id);
|
||||
|
||||
$stats = $report->getDashboardStats($month);
|
||||
|
||||
$answer['output'] = [
|
||||
'total_in' => $stats['total_in'],
|
||||
'total_out' => $stats['total_out'],
|
||||
'active_products' => $stats['active_products'],
|
||||
'low_stock' => $report->getDashboardLowStockCount(),
|
||||
'stock_movement' => $report->getStockMovementChart(12),
|
||||
'most_moved' => $report->getMostMovedProducts($month),
|
||||
'low_stock_items' => $report->getLowStockItems(),
|
||||
'recent_activity' => $report->getRecentActivity(10),
|
||||
'months' => $report->getAvailableMonths(),
|
||||
];
|
||||
$answer['success'] = 1;
|
||||
exit(json_encode($answer));
|
||||
?>
|
||||
Reference in New Issue
Block a user