007 interface improvements
This commit is contained in:
@@ -27,30 +27,36 @@
|
||||
thisUrl="#request.thisPage#?specification_item_uid=#specification_item_uid#&agreement_version=#agreement_version#"
|
||||
defaultBackUrl="specification_item.cfm?specification_item_uid=#specification_item_uid#"
|
||||
/>
|
||||
<!--- ситуация
|
||||
мы создаем новую строку спецификации и сразу ее версию - при этом у нас в контексте может быть известно текущее соглашение, и еще из него нужно взять dt_from по умолчанию
|
||||
либо мы создаем новую версию строки, а текущая версия уже занята - тогда нужно создавать
|
||||
НЕУДОБНО: когда мы меняем номер соглашения у версии строки, у нас не меняется версия, а создается новая --->
|
||||
|
||||
<cfquery name="qLastVersion">
|
||||
select agreement_version, quantity, price, specification_item_version
|
||||
from specification_item_version
|
||||
where specification_item_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#specification_item_uid#" null=#!IsValid('guid',specification_item_uid)#/>
|
||||
<cfif isValid('integer',agreement_version)>
|
||||
AND agreement_version=<cfqueryparam cfsqltype="cf_sql_integer" value="#agreement_version#"/>
|
||||
</cfif>
|
||||
order by agreement_version desc limit 1
|
||||
</cfquery>
|
||||
<cfif qLastVersion.recordCount EQ 0>
|
||||
<cfset queryAddRow(qLastVersion,[0,1,0,""])/>
|
||||
<!--- <cfdump var=#lastVersion#/> --->
|
||||
</cfif>
|
||||
|
||||
<cfquery name="qAgreement">
|
||||
select a.agreement, a.dt_agreement, a.contract_id
|
||||
from specification_item si
|
||||
join specification s on (si.specification_id=s.specification_id)
|
||||
join agreement a on (s.contract_id=a.contract_id)
|
||||
where si.specification_item_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#specification_item_uid#" null=#!IsValid('guid',specification_item_uid)#/>
|
||||
<cfif isValid('integer',agreement_version)>
|
||||
AND agreement_version=<cfqueryparam cfsqltype="cf_sql_integer" value="#agreement_version#"/>
|
||||
</cfif>
|
||||
order by a.agreement_version desc limit 1
|
||||
</cfquery>
|
||||
<!--- <cfdump var=#qAgreement#/> --->
|
||||
|
||||
<!--- <cfdump var=#pageInfo#/>
|
||||
<cfdump var=#specification_item_version#/>
|
||||
<cfabort/> --->
|
||||
|
||||
<d:bean readonly=#!pageInfo.writePermitted()# table="#pageInfo.entity#" datasource="#request.DS#" output="d" status="status">
|
||||
<d:param field="specification_item_uid" type="guid" key/>
|
||||
|
||||
Reference in New Issue
Block a user