aonestar
.public
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
sp_salestax_save_hotel_profile
Parameters
Name
Type
Mode
user_name
text
IN (DEFAULT '')
Definition
declare hotel_profile jsonb; begin select jsonb_build_object( 'id', null, 'hotel_primary_name', name, 'hotel_secondary_name', name, 'hotel_interface_code', prop_code, 'hotel_email', email, 'hotel_website', website, 'hotel_office_phone', telephone, 'hotel_fax', fax, 'hotel_address_primary', address1, 'hotel_address_secondary', address2, 'companies', array[jsonb_build_object( 'taxid', tax_id, 'branch_no_text', branch_no, 'company_fax', fax, 'company_email', email, 'company_website', website, 'company_office_phone', telephone, 'company_primary_name', company, 'company_secondary_name', company, 'company_address_primary', address3, 'company_address_secondary', address4 )] ) from property_info p into hotel_profile; RETURN sp_call_accsys_api('/system/save_hotel_profile', jsonb_build_object( 'user_name', coalesce(user_name, fn_current_user()), 'save_type', 'create', 'item', hotel_profile ) ); /* rpc.system_save_hotel_profile if not (params->'item' ? 'companies') then raise exception 'missing companies'; end if; if not (params->'item' ? 'hotel_primary_name') then raise exception 'missing hotel primary name'; end if; if not (params->'item' ? 'hotel_secondary_name') then raise exception 'missing hotel secondary name'; end if; if not (params->'item' ? 'hotel_interface_code') then raise exception 'missing hotel interface code'; end if; if not (params->'item'->'companies'->0 ? 'company_primary_name') then raise exception 'missing company primary name'; end if; if not (params->'item'->'companies'->0 ? 'company_secondary_name') then raise exception 'missing company secondary name'; end if; if not (params->'item'->'companies'->0 ? 'taxid') then raise exception 'missing tax id'; end if; if not (params->'item'->'companies'->0 ? 'branch_no') */ end