|
|
@@ -50,10 +50,10 @@ class StatisticService extends Service
|
|
|
$item_ids = $dataCollection->pluck('item_id')->unique()->values()->all();
|
|
|
$employee_ids = $dataCollection->pluck('employee_id')->unique()->values()->all();
|
|
|
|
|
|
- $employee = Employee::Clear($user, $data);
|
|
|
+ $employee = Employee::TopClear($user, $data);
|
|
|
$employee_key_list = $employee->wherein('id', $employee_ids)->pluck("title", "id")->toArray();
|
|
|
|
|
|
- $item = Item::Clear($user, $data);
|
|
|
+ $item = Item::TopClear($user, $data);
|
|
|
$item_title_key_list = $item->wherein('id', $item_ids)->pluck("title", "id")->toArray();
|
|
|
$item_code_key_list = $item->wherein('id', $item_ids)->pluck("code", "id")->toArray();
|
|
|
$collect = collect($month_employee_list);
|
|
|
@@ -187,7 +187,7 @@ class StatisticService extends Service
|
|
|
$collect = collect($item_month_list);
|
|
|
$item_month_list = collect($item_month_list)->sortBy('month')->values()->all();
|
|
|
$items = collect($item_month_list)->pluck('item_id')->unique()->values()->all();
|
|
|
- $item = Item::Clear($user, $data);
|
|
|
+ $item = Item::TopClear($user, $data);
|
|
|
$item_title_key_list = $item->wherein('id', $items)->pluck("title", "id")->toArray();
|
|
|
$item_code_key_list = $item->wherein('id', $items)->pluck("code", "id")->toArray();
|
|
|
|
|
|
@@ -342,13 +342,13 @@ class StatisticService extends Service
|
|
|
|
|
|
$item_month_list = collect($item_month_list)->sortBy('month')->values()->all();
|
|
|
$items = collect($item_month_list)->pluck('item_id')->unique()->values()->all();
|
|
|
- $item = Item::Clear($user, $data);
|
|
|
+ $item = Item::TopClear($user, $data);
|
|
|
$item_title_key_list = $item->wherein('id', $items)->pluck("title", "id")->toArray();
|
|
|
$item_code_key_list = $item->wherein('id', $items)->pluck("code", "id")->toArray();
|
|
|
|
|
|
$employee_ids = collect($item_month_list)->pluck('employee_id')->unique()->values()->all();
|
|
|
|
|
|
- $employee = Employee::Clear($user, $data);
|
|
|
+ $employee = Employee::TopClear($user, $data);
|
|
|
$employee_key_list = $employee->wherein('id', $employee_ids)->pluck("title", "id")->toArray();
|
|
|
|
|
|
$item_month_list = collect($item_month_list)->transform(function ($item, $index) use ($item_title_key_list, $item_code_key_list, $employee_key_list, &$total_work_min, &$all_salary, &$employee_count) {
|
|
|
@@ -464,13 +464,13 @@ class StatisticService extends Service
|
|
|
}
|
|
|
$item_month_list = collect($item_month_list)->sortBy('month')->values()->all();
|
|
|
$items = collect($item_month_list)->pluck('item_id')->unique()->values()->all();
|
|
|
- $item = Item::Clear($user, $data);
|
|
|
+ $item = Item::TopClear($user, $data);
|
|
|
$item_title_key_list = $item->wherein('id', $items)->pluck("title", "id")->toArray();
|
|
|
$item_code_key_list = $item->wherein('id', $items)->pluck("code", "id")->toArray();
|
|
|
|
|
|
$device_ids = collect($item_month_list)->pluck('device_id')->unique()->values()->all();
|
|
|
|
|
|
- $device = Device::Clear($user, $data);
|
|
|
+ $device = Device::TopClear($user, $data);
|
|
|
$device_key_list = $device->wherein('id', $device_ids)->pluck("title", "id")->toArray();
|
|
|
$device_original_value_key_list = $device->wherein('id', $device_ids)->pluck("original_value", "id")->toArray();
|
|
|
|
|
|
@@ -576,7 +576,7 @@ class StatisticService extends Service
|
|
|
return [false, $month_start];
|
|
|
}
|
|
|
//第一步确定项目
|
|
|
- $item = Item::Clear($user, $data);
|
|
|
+ $item = Item::TopClear($user, $data);
|
|
|
$item_list = $item->where('del_time', 0)
|
|
|
->where(function ($query) use ($month_start, $month_end) {
|
|
|
$query->where('start_time', '<=', $month_start)
|
|
|
@@ -829,7 +829,7 @@ class StatisticService extends Service
|
|
|
"entrust_type"
|
|
|
)->get()->toArray();
|
|
|
//需要根据分类去汇总
|
|
|
- $fee = Fee::Clear($user, $data);
|
|
|
+ $fee = Fee::TopClear($user, $data);
|
|
|
$fee = $fee->where('del_time', 0)->orderBy("sort", 'desc')->get()->toArray();
|
|
|
return $this->groupListByRoot($expense_list, $fee);
|
|
|
}
|
|
|
@@ -924,7 +924,7 @@ class StatisticService extends Service
|
|
|
//项目编码、项目名称、项目状态、凭证日期、凭证种类、凭证号数、凭证摘要、会计凭证归集金额、N个一级费用类型、委内、委外
|
|
|
|
|
|
//确认所有项目
|
|
|
- $item = Item::Clear($user, $data);
|
|
|
+ $item = Item::TopClear($user, $data);
|
|
|
$item_list = $item->where('del_time', 0)
|
|
|
->where(function ($query) use ($month_start, $month_end) {
|
|
|
$query->where('start_time', '<=', $month_start)
|
|
|
@@ -937,7 +937,7 @@ class StatisticService extends Service
|
|
|
//获取该区间内所有项目人工费、折旧费
|
|
|
$item_salary = $this->auxiliaryEmployee($user, $data, $month_start, $month_end);
|
|
|
$device_depreciation = $this->auxiliaryDevice($user, $data, $month_start, $month_end);
|
|
|
- $fee = Fee::Clear($user, $data);
|
|
|
+ $fee = Fee::TopClear($user, $data);
|
|
|
$fee = $fee->where('del_time', 0)->orderBy("sort", 'desc')->get()->toArray();
|
|
|
$auxiliary = AuxiliaryAccountDetails::Clear($user, $data);
|
|
|
$auxiliary_list = $auxiliary->where("voucher_date", ">=", $month_start)->where("voucher_date", "<", $month_end)
|
|
|
@@ -1306,13 +1306,13 @@ class StatisticService extends Service
|
|
|
$item_month_list = collect($item_month_list)->sortBy('month')->values()->all();
|
|
|
$items = collect($item_month_list)->pluck('item_id')->unique()->values()->all();
|
|
|
$employee_ids = collect($item_month_list)->pluck('employee_id')->unique()->values()->all();
|
|
|
- $employee = Employee::Clear($user, $data);
|
|
|
+ $employee = Employee::TopClear($user, $data);
|
|
|
$employee_list = $employee->wherein('id', $employee_ids)->select("major", "title", "id")->get()->toArray();
|
|
|
$employee_key_list = [];
|
|
|
foreach ($employee_list as $v) {
|
|
|
$employee_key_list[$v['id']] = $v;
|
|
|
}
|
|
|
- $item = Item::Clear($user, $data);
|
|
|
+ $item = Item::TopClear($user, $data);
|
|
|
$item_title_key_list = $item->wherein('id', $items)->pluck("title", "id")->toArray();
|
|
|
$item_code_key_list = $item->wherein('id', $items)->pluck("code", "id")->toArray();
|
|
|
//项目编码、项目名称、姓名、人员类别、应出勤工时、研发出勤工时、研发工时占比、归集工资总额、归集社保金额、归集公积金、研发工资总额、研发社保金额、研发公积金
|