СОРМ3 Специальные технологии

Ключ
Эта строка удалена.
Это слово было удалено. Это слово было добавлено.
Эта строка добавлена.

Изменения (14)

просмотр истории страницы
iif(fo.operator_id is not null and fo.operator_id<>'' and upper(fo.operator_id) not like '%OSMP%',coalesce(b_acc.attribute_value,''),'') || ';' || --bank_account
iif(fo.operator_id is not null and fo.operator_id<>'' and upper(fo.operator_id) not like '%OSMP%',coalesce(b_name.attribute_value,''),'') || ';' ||--bank_name
iif(fo.descr like 'Карта оплаты %', substring(fo.descr replace(substring(left(fo.descr,(position('.', fo.descr))) from 14 for (position('.', fo.descr)-14)),'') 20),'.',''),'') || ';' || --express_card_number
';;;;' || --terminal_id--terminal_number --latitude --longitude --projection_type
a.operator_id || ';' || --center_id идентификатор центра обслуживания клиентов
'' || ';' || --unstruct_info
'1'
from finance_operations fo
from abonents a
join abonents a finance_operations fo on fo.abonent_id=a.id -- чтобы узнать абонента
left join homes h on a.home_id=h.id -- получаем адрес абонента для --address_type_id --address_type
left join attribute_values b_acc on b_acc.attribute_id=6 and b_acc.abonent_id=fo.abonent_id b_acc.abonent_id=a.id -- банковский счет абонента
left join attribute_values b_name on b_acc.attribute_id=7 b_name.attribute_id=7 and b_acc.abonent_id=fo.abonent_id b_name.abonent_id=a.id -- наименование банка абонента
--left join abonents a_perevod on a_perevod.contract_number=substring(fo.descr from 39 for (position(' (', fo.descr))-39) and fo.descr like '%Перевод от другого абонента через ЛК%'
left join finance_operations fo_don on fo.related_fin_op_id=fo_don.op_id and fo.descr like '%Перевод от другого абонента через ЛК%' -- для --payment_type=86 (переводов денег между абонентами)
left join abonents a_don on fo_don.abonent_id=a_don.id -- для payment_type=86 (переводов денег между абонентами)
iif(fo.operator_id is not null and fo.operator_id<>'' and upper(fo.operator_id) not like '%OSMP%',coalesce(b_acc.attribute_value,''),'') || ';' || --bank_account
iif(fo.operator_id is not null and fo.operator_id<>'' and upper(fo.operator_id) not like '%OSMP%',coalesce(b_name.attribute_value,''),'') || ';' ||--bank_name
iif(fo.descr like 'Карта оплаты %', substring(fo.descr replace(substring(left(fo.descr,(position('.', fo.descr))) from 14 for (position('.', fo.descr)-14)),'') 20),'.',''),'') || ';' || --express_card_number
';;;;' || --terminal_id--terminal_number --latitude --longitude --projection_type
a.operator_id || ';' || --center_id идентификатор центра обслуживания клиентов
'' || ';' || --unstruct_info
'1'
from finance_operations fo
from abonents a
join abonents a finance_operations fo on fo.abonent_id=a.id -- чтобы узнать абонента
left join homes h on a.home_id=h.id -- получаем адрес абонента для --address_type_id --address_type
left join attribute_values b_acc on b_acc.attribute_id=6 and b_acc.abonent_id=fo.abonent_id b_acc.abonent_id=a.id -- банковский счет абонента
left join attribute_values b_name on b_acc.attribute_id=7 b_name.attribute_id=7 and b_acc.abonent_id=fo.abonent_id b_name.abonent_id=a.id -- наименование банка абонента
--left join abonents a_perevod on a_perevod.contract_number=substring(fo.descr from 39 for (position(' (', fo.descr))-39) and fo.descr like '%Перевод от другого абонента через ЛК%'
left join finance_operations fo_don on fo.related_fin_op_id=fo_don.op_id and fo.descr like '%Перевод от другого абонента через ЛК%' -- для --payment_type=86 (переводов денег между абонентами)
left join abonents a_don on fo_don.abonent_id=a_don.id -- для payment_type=86 (переводов денег между абонентами)