|
|
@@ -205,6 +205,9 @@ class ExpendController extends BaseController
|
|
|
if ($bx != -1) {
|
|
|
$where['bx'] = $bx;
|
|
|
}
|
|
|
+ if (true) { //过滤掉已删除的
|
|
|
+ $where['delStaffId'] = 0;
|
|
|
+ }
|
|
|
$searchTime = isset($get['searchTime']) && !empty($get['searchTime']) ? $get['searchTime'] : 'thisYear';
|
|
|
$startTime = $get['startTime'] ?? '';
|
|
|
$endTime = $get['endTime'] ?? '';
|
|
|
@@ -359,6 +362,43 @@ class ExpendController extends BaseController
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //删除支出
|
|
|
+ public function actionDelExpend()
|
|
|
+ {
|
|
|
+ $mainId = $this->mainId;
|
|
|
+ if (getenv('YII_ENV') == 'production') {
|
|
|
+ if (in_array($mainId, [23390])) {
|
|
|
+ if (!in_array($this->adminId, [24655])) {
|
|
|
+ util::fail('请财务人员操作吧');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ $post = Yii::$app->request->post();
|
|
|
+ $staffId = intVal($post['staffId']);
|
|
|
+ $staff = ShopAdminClass::getById($staffId, true);
|
|
|
+ if (empty($staff)) {
|
|
|
+ util::fail('没有找到员工');
|
|
|
+ }
|
|
|
+ if ($staff->mainId != $this->mainId) {
|
|
|
+ util::fail('员工不存在');
|
|
|
+ }
|
|
|
+
|
|
|
+ $shop = $this->shop;
|
|
|
+ $admin = $this->admin;
|
|
|
+
|
|
|
+ $id = intval($post['id']);
|
|
|
+ $expend = ExpendClass::getById($id, true);
|
|
|
+ $expend->delStaffId = $staffId;
|
|
|
+ $expend->delStaffName = $staff->name;
|
|
|
+ $rs = $expend->save();
|
|
|
+ if ($rs) {
|
|
|
+ util::complete();
|
|
|
+ } else {
|
|
|
+ util::fail('删除支出失败');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//修改账单日期 ssh 20241122
|
|
|
public function actionChangePayTime()
|
|
|
{
|