18 lines
660 B
Plaintext
18 lines
660 B
Plaintext
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
|
@EndUserText.label: 'Guest stay totals'
|
|
define view entity {{P}}I_GUEST_STAY
|
|
as select from {{p}}guest as g
|
|
inner join {{p}}stay as s on s.guest_id = g.guest_id
|
|
{
|
|
key g.guest_id as guest_id,
|
|
g.guest_name as guest_name,
|
|
count( * ) as stay_count,
|
|
max( cast( s.nights as abap.int8 ) ) as night_count,
|
|
sum( cast( s.nights as abap.dec( 10, 0 ) ) * s.rate ) as total_charge
|
|
}
|
|
group by
|
|
g.guest_id,
|
|
g.guest_name
|
|
having
|
|
count( * ) > 1
|