672 lines
27 KiB
Plaintext
672 lines
27 KiB
Plaintext
<cfsilent>
|
||
<cfimport prefix="m" taglib="lib"/>
|
||
<cfimport prefix="c" taglib="lib/controls"/>
|
||
<cfimport prefix="d" taglib="lib/data"/>
|
||
<cfimport prefix="layout" taglib="layout"/>
|
||
</cfsilent><m:silent silent="No">
|
||
|
||
<cffunction name="plain2HtmClean">
|
||
<cfargument name="s" type="string"/>
|
||
<cfreturn request.plain2htm(request.cleanHtm(s))/>
|
||
</cffunction>
|
||
|
||
<cffunction name="cleanInput">
|
||
<cfargument name="s" type="string"/>
|
||
<cfreturn htmlEditFormat(s)/>
|
||
</cffunction>
|
||
|
||
<m:prepare_detail entity="service" key="service_id" pageInfoOut="pageInfo"/>
|
||
|
||
<cfif structKeyExists(form,"vat_free")>
|
||
<cfset form.vat_perc=""/><!--- *** выглядит некрасиво - модифицировать форму --->
|
||
<!--- <cfdump var=#form#/> --->
|
||
</cfif>
|
||
|
||
<d:bean readonly=#!pageInfo.writePermitted()# table="#pageInfo.entity#" datasource="#request.DS#" output="d" status="status">
|
||
<d:param field="service_id" type="integer" key autoincrement/>
|
||
<d:param field="abstract_service_id" type="integer"/>
|
||
<d:param field="modifier_id" type="integer" forNull=""/>
|
||
<d:param field="manager_id" type="integer" forNull=""/>
|
||
<d:param field="measure_id" type="integer" forNull=""/>
|
||
<d:param field="precision" type="integer" forNull=""/>
|
||
<!--- <d:param field="sort" type="integer" forNull=""/> --->
|
||
<d:param field="is_internal" type="bit" init="0" default="0"/><!--- *** bit and boolean --->
|
||
<d:param field="status_id" type="integer" default="1" init="1"/>
|
||
<d:param field="dt_status" type="timestamp" default="#Now()#" init="#Now()#"/>
|
||
<d:param field="vat_perc" type="integer" init="#request.VAT#" forNull=""/>
|
||
<d:param field="vat_free" type="bit" default=false init=false/>
|
||
<d:param field="descr" type="varchar" preprocessor=#plain2HtmClean#/>
|
||
<d:param field="commercial_note" type="varchar" preprocessor=#plain2HtmClean#/>
|
||
|
||
<d:param field="creator_id" type="integer" value="#request.usr_id#" skipUpdate/>
|
||
<d:param field="updater_id" type="integer" value="#request.usr_id#" />
|
||
<d:param field="dt_created" type="timestamp" value="#Now()#" skipUpdate/>
|
||
<d:param field="dt_updated" type="timestamp" value="#Now()#"/>
|
||
</d:bean>
|
||
|
||
<m:dispatch_detail
|
||
usePRG="No"<!---*** --->
|
||
pageInfo=#pageInfo#
|
||
id="#d.service_id#"
|
||
status=#pageInfo.status#
|
||
trackOut="tr"
|
||
idAttributesOut="id"
|
||
/>
|
||
|
||
<cfquery name="qDecoration" datasource="#request.DS#">
|
||
select a.abstract_service, m.modifier, m.modifier_id, c.modifier_class,
|
||
m.code as modifier_code, a.code, g.area_code, a.manager_id,
|
||
a.measure_id, u.measure, u.measure_short, a.precision
|
||
,au.login as creator, au.shortname as creator_shortname, mu.login as updater, mu.shortname as updater_shortname
|
||
from service s
|
||
left outer join abstract_service a on (s.abstract_service_id=a.abstract_service_id)
|
||
left outer join area g on a.area_id=g.area_id
|
||
left outer join modifier m on (s.modifier_id=m.modifier_id)
|
||
left outer join modifier_class c on (m.modifier_class_id=c.modifier_class_id)
|
||
left outer join measure u on (a.measure_id=u.measure_id)
|
||
left outer join usr au on (s.creator_id=au.usr_id)
|
||
left outer join usr mu on (s.updater_id=mu.usr_id)
|
||
where s.service_id=<cfqueryparam cfsqltype="cf_sql_integer" value="#d.service_id#" null=#!isNumeric(d.service_id)#/>
|
||
</cfquery>
|
||
|
||
<!--- template --->
|
||
<cfquery name="qAbstractService" datasource="#request.DS#">
|
||
select a.modifier_class_id, mc.modifier_class, a.measure_id, a.precision
|
||
from abstract_service a
|
||
left outer join modifier_class mc on (a.modifier_class_id=mc.modifier_class_id)
|
||
where a.abstract_service_id=<cfqueryparam cfsqltype="cf_sql_integer" value="#d.abstract_service_id#" null=#!isNumeric(d.abstract_service_id)#/>
|
||
</cfquery>
|
||
|
||
<!--- Патчим атрибуты значениями родительского класса - никогда раньше так не делали, всегда вели себя так, словно d immutable --->
|
||
<!--- Принесет ли модифицируемость пагубные последствия? --->
|
||
<!--- Похожее раньше делали в bean через init и default --->
|
||
<cfif NOT d.measure_id GT 0>
|
||
<cfset d.measure_id=qAbstractService.measure_id/>
|
||
</cfif>
|
||
<cfif NOT d.precision GT 0>
|
||
<cfset d.precision=qAbstractService.precision/>
|
||
</cfif>
|
||
|
||
</m:silent><!---
|
||
------------------------------------------------------------------------------------------------------------------------
|
||
------------------------------------------------------------------------------------------------------------------------
|
||
------------------------------------------------------------------------------------------------------------------------
|
||
------------------------------------------------------------------------------------------------------------------------
|
||
------------------------------------------------------------------------------------------------------------------------
|
||
---><layout:page section="header" pageInfo=#pageInfo#>
|
||
<layout:attribute name="title">
|
||
<cfoutput>
|
||
Вариант услуги (конкретная услуга)
|
||
<cfif d.service_id GT 0>
|
||
<b>#qDecoration.abstract_service#</b>
|
||
<cfif qDecoration.modifier_id GT 0>
|
||
<!--- #qDecoration.modifier_class#: ---> <b> - #qDecoration.modifier#</b>
|
||
</cfif>
|
||
[#d.service_id#]
|
||
</cfif>
|
||
</cfoutput>
|
||
</layout:attribute>
|
||
</layout:page>
|
||
|
||
<cfif status.errorState GT 0>
|
||
<cfoutput><div class="err">#status.errorMessage#</div></cfoutput>
|
||
</cfif>
|
||
|
||
<cfoutput>
|
||
<input type="hidden" name="service_id" value="#d.service_id#"/>
|
||
<input type="hidden" name="track" value="#tr.self#"/>
|
||
<input type="hidden" name="pass" value=""/><!--- pass marker to prevent save on submit --->
|
||
|
||
<div class="detail">
|
||
|
||
|
||
<div class="tr">
|
||
<div class="th">Абстрактная услуга</div>
|
||
<div class="td">
|
||
<cfquery name="qList" datasource="#request.DS#">
|
||
select abstract_service_id, abstract_service, code
|
||
from abstract_service
|
||
order by 3,2
|
||
</cfquery>
|
||
<c:combo
|
||
query=#qList#
|
||
combo="abstract_service_id"
|
||
id="abstract_service_id"
|
||
key="abstract_service_id"
|
||
selected="#d.abstract_service_id#"
|
||
displayf="##abstract_service## ##code##"
|
||
empty=""
|
||
class=""
|
||
<!---onchange="submit();"--->
|
||
/>
|
||
<cfif d.abstract_service_id GT 0>
|
||
<c:link_view_edit canWrite=#pageInfo.writePermitted()# entity="abstract_service" id=#d.abstract_service_id# fwx=#tr.fwx#/>
|
||
Единица измерения: <b>#qDecoration.measure# (#qDecoration.measure_short#)</b>
|
||
Точность: <b><cfif isNumeric(qDecoration.precision)>#qDecoration.precision#<cfelse>(нет)</cfif></b>
|
||
</cfif>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="tr">
|
||
<div class="th">Характеристика</div>
|
||
<div class="td">
|
||
<cfquery name="qList" datasource="#request.DS#">
|
||
select m.modifier_id, m.modifier
|
||
from modifier m
|
||
join abstract_service a on (m.modifier_class_id=a.modifier_class_id)
|
||
where a.abstract_service_id=<cfqueryparam cfsqltype="cf_sql_integer" value="#d.abstract_service_id#"/>
|
||
order by m.sort, m.code, m.modifier
|
||
</cfquery>
|
||
<cfif qList.recordCount GT 0>
|
||
<a href="modifier_class.cfm?modifier_class_id=#qAbstractService.modifier_class_id#&#tr.fwx#">#qAbstractService.modifier_class#</a>
|
||
<c:combo
|
||
query=#qList#
|
||
combo="modifier_id"
|
||
id="modifier_id"
|
||
key="modifier_id"
|
||
selected="#d.modifier_id#"
|
||
displayf="##modifier##"
|
||
empty=""
|
||
class=""
|
||
/>
|
||
<cfif d.modifier_id GT 0>
|
||
<c:link_view_edit canWrite=#pageInfo.writePermitted()# entity="modifier" id=#d.modifier_id# fwx=#tr.fwx#/>
|
||
</cfif>
|
||
<cfelse>
|
||
(нет)
|
||
</cfif>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="tr">
|
||
<div class="th">Код варианта услуги</div>
|
||
<div class="td">
|
||
<b>#request.skuCode(qDecoration.area_code, qDecoration.code, qDecoration.modifier_code)#</b>
|
||
</div>
|
||
</div>
|
||
|
||
<!--- Паттерн: копирование атрибута из родительского класса --->
|
||
<!--- Может быть, лучше было реализовать не в интерфейсе, а в наборе данных --->
|
||
|
||
<div class="tr">
|
||
<div class="th">Единица измерения</div>
|
||
<div class="td">
|
||
<cfquery name="qList" datasource="#request.DS#">
|
||
select measure_id, measure
|
||
from measure
|
||
order by 2
|
||
</cfquery>
|
||
<c:combo
|
||
query=#qList#
|
||
combo="measure_id"
|
||
id="measure_id"
|
||
key="measure_id"
|
||
selected="#d.measure_id#"
|
||
displayf="##measure##"
|
||
empty=""
|
||
class=""
|
||
<!---onchange="submit();"--->
|
||
/>
|
||
<i>для композитных услуг (состоящих из компонентов) указывать штуки. Обычно композитные услуги попадают в спецификацию в количестве 1 шт.</i>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="tr">
|
||
<div class="th">Точность</div>
|
||
<div class="td">
|
||
<input type="text" name="precision" value="#d.precision#" size="1" class="r"/>
|
||
<i>Количество знаков после запятой, 0 - целое число. Переопределяет точность из абстрактной услуги</i>
|
||
</div>
|
||
</div>
|
||
|
||
<!--- <div class="tr">
|
||
<div class="th">Сортировка</div>
|
||
<div class="td">
|
||
<input type="text" name="sort" id="sort" value="#d.sort#" size="2"/>
|
||
<i>Целое число - порядок, в котором вариант услуги будет выводиться в списке в рамках абстрактной услуги. Рекомендуется ставить через 100, чтобы потом удобнее было тасовать</i>
|
||
</div>
|
||
</div> --->
|
||
|
||
<div class="tr">
|
||
<div class="th">Ответственный</div>
|
||
<div class="td">
|
||
<cfquery name="qList" datasource="#request.DS#">
|
||
select usr_id, firstname, middlename, lastname
|
||
from usr
|
||
order by 4,2,3
|
||
</cfquery>
|
||
<cfif d.manager_id GT 0>
|
||
<cfset m_manager_id=d.manager_id/>
|
||
<cfelse>
|
||
<cfset m_manager_id=qDecoration.manager_id/>
|
||
</cfif>
|
||
<c:combo
|
||
query=#qList#
|
||
combo="manager_id"
|
||
id="manager_id"
|
||
key="usr_id"
|
||
selected="#m_manager_id#"
|
||
displayf="##lastname## ##firstname## ##middlename## "
|
||
empty=""
|
||
class=""
|
||
/>
|
||
<i>Переопределяет ответственного за абстрактную услугу</i>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="tr">
|
||
<div class="th">Внутренняя</div>
|
||
<div class="td">
|
||
<input type="checkbox" name="is_internal" id="is_internal" value="1"<cfif d.is_internal> checked</cfif> />
|
||
<i>Предоставляется только внутри компании. Не должна попадать в списки, публикуемые наружу. Не предполагается наличия цены. При снятии отметки станет обычной услугой.</i>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="tr">
|
||
<div class="th">Статус</div>
|
||
<div class="td">
|
||
<cfquery name="qList" datasource="#request.DS#">
|
||
select status_id, status
|
||
from status
|
||
order by 1
|
||
</cfquery>
|
||
<c:combo
|
||
query=#qList#
|
||
combo="status_id"
|
||
id="status_id"
|
||
key="status_id"
|
||
selected="#d.status_id#"
|
||
displayf="##status##"
|
||
class=""
|
||
<!---onchange="submit();"--->
|
||
/>
|
||
с <input type="text" name="dt_status" id="dt_status" value="#dateFormat(d.dt_status,'DD.MM.YYYY')#" size="10"/>
|
||
<button type="button" onclick="document.getElementById('dt_status').value='#DateFormat(Now(), 'DD.MM.YYYY')#';">Сегодня</button>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="tr">
|
||
<div class="th">Ставка НДС</div>
|
||
<div class="td">
|
||
<input type="text" name="vat_perc" id="vat_perc" value="#d.vat_perc#" size="2"/>%
|
||
</div>
|
||
</div>
|
||
|
||
<div class="tr">
|
||
<div class="th">НДС не облагается</div>
|
||
<div class="td">
|
||
<input type="checkbox" name="vat_free" id="vat_free" value="1"<cfif d.vat_free> checked</cfif> />
|
||
<i>Если флаг установлен, ставка НДС игнорируется</i>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<div class="tr">
|
||
<div class="th">Описание</div>
|
||
<div class="td">
|
||
<textarea name="descr" rows="5" cols="100" style="width:97%">#request.htm2plain(d.descr)#</textarea>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="tr">
|
||
<div class="th">Коммерческие примечания</div>
|
||
<div class="td">
|
||
<textarea name="commercial_note" rows="5" cols="100" style="width:97%">#request.htm2plain(d.commercial_note)#</textarea>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="tr">
|
||
<div class="th">Создано</div>
|
||
<div class="td">
|
||
#dateFormat(d.dt_created,'DD.MM.YYYY')# #timeFormat(d.dt_created,'HH:MM')#
|
||
#qDecoration.creator# <cfif len(qDecoration.creator_shortname)>(#qDecoration.creator_shortname#)</cfif>
|
||
|
||
Изменено
|
||
#dateFormat(d.dt_updated,'DD.MM.YYYY')# #timeFormat(d.dt_updated,'HH:MM')#
|
||
#qDecoration.updater# <cfif len(qDecoration.updater_shortname)>(#qDecoration.updater_shortname#)</cfif>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
</cfoutput>
|
||
|
||
<layout:page section="extension" closeForm="Yes"/>
|
||
|
||
<!--- ------------------------------------------------------------------------------- --->
|
||
<!--- ------------------------------------------------------------------------------- --->
|
||
<!--- ------------------------------------------------------------------------------- --->
|
||
<cfif d.service_id GT 0>
|
||
<cfquery name="qServiceParam" datasource="#request.DS#">
|
||
select
|
||
sp.service_param_id
|
||
,ac.param_class_id
|
||
,ac.abstract_service_param_class_id
|
||
,ac.is_multiple
|
||
,sp.param_id
|
||
,sp.min_value
|
||
,sp.max_value
|
||
,p.param
|
||
,p.code as param_code
|
||
,p.precision
|
||
,m.measure
|
||
,m.measure_short
|
||
,c.param_class
|
||
|
||
,(select count(*) from service_param_price t where t.service_param_id=sp.service_param_id AND t.pricing_model_id=1) as inst_cnt
|
||
,(select price from service_param_price t where t.service_param_id=sp.service_param_id AND t.pricing_model_id=1 order by service_param_price_id desc limit 1) as prc_inst
|
||
,(select service_param_price_id from service_param_price t where t.service_param_id=sp.service_param_id AND t.pricing_model_id=1 order by service_param_price_id desc limit 1) as prc_inst_id
|
||
,(select status from service_param_price t where t.service_param_id=sp.service_param_id AND t.pricing_model_id=1 order by service_param_price_id desc limit 1) as prc_inst_stat
|
||
|
||
,(select count(*) from service_param_price t where t.service_param_id=sp.service_param_id AND t.pricing_model_id=2) as fix_cnt
|
||
,(select price from service_param_price t where t.service_param_id=sp.service_param_id AND t.pricing_model_id=2 order by service_param_price_id desc limit 1) as prc_fix
|
||
,(select service_param_price_id from service_param_price t where t.service_param_id=sp.service_param_id AND t.pricing_model_id=2 order by service_param_price_id desc limit 1) as prc_fix_id
|
||
,(select status from service_param_price t where t.service_param_id=sp.service_param_id AND t.pricing_model_id=2 order by service_param_price_id desc limit 1) as prc_fix_stat
|
||
|
||
,(select count(*) from service_param_price t where t.service_param_id=sp.service_param_id AND t.pricing_model_id=3) as payg_cnt
|
||
,(select price from service_param_price t where t.service_param_id=sp.service_param_id AND t.pricing_model_id=3 order by service_param_price_id desc limit 1) as prc_payg
|
||
,(select service_param_price_id from service_param_price t where t.service_param_id=sp.service_param_id AND t.pricing_model_id=3 order by service_param_price_id desc limit 1) as prc_payg_id
|
||
,(select status from service_param_price t where t.service_param_id=sp.service_param_id AND t.pricing_model_id=3 order by service_param_price_id desc limit 1) as prc_payg_stat
|
||
|
||
from abstract_service_param_class ac
|
||
left outer join service_param sp on (ac.abstract_service_param_class_id=sp.abstract_service_param_class_id
|
||
AND sp.service_id=<cfqueryparam cfsqltype="cf_sql_integer" value="#d.service_id#"/>)
|
||
left outer join param_class c on (ac.param_class_id=c.param_class_id)
|
||
left outer join param p on (sp.param_id=p.param_id)
|
||
left outer join measure m on (p.measure_id=m.measure_id)
|
||
where ac.abstract_service_id=<cfqueryparam cfsqltype="cf_sql_integer" value="#d.abstract_service_id#"/>
|
||
order by ac.sort, ac.abstract_service_param_class_id, p.sort, p.param
|
||
</cfquery>
|
||
<!--- <cfdump var=#qServiceParam#/> --->
|
||
|
||
<cfoutput>
|
||
<p>
|
||
<b>Компоненты варианта услуги</b> (#qServiceParam.recordCount#), цены без НДС
|
||
<cfif qServiceParam.recordCount GT 0>
|
||
<cfif pageInfo.writePermitted()>
|
||
<!--- Под добавлением имеется в виду только добавление разрешенного варианта из тех, что определены в абстрактной услуге --->
|
||
<cfoutput>
|
||
<cfset addUrl="service_param.cfm?service_param_id=-1&service_id=#d.service_id#&#tr.fwx#"/>
|
||
<button type="button" class="maincontrol" onclick="document.location.href='#addUrl#'">
|
||
<a href="#addUrl#">Добавить</a>
|
||
</button>
|
||
</cfoutput>
|
||
<i></i>
|
||
</cfif>
|
||
</cfif>
|
||
</p>
|
||
</cfoutput>
|
||
<!--- можно в строки добавить кнопки добавления цен, можно сразу с ценой
|
||
*** здесь выводится единица измерения от класса. Пока не понял, нужна ли возможность переопределять единицу измерения --->
|
||
<cfif qServiceParam.recordCount GT 0>
|
||
<table class="worktable">
|
||
<thead>
|
||
<tr>
|
||
<th></th>
|
||
<th></th>
|
||
<th>Компонент</th>
|
||
<th>Вариант компонента</th>
|
||
<th>Код</th>
|
||
<th>Ед.изм.</th>
|
||
<th>Min</th>
|
||
<th>Max</th>
|
||
<th>Цена инст</th>
|
||
<th>Цена фикс</th>
|
||
<th>Цена payg</th>
|
||
<th></th>
|
||
</tr>
|
||
</thead>
|
||
<cfoutput query="qServiceParam">
|
||
<tr>
|
||
<td>
|
||
<cfif service_param_id GT 0>
|
||
<a href="service_param.cfm?service_param_id=#service_param_id#¶m_class_id=#param_class_id#¶m_id=#param_id#&#tr.fwx#">
|
||
<img src="img/edit.gif"/><!--- *** халява param_class_id=#param_class_id# --->
|
||
</a>
|
||
<cfelse>
|
||
<a href="service_param.cfm?abstract_service_param_class_id=#abstract_service_param_class_id#&service_param_id=#service_param_id#<!--- ¶m_class_id=#param_class_id# --->&service_id=#d.service_id#&#tr.fwx#">
|
||
<img src="img/add.gif"/>
|
||
</a>
|
||
</cfif>
|
||
<!--- </a> --->
|
||
|
||
</td>
|
||
|
||
<td>
|
||
<cfif service_param_id GT 0>
|
||
<form name="frmClone#param_id#" action="param_clone.cfm"><!--- *** а почто метод не указан? --->
|
||
<input type="hidden" name="original_service_param_id" value="#service_param_id#"/>
|
||
<input type="hidden" name="param_id" value="#param_id#"/><!--- *** аккуратнее было бы восстанавливать на принимающей стороне из service_param_id --->
|
||
<input type="hidden" name="do_clone" value="1"/>
|
||
<input type="hidden" name="track" value="#tr.fw#"/>
|
||
<button type="submit"<cfif !pageInfo.writePermitted()> disabled</cfif>>clone</button>
|
||
</form>
|
||
</cfif>
|
||
</td>
|
||
|
||
<td class="mid"><!--- mid=vertical-align:middle указан для симметрии, здесь оно по умолчанию, а вот в ячейке ниже его нужно явно указывать --->
|
||
<a href="param_class.cfm?param_class_id=#param_class_id#&#tr.fwx#">#param_class#</a>
|
||
<cfif service_param_id GT 0 AND is_multiple GT 0>
|
||
<a href="service_param.cfm?abstract_service_param_class_id=#abstract_service_param_class_id#<!--- ¶m_class_id=#param_class_id# --->¶m_id=#param_id#&service_id=#service_id#&#tr.fwx#" title="добавить вариант компонента #param_class#">
|
||
<img src="img/add.gif"/>
|
||
</a>
|
||
</cfif>
|
||
</td>
|
||
|
||
<td>
|
||
<!--- <div class="table wh100">
|
||
<a href="param.cfm?param_id=#param_id#&#tr.fwx#" class="tcell mid">#param#</a>
|
||
</div> ---><!--- такой изврат, чтобы сделать ссылку на пустой ячейке --->
|
||
<cfif param_id GT 0>
|
||
<a href="param.cfm?param_id=#param_id#&#tr.fwx#" class="tcell mid">
|
||
<!--- #param_param_class# / ---> #param#
|
||
<cfif len(param) LE 1>(основной вариант)</cfif>
|
||
</a>
|
||
<cfelse>
|
||
(не выбран)
|
||
</cfif>
|
||
</td>
|
||
|
||
<td>
|
||
<cfif param_id GT 0>
|
||
<!--- наличие кода более явно указывает на актуальность компонента в конкретной услуге --->
|
||
#request.skuCode(qDecoration.area_code,qDecoration.code,qDecoration.modifier_code,param_code)#
|
||
</cfif>
|
||
</td>
|
||
<td class="c">#measure_short#</td>
|
||
<td class="c">#request.roundSafe(min_value,precision)#</td>
|
||
<td class="c">#request.roundSafe(max_value,precision)#</td>
|
||
<td class="r">
|
||
<cfif prc_inst_id GT 0>
|
||
<cfif len(prc_inst_stat)>(#prc_inst_stat#)</cfif>
|
||
<a href="service_param_price.cfm?service_param_price_id=#prc_inst_id#&#tr.fwx#">
|
||
<cfif len(prc_inst)>
|
||
#prc_inst#
|
||
<cfelse>
|
||
<i>по запросу</i>
|
||
</cfif>
|
||
</a>
|
||
</cfif>
|
||
<cfif inst_cnt GT 1>(#inst_cnt#)</cfif>
|
||
</td>
|
||
<td class="r">
|
||
<cfif prc_fix_id GT 0>
|
||
<cfif len(prc_fix_stat)>(prc_fiх_stat)</cfif>
|
||
<a href="service_param_price.cfm?service_param_price_id=#prc_fix_id#&#tr.fwx#">
|
||
<cfif len(prc_fix)>
|
||
#prc_fix#
|
||
<cfelse>
|
||
<i>по запросу</i>
|
||
</cfif>
|
||
</a>
|
||
</cfif>
|
||
</td>
|
||
<td class="r">
|
||
<cfif prc_payg_id GT 0>
|
||
<a href="service_param_price.cfm?service_param_price_id=#prc_payg_id#&#tr.fwx#">
|
||
<cfif len(prc_payg)>
|
||
#prc_payg#
|
||
<cfelse>
|
||
<i>по запросу</i>
|
||
</cfif>
|
||
</a>
|
||
</cfif>
|
||
</td>
|
||
<td class="c">
|
||
<cfif service_param_id GT 0>
|
||
<c:link_del canWrite=#pageInfo.writePermitted()# entity="service_param" id=#service_param_id# fwx=#tr.fwx#/>
|
||
</cfif>
|
||
</td>
|
||
</tr>
|
||
</cfoutput>
|
||
</table>
|
||
</cfif>
|
||
|
||
|
||
<!--- <cfif qServiceParam.recordCount GT 0>
|
||
<cfelse>
|
||
<cfquery name="qPrice" datasource="#request.DS#">
|
||
select
|
||
<d:field_set titleMapOut="titleMapPrice" lengthOut="fieldCountPrice">
|
||
<d:field title="price_id" cfSqlType="CF_SQL_INTEGER">prc.price_id</d:field>
|
||
<d:field title=#i18("Цена без НДС, ₽","Price w/o VAT, ₽")# cfSqlType="CF_SQL_INTEGER">prc.base_price</d:field>
|
||
</d:field_set>
|
||
from
|
||
price prc
|
||
where prc.service_id=<cfqueryparam cfsqltype="cf_sql_integer" value="#d.service_id#"/>
|
||
order by 1
|
||
</cfquery>
|
||
</cfif> --->
|
||
|
||
<!--- ---------------------------------------------------------------------------- --->
|
||
|
||
<cffunction name="formatPrice" output="true">
|
||
<cfargument name="price"/>
|
||
<cfif isNumeric(price)><cfreturn numberFormat(price,'.00')/><cfelse><cfreturn "(по запросу)"></cfif>
|
||
</cffunction>
|
||
<cfset request.formatPrice=formatPrice/>
|
||
|
||
<cfquery name="qServicePrice" datasource="#request.DS#">
|
||
select
|
||
t.service_price_id
|
||
,t.service_id
|
||
,t.pricing_model_id
|
||
,m.pricing_model
|
||
,m.pricing_model_short
|
||
,t.pricing_period
|
||
,t.rating_period
|
||
,t.price
|
||
<!--- ,t.discount_policy_id --->
|
||
,t.dt_from
|
||
,t.dt_to
|
||
,t.status
|
||
,t.descr
|
||
from service_price t
|
||
left outer join pricing_model m on (t.pricing_model_id=m.pricing_model_id)
|
||
where t.service_id=<cfqueryparam cfsqltype="cf_sql_integer" value="#d.service_id#"/>
|
||
order by 1
|
||
</cfquery>
|
||
|
||
<cfoutput>
|
||
<p>
|
||
<b>Цены услуги</b> без НДС (#qServicePrice.recordCount#)
|
||
<cfif pageInfo.writePermitted()>
|
||
<cfset addUrl="service_price.cfm?service_id=#d.service_id#&#tr.fwx#"/>
|
||
<button type="button" class="maincontrol" onclick="document.location.href='#addUrl#'">
|
||
<a href="#addUrl#">Добавить</a>
|
||
</button>
|
||
</cfif>
|
||
<i>цена услуги - это то, что остается, если все компоненты обнулить, или их нет (для атомарной услуги). Если компоненты есть, обычно цена услуги не нужна, стоимость складывается из компонентов</i>
|
||
</p>
|
||
</cfoutput>
|
||
|
||
<table class="worktable">
|
||
<thead>
|
||
<tr>
|
||
<th></th>
|
||
<th>ID</th>
|
||
<th>Ц-обр.</th>
|
||
<th>Период цены</th>
|
||
<th>Период опроса</th>
|
||
<!--- <th>Политика</th> --->
|
||
<th>Статус</th>
|
||
<th>С</th>
|
||
<th>По</th>
|
||
<th>Цена GPL без НДС</th>
|
||
<th></th>
|
||
</tr>
|
||
</thead>
|
||
<cfoutput query="qServicePrice">
|
||
<tr>
|
||
<td>
|
||
<c:link_view_edit canWrite=#pageInfo.writePermitted()# entity="service_price" key="service_price_id" id=#service_price_id# fwx=#tr.fwx#/>
|
||
</td>
|
||
<td>#service_price_id#</td>
|
||
<td>#pricing_model_short#</td>
|
||
<td>#pricing_period#</td>
|
||
<td>#rating_period#</td>
|
||
<!--- <td>#discount_policy_id#</td> --->
|
||
<td>#status#</td>
|
||
<td>#dateFormat(dt_from,'DD.MM.YYYY')#</td>
|
||
<td>#dateFormat(dt_to,'DD.MM.YYYY')#</td>
|
||
<td class="r">#request.formatPrice(price)#</td>
|
||
<td class="c">
|
||
<c:link_del canWrite=#pageInfo.writePermitted()# entity="service_price" key="service_price_id" id=#service_price_id# fwx=#tr.fwx#/>
|
||
</td>
|
||
</tr>
|
||
</cfoutput>
|
||
</table>
|
||
|
||
<!--- ---------------------------------------------------------------------------- --->
|
||
|
||
<cfquery name="qSpecification" datasource="#request.DS#">
|
||
select f.specification_id, f.specification,
|
||
(select count(*) from specification_item_param sip where sip.specification_item_id=si.specification_item_id) as item_param_cnt
|
||
from specification_item si
|
||
left outer join specification f on (si.specification_id=f.specification_id)
|
||
where si.service_id=<cfqueryparam cfsqltype="cf_sql_integer" value="#d.service_id#"/>
|
||
</cfquery>
|
||
|
||
<cfoutput>
|
||
<p><b>Используется спецификациями</b> (#qSpecification.recordCount#)</p>
|
||
</cfoutput>
|
||
|
||
<table class="worktable">
|
||
<thead>
|
||
<tr>
|
||
<th></th>
|
||
<th>Спецификация</th>
|
||
<th>Компонентов</th>
|
||
<th>Сумма, ₽</th>
|
||
</tr>
|
||
</thead>
|
||
<cfoutput query="qSpecification">
|
||
<tr>
|
||
<td>
|
||
<c:link_view_edit canWrite=#pageInfo.writePermitted()# entity="specification" id=#specification_id# fwx=#tr.fwx#/>
|
||
</td>
|
||
<td>
|
||
#specification#
|
||
</td>
|
||
<td class="c">
|
||
<cfif item_param_cnt GT 0>
|
||
#item_param_cnt#
|
||
</cfif>
|
||
</td>
|
||
<td class="c">
|
||
under construction
|
||
</td>
|
||
</tr>
|
||
</cfoutput>
|
||
</table>
|
||
|
||
<cfelse>
|
||
|
||
Компоненты доступны после сохранения услуги
|
||
|
||
</cfif>
|
||
<!--- ------------------------------------------------------------------------------- --->
|
||
<!--- ------------------------------------------------------------------------------- --->
|
||
<!--- ------------------------------------------------------------------------------- --->
|
||
<layout:page section="footer"/>
|