006 interface improvements
This commit is contained in:
+55
-15
@@ -69,6 +69,17 @@
|
||||
where d.contract_id=<cfqueryparam cfsqltype="cf_sql_integer" value="#d.contract_id#"/>
|
||||
</cfquery>
|
||||
|
||||
<cfquery name="qVersion" datasource="#request.DS#">
|
||||
select
|
||||
a.agreement
|
||||
,a.dt_agreement
|
||||
,a.agreement_version
|
||||
,a.is_actual
|
||||
from agreement a
|
||||
where a.contract_id=<cfqueryparam cfsqltype="cf_sql_integer" value="#d.contract_id#"/>
|
||||
order by a.agreement_version
|
||||
</cfquery>
|
||||
|
||||
</m:silent><!---
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -172,6 +183,20 @@
|
||||
#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 class="tr">
|
||||
<div class="th">Версии</div>
|
||||
<div class="td">
|
||||
<cfoutput query=#qVersion#>
|
||||
<cfif qVersion.agreement_version EQ d.agreement_version>
|
||||
<b>#agreement_version#</b>
|
||||
<cfelse>
|
||||
<a href="agreement.cfm?contract_id=#contract_id#&agreement_version=#agreement_version#&track=#tr.self#">#agreement_version#</a>
|
||||
</cfif>
|
||||
|
||||
</cfoutput>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Соглашение просто объединяет правки строк спецификации в пакет и оформляет их документом (в случае с допником). То есть версии строк существуют не сами по себе, а связаны с конкретным соглашением. Между прочим, это означает, что в рамках одного доп. соглашения мы не можем сделать 2 изменения строки, например 2 разные цены с разных дат - нужно оформлять отдельными допниками.
|
||||
@@ -193,7 +218,7 @@
|
||||
<!--- для identity проверка существования записи простая, а тут как? В принципе, бин должен экспортировать флаг существования записи --->
|
||||
<cfif d.agreement_version GE 0>
|
||||
<cfquery name="qItem" datasource="#request.DS#">
|
||||
select
|
||||
select
|
||||
iv.specification_item_uid
|
||||
,iv.agreement_version /*лучше читается, когда все одинаково берется из резалтсета*/
|
||||
,i.svc_id
|
||||
@@ -219,7 +244,11 @@
|
||||
,ver.quantity as prev_quantity
|
||||
,ver.dt_from as prev_dt_from
|
||||
,ver.dt_to as prev_dt_to
|
||||
,case when ver.agreement_version IS NULL then 'new' else 'change' end as change_type /*удалить услугу нельзя, можно только завершить ее оказание (после этого в более поздних версиях она должна стать незаметной)*/
|
||||
,case
|
||||
when ver.agreement_version = iv.agreement_version then ''
|
||||
when ver.agreement_version IS NULL then 'new'
|
||||
else 'changed'
|
||||
end as change_type /*удалить услугу нельзя, можно только завершить ее оказание (после этого в более поздних версиях она должна стать незаметной)*/
|
||||
,COALESCE(iv.price*iv.quantity,0) - COALESCE(ver.price*ver.quantity,0) as cost_diff
|
||||
|
||||
from specification_item_version iv
|
||||
@@ -229,7 +258,7 @@
|
||||
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)
|
||||
left outer join (select
|
||||
left outer join (select /*предыдущая версия*/
|
||||
siv.agreement_version
|
||||
,siv.specification_item_uid
|
||||
,a.agreement
|
||||
@@ -255,9 +284,17 @@
|
||||
AND ia.is_actual
|
||||
AND ia.agreement_version < <cfqueryparam cfsqltype="cf_sql_integer" value="#d.agreement_version#"/>
|
||||
)
|
||||
) ver on (iv.specification_item_uid=ver.specification_item_uid AND ver.specification_id=s.specification_id)
|
||||
) ver on (iv.specification_item_uid=ver.specification_item_uid AND ver.specification_id=s.specification_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#"/>
|
||||
AND iv.agreement_version=(select max(iiv.agreement_version)
|
||||
from specification_item_version iiv
|
||||
join specification_item ii on (iiv.specification_item_uid=ii.specification_item_uid)
|
||||
join specification isp on (ii.specification_id=isp.specification_id)
|
||||
join agreement ia on (isp.contract_id=ia.contract_id AND iiv.agreement_version=ia.agreement_version)
|
||||
where iiv.specification_item_uid=i.specification_item_uid
|
||||
AND ia.is_actual
|
||||
AND iiv.agreement_version <=<cfqueryparam cfsqltype="cf_sql_integer" value="#d.agreement_version#"/>
|
||||
)
|
||||
order by i.specification_id
|
||||
</cfquery>
|
||||
|
||||
@@ -267,17 +304,19 @@
|
||||
</p>
|
||||
</cfoutput>
|
||||
<table class="worktable">
|
||||
<thead>
|
||||
<cfoutput query="qItem" group="specification_id">
|
||||
<!--- <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>
|
||||
@@ -299,8 +338,8 @@
|
||||
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<cfoutput query="qItem">
|
||||
<!--- </thead> --->
|
||||
<cfoutput group="specification_item_uid">
|
||||
<tr>
|
||||
<td>
|
||||
<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>
|
||||
@@ -312,13 +351,14 @@
|
||||
<td>#contragent#</td>
|
||||
<td>
|
||||
<a href="specification_item.cfm?specification_item_uid=#specification_item_uid#&#tr.fwx#">#specification_item_uid#</a>
|
||||
</td>
|
||||
</td>
|
||||
|
||||
<td>#code#</td>
|
||||
<td>
|
||||
<a href="svc.cfm?svc_id=#svc_id#&#tr.fwx#">#svc#</a>
|
||||
</td>
|
||||
<td class="c">#pricing_model_short#</td>
|
||||
<td>#code#</td>
|
||||
</td>
|
||||
<td>#specification_item_version#</td>
|
||||
<td class="c">#pricing_model_short#</td>
|
||||
|
||||
<td class="c">#dateFormat(dt_from,'DD.MM.YYYY')#</td>
|
||||
<td class="c">#dateFormat(dt_to,'DD.MM.YYYY')#</td>
|
||||
@@ -344,8 +384,8 @@
|
||||
</td>
|
||||
</tr>
|
||||
</cfoutput>
|
||||
</cfoutput>
|
||||
</table>
|
||||
Может быть, сюда для ясности добавить не измененые строки спецификаций?
|
||||
|
||||
</cfif>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user