25 lines
1.0 KiB
Plaintext
25 lines
1.0 KiB
Plaintext
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
|
@EndUserText.label: 'Service job cost'
|
|
define view entity {{P}}I_JOB_COST
|
|
as select from {{p}}job as h
|
|
inner join {{p}}jobl as l on l.job_id = h.job_id
|
|
{
|
|
key h.job_id as job_id,
|
|
h.customer as customer,
|
|
h.calc_mode as calc_mode,
|
|
h.group_code as group_code,
|
|
h.job_date as job_date,
|
|
max( l.work_hours ) as work_hours,
|
|
count( * ) as line_count,
|
|
sum( case when h.calc_mode = 'F'
|
|
then cast( l.rate as abap.dec( 21, 4 ) )
|
|
else cast( l.work_hours * l.rate as abap.dec( 21, 4 ) )
|
|
end ) as job_value
|
|
}
|
|
group by
|
|
h.job_id,
|
|
h.customer,
|
|
h.calc_mode,
|
|
h.group_code,
|
|
h.job_date
|