Files
wms-app/app/ics/api/engine_report/warehouse_balance.php
T
2026-04-09 09:48:47 +07:00

24 lines
575 B
PHP

<?php
session_start();
require '../../../assets/utils/db_auth.php';
$sql = "SELECT SUM(total_in) as total_in, SUM(total_out) as total_out, COUNT(DISTINCT warehouse_id) as total_warehouse
FROM warehouse_balance a
WHERE
a.company_id = :company_id
";
$sth = $pdo2->prepare($sql);
$sth->execute([
":company_id" => $company_id
]);
db_check($sth, $answer);
$output = $sth->fetch(PDO::FETCH_ASSOC);
$answer["output"] = $output;
$answer["success"] = 1;
exit(json_encode($answer));
?>