237 lines
8.9 KiB
Plaintext
237 lines
8.9 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="specification_item" key="specification_item_uid" pageInfoOut="pageInfo"/>
|
||
|
||
<d:bean readonly=#!pageInfo.writePermitted()# table="#pageInfo.entity#" datasource="#request.DS#" output="d" status="status">
|
||
<d:param field="specification_item_uid" type="guid" key autoincrement/>
|
||
<d:param field="specification_id" type="integer" required/>
|
||
<d:param field="svc_id" type="integer" required/>
|
||
<!--- <d:param field="specification_item" type="varchar" size="1023" preprocessor=#cleanInput#/> можно было оставить здесь, но мигрировали в версию --->
|
||
|
||
<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.specification_item_uid#"
|
||
status=#pageInfo.status#
|
||
trackOut="tr"
|
||
idAttributesOut="id"
|
||
/>
|
||
|
||
<cfquery name="qSpecification" datasource="#request.DS#">
|
||
select s.specification_id, s.specification, s.contract_id
|
||
,d.contract, d.dt_contract, d.contragent_id
|
||
,k.contragent
|
||
from specification s
|
||
join contract d on (s.contract_id=d.contract_id)
|
||
join contragent k on (d.contragent_id=k.contragent_id)
|
||
where s.specification_id=<cfqueryparam cfsqltype="cf_sql_integer" value="#d.specification_id#" null=#!isNumeric(d.specification_id)#/>
|
||
</cfquery>
|
||
|
||
<cfquery name="qSvc" datasource="#request.DS#">
|
||
select s.svc, s.code
|
||
from svc s
|
||
where s.svc_id=<cfqueryparam cfsqltype="cf_sql_integer" value="#d.svc_id#" null=#!isNumeric(d.svc_id)#/>
|
||
</cfquery>
|
||
|
||
<!--- decoration --->
|
||
<cfquery name="qDecoration" datasource="#request.DS#">
|
||
select
|
||
a.login as creator, a.shortname as creator_shortname, m.login as updater, m.shortname as updater_shortname
|
||
from specification_item e
|
||
left outer join usr a on (e.creator_id=a.usr_id)
|
||
left outer join usr m on (e.updater_id=m.usr_id)
|
||
where e.specification_item_uid=<cfqueryparam cfsqltype="cf_sql_other" value=#d.specification_item_uid# null=#!isValid('guid',d.specification_item_uid)#/>
|
||
</cfquery>
|
||
|
||
</m:silent><!---
|
||
------------------------------------------------------------------------------------------------------------------------
|
||
------------------------------------------------------------------------------------------------------------------------
|
||
------------------------------------------------------------------------------------------------------------------------
|
||
------------------------------------------------------------------------------------------------------------------------
|
||
------------------------------------------------------------------------------------------------------------------------
|
||
---><layout:page section="header" pageInfo=#pageInfo#>
|
||
<layout:attribute name="title">
|
||
<cfoutput>
|
||
Строка спецификации (экземпляр услуги)
|
||
<cfif len(d.specification_item_uid)>
|
||
[#d.specification_item_uid#]
|
||
</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="specification_item_uid" value="#d.specification_item_uid#"/>
|
||
<input type="hidden" name="specification_id" value="#d.specification_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">
|
||
<a href="specification.cfm?specification_id=#d.specification_id#&#tr.fwx#">#qSpecification.specification#[#d.specification_id#]</a>
|
||
<a href="contract.cfm?contract_id=#qSpecification.contract_id#&#tr.fwx#">#qSpecification.contract# #dateFormat(qSpecification.dt_contract,'DD.MM.YYYY')#</a>
|
||
<a href="contragent.cfm?contragent_id=#qSpecification.contragent_id#&#tr.fwx#">#qSpecification.contragent# </a>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="tr">
|
||
<div class="th">Ключ строки</div>
|
||
<div class="td">
|
||
#d.specification_item_uid# <i>стабильный идентификатор строки</i>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="tr">
|
||
<div class="th">Услуга</div>
|
||
<div class="td">
|
||
<cfquery name="qList" datasource="#request.DS#">
|
||
select s.svc_id, s.svc, s.code
|
||
from svc s
|
||
order by 2
|
||
</cfquery>
|
||
<c:combo
|
||
query=#qList#
|
||
combo="svc_id"
|
||
id="svc_id"
|
||
key="svc_id"
|
||
selected="#d.svc_id#"
|
||
displayf="##code## ##svc##"
|
||
empty=""
|
||
class=""
|
||
onchange="submit();"
|
||
/>
|
||
<!--- <cfif d.svc_id GT 0>
|
||
<c:link_view_edit canWrite=#pageInfo.writePermitted()# entity="svc" id=#d.svc_id# fwx=#tr.fwx#/>
|
||
</cfif> --->
|
||
при наличии версий предлагается исключить изменение
|
||
</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 len(d.specification_item_uid)>
|
||
<cfquery name="qSpecificationItemVersion" datasource="#request.DS#">
|
||
select
|
||
siv.price
|
||
,siv.quantity
|
||
,siv.specification_item_version
|
||
,siv.agreement_version
|
||
,siv.dt_from
|
||
,siv.dt_to
|
||
,a.contract_id
|
||
,a.agreement
|
||
,a.dt_agreement
|
||
,a.is_actual
|
||
from specification_item_version siv
|
||
left join specification_item i on (siv.specification_item_uid=i.specification_item_uid)
|
||
left join specification s on (i.specification_id=s.specification_id)
|
||
left join contract d on (s.contract_id=d.contract_id)
|
||
left join agreement a on (siv.agreement_version=a.agreement_version AND s.contract_id=a.contract_id)
|
||
where siv.specification_item_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#d.specification_item_uid#"/>
|
||
order by siv.agreement_version desc
|
||
</cfquery>
|
||
|
||
<cfoutput>
|
||
<p>
|
||
Версии строки (#qSpecificationItemVersion.recordCount#) (история инстанса)
|
||
<cfif pageInfo.writePermitted()>
|
||
<cfoutput>
|
||
<cfset addUrl="specification_item_version.cfm?agreement_version=&specification_item_uid=#d.specification_item_uid#&#tr.fwx#"/>
|
||
<button type="button" class="maincontrol" onclick="document.location.href='#addUrl#'">
|
||
<a href="#addUrl#">Создать</a>
|
||
</button>
|
||
</cfoutput>
|
||
</cfif>
|
||
</p>
|
||
</cfoutput>
|
||
<table class="worktable">
|
||
<thead>
|
||
<tr>
|
||
<th></th>
|
||
<th>Версия N</th>
|
||
<th>Соглашение</th>
|
||
<th>Дата соглашения</th>
|
||
<th>Согл. действ.</th>
|
||
<th>Дата с</th>
|
||
<th>Дата по</th>
|
||
<th>Услуга (для печати)</th>
|
||
<th>Кол-во</th>
|
||
<th>Цена</th>
|
||
<th></th>
|
||
</tr>
|
||
</thead>
|
||
<cfoutput query="qSpecificationItemVersion">
|
||
<tr>
|
||
<td>
|
||
<a href="specification_item_version.cfm?specification_item_uid=#specification_item_uid#&agreement_version=#agreement_version#&#tr.fwx#">
|
||
<img src="img/edit.gif"/>
|
||
</a>
|
||
</td>
|
||
<td class="c"><a href="agreement.cfm?contract_id=#contract_id#&agreement_version=#agreement_version#&#tr.fwx#">#agreement_version#</a></td>
|
||
<td>#agreement#</td>
|
||
<td class="c">#dateFormat(dt_agreement,'DD.MM.YYYY')#</td>
|
||
<td class="c"><cfif is_actual GT 0><img src="img/ok.png"/></cfif></td>
|
||
<td class="c">#dateFormat(dt_from, 'DD.MM.YYYY')#</td>
|
||
<td class="c">#dateFormat(dt_to, 'DD.MM.YYYY')#</td>
|
||
<td>#specification_item_version#</td>
|
||
<td class="r">#quantity#</td>
|
||
<td class="r">#price#</td>
|
||
<td class="c">
|
||
<cfif pageInfo.writePermitted()>
|
||
<a href="specification_item_version_del.cfm?specification_item_uid=#specification_item_uid#&agreement_version=#agreement_version#&#tr.fwx#">
|
||
<img src="img/del.gif"/>
|
||
</a>
|
||
</cfif>
|
||
</td>
|
||
</tr>
|
||
</cfoutput>
|
||
</table>
|
||
|
||
</cfif>
|
||
|
||
<layout:page section="footer"/>
|