intermediate draft 2
This commit is contained in:
parent
118012e17e
commit
535ac713c6
@ -168,62 +168,87 @@
|
||||
|
||||
<layout:page section="extension" closeForm="Yes"/>
|
||||
|
||||
<!--- <cfif d.agreement_id GT 0>
|
||||
<!--- для identity проверка существования записи простая, а тут как? В принципе, бин должен экспортировать флаг существования записи --->
|
||||
<cfif d.agreement_version GE 0>
|
||||
<cfquery name="qItem" datasource="#request.DS#">
|
||||
select
|
||||
i.agreement_item_uid
|
||||
,s.svc_id
|
||||
,s.svc
|
||||
,s.code
|
||||
,(select count(*) from agreement_item_version siv where siv.agreement_item_uid=i.agreement_item_uid) as item_version_count
|
||||
from agreement_item i
|
||||
left outer join svc s on (i.svc_id=s.svc_id)
|
||||
where i.agreement_id=<cfqueryparam cfsqltype="cf_sql_integer" value="#d.agreement_id#"/>
|
||||
i.specification_item_uid
|
||||
i.agreement_version /*лучше читается, когда все берется из резалтсета*/
|
||||
,i.svc_id
|
||||
,svc.svc
|
||||
,svc.code
|
||||
,iv.specification_item_version /*it is printable name not number*/
|
||||
,iv.quantity
|
||||
,iv.price
|
||||
,iv.dt_from
|
||||
,iv.dt_to
|
||||
,i.specification_id
|
||||
,s.specification
|
||||
,s.contract_id
|
||||
,d.contract
|
||||
,d.dt_contract
|
||||
,d.contragent_id
|
||||
,k.contragent
|
||||
from specification_item_version iv
|
||||
join specification_item i on (iv.specification_item_uid=i.specification_item_uid)
|
||||
join specification s on (i.specification_id=s.specification_id)
|
||||
join contract d on (s.contract_id=d.contract_id)
|
||||
join contragent k on (d.contragent_id=k.contragent_id)
|
||||
left outer join svc on (i.svc_id=svc.svc_id)
|
||||
where s.contract_id=<cfqueryparam cfsqltype="cf_sql_integer" value="#d.contract_id#"/>
|
||||
AND iv.agreement_version=<cfqueryparam cfsqltype="cf_sql_integer" value="#d.agreement_version#"/>
|
||||
order by 1
|
||||
</cfquery>
|
||||
|
||||
<cfoutput>
|
||||
<p>
|
||||
Строки спецификации (#qItem.recordCount#)
|
||||
<cfif pageInfo.writePermitted()>
|
||||
<cfoutput>
|
||||
<cfset addUrl="agreement_item.cfm?agreement_item_uid=&agreement_id=#d.agreement_id#&#tr.fwx#"/>
|
||||
<button type="button" class="maincontrol" onclick="document.location.href='#addUrl#'">
|
||||
<a href="#addUrl#">Создать</a>
|
||||
</button>
|
||||
</cfoutput>
|
||||
</cfif>
|
||||
Строки спецификаций (#qItem.recordCount#)
|
||||
</p>
|
||||
</cfoutput>
|
||||
<table class="worktable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Ключ строки</th>
|
||||
<th>Стабильный ключ строки</th>
|
||||
<th>Услуга</th>
|
||||
<th>Код услуги</th>
|
||||
<th>Версий</th>
|
||||
<!--- <th>Компонентов</th> --->
|
||||
<th>Имя для печати</th>
|
||||
<th>Дата с</th>
|
||||
<th>Дата по</th>
|
||||
<th>Кол-во</th>
|
||||
<th>Цена</th>
|
||||
<th>Спецификация</th>
|
||||
<th>Договор</th>
|
||||
<th>Контрагент</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<cfoutput query="qItem">
|
||||
<tr>
|
||||
<td>
|
||||
<c:link_view_edit canWrite=#pageInfo.writePermitted()# entity="agreement_item" key="agreement_item_uid" id=#agreement_item_uid# fwx=#tr.fwx#/>
|
||||
<a href="specification_item_version.cfm?specification_item_uid=#specification_item_uid#&agreement_version=#agreement_version#&#tr.fwx#" class=<cfif pageInfo.writePermitted()>"edit"<cfelse>"view"</cfif>></a>
|
||||
</td>
|
||||
<td>#agreement_item_uid#</td>
|
||||
<td>#specification_item_uid#</td>
|
||||
<td>#svc#</td>
|
||||
<td>#code#</td>
|
||||
<td>#item_version_count#</td>
|
||||
<td>#specification_item_version#</td>
|
||||
<td>#dateFormat(dt_from,'DD.MM.YYYY')#</td>
|
||||
<td>#dateFormat(dt_to,'DD.MM.YYYY')#</td>
|
||||
<td>#quantity#</td>
|
||||
<td>#price#</td>
|
||||
<td><a href="specification.cfm?specification_id=#specification_id#&#tr.fwx#">#specification#</a></td>
|
||||
<td>#contract# #dateFormat(dt_contract,'DD.MM.YYYY')#</td>
|
||||
<td>#contragent#</td>
|
||||
<td class="c">
|
||||
<c:link_del canWrite=#pageInfo.writePermitted()# entity="agreement_item" id=#agreement_item_uid# fwx=#tr.fwx#/>
|
||||
<cfif pageInfo.writePermitted()>
|
||||
<a href="specification_item_version_del.cfm?specification_item_uid=#specification_item_uid#&agreement_version=#agreement_version#&#tr.fwx#" class="del"></a>
|
||||
</cfif>
|
||||
</td>
|
||||
</tr>
|
||||
</cfoutput>
|
||||
</table>
|
||||
|
||||
</cfif> --->
|
||||
</cfif>
|
||||
|
||||
|
||||
<layout:page section="footer"/>
|
||||
|
@ -102,6 +102,7 @@ insert into specification (specification,contract_id) values ('first spec',1);
|
||||
|
||||
-- на соглашение должна быть одна актуальная версия спецификации
|
||||
-- может, она не очень-то и нужна, у нее полей-то только описание, а оно не очень нужно, а ключ составной и распространяется дальше
|
||||
-- и правда, она просто не используется
|
||||
drop table if exists specification_version CASCADE;
|
||||
create table specification_version (
|
||||
specification_id int
|
||||
|
Loading…
Reference in New Issue
Block a user