|
|
@@ -162,28 +162,21 @@ class GhsController extends BaseController
|
|
|
$where['name'] = ['like', $name];
|
|
|
}
|
|
|
}
|
|
|
- $type = $get['type'] ?? -1;
|
|
|
$location = $get['location'] ?? '';
|
|
|
if (is_numeric($location)) {
|
|
|
$where['location'] = $location;
|
|
|
}
|
|
|
- $order = 'inTurn DESC,addTime DESC';
|
|
|
- if ($type == 0) {
|
|
|
- $order = 'debtAmount DESC';
|
|
|
- }
|
|
|
- if ($type == 1) {
|
|
|
- $order = 'expendAmount DESC';
|
|
|
- }
|
|
|
- $respond = GhsClass::getGhsList($where, $order);
|
|
|
+ $list = GhsClass::getGhsList($where);
|
|
|
+
|
|
|
$staff = $this->shopAdmin;
|
|
|
- //待结款合计,有财务权限才能查看
|
|
|
if (isset($staff->finance) == false || $staff->finance == 0) {
|
|
|
$totalDebtAmount = 0;
|
|
|
} else {
|
|
|
+ //累计总欠款
|
|
|
$totalDebtAmount = PurchaseOrderClass::sum(['mainId' => $this->mainId, 'status' => 4, 'debt' => PurchaseOrderClass::DEBT_YES], 'actPrice');
|
|
|
}
|
|
|
- $respond['totalDebtAmount'] = $totalDebtAmount;
|
|
|
- util::success($respond);
|
|
|
+ $list['totalDebtAmount'] = $totalDebtAmount;
|
|
|
+ util::success($list);
|
|
|
}
|
|
|
|
|
|
//下载供货商 ssh 20240506
|