025 interface imptovements
This commit is contained in:
+2
-4
@@ -19,14 +19,12 @@
|
||||
<cfset this.defaultdatasource = this.datasource/>
|
||||
<cfset request.DS = "#this.datasource#">
|
||||
<!--- кажется, нужно инициализировать датасорцы в псевдоконструкторе - onRequest не получается --->
|
||||
<cfset this.datasources["#this.datasource#"]=getDS("#this.datasource#","ds_#this.datasource#")/>
|
||||
<!--- <cfset this.datasources["#this.datasource#"]=getDS("#this.datasource#","ds_#this.datasource#")/>
|
||||
<cfset this.datasources["billing-vc"]=getDS("billing-vc","ds_billing_vc")/>
|
||||
<cfset this.datasources["billing-s3"]=getDS("billing-s3","ds_billing_s3")/>
|
||||
<cfset this.datasources["billing-s3"]=getDS("billing-s3","ds_billing_s3")/> --->
|
||||
|
||||
<!--- но датасорцы таинственно прочухались с прошлым пушем, без переноса инициализации в псевдоконструктор --->
|
||||
|
||||
|
||||
|
||||
<cfset COOKIEENCKEY = "PREVED!Y2"/>
|
||||
<!--- Define the page request properties. --->
|
||||
<cfsetting
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
<d:param field="__deletedAt" type="timestamp" forNull=""/> --->
|
||||
<d:param field="documents" type="ARRAY" forNull=""/>
|
||||
<d:param field="contract_uid" type="uuid" forNull=""/>
|
||||
<d:param field="__index" type="integer" forNull="" default="0" init="0"/>
|
||||
<d:param field="index" type="integer" forNull="" default="0" init="0"/>
|
||||
<!--- <d:param field="services" type="ARRAY" forNull=""/> --->
|
||||
<d:param field="is_actual" type="bit" forNull=""/>
|
||||
@@ -93,7 +94,7 @@
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">__id</div>
|
||||
<div class="td">#d.__id#</div>
|
||||
<div class="td">#d.__id# __index #d.__index#</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
@@ -296,7 +297,7 @@
|
||||
<td class="c">#dateFormat(date_nop,'YYYY-MM-DD')#</td>
|
||||
<td class="c">#dateFormat(date_end,'YYYY-MM-DD')#</td>
|
||||
<td class="c"><cfif is_easy GT 0>Простая<cfelse>Композитная</cfif></td>
|
||||
<td class="c">#params#</td>
|
||||
<td>#params#</td>
|
||||
</tr>
|
||||
</cfoutput>
|
||||
</table>
|
||||
|
||||
@@ -0,0 +1,307 @@
|
||||
<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="additional_agreement" accessObject="" key="__id" pageInfoOut="pageInfo"/>
|
||||
|
||||
<d:bean readonly=true table="elma.additional_agreements" datasource="#request.DS#" output="d" status="status">
|
||||
<d:param field="__id" type="uuid" key/>
|
||||
<d:param field="__name" type="varchar" size="255" preprocessor=#cleanInput# forNull=""/>
|
||||
<!--- <d:param field="__createdAt" type="timestamp" forNull=""/> тут нужно добавлять в селект кавычки
|
||||
<d:param field="__createdBy" type="uuid" forNull=""/>
|
||||
<d:param field="__updatedAt" type="timestamp" forNull=""/>
|
||||
<d:param field="__updatedBy" type="uuid" forNull=""/>
|
||||
<d:param field="__deletedAt" type="timestamp" forNull=""/> --->
|
||||
<d:param field="documents" type="ARRAY" forNull=""/>
|
||||
<d:param field="contract_uid" type="uuid" forNull=""/>
|
||||
<d:param field="__index" type="integer" forNull="" default="0" init="0"/>
|
||||
<d:param field="index" type="integer" forNull="" default="0" init="0"/>
|
||||
<!--- <d:param field="services" type="ARRAY" forNull=""/> --->
|
||||
<d:param field="is_actual" type="bit" forNull=""/>
|
||||
<d:param field="last_aa" type="bit" forNull=""/>
|
||||
<!--- <d:param field="services_::text as services_" type="ARRAY" forNull=""/> --->
|
||||
<d:param field="deal_uid" type="uuid" forNull=""/>
|
||||
<d:param field="base_by" type="ARRAY" forNull=""/>
|
||||
<d:param field="__index" type="integer" forNull="" default="0" init="0"/>
|
||||
<d:param field="dt_load" type="timestamp"/>
|
||||
</d:bean>
|
||||
|
||||
|
||||
<m:dispatch_detail
|
||||
usePRG="No"<!---*** --->
|
||||
pageInfo=#pageInfo#
|
||||
id="#d.__id#"
|
||||
status=#pageInfo.status#
|
||||
trackOut="tr"
|
||||
idAttributesOut="id"
|
||||
/>
|
||||
|
||||
<!--- decoration --->
|
||||
<cfquery name="qDecoration" datasource="#request.DS#">
|
||||
select
|
||||
c.__name as contract
|
||||
,c.date_of_aggrement
|
||||
,c.date_end_aggrement
|
||||
,k.__name as contragent
|
||||
,k.id_klienta as wz
|
||||
from elma.aggrements c
|
||||
left outer join elma.companies k on (c.company_uid=k.__id)
|
||||
where c.__id=<cfqueryparam cfsqltype="cf_sql_other" value=#d.contract_uid# null=#!isValid("guid",d.contract_uid)#/>
|
||||
</cfquery>
|
||||
|
||||
|
||||
</m:silent><!---
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
---><layout:page section="header" pageInfo=#pageInfo#>
|
||||
<layout:attribute name="title">
|
||||
<cfoutput>
|
||||
Дополнительное соглашение
|
||||
<cfif len(d.__id)>
|
||||
<b>#d.__name#</b>
|
||||
[#d.__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="__id" value="#d.__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">__id</div>
|
||||
<div class="td">#d.__id# __index #d.__index#</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Название</div>
|
||||
<div class="td">#d.__name#</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Версия (index)</div>
|
||||
<div class="td">#d.index#</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Версии</div>
|
||||
<div class="td">
|
||||
<cfquery name="qVer">
|
||||
with
|
||||
s(status, status_id, probability_pc) as (VALUES
|
||||
('Закрыта неуспешно',7,0),('Закрыта успешно',6,100),('Договор подписан',5,100),('Договор на подписании',15,90),('Договор на согласовании',12,70),
|
||||
('Тестирование',8,50),('Отправлено ТКП',10,20),('Внутреннее согласование',37,10),('Проработка решения',4,10),('Сбор потребностей',1,0)
|
||||
)
|
||||
select
|
||||
index
|
||||
, a.__id::text
|
||||
, d.__id::text as deal_uid
|
||||
, a.__name
|
||||
, d.__status_status
|
||||
, s.status
|
||||
, s.probability_pc
|
||||
from elma.additional_agreements a
|
||||
left outer join elma.deals d on (a.deal_uid=d.__id)
|
||||
left outer join s on (d.__status_status=s.status_id)
|
||||
where a.contract_uid=<cfqueryparam cfsqltype="cf_sql_other" value=#d.contract_uid# null=#!isValid("guid",d.contract_uid)#/>
|
||||
order by index
|
||||
</cfquery>
|
||||
<cfloop query=#qVer#>
|
||||
<cfif __id EQ toString(d.__id)>
|
||||
#index#: #__name#
|
||||
<cfelse>
|
||||
<a href="additional_agreement.cfm?__id=#__id#&#tr.fwx#">#index#: #__name# </a>
|
||||
</cfif>
|
||||
<a href="deal.cfm?__id=#deal_uid#&#tr.fwx#">(#__status_status#: #probability_pc#%)</a>
|
||||
<cfif qVer.currentRow LT qVer.recordCount>|</cfif>
|
||||
</cfloop>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Договор</div>
|
||||
<div class="td">
|
||||
<cfif len(d.contract_uid)>
|
||||
<a href="contract.cfm?__id=#d.contract_uid#&#tr.fwx#"><b>#qDecoration.contract#</b> #dateFormat(qDecoration.date_of_aggrement,'DD.MM.YYYY')#
|
||||
[#d.contract_uid#]</a>
|
||||
#qDecoration.contragent# #qDecoration.wz#
|
||||
</cfif>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">is_actual</div>
|
||||
<div class="td">#d.is_actual#</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Последнее в цепочке</div>
|
||||
<div class="td">#d.last_aa#</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Сделка</div>
|
||||
<div class="td">
|
||||
<cfif len(d.deal_uid)>
|
||||
<a href="deal.cfm?__id=#d.deal_uid#&#tr.fwx#">#d.deal_uid#</a>
|
||||
<cfquery name="qDeal">
|
||||
with
|
||||
s(status, status_id, probability_pc) as (VALUES
|
||||
('Закрыта неуспешно',7,0),('Закрыта успешно',6,100),('Договор подписан',5,100),('Договор на подписании',15,90),('Договор на согласовании',12,70),
|
||||
('Тестирование',8,50),('Отправлено ТКП',10,20),('Внутреннее согласование',37,10),('Проработка решения',4,10),('Сбор потребностей',1,0)
|
||||
)
|
||||
select d.__id::text
|
||||
, d.__name
|
||||
, d.__status_status
|
||||
, s.status
|
||||
, s.probability_pc
|
||||
from elma.deals d
|
||||
left outer join s on (d.__status_status=s.status_id)
|
||||
where d.__id=<cfqueryparam cfsqltype="cf_sql_other" value=#d.deal_uid# null=#!isValid("guid",d.deal_uid)#/>
|
||||
</cfquery>
|
||||
#qDeal.__name#
|
||||
(#qDeal.status#:
|
||||
#qDeal.probability_pc#%)
|
||||
</cfif>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Услуги</div>
|
||||
<div class="td">
|
||||
<cfquery name="qService_">
|
||||
select services_::text
|
||||
from elma.additional_agreements a
|
||||
where a.__id=<cfqueryparam cfsqltype="cf_sql_other" value=#d.__id# null=#!isValid("guid",d.__id)#/>
|
||||
</cfquery>
|
||||
#qService_.services_# (обратная ссылка)
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">base_by</div>
|
||||
<div class="td">
|
||||
<cfquery name="qBaseBy">
|
||||
select b.__id::text
|
||||
, b.__name
|
||||
from elma.additional_agreements a
|
||||
join elma.additional_agreements b on (b.__id = ANY(a.base_by))
|
||||
where a.__id=<cfqueryparam cfsqltype="cf_sql_other" value=#d.__id# null=#!isValid("guid",d.__id)#/>
|
||||
</cfquery>
|
||||
<a href="additional_agreement.cfm?__id=#qBaseBy.__id#&#tr.fwx#">#qBaseBy.__id#</a>
|
||||
#qBaseBy.__name#
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</cfoutput>
|
||||
|
||||
<layout:page section="extension" closeForm="Yes"/>
|
||||
|
||||
<cfif len(d.__id)>
|
||||
<cfquery name="qService">
|
||||
select
|
||||
siv.__id
|
||||
,siv.__name
|
||||
,siv.user_description
|
||||
,siv.discount
|
||||
,siv.cnt
|
||||
,siv.modifier_code
|
||||
,siv.abstractive_service_code
|
||||
,siv.is_actual
|
||||
,siv.type
|
||||
,siv.hash
|
||||
,siv.version
|
||||
,siv.name_version
|
||||
,siv.date_accept
|
||||
,siv.__index
|
||||
,siv.date_nop
|
||||
,siv.date_end
|
||||
,siv.is_easy
|
||||
,siv.params::text
|
||||
from elma.deals_services siv
|
||||
where <cfqueryparam cfsqltype="cf_sql_other" value="#d.__id#" null=#!isValid("guid",d.__id)#/>=ANY(siv.additional_agreement)
|
||||
order by type
|
||||
</cfquery>
|
||||
|
||||
<cfoutput>
|
||||
<h4>Услуги (строки спецификации) (#qService.recordCount#)</h4>
|
||||
</cfoutput>
|
||||
|
||||
<!--- <layout:render_query query=#qService#/> --->
|
||||
<table class="worktable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>__id</th>
|
||||
<!--- <th>__name</th> --->
|
||||
<th>user_description</th>
|
||||
<th>Кол-во</th>
|
||||
<th>Скидка</th>
|
||||
<th>abstractive_service_code</th>
|
||||
<th>modifier_code</th>
|
||||
<th>is_actual</th>
|
||||
<th>type</th>
|
||||
<th>hash</th>
|
||||
<th>version</th>
|
||||
<th>name_version</th>
|
||||
<th>date_accept</th>
|
||||
<th>__index</th>
|
||||
<th>date_nop</th>
|
||||
<th>date_end</th>
|
||||
<th>is_easy</th>
|
||||
<th>params</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<cfoutput query="qService">
|
||||
<tr>
|
||||
<td class="c"><a href="deal_service.cfm?__id=#__id#&#tr.fwx#">#__id#</a></td>
|
||||
<!--- <td class="c">#__name#</td> --->
|
||||
<td class="c">#user_description#</td>
|
||||
<td class="c">#cnt#</td>
|
||||
<td class="c">#discount#</td>
|
||||
<td class="c">#abstractive_service_code#</td>
|
||||
<td class="c">#modifier_code#</td>
|
||||
<td class="c">#is_actual#</td>
|
||||
<td class="c">#type#</td>
|
||||
<td class="c">#hash#</td>
|
||||
<td class="c">#version#</td>
|
||||
<td class="c">#name_version#</td>
|
||||
<td class="c">#date_accept#</td>
|
||||
<td class="c">#__index#</td>
|
||||
<td class="c">#dateFormat(date_nop,'YYYY-MM-DD')#</td>
|
||||
<td class="c">#dateFormat(date_end,'YYYY-MM-DD')#</td>
|
||||
<td class="c"><cfif is_easy GT 0>Простая<cfelse>Композитная</cfif></td>
|
||||
<td class="c">#params#</td>
|
||||
</tr>
|
||||
</cfoutput>
|
||||
</table>
|
||||
</cfif>
|
||||
|
||||
|
||||
<layout:page section="footer"/>
|
||||
@@ -52,7 +52,7 @@
|
||||
</cftry>
|
||||
|
||||
<cfquery name="qCountTotal" datasource="#request.DS#">
|
||||
select count(*) as cnt from elma.aggrements d where 1=1
|
||||
select count(*) as cnt from elma.additional_agreements d where 1=1
|
||||
</cfquery>
|
||||
|
||||
</m:silent><!---
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
<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="hideNonPositive">
|
||||
<cfargument name="a"/>
|
||||
<cfreturn (a GT 0)? a : ""/>
|
||||
</cffunction>
|
||||
|
||||
<m:prepare_ls entity="additional_agreement" accessObject="" pageInfoOut="pageInfo" trackOut="tr"/>
|
||||
|
||||
<!--- <m:filter_settings target="#pageInfo.entity#_ls">
|
||||
<m:filterparam filter=#filter# param="quickfilter" ftype="string" prefix="%" suffix="%" expression="((p.project like ?) OR (p.customer like ?) OR (p.customer_alias like ?) OR (p.contract_class_type like ?) OR (p.division like ?) OR (p.performer_short like ?))" default=""/>
|
||||
</m:filter_settings> --->
|
||||
<!--- <cfset pageInfo.settings.filter=#filter#/> --->
|
||||
|
||||
<cftry>
|
||||
<cfquery name="qRead" datasource="#request.DS#">
|
||||
select
|
||||
<d:field_set titleMapOut="titleMap" lengthOut="fieldCount">
|
||||
<d:field title="ID" cfSqlType="CF_SQL_OTHER">a.__id</d:field>
|
||||
<d:field title="Внут.номер">g.agreement_id</d:field>
|
||||
<d:field title="Доп.соглашение">a.__name</d:field>
|
||||
<d:field title="Версия">a.index</d:field>
|
||||
<d:field title="Сделка">d.__name as deal</d:field>
|
||||
<d:field title="Сделка">d.__id as deal_uid</d:field>
|
||||
<d:field title="Договор">g.__name as contract</d:field>
|
||||
<d:field title="Договор">g.__id as contract_uid</d:field>
|
||||
<d:field title="company_uid">g.company_uid</d:field>
|
||||
<d:field title="Контрагент">k.__name as contragent</d:field>
|
||||
<d:field title="WZ">k.id_klienta as wz</d:field>
|
||||
<d:field title="Дата договора">g.date_of_aggrement</d:field>
|
||||
<d:field title="Дата окончания">g.date_end_aggrement</d:field>
|
||||
<d:field title="Тип договора">g.type_of_agreement</d:field>
|
||||
</d:field_set>
|
||||
from elma.additional_agreements a
|
||||
left outer join elma.additional_agreements b on (b.__id=ANY(a.base_by))
|
||||
left outer join elma.aggrements g on (a.contract_uid=g.__id)
|
||||
left outer join elma.deals d on (a.deal_uid=d.__id)
|
||||
left outer join elma.companies k on (g.company_uid=k.__id)
|
||||
where 1=1 <m:filter_build filter=#pageInfo.settings.filter#/>
|
||||
order by <m:order_build sortArray=#pageInfo.settings.sort.sortArray# fieldCount=#fieldCount#/>
|
||||
</cfquery>
|
||||
|
||||
|
||||
<cfcatch type="database">
|
||||
<m:ls_catch catch=#cfcatch# status=#pageInfo.status#/>
|
||||
</cfcatch>
|
||||
</cftry>
|
||||
|
||||
<cfquery name="qCountTotal" datasource="#request.DS#">
|
||||
select count(*) as cnt from elma.aggrements d where 1=1
|
||||
</cfquery>
|
||||
|
||||
</m:silent><!---
|
||||
-----------------------------------------------------------------------------------------
|
||||
-----------------------------------------------------------------------------------------
|
||||
-----------------------------------------------------------------------------------------
|
||||
---><cfif isDefined("output_xls")>
|
||||
<layout:xml qRead=#qRead# titleMap=#titleMap# filename="#pageInfo.entity#.xml"/>
|
||||
<cfabort/>
|
||||
</cfif><cfif isDefined("output_json")>
|
||||
<layout:json qRead=#qRead# titleMap=#titleMap# filename="#pageInfo.entity#.json"/>
|
||||
<cfabort/>
|
||||
</cfif><!---
|
||||
---><layout:page section="header" pageInfo=#pageInfo#>
|
||||
|
||||
<layout:attribute name="title">
|
||||
<cfoutput><b>Дополнительные соглашения</b></cfoutput>
|
||||
</layout:attribute>
|
||||
<!--- <layout:attribute name="controls"></layout:attribute> --->
|
||||
</layout:page>
|
||||
|
||||
<cfif pageInfo.readPermitted() AND !pageInfo.status.errorState>
|
||||
|
||||
<layout:grid_summary
|
||||
recordCount=#qRead.recordCount#
|
||||
totalCount=#qCountTotal.cnt#
|
||||
footerOut="gridFooter"
|
||||
excelLink="Yes"
|
||||
jsonLink="Yes"
|
||||
/>
|
||||
|
||||
|
||||
<!--- так довольно громоздко, но можно обойтись без Dynamic Evaluation --->
|
||||
<cfset queryAddColumn(qRead,'f_link_view_edit')/>
|
||||
<cfset titleMap.f_link_view_edit={ordinal=#StructCount(titleMap)+1#}/><!--- *** Это легко забыть, потому что TitleMap никак не сцеплен с qRead. Напрашивается: упаковать их в одну обертку (но тогда обращение станет длиннее). Еще идея - назвать qRead и TitleMap так, чтобы была видна их связь. --->
|
||||
<!--- <cfdump var=#titleMap#/> --->
|
||||
|
||||
<cfset queryAddColumn(qRead,'f_contract')/>
|
||||
<cfset titleMap.f_contract=titleMap.contract/>
|
||||
|
||||
<cfset queryAddColumn(qRead,'f_contragent')/>
|
||||
<cfset titleMap.f_contragent=titleMap.contragent/>
|
||||
|
||||
<cfset queryAddColumn(qRead,'f_deal')/>
|
||||
<cfset titleMap.f_deal=titleMap.deal/>
|
||||
|
||||
<cfset queryAddColumn(qRead,'f_link_del')/>
|
||||
<cfset titleMap.f_link_del={ordinal=0}/>
|
||||
<!--- <cfdump var=#titleMap#/> --->
|
||||
|
||||
<cfoutput query=#qRead# startRow=#pageInfo.nStart# maxRows=#pageInfo.recordsPerPage#>
|
||||
<cfsavecontent variable="qRead.f_link_view_edit">
|
||||
<a href="additional_agreement.cfm?__id=#__id#&#tr.fwx#" name="#__id#" title="просмотр" class="view"></a>
|
||||
</cfsavecontent>
|
||||
|
||||
<cfsavecontent variable="qRead.f_contract">
|
||||
<a href="contract.cfm?__id=#contract_uid#&#tr.fwx#">#contract#</a>
|
||||
</cfsavecontent>
|
||||
|
||||
<cfsavecontent variable="qRead.f_contragent">
|
||||
<a href="contragent.cfm?__id=#company_uid#&#tr.fwx#">#contragent#</a>
|
||||
</cfsavecontent>
|
||||
|
||||
<cfsavecontent variable="qRead.f_deal">
|
||||
<a href="deal.cfm?__id=#deal_uid#&#tr.fwx#">#deal#</a>
|
||||
</cfsavecontent>
|
||||
|
||||
</cfoutput>
|
||||
|
||||
<c:table query=#qRead# recordsPerPage=#pageInfo.recordsPerPage# nStart=#pageInfo.nStart# titleMap=#titleMap# sortArray=#pageInfo.settings.sort.sortArray# class="worktable wide">
|
||||
<c:column width="1%" sortable="false"><!---*** class="c" не пробрасывается --->
|
||||
|
||||
<c:td field="f_link_view_edit" class="c"/>
|
||||
|
||||
</c:column>
|
||||
<c:column width="10%" field="__id"><c:td class="l"/></c:column>
|
||||
<c:column width="3%" field="index"/>
|
||||
<c:column width="15%" field="__name"/>
|
||||
<c:column width="15%" field="f_contract"/>
|
||||
<c:column width="6%" field="agreement_id"/>
|
||||
<c:column width="10%" field="f_deal"/>
|
||||
<c:column width="15%" field="f_contragent"/>
|
||||
<c:column width="5%" field="wz"/>
|
||||
<c:column width="10%" field="date_of_aggrement" formatter=#function(dt){return dateformat(dt,"YYYY-MM-DD");}#><c:td class="c"/></c:column>
|
||||
<c:column width="10%" field="date_end_aggrement" formatter=#function(dt){return dateformat(dt,"YYYY-MM-DD");}#><c:td class="c"/></c:column>
|
||||
<c:column width="10%" field="type_of_agreement"><c:td class="l"/></c:column>
|
||||
|
||||
</c:table>
|
||||
|
||||
<cfoutput>#gridFooter#</cfoutput>
|
||||
|
||||
</cfif>
|
||||
<layout:page section="footer"/>
|
||||
+21
-10
@@ -118,12 +118,15 @@
|
||||
select
|
||||
a.__id::text
|
||||
,a.__name
|
||||
,contract_uid::text
|
||||
,is_actual
|
||||
,last_aa
|
||||
,index
|
||||
,deal_uid::text
|
||||
,base_by::text
|
||||
,a.__index
|
||||
,a.contract_uid::text
|
||||
,a.is_actual
|
||||
,a.last_aa
|
||||
,a.index
|
||||
,a.deal_uid::text
|
||||
,a.base_by[1]::text as base_by_uid
|
||||
,b.__name as base_by_name
|
||||
,b.__index as base_by_index
|
||||
,d.__name as deal
|
||||
,d.__status_status as status_id
|
||||
,s.status
|
||||
@@ -131,6 +134,7 @@
|
||||
from elma.additional_agreements a
|
||||
left outer join elma.deals d on (a.deal_uid=d.__id)
|
||||
left outer join s on (d.__status_status=s.status_id)
|
||||
left outer join elma.additional_agreements b on (a.base_by[1]=b.__id)
|
||||
where a.contract_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#d.__id#" null=#!isValid('guid',d.__id)#/>
|
||||
order by 1
|
||||
</cfquery>
|
||||
@@ -143,10 +147,11 @@
|
||||
<table class="worktable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>__index</th>
|
||||
<th>__id</th>
|
||||
<th>__name</th>
|
||||
<th>версия</th>
|
||||
<th>contract_uid</th>
|
||||
<!--- <th>contract_uid</th> --->
|
||||
<th>is_actual</th>
|
||||
<th>last_aa</th>
|
||||
<th>deal_uid</th>
|
||||
@@ -154,16 +159,19 @@
|
||||
<th>status_id</th>
|
||||
<th>status</th>
|
||||
<th>вер-ть</th>
|
||||
<th>base_by</th>
|
||||
<th>base_by_index</th>
|
||||
<th>base_by_uid</th>
|
||||
<th>base_by_name</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<cfoutput query="qAdditionalAgreement">
|
||||
<tr>
|
||||
|
||||
<td><a href="additional_agreement.cfm?__id=#__id#&#tr.fwx#">#__index#</a></td>
|
||||
<td><a href="additional_agreement.cfm?__id=#__id#&#tr.fwx#">#__id#</a></td>
|
||||
<td>#__name#</td>
|
||||
<td class="c">#index#</td>
|
||||
<td>#contract_uid#</td>
|
||||
<!--- <td>#contract_uid#</td> --->
|
||||
<td class="c">#is_actual#</td>
|
||||
<td class="c">#last_aa#</td>
|
||||
<td><a href="deal.cfm?__id=#deal_uid#&#tr.fwx#">#deal_uid#</a></td>
|
||||
@@ -171,7 +179,10 @@
|
||||
<td class="c">#status_id#</td>
|
||||
<td>#status#</td>
|
||||
<td class="r">#probability_pc#</td>
|
||||
<td>#base_by#</td>
|
||||
<td class="r"><a href="additional_agreement.cfm?__id=#base_by_uid#&#tr.fwx#">#base_by_index#</a></td>
|
||||
<td><a href="additional_agreement.cfm?__id=#base_by_uid#&#tr.fwx#">#base_by_uid#</a></td>
|
||||
<td><a href="additional_agreement.cfm?__id=#base_by_uid#&#tr.fwx#">#base_by_name#</a></td>
|
||||
|
||||
<!--- <td class="c">
|
||||
#dateFormat(dt_contract,'YYYY-MM-DD')#
|
||||
</td> --->
|
||||
|
||||
@@ -0,0 +1,210 @@
|
||||
<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="contract" accessObject="" key="__id" pageInfoOut="pageInfo"/>
|
||||
|
||||
<d:bean readonly=true table="elma.aggrements" datasource="#request.DS#" output="d" status="status">
|
||||
<d:param field="__id" type="uuid" key/>
|
||||
<d:param field="__name" type="varchar" size="255" preprocessor=#cleanInput# forNull=""/>
|
||||
<d:param field="company_uid" type="uuid"/>
|
||||
<d:param field="date_of_aggrement" type="timestamp"/>
|
||||
<d:param field="date_end_aggrement" type="timestamp"/>
|
||||
</d:bean>
|
||||
|
||||
|
||||
<m:dispatch_detail
|
||||
usePRG="No"<!---*** --->
|
||||
pageInfo=#pageInfo#
|
||||
id="#d.__id#"
|
||||
status=#pageInfo.status#
|
||||
trackOut="tr"
|
||||
idAttributesOut="id"
|
||||
/>
|
||||
|
||||
<!--- decoration --->
|
||||
<cfquery name="qDecoration" datasource="#request.DS#">
|
||||
select
|
||||
__name as contragent, id_klienta as wz
|
||||
from elma.companies k
|
||||
where k.__id=<cfqueryparam cfsqltype="cf_sql_other" value=#d.company_uid# null=#!isValid('guid',d.company_uid)#/>
|
||||
</cfquery>
|
||||
|
||||
|
||||
</m:silent><!---
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
---><layout:page section="header" pageInfo=#pageInfo#>
|
||||
<layout:attribute name="title">
|
||||
<cfoutput>
|
||||
Договор
|
||||
<cfif len(d.__id)>
|
||||
<b>#d.__name#</b>
|
||||
[#d.__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="__id" value="#d.__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">__id</div>
|
||||
<div class="td">#d.__id#</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Номер договора</div>
|
||||
<div class="td">#d.__name#</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Контрагент</div>
|
||||
<div class="td">
|
||||
<a href="contragent.cfm?__id=#d.company_uid#&#tr.fwx#">
|
||||
#qDecoration.contragent# #qDecoration.wz# [#d.company_uid#]
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Дата договора</div>
|
||||
<div class="td">#dateFmt(d.date_of_aggrement)#</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Дата окончания договора</div>
|
||||
<div class="td">#dateFmt(d.date_end_aggrement)#</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</cfoutput>
|
||||
|
||||
<layout:page section="extension" closeForm="Yes"/>
|
||||
|
||||
<cfif len(d.__id)>
|
||||
<cfquery name="qAdditionalAgreement">
|
||||
with
|
||||
s(status, status_id, probability_pc) as (VALUES
|
||||
('Закрыта неуспешно',7,0),('Закрыта успешно',6,100),('Договор подписан',5,100),('Договор на подписании',15,90),('Договор на согласовании',12,70),
|
||||
('Тестирование',8,50),('Отправлено ТКП',10,20),('Внутреннее согласование',37,10),('Проработка решения',4,10),('Сбор потребностей',1,0)
|
||||
)
|
||||
select
|
||||
a.__id::text
|
||||
,a.__name
|
||||
,a.__index
|
||||
,a.contract_uid::text
|
||||
,a.is_actual
|
||||
,a.last_aa
|
||||
,a.index
|
||||
,a.deal_uid::text
|
||||
,a.base_by[1]::text as base_by_uid
|
||||
,b.__name as base_by_name
|
||||
,b.__index as base_by_index
|
||||
,d.__name as deal
|
||||
,d.__status_status as status_id
|
||||
,s.status
|
||||
,s.probability_pc
|
||||
from elma.additional_agreements a
|
||||
left outer join elma.deals d on (a.deal_uid=d.__id)
|
||||
left outer join s on (d.__status_status=s.status_id)
|
||||
left outer join elma.additional_agreements b on (a.base_by[1]=b.__id)
|
||||
where a.contract_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#d.__id#" null=#!isValid('guid',d.__id)#/>
|
||||
order by 1
|
||||
</cfquery>
|
||||
|
||||
<cfoutput>
|
||||
<h4>Дополнительные соглашения (#qAdditionalAgreement.recordCount#)</h4>
|
||||
</cfoutput>
|
||||
<!--- <cfdump var=#qAdditionalAgreements#/> --->
|
||||
<!--- <layout:render_query query=#qAdditionalAgreement#/> --->
|
||||
<table class="worktable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>__index</th>
|
||||
<th>__id</th>
|
||||
<th>__name</th>
|
||||
<th>версия</th>
|
||||
<!--- <th>contract_uid</th> --->
|
||||
<th>is_actual</th>
|
||||
<th>last_aa</th>
|
||||
<th>deal_uid</th>
|
||||
<th>deal</th>
|
||||
<th>status_id</th>
|
||||
<th>status</th>
|
||||
<th>вер-ть</th>
|
||||
<th>base_by_index</th>
|
||||
<th>base_by_uid</th>
|
||||
<th>base_by_name</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<cfoutput query="qAdditionalAgreement">
|
||||
<tr>
|
||||
|
||||
<td><a href="additional_agreement.cfm?__id=#__id#&#tr.fwx#">#__index#</a></td>
|
||||
<td><a href="additional_agreement.cfm?__id=#__id#&#tr.fwx#">#__id#</a></td>
|
||||
<td>#__name#</td>
|
||||
<td class="c">#index#</td>
|
||||
<!--- <td>#contract_uid#</td> --->
|
||||
<td class="c">#is_actual#</td>
|
||||
<td class="c">#last_aa#</td>
|
||||
<td><a href="deal.cfm?__id=#deal_uid#&#tr.fwx#">#deal_uid#</a></td>
|
||||
<td>#deal#</td>
|
||||
<td class="c">#status_id#</td>
|
||||
<td>#status#</td>
|
||||
<td class="r">#probability_pc#</td>
|
||||
<td><a href="additional_agreement.cfm?__id=#base_by_uid#&#tr.fwx#">#base_by_index#</a></td>
|
||||
<td><a href="additional_agreement.cfm?__id=#base_by_uid#&#tr.fwx#">#base_by_uid#</a></td>
|
||||
<td><a href="additional_agreement.cfm?__id=#base_by_uid#&#tr.fwx#">#base_by_name#</a></td>
|
||||
|
||||
<!--- <td class="c">
|
||||
#dateFormat(dt_contract,'YYYY-MM-DD')#
|
||||
</td> --->
|
||||
</tr>
|
||||
</cfoutput>
|
||||
</table>
|
||||
</cfif>
|
||||
<br/>
|
||||
Мы не показываем тут сделки, поскольку связь со сделкой у договора не прямая и не обязательная. Сделки относятся к контрагенту, а не к договору. Сделка может быть связана с договором через дополнительное соглашение (включая нулевое соглашение, по умолчанию)
|
||||
<!--- <cfquery name="qDeal">
|
||||
select
|
||||
d.__id
|
||||
,d.__name
|
||||
,d._companies
|
||||
,d._plannedDueDate
|
||||
,d.kommentarii_k_sdelke
|
||||
,d.__status_notify
|
||||
,d.__debug
|
||||
,d.is_corrective_transaction
|
||||
,d.dt_load
|
||||
from elma.deals d limit 10
|
||||
</cfquery> --->
|
||||
|
||||
|
||||
<layout:page section="footer"/>
|
||||
@@ -30,6 +30,7 @@
|
||||
<d:field title="Дата договора">d.date_of_aggrement</d:field>
|
||||
<d:field title="Дата окончания">d.date_end_aggrement</d:field>
|
||||
<d:field title="Тип договора">d.type_of_agreement</d:field>
|
||||
<d:field title="Доп. соглашений">(select count(*) from elma.additional_agreements a where a.contract_uid=d.__id AND a."__deletedAt" IS NULL) as aa_cnt</d:field>
|
||||
</d:field_set>
|
||||
from elma.aggrements d
|
||||
left outer join elma.companies k on (d.company_uid=k.__id)
|
||||
@@ -120,6 +121,7 @@ select count(*) as cnt from elma.aggrements d where 1=1
|
||||
<c:column width="10%" field="date_of_aggrement" formatter=#function(dt){return dateformat(dt,"YYYY-MM-DD");}#/>
|
||||
<c:column width="10%" field="date_end_aggrement" formatter=#function(dt){return dateformat(dt,"YYYY-MM-DD");}#/>
|
||||
<c:column width="10%" field="type_of_agreement"><c:td class="l"/></c:column>
|
||||
<c:column width="10%" field="aa_cnt"><c:td class="c"/></c:column>
|
||||
|
||||
</c:table>
|
||||
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
<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="hideNonPositive">
|
||||
<cfargument name="a"/>
|
||||
<cfreturn (a GT 0)? a : ""/>
|
||||
</cffunction>
|
||||
|
||||
<m:prepare_ls entity="contract" accessObject="" pageInfoOut="pageInfo" trackOut="tr"/>
|
||||
|
||||
<!--- <m:filter_settings target="#pageInfo.entity#_ls">
|
||||
<m:filterparam filter=#filter# param="quickfilter" ftype="string" prefix="%" suffix="%" expression="((p.project like ?) OR (p.customer like ?) OR (p.customer_alias like ?) OR (p.contract_class_type like ?) OR (p.division like ?) OR (p.performer_short like ?))" default=""/>
|
||||
</m:filter_settings> --->
|
||||
<!--- <cfset pageInfo.settings.filter=#filter#/> --->
|
||||
|
||||
<cftry>
|
||||
<cfquery name="qRead" datasource="#request.DS#">
|
||||
select
|
||||
<d:field_set titleMapOut="titleMap" lengthOut="fieldCount">
|
||||
<d:field title="ID" cfSqlType="CF_SQL_OTHER">d.__id</d:field>
|
||||
<d:field title="Внут.номер">d.agreement_id</d:field>
|
||||
<d:field title="Договор">d.__name</d:field>
|
||||
<d:field title="company_uid">d.company_uid</d:field>
|
||||
<d:field title="Контрагент">k.__name as contragent</d:field>
|
||||
<d:field title="WZ">k.id_klienta as wz</d:field>
|
||||
<d:field title="Дата договора">d.date_of_aggrement</d:field>
|
||||
<d:field title="Дата окончания">d.date_end_aggrement</d:field>
|
||||
<d:field title="Тип договора">d.type_of_agreement</d:field>
|
||||
<d:field title="Доп. соглашений">(select count(*) from elma.additional_agreements a where a.contract_uid=d.__id AND a."_deletedAt" IS NULL) as aa_cnt</d:field>
|
||||
</d:field_set>
|
||||
from elma.aggrements d
|
||||
left outer join elma.companies k on (d.company_uid=k.__id)
|
||||
where 1=1 <m:filter_build filter=#pageInfo.settings.filter#/>
|
||||
order by <m:order_build sortArray=#pageInfo.settings.sort.sortArray# fieldCount=#fieldCount#/>
|
||||
</cfquery>
|
||||
|
||||
|
||||
<cfcatch type="database">
|
||||
<m:ls_catch catch=#cfcatch# status=#pageInfo.status#/>
|
||||
</cfcatch>
|
||||
</cftry>
|
||||
|
||||
<cfquery name="qCountTotal" datasource="#request.DS#">
|
||||
select count(*) as cnt from elma.aggrements d where 1=1
|
||||
</cfquery>
|
||||
|
||||
</m:silent><!---
|
||||
-----------------------------------------------------------------------------------------
|
||||
-----------------------------------------------------------------------------------------
|
||||
-----------------------------------------------------------------------------------------
|
||||
---><cfif isDefined("output_xls")>
|
||||
<layout:xml qRead=#qRead# titleMap=#titleMap# filename="#pageInfo.entity#.xml"/>
|
||||
<cfabort/>
|
||||
</cfif><cfif isDefined("output_json")>
|
||||
<layout:json qRead=#qRead# titleMap=#titleMap# filename="#pageInfo.entity#.json"/>
|
||||
<cfabort/>
|
||||
</cfif><!---
|
||||
---><layout:page section="header" pageInfo=#pageInfo#>
|
||||
|
||||
<layout:attribute name="title">
|
||||
<cfoutput><b>Договоры</b></cfoutput>
|
||||
</layout:attribute>
|
||||
<!--- <layout:attribute name="controls"></layout:attribute> --->
|
||||
</layout:page>
|
||||
|
||||
<cfif pageInfo.readPermitted() AND !pageInfo.status.errorState>
|
||||
|
||||
<layout:grid_summary
|
||||
recordCount=#qRead.recordCount#
|
||||
totalCount=#qCountTotal.cnt#
|
||||
footerOut="gridFooter"
|
||||
excelLink="Yes"
|
||||
jsonLink="Yes"
|
||||
/>
|
||||
|
||||
|
||||
<!--- так довольно громоздко, но можно обойтись без Dynamic Evaluation --->
|
||||
<cfset queryAddColumn(qRead,'f_link_view_edit')/>
|
||||
<cfset titleMap.f_link_view_edit={ordinal=#StructCount(titleMap)+1#}/><!--- *** Это легко забыть, потому что TitleMap никак не сцеплен с qRead. Напрашивается: упаковать их в одну обертку (но тогда обращение станет длиннее). Еще идея - назвать qRead и TitleMap так, чтобы была видна их связь. --->
|
||||
<!--- <cfdump var=#titleMap#/> --->
|
||||
|
||||
<cfset queryAddColumn(qRead,'f_contract')/>
|
||||
<cfset titleMap.f_contract=titleMap.__name/>
|
||||
|
||||
<cfset queryAddColumn(qRead,'f_contragent')/>
|
||||
<cfset titleMap.f_contragent=titleMap.contragent/>
|
||||
|
||||
<cfset queryAddColumn(qRead,'f_link_del')/>
|
||||
<cfset titleMap.f_link_del={ordinal=0}/>
|
||||
|
||||
<!--- <cfdump var=#titleMap#/> --->
|
||||
<cfoutput query=#qRead# startRow=#pageInfo.nStart# maxRows=#pageInfo.recordsPerPage#>
|
||||
<cfsavecontent variable="qRead.f_link_view_edit">
|
||||
<a href="contract.cfm?__id=#__id#&#tr.fwx#" name="#__id#" title="просмотр" class="view"></a>
|
||||
</cfsavecontent>
|
||||
|
||||
<cfsavecontent variable="qRead.f_contract">
|
||||
<a href="contract.cfm?__id=#__id#&#tr.fwx#">#__name#</a>
|
||||
</cfsavecontent>
|
||||
|
||||
<cfsavecontent variable="qRead.f_contragent">
|
||||
<a href="contragent.cfm?__id=#company_uid#&#tr.fwx#">#contragent#</a>
|
||||
</cfsavecontent>
|
||||
|
||||
</cfoutput>
|
||||
|
||||
<c:table query=#qRead# recordsPerPage=#pageInfo.recordsPerPage# nStart=#pageInfo.nStart# titleMap=#titleMap# sortArray=#pageInfo.settings.sort.sortArray# class="worktable wide">
|
||||
<c:column width="1%" sortable="false"><!---*** class="c" не пробрасывается --->
|
||||
<c:td field="f_link_view_edit" class="c"/>
|
||||
</c:column>
|
||||
<c:column width="10%" field="__id"><c:td class="l"/></c:column>
|
||||
<c:column width="10%" field="f_contract"/>
|
||||
<c:column width="10%" field="agreement_id"/>
|
||||
<c:column width="10%" field="company_uid"/>
|
||||
<c:column width="10%" field="f_contragent"/>
|
||||
<c:column width="10%" field="wz"/>
|
||||
<c:column width="10%" field="date_of_aggrement" formatter=#function(dt){return dateformat(dt,"YYYY-MM-DD");}#/>
|
||||
<c:column width="10%" field="date_end_aggrement" formatter=#function(dt){return dateformat(dt,"YYYY-MM-DD");}#/>
|
||||
<c:column width="10%" field="type_of_agreement"><c:td class="l"/></c:column>
|
||||
<c:column width="10%" field="aa_cnt"><c:td class="c"/></c:column>
|
||||
|
||||
</c:table>
|
||||
|
||||
<cfoutput>#gridFooter#</cfoutput>
|
||||
|
||||
</cfif>
|
||||
<layout:page section="footer"/>
|
||||
+22
-14
@@ -15,7 +15,7 @@
|
||||
<cfreturn htmlEditFormat(s)/>
|
||||
</cffunction>
|
||||
|
||||
<m:prepare_detail entity="contragent" accessObject="" key="contragent_id" pageInfoOut="pageInfo"/>
|
||||
<m:prepare_detail entity="contragent" accessObject="" key="__id" pageInfoOut="pageInfo"/>
|
||||
|
||||
<d:bean readonly=true table="elma.companies" datasource="#request.DS#" output="d" status="status">
|
||||
<d:param field="__id" type="uuid" key/>
|
||||
@@ -179,10 +179,12 @@
|
||||
component as (select siv.deal as deal_uids, siv.type, (siv.cnt*(100-COALESCE(siv.discount,0))/100*p.price*p.cnt*(100-COALESCE(p.discount,0))) as param_cost
|
||||
from elma.deals_services siv
|
||||
join elma.service_parametrs p on (p.__id = ANY(siv.params))
|
||||
where p."__deletedAt" IS NULL AND siv."__deletedAt" IS NULL AND siv.is_actual
|
||||
)
|
||||
select
|
||||
a.__id::text
|
||||
,a.__name as additional_agreement
|
||||
,a.__index
|
||||
,a.contract_uid::text
|
||||
,a.is_actual
|
||||
,a.last_aa
|
||||
@@ -197,16 +199,16 @@
|
||||
,s.probability_pc
|
||||
,u.__name as owner
|
||||
,(select sum(param_cost)
|
||||
from component
|
||||
where d.__id = ANY(component.deal_uids) AND component.type IN (1)
|
||||
from component p
|
||||
where d.__id = p.deal_uids[1] AND p.type IN (1)
|
||||
) as install
|
||||
,(select sum(param_cost)
|
||||
from component
|
||||
where d.__id = ANY(component.deal_uids) AND component.type IN (2)
|
||||
from component p
|
||||
where d.__id = p.deal_uids[1] AND p.type IN (2)
|
||||
) as periodical
|
||||
,(select sum(param_cost)
|
||||
from component
|
||||
where d.__id = ANY(component.deal_uids) AND component.type IN (3)
|
||||
from component p
|
||||
where d.__id = p.deal_uids[1] AND p.type IN (3)
|
||||
) as metered
|
||||
from elma.additional_agreements a
|
||||
join elma.aggrements c on (a.contract_uid=c.__id)
|
||||
@@ -215,6 +217,7 @@
|
||||
left outer join elma.comp_users_ext u on (d._owner=c.__id)
|
||||
where c.company_uid=<cfqueryparam cfsqltype="cf_sql_other" value=#d.__id# null=#!isValid("guid",d.__id)#/>
|
||||
AND s.probability_pc > 0
|
||||
order by a.__index
|
||||
</cfquery>
|
||||
|
||||
|
||||
@@ -228,6 +231,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th>__id</th>
|
||||
<th>__index</th>
|
||||
<th>Доп. соглашение</th>
|
||||
<th>Внут. н-р дог.</th>
|
||||
<th>Дата договора</th>
|
||||
@@ -243,6 +247,7 @@
|
||||
<cfoutput query="qAdditionalAgreement">
|
||||
<tr>
|
||||
<td><a href="additional_agreement.cfm?__id=#__id#&#tr.fwx#">#__id#</a></td>
|
||||
<td><a href="additional_agreement.cfm?__id=#__id#&#tr.fwx#">#__index#</a></td>
|
||||
<td>#additional_agreement#</td>
|
||||
<td><a href="contract.cfm?__id=#contract_uid#&#tr.fwx#">#agreement_id#</a></td>
|
||||
<td>#dateFormat(date_of_aggrement,"YYYY-MM-DD")#</td>
|
||||
@@ -250,9 +255,9 @@
|
||||
<td>#status#</td>
|
||||
<td>#probability_pc#</td>
|
||||
<td>#owner#</td>
|
||||
<td class="r">#nFmt(install)#</td>
|
||||
<td class="r">#nFmt(periodical)#</td>
|
||||
<td class="r">#nFmt(metered)#</td>
|
||||
<td class="r nw">#nFmt(install)#</td>
|
||||
<td class="r nw">#nFmt(periodical)#</td>
|
||||
<td class="r nw">#nFmt(metered)#</td>
|
||||
</tr>
|
||||
</cfoutput>
|
||||
</table>
|
||||
@@ -270,6 +275,7 @@
|
||||
component as (select siv.deal as deal_uids, siv.type, (siv.cnt*(100-COALESCE(siv.discount,0))/100*p.price*p.cnt*(100-COALESCE(p.discount,0))) as param_cost
|
||||
from elma.deals_services siv
|
||||
join elma.service_parametrs p on (p.__id = ANY(siv.params))
|
||||
where p."__deletedAt" IS NULL AND siv."__deletedAt" IS NULL AND siv.is_actual
|
||||
)
|
||||
select
|
||||
<d:field_set titleMapOut="titleMap" lengthOut="fieldCount">
|
||||
@@ -353,9 +359,9 @@
|
||||
<td>#contract#</td>
|
||||
<td><a href="contract.cfm?__id=#contract_uid#&#tr.fwx#">#agreement_id#</a></td>
|
||||
<td>#dateFormat(date_of_aggrement,"YYYY-MM-DD")#</td>
|
||||
<td class="r">#nFmt(install)#</td>
|
||||
<td class="r">#nFmt(periodical)#</td>
|
||||
<td class="r">#nFmt(metered)#</td>
|
||||
<td class="r nw">#nFmt(install)#</td>
|
||||
<td class="r nw">#nFmt(periodical)#</td>
|
||||
<td class="r nw">#nFmt(metered)#</td>
|
||||
</tr>
|
||||
</cfoutput>
|
||||
</table>
|
||||
@@ -396,10 +402,12 @@
|
||||
sum(siv.cnt*(100-COALESCE(siv.discount,0))/100*p.price*p.cnt*(100-COALESCE(p.discount,0))/100)
|
||||
from elma.service_parametrs p
|
||||
where p.__id = ANY (siv.params)
|
||||
AND p."__deletedAt" IS NULL
|
||||
) as line_cost
|
||||
,(select count(*)
|
||||
from elma.service_parametrs p
|
||||
where p.__id = ANY (siv.params)
|
||||
AND p."__deletedAt" IS NULL
|
||||
) as param_cnt
|
||||
,s.probability_pc
|
||||
,d.__index
|
||||
@@ -414,7 +422,7 @@
|
||||
</cfquery>
|
||||
|
||||
<cfoutput>
|
||||
<h4>Услуги (версии строк спецификации, только актуальные) (#qService.recordCount#)</h4>
|
||||
<h4>Услуги (версии строк спецификации, только актуальные) (#qService.recordCount#) *** здесь не учтено дублирование строк в новых версиях</h4>
|
||||
</cfoutput>
|
||||
|
||||
<!--- <layout:render_query query=#qService#/> --->
|
||||
|
||||
@@ -0,0 +1,488 @@
|
||||
<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="contragent" accessObject="" key="__id" pageInfoOut="pageInfo"/>
|
||||
|
||||
<d:bean readonly=true table="elma.companies" datasource="#request.DS#" output="d" status="status">
|
||||
<d:param field="__id" type="uuid" key/>
|
||||
<d:param field="__name" type="varchar" size="255" preprocessor=#cleanInput# forNull=""/>
|
||||
<d:param field="_inn" type="varchar" size="255" preprocessor=#cleanInput# forNull=""/>
|
||||
<d:param field="_kpp" type="varchar" size="255" preprocessor=#cleanInput# forNull=""/>
|
||||
<d:param field="id_klienta" type="varchar" size="255" preprocessor=#cleanInput# forNull=""/>
|
||||
<!--- *** билдер показывает... <d:param field="wz_id" type="varchar" size="255" preprocessor=#cleanInput# forNull=""/> --->
|
||||
<!--- <d:param field="code_inn" type="varchar" size="255" preprocessor=#cleanInput# forNull=""/>
|
||||
<d:param field="code_kpp" type="varchar" size="255" preprocessor=#cleanInput# forNull=""/> --->
|
||||
</d:bean>
|
||||
|
||||
|
||||
<m:dispatch_detail
|
||||
usePRG="No"<!---*** --->
|
||||
pageInfo=#pageInfo#
|
||||
id="#d.__id#"
|
||||
status=#pageInfo.status#
|
||||
trackOut="tr"
|
||||
idAttributesOut="id"
|
||||
/>
|
||||
|
||||
<!--- 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 contragent g
|
||||
left outer join usr a on (g.creator_id=a.usr_id)
|
||||
left outer join usr m on (g.updater_id=m.usr_id)
|
||||
where g.contragent_id=<cfqueryparam attributeCollection=#id#/>
|
||||
</cfquery> --->
|
||||
|
||||
|
||||
</m:silent><!---
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
---><layout:page section="header" pageInfo=#pageInfo#>
|
||||
<layout:attribute name="title">
|
||||
<cfoutput>
|
||||
Контрагент
|
||||
<cfif len(d.__id)>
|
||||
<b>#d.__name#</b>
|
||||
[#d.__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="__id" value="#d.__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">__id</div>
|
||||
<div class="td">#d.__id#</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">__name</div>
|
||||
<div class="td">#d.__name#</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">_inn</div>
|
||||
<div class="td">#d._inn#</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">_kpp</div>
|
||||
<div class="td">#d._kpp#</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">id_klienta</div>
|
||||
<div class="td">#d.id_klienta#</div>
|
||||
</div>
|
||||
|
||||
<!--- <div class="tr">
|
||||
<div class="th">wz_id</div>
|
||||
<div class="td">#d.wz_id#"/></div>
|
||||
</div> --->
|
||||
|
||||
<!--- <div class="tr">
|
||||
<div class="th">code_inn</div>
|
||||
<div class="td">#d.code_inn#"/></div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">code_kpp</div>
|
||||
<div class="td">#d.code_kpp#"/></div>
|
||||
</div> --->
|
||||
|
||||
</div>
|
||||
|
||||
</cfoutput>
|
||||
сюда добавить сделок, договоров и т.д.
|
||||
|
||||
<layout:page section="extension" closeForm="Yes"/>
|
||||
|
||||
<cfif len(d.__id)>
|
||||
|
||||
<cfquery name="qContract">
|
||||
select
|
||||
<d:field_set titleMapOut="titleMap" lengthOut="fieldCount">
|
||||
<d:field title="ID" cfSqlType="CF_SQL_OTHER">d.__id</d:field>
|
||||
<d:field title="Внут.номер">d.agreement_id</d:field>
|
||||
<d:field title="Договор">d.__name</d:field>
|
||||
<d:field title="company_uid">d.company_uid</d:field>
|
||||
<d:field title="Дата договора">d.date_of_aggrement</d:field>
|
||||
<d:field title="Дата окончания">d.date_end_aggrement</d:field>
|
||||
<d:field title="Тип договора">d.type_of_agreement</d:field>
|
||||
<d:field title="__index">d.__index</d:field>
|
||||
</d:field_set>
|
||||
from elma.aggrements d
|
||||
where d.company_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#d.__id#" null=#!isValid('guid',d.__id)#/>
|
||||
</cfquery>
|
||||
|
||||
<cfoutput>
|
||||
<h4>Договоры (#qContract.recordCount#)</h4>
|
||||
</cfoutput>
|
||||
<table class="worktable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>__id</th>
|
||||
<th>Номер</th>
|
||||
<th>Внут. номер</th>
|
||||
<th>Дата</th>
|
||||
<th>Дата оконч.</th>
|
||||
<th>Тип договора</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<cfoutput query="qContract">
|
||||
<tr>
|
||||
<td><a href="contract.cfm?__id=#__id#&#tr.fwx#">#__id#</a></td>
|
||||
<td>#__name#</td>
|
||||
<td>#agreement_id#</td>
|
||||
<td>#dateFormat(date_of_aggrement,"YYYY-MM-DD")#</td>
|
||||
<td>#dateFormat(date_end_aggrement,"YYYY-MM-DD")#</td>
|
||||
<td class="c">#type_of_agreement#</td>
|
||||
</tr>
|
||||
</cfoutput>
|
||||
</table>
|
||||
|
||||
|
||||
<cfquery name="qAdditionalAgreement">
|
||||
with
|
||||
s(status, status_id, probability_pc) as (VALUES
|
||||
('Закрыта неуспешно',7,0),('Закрыта успешно',6,100),('Договор подписан',5,100),('Договор на подписании',15,90),('Договор на согласовании',12,70),
|
||||
('Тестирование',8,50),('Отправлено ТКП',10,20),('Внутреннее согласование',37,10),('Проработка решения',4,10),('Сбор потребностей',1,0)
|
||||
),
|
||||
component as (select siv.deal as deal_uids, siv.type, (siv.cnt*(100-COALESCE(siv.discount,0))/100*p.price*p.cnt*(100-COALESCE(p.discount,0))) as param_cost
|
||||
from elma.deals_services siv
|
||||
join elma.service_parametrs p on (p.__id = ANY(siv.params))
|
||||
where p."__deletedAt" IS NULL AND siv."__deletedAt" IS NULL AND siv.is_actual
|
||||
)
|
||||
select
|
||||
a.__id::text
|
||||
,a.__name as additional_agreement
|
||||
,a.__index
|
||||
,a.contract_uid::text
|
||||
,a.is_actual
|
||||
,a.last_aa
|
||||
,a.deal_uid::text
|
||||
,c.__name as contract
|
||||
,c.agreement_id
|
||||
,c.date_of_aggrement
|
||||
,d.__id as deal_uid
|
||||
,d.__name as deal
|
||||
,d.__status_status
|
||||
,s.status
|
||||
,s.probability_pc
|
||||
,u.__name as owner
|
||||
,(select sum(param_cost)
|
||||
from component p
|
||||
where d.__id = p.deal_uids[1] AND p.type IN (1)
|
||||
) as install
|
||||
,(select sum(param_cost)
|
||||
from component p
|
||||
where d.__id = p.deal_uids[1] AND p.type IN (2)
|
||||
) as periodical
|
||||
,(select sum(param_cost)
|
||||
from component p
|
||||
where d.__id = p.deal_uids[1] AND p.type IN (3)
|
||||
) as metered
|
||||
from elma.additional_agreements a
|
||||
join elma.aggrements c on (a.contract_uid=c.__id)
|
||||
join elma.deals d on (a.deal_uid=d.__id)
|
||||
left outer join s on (d.__status_status=s.status_id)
|
||||
left outer join elma.comp_users_ext u on (d._owner=c.__id)
|
||||
where c.company_uid=<cfqueryparam cfsqltype="cf_sql_other" value=#d.__id# null=#!isValid("guid",d.__id)#/>
|
||||
AND s.probability_pc > 0
|
||||
order by a.__index
|
||||
</cfquery>
|
||||
|
||||
|
||||
<cfoutput>
|
||||
<h4>Доп. соглашения (#qAdditionalAgreement.recordCount#)
|
||||
- исключены соглашения, сделки которых имеют нулевую вероятность
|
||||
</h4>
|
||||
</cfoutput>
|
||||
|
||||
<table class="worktable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>__id</th>
|
||||
<th>__index</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="qAdditionalAgreement">
|
||||
<tr>
|
||||
<td><a href="additional_agreement.cfm?__id=#__id#&#tr.fwx#">#__id#</a></td>
|
||||
<td><a href="additional_agreement.cfm?__id=#__id#&#tr.fwx#">#__index#</a></td>
|
||||
<td>#additional_agreement#</td>
|
||||
<td><a href="contract.cfm?__id=#contract_uid#&#tr.fwx#">#agreement_id#</a></td>
|
||||
<td>#dateFormat(date_of_aggrement,"YYYY-MM-DD")#</td>
|
||||
<td><a href="deal.cfm?__id=#deal_uid#&#tr.fwx#">#deal#</a></td>
|
||||
<td>#status#</td>
|
||||
<td>#probability_pc#</td>
|
||||
<td>#owner#</td>
|
||||
<td class="r nw">#nFmt(install)#</td>
|
||||
<td class="r nw">#nFmt(periodical)#</td>
|
||||
<td class="r nw">#nFmt(metered)#</td>
|
||||
</tr>
|
||||
</cfoutput>
|
||||
</table>
|
||||
|
||||
<!--- ----------------------------------------------------------------- --->
|
||||
<!--- ----------------------------------------------------------------- --->
|
||||
<!--- ----------------------------------------------------------------- --->
|
||||
|
||||
<cfquery name="qDeal">
|
||||
with
|
||||
status(status, status_id, probability_pc) as (VALUES
|
||||
('Закрыта неуспешно',7,0),('Закрыта успешно',6,100),('Договор подписан',5,100),('Договор на подписании',15,90),('Договор на согласовании',12,70),
|
||||
('Тестирование',8,50),('Отправлено ТКП',10,20),('Внутреннее согласование',37,10),('Проработка решения',4,10),('Сбор потребностей',1,0)
|
||||
),
|
||||
component as (select siv.deal as deal_uids, siv.type, (siv.cnt*(100-COALESCE(siv.discount,0))/100*p.price*p.cnt*(100-COALESCE(p.discount,0))) as param_cost
|
||||
from elma.deals_services siv
|
||||
join elma.service_parametrs p on (p.__id = ANY(siv.params))
|
||||
where p."__deletedAt" IS NULL AND siv."__deletedAt" IS NULL AND siv.is_actual
|
||||
)
|
||||
select
|
||||
<d:field_set titleMapOut="titleMap" lengthOut="fieldCount">
|
||||
<d:field title="ID" cfSqlType="CF_SQL_OTHER">d.__id</d:field>
|
||||
<d:field title="index" cfSqlType="CF_SQL_INTEGER">d.__index</d:field>
|
||||
<d:field title="Название">d.__name</d:field>
|
||||
<d:field title="company_uid">d._companies</d:field>
|
||||
<d:field title="Создана">d."__createdAt" as __createdAt</d:field><!--- *** косяк d:field, если взять в кавычки имя поля, оно не попадает в массив полей --->
|
||||
<d:field title="Контрагент">k.__name as contragent</d:field>
|
||||
<d:field title="Контрагент">k.__id as contragent_uid</d:field>
|
||||
<d:field title="WZ">k.id_klienta as wz</d:field>
|
||||
<d:field title="status_id">d.__status_status</d:field>
|
||||
<d:field title="Статус">s.status</d:field>
|
||||
<d:field title="Вероятность%">s.probability_pc</d:field>
|
||||
<d:field title="Ответственный">c.__name as owner</d:field>
|
||||
<d:field title="Допник">a.__name as additional_agreement</d:field>
|
||||
<d:field title="Допник">a.__id as additional_agreement_uid</d:field>
|
||||
<d:field title="Договор">g.__name as contract</d:field>
|
||||
<d:field title="Договор">g.__id as contract_uid</d:field>
|
||||
<d:field title="Договор">g.date_of_aggrement</d:field>
|
||||
<d:field title="Договор">g.agreement_id</d:field>
|
||||
<d:field title="Дата дог.">g.date_of_aggrement as dt_contract</d:field>
|
||||
<d:field>(select sum(param_cost)
|
||||
from component
|
||||
where d.__id = ANY(component.deal_uids) AND component.type IN (1)
|
||||
) as install
|
||||
</d:field>
|
||||
<d:field>(select sum(param_cost)
|
||||
from component
|
||||
where d.__id = ANY(component.deal_uids) AND component.type IN (2)
|
||||
) as periodical
|
||||
</d:field>
|
||||
<d:field>(select sum(param_cost)
|
||||
from component
|
||||
where d.__id = ANY(component.deal_uids) AND component.type IN (3)
|
||||
) as metered
|
||||
</d:field>
|
||||
</d:field_set>
|
||||
from elma.deals d
|
||||
left outer join elma.companies k on (d._companies=k.__id)
|
||||
left outer join status s on (d.__status_status=s.status_id)
|
||||
left outer join elma.comp_users_ext c on (d._owner=c.__id)
|
||||
left outer join elma.additional_agreements a on (d.__id=a.deal_uid)
|
||||
left outer join elma.aggrements g on (a.contract_uid = g.__id)
|
||||
where d._companies=<cfqueryparam cfsqltype="cf_sql_other" value="#d.__id#" null=#!isValid('guid',d.__id)#/>
|
||||
AND s.probability_pc > 0
|
||||
order by d.__index
|
||||
</cfquery>
|
||||
|
||||
<cfoutput>
|
||||
<h4>Сделки (#qDeal.recordCount#) - исключены сделки с нулевой вероятностью</h4>
|
||||
</cfoutput>
|
||||
|
||||
<table class="worktable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>__id</th>
|
||||
<th>__index</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="qDeal">
|
||||
<tr>
|
||||
<td><a href="deal.cfm?__id=#__id#&#tr.fwx#">#__id#</a></td>
|
||||
<td>#__index#</td>
|
||||
<td><a href="deal.cfm?__id=#__id#&#tr.fwx#">#__name#</a></td>
|
||||
<td>#status#</td>
|
||||
<td>#probability_pc#</td>
|
||||
<td>#owner#</td>
|
||||
<td>#additional_agreement#</td>
|
||||
<td>#contract#</td>
|
||||
<td><a href="contract.cfm?__id=#contract_uid#&#tr.fwx#">#agreement_id#</a></td>
|
||||
<td>#dateFormat(date_of_aggrement,"YYYY-MM-DD")#</td>
|
||||
<td class="r nw">#nFmt(install)#</td>
|
||||
<td class="r nw">#nFmt(periodical)#</td>
|
||||
<td class="r nw">#nFmt(metered)#</td>
|
||||
</tr>
|
||||
</cfoutput>
|
||||
</table>
|
||||
|
||||
|
||||
<!--- ----------------------------------------------------- --->
|
||||
<!--- ----------------------------------------------------- --->
|
||||
<!--- ----------------------------------------------------- --->
|
||||
|
||||
<cfquery name="qService">
|
||||
with
|
||||
status(status, status_id, probability_pc) as (VALUES
|
||||
('Закрыта неуспешно',7,0),('Закрыта успешно',6,100),('Договор подписан',5,100),('Договор на подписании',15,90),('Договор на согласовании',12,70),
|
||||
('Тестирование',8,50),('Отправлено ТКП',10,20),('Внутреннее согласование',37,10),('Проработка решения',4,10),('Сбор потребностей',1,0)
|
||||
)
|
||||
select
|
||||
siv.__id
|
||||
,siv.__name
|
||||
,siv.user_description
|
||||
,siv.discount
|
||||
,siv.cnt
|
||||
,siv.modifier_code
|
||||
,siv.abstractive_service_code
|
||||
,siv.is_actual
|
||||
,siv.type
|
||||
,siv.hash
|
||||
,siv.version
|
||||
,siv.name_version
|
||||
,siv.date_accept
|
||||
,siv.__index
|
||||
,siv.date_nop
|
||||
,siv.date_end
|
||||
,siv.is_easy
|
||||
,siv.params::text
|
||||
,a.__id::text as additional_agreement_uid
|
||||
,a.__name as additional_agreement
|
||||
,(select
|
||||
sum(siv.cnt*(100-COALESCE(siv.discount,0))/100*p.price*p.cnt*(100-COALESCE(p.discount,0))/100)
|
||||
from elma.service_parametrs p
|
||||
where p.__id = ANY (siv.params)
|
||||
AND p."__deletedAt" IS NULL
|
||||
) as line_cost
|
||||
,(select count(*)
|
||||
from elma.service_parametrs p
|
||||
where p.__id = ANY (siv.params)
|
||||
AND p."__deletedAt" IS NULL
|
||||
) as param_cnt
|
||||
,s.probability_pc
|
||||
,d.__index
|
||||
,d.__id as deal_uid
|
||||
from elma.deals_services siv
|
||||
join elma.deals d on d.__id=ANY(siv.deal)
|
||||
join status s on (d.__status_status=s.status_id)
|
||||
left outer join elma.additional_agreements a on (a.__id=ANY(siv.additional_agreement))
|
||||
where d._companies=<cfqueryparam cfsqltype="cf_sql_other" value="#d.__id#" null=#!isValid("guid",d.__id)#/>
|
||||
and siv.is_actual
|
||||
order by version::int
|
||||
</cfquery>
|
||||
|
||||
<cfoutput>
|
||||
<h4>Услуги (версии строк спецификации, только актуальные) (#qService.recordCount#) *** здесь не учтено дублирование строк в новых версиях</h4>
|
||||
</cfoutput>
|
||||
|
||||
<!--- <layout:render_query query=#qService#/> --->
|
||||
<table class="worktable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>__index</th>
|
||||
<!--- <th>__name</th> --->
|
||||
<th width="12%">user_description</th>
|
||||
<th>Кол-во</th>
|
||||
<th>Скидка%</th>
|
||||
<th width="5%">Сумма</th>
|
||||
<th>Код</th>
|
||||
<th>type</th>
|
||||
<th>is_actual</th>
|
||||
<th>hash</th>
|
||||
<th>version</th>
|
||||
<th>name_version</th>
|
||||
<th>date_accept</th>
|
||||
<th>__index</th>
|
||||
<th width="5%">date_nop</th>
|
||||
<th width="5%">date_end</th>
|
||||
<th>is_easy</th>
|
||||
<th>Компонентов</th>
|
||||
<th width="12%">additional_agreement</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<cfoutput query="qService">
|
||||
<tr>
|
||||
<td class="c"><a href="deal_service.cfm?__id=#__id#&#tr.fwx#" title="__id">#__index#</a></td>
|
||||
<!--- <td class="c">#__name#</td> --->
|
||||
<td class="l">#user_description#</td>
|
||||
<td class="c">#cnt#</td>
|
||||
<td class="c">#discount#</td>
|
||||
<td class="r">#nFmt(line_cost)#</td>
|
||||
<td class="l">
|
||||
#abstractive_service_code#.#modifier_code#<!--- <cfswitch expression=#type#>
|
||||
<cfcase value=1>-i</cfcase>
|
||||
<cfcase value=2>-f</cfcase>
|
||||
<cfcase value=3>-m</cfcase>
|
||||
</cfswitch> --->
|
||||
</td>
|
||||
<td class="c">#type#</td>
|
||||
<td class="c">#is_actual#</td>
|
||||
<td class="c">#hash#</td>
|
||||
<td class="c">#version#</td>
|
||||
<td class="c">#name_version#</td>
|
||||
<td class="c">#date_accept#</td>
|
||||
<td class="c">#__index#</td>
|
||||
<td class="c">#dateFormat(date_nop,'YYYY-MM-DD')#</td>
|
||||
<td class="c">#dateFormat(date_end,'YYYY-MM-DD')#</td>
|
||||
<td class="c">#is_easy#</td>
|
||||
<td class="c">#param_cnt#</td>
|
||||
|
||||
<!--- <td class="c">#additional_agreement_uid#</td> --->
|
||||
<td class="c"><a href="additional_agreement.cfm?__id=#additional_agreement_uid#&#tr.fwx#">#additional_agreement#</a></td>
|
||||
</tr>
|
||||
</cfoutput>
|
||||
</table>
|
||||
|
||||
</cfif>
|
||||
<layout:page section="footer"/>
|
||||
@@ -257,18 +257,17 @@
|
||||
<tr>
|
||||
<th>__index</th>
|
||||
<!--- <th>__name</th> --->
|
||||
<th width="12%">user_description</th>
|
||||
<th>Код</th><th>type</th><th width="12%">user_description</th>
|
||||
<th>Кол-во</th>
|
||||
<th>Скидка%</th>
|
||||
<th width="5%">Сумма</th>
|
||||
<th>Код</th>
|
||||
<th>type</th>
|
||||
|
||||
|
||||
<th>is_actual</th>
|
||||
<th>hash</th>
|
||||
<th>version</th>
|
||||
<th>name_version</th>
|
||||
<th>date_accept</th>
|
||||
<th>__index</th>
|
||||
<th width="5%">date_nop</th>
|
||||
<th width="5%">date_end</th>
|
||||
<th>is_easy</th>
|
||||
@@ -281,10 +280,6 @@
|
||||
<tr>
|
||||
<td class="c"><a href="deal_service.cfm?__id=#__id#&#tr.fwx#" title="__id">#__index#</a></td>
|
||||
<!--- <td class="c">#__name#</td> --->
|
||||
<td class="l">#user_description#</td>
|
||||
<td class="c">#cnt#</td>
|
||||
<td class="c">#discount#</td>
|
||||
<td class="r">#nFmt(line_cost)#</td>
|
||||
<td class="l">
|
||||
#abstractive_service_code#.#modifier_code#<!--- <cfswitch expression=#type#>
|
||||
<cfcase value=1>-i</cfcase>
|
||||
@@ -292,13 +287,22 @@
|
||||
<cfcase value=3>-m</cfcase>
|
||||
</cfswitch> --->
|
||||
</td>
|
||||
<td class="c">#type#</td>
|
||||
<td class="c">#type# (<cfswitch expression=#type#>
|
||||
<cfcase value=1>i</cfcase>
|
||||
<cfcase value=2>f</cfcase>
|
||||
<cfcase value=3>m</cfcase>
|
||||
</cfswitch>)</td>
|
||||
<td class="l">#user_description#</td>
|
||||
<td class="c">#cnt#</td>
|
||||
<td class="c">#discount#</td>
|
||||
<td class="r">#nFmt(line_cost)#</td>
|
||||
|
||||
|
||||
<td class="c">#is_actual#</td>
|
||||
<td class="c">#hash#</td>
|
||||
<td class="c">#version#</td>
|
||||
<td class="c">#name_version#</td>
|
||||
<td class="c">#date_accept#</td>
|
||||
<td class="c">#__index#</td>
|
||||
<td class="c">#dateFormat(date_nop,'YYYY-MM-DD')#</td>
|
||||
<td class="c">#dateFormat(date_end,'YYYY-MM-DD')#</td>
|
||||
<td class="c"><cfif is_easy GT 0>Простая<cfelseif is_easy EQ 0>Композитная<cfelse>is_easy=#is_easy#</cfif></td>
|
||||
|
||||
+317
@@ -0,0 +1,317 @@
|
||||
<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="deal" accessObject="" key="__id" pageInfoOut="pageInfo"/>
|
||||
|
||||
<d:bean readonly=true table="elma.deals" datasource="#request.DS#" output="d" status="status">
|
||||
<d:param field="__id" type="uuid" key/>
|
||||
<d:param field="__name" type="varchar" size="255" preprocessor=#cleanInput# forNull=""/>
|
||||
<d:param field="_companies" type="uuid" forNull=""/>
|
||||
<!--- <d:param field="_plannedDueDate" type="timestamp" forNull=""/> ---><!--- *** не используем, потому что имя в смешанном регистре --->
|
||||
<d:param field="__index" type="integer" forNull="" default="0" init="0"/>
|
||||
<d:param field="__status_status" type="integer" forNull="" default="0" init="0"/>
|
||||
<d:param field="is_corrective_transaction" type="bit" forNull=""/>
|
||||
<d:param field="dt_load" type="timestamp"/>
|
||||
</d:bean>
|
||||
|
||||
|
||||
<m:dispatch_detail
|
||||
usePRG="No"<!---*** --->
|
||||
pageInfo=#pageInfo#
|
||||
id="#d.__id#"
|
||||
status=#pageInfo.status#
|
||||
trackOut="tr"
|
||||
idAttributesOut="id"
|
||||
/>
|
||||
|
||||
<!--- decoration --->
|
||||
<cfquery name="qDecoration" datasource="#request.DS#">
|
||||
with
|
||||
s(status, status_id, probability_pc) as (VALUES
|
||||
('Закрыта неуспешно',7,0),('Закрыта успешно',6,100),('Договор подписан',5,100),('Договор на подписании',15,90),('Договор на согласовании',12,70),
|
||||
('Тестирование',8,50),('Отправлено ТКП',10,20),('Внутреннее согласование',37,10),('Проработка решения',4,10),('Сбор потребностей',1,0)
|
||||
),
|
||||
component as (select siv.deal as deal_uids, siv.type, (siv.cnt*(100-COALESCE(siv.discount,0))/100*p.price*p.cnt*(100-COALESCE(p.discount,0))) as param_cost
|
||||
from elma.deals_services siv
|
||||
join elma.service_parametrs p on (p.__id = ANY(siv.params))
|
||||
)
|
||||
|
||||
select
|
||||
k.__name as contragent
|
||||
,k.id_klienta as wz
|
||||
,k.__index as contragent_index
|
||||
,d."_plannedDueDate" as _plannedDueDate
|
||||
,d."__createdAt"
|
||||
,d."__index" as deal_index
|
||||
,s.status
|
||||
,s.probability_pc
|
||||
,c.__name as owner
|
||||
,(select sum(param_cost)
|
||||
from component
|
||||
where d.__id = ANY(component.deal_uids) AND component.type IN (1)
|
||||
) as install
|
||||
,(select sum(param_cost)
|
||||
from component
|
||||
where d.__id = ANY(component.deal_uids) AND component.type IN (2)
|
||||
) as periodical
|
||||
,(select sum(param_cost)
|
||||
from component
|
||||
where d.__id = ANY(component.deal_uids) AND component.type IN (3)
|
||||
) as metered
|
||||
from elma.deals d
|
||||
left outer join elma.companies k on (d._companies=k.__id)
|
||||
left outer join elma.comp_users_ext c on (d._owner=c.__id)
|
||||
left outer join s on (d.__status_status=s.status_id)
|
||||
where d.__id=<cfqueryparam cfsqltype="cf_sql_other" value=#d.__id# null=#!isValid("guid",d.__id)#/>
|
||||
</cfquery>
|
||||
|
||||
|
||||
</m:silent><!---
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
---><layout:page section="header" pageInfo=#pageInfo#>
|
||||
<layout:attribute name="title">
|
||||
<cfoutput>
|
||||
Сделка
|
||||
<cfif len(d.__id)>
|
||||
<b>#d.__name#</b>
|
||||
[#d.__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="__id" value="#d.__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">__id</div>
|
||||
<div class="td">
|
||||
#d.__id#
|
||||
index:#qDecoration.deal_index#
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Название</div>
|
||||
<div class="td">#d.__name#</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Контрагент</div>
|
||||
<div class="td"><!--- <a href="contract.cfm?__id=#d.contract_uid#&#tr.fwx#"><b>#qDecoration.contract#</b> #dateFormat(qDecoration.date_of_aggrement,'DD.MM.YYYY')#
|
||||
[#d.contract_uid#]</a> --->
|
||||
<a href="contragent.cfm?__id=#d._companies#&#tr.fwx#"> #qDecoration.contragent# #qDecoration.wz#
|
||||
index:#qDecoration.contragent_index#</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">_plannedDueDate</div>
|
||||
<div class="td">#dateFormat(qDecoration._plannedDueDate,'YYYY-MM-DD')#
|
||||
Паразитное поле, не использовать в расчетах
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Статус</div>
|
||||
<div class="td">
|
||||
#d.__status_status#: #qDecoration.status# (#qDecoration.probability_pc#%)
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Доп.соглашение</div>
|
||||
<div class="td">
|
||||
<cfquery name="qAgreement">
|
||||
select
|
||||
a.__id
|
||||
,a.__name
|
||||
,g.__id as contract_uid
|
||||
,g.__name as contract
|
||||
,g.date_of_aggrement
|
||||
from elma.additional_agreements a
|
||||
join elma.aggrements g on (a.contract_uid=g.__id)
|
||||
where a.deal_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#d.__id#" null=#!isValid("guid",d.__id)#/>
|
||||
</cfquery>
|
||||
<cfloop query=#qAgreement#>
|
||||
<a href="additional_agreement.cfm?__id=#__id#&#tr.fwx#" title="доп.соглашение">#__name#</a>
|
||||
<a href="contract.cfm?__id=#contract_uid#&#tr.fwx#" title="договор">#contract# #dateFmt(date_of_aggrement)#</a>
|
||||
</cfloop>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">is_corrective_transaction</div>
|
||||
<div class="td">#d.is_corrective_transaction#</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">dt_load</div>
|
||||
<div class="td">#dateTimeFormat(d.dt_load,"yyyy-MM-dd HH:nn:ss.SSSZ")#</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">__createdAt</div>
|
||||
<div class="td">#dateFormat(qDecoration.__createdAt,"YYYY-MM-DD")#</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Ответственный</div>
|
||||
<div class="td">#qDecoration.owner#</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Инсталл</div>
|
||||
<div class="td">#numFmt(qDecoration.install,2)#</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Ежемес</div>
|
||||
<div class="td">#numFmt(qDecoration.periodical,2)#</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Тарифицируемые</div>
|
||||
<div class="td">#numFmt(qDecoration.metered,2)#</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</cfoutput>
|
||||
|
||||
<layout:page section="extension" closeForm="Yes"/>
|
||||
|
||||
<cfif len(d.__id)>
|
||||
<cfquery name="qService">
|
||||
select
|
||||
siv.__id
|
||||
,siv.__name
|
||||
,siv.user_description
|
||||
,siv.discount
|
||||
,siv.cnt
|
||||
,siv.modifier_code
|
||||
,siv.abstractive_service_code
|
||||
,siv.is_actual
|
||||
,siv.type
|
||||
,siv.hash
|
||||
,siv.version
|
||||
,siv.name_version
|
||||
,siv.date_accept
|
||||
,siv.__index
|
||||
,siv.date_nop
|
||||
,siv.date_end
|
||||
,siv.is_easy
|
||||
,siv.params::text
|
||||
,a.__id::text as additional_agreement_uid
|
||||
,a.__name as additional_agreement
|
||||
,(select
|
||||
sum(siv.cnt*(100-COALESCE(siv.discount,0))/100*p.price*p.cnt*(100-COALESCE(p.discount,0))/100)
|
||||
from elma.service_parametrs p
|
||||
where p.__id = ANY (siv.params)
|
||||
) as line_cost
|
||||
,(select count(*)
|
||||
from elma.service_parametrs p
|
||||
where p.__id = ANY (siv.params)
|
||||
) as param_cnt
|
||||
from elma.deals_services siv
|
||||
left outer join elma.additional_agreements a on (a.__id=ANY(siv.additional_agreement))
|
||||
where <cfqueryparam cfsqltype="cf_sql_other" value="#d.__id#" null=#!isValid("guid",d.__id)#/>=ANY(siv.deal)
|
||||
and siv.is_actual
|
||||
order by version::int
|
||||
</cfquery>
|
||||
|
||||
<cfoutput>
|
||||
<h4>Услуги (версии строк спецификации, только актуальные) (#qService.recordCount#)</h4>
|
||||
</cfoutput>
|
||||
|
||||
<!--- <layout:render_query query=#qService#/> --->
|
||||
<table class="worktable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>__index</th>
|
||||
<!--- <th>__name</th> --->
|
||||
<th width="12%">user_description</th>
|
||||
<th>Кол-во</th>
|
||||
<th>Скидка%</th>
|
||||
<th width="5%">Сумма</th>
|
||||
<th>Код</th>
|
||||
<th>type</th>
|
||||
<th>is_actual</th>
|
||||
<th>hash</th>
|
||||
<th>version</th>
|
||||
<th>name_version</th>
|
||||
<th>date_accept</th>
|
||||
<th width="5%">date_nop</th>
|
||||
<th width="5%">date_end</th>
|
||||
<th>is_easy</th>
|
||||
<th>Компонентов</th>
|
||||
<th width="12%">additional_agreement</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<cfoutput query="qService">
|
||||
<tr>
|
||||
<td class="c"><a href="deal_service.cfm?__id=#__id#&#tr.fwx#" title="__id">#__index#</a></td>
|
||||
<!--- <td class="c">#__name#</td> --->
|
||||
<td class="l">#user_description#</td>
|
||||
<td class="c">#cnt#</td>
|
||||
<td class="c">#discount#</td>
|
||||
<td class="r">#nFmt(line_cost)#</td>
|
||||
<td class="l">
|
||||
#abstractive_service_code#.#modifier_code#<!--- <cfswitch expression=#type#>
|
||||
<cfcase value=1>-i</cfcase>
|
||||
<cfcase value=2>-f</cfcase>
|
||||
<cfcase value=3>-m</cfcase>
|
||||
</cfswitch> --->
|
||||
</td>
|
||||
<td class="c">#type# (<cfswitch expression=#type#>
|
||||
<cfcase value=1>i</cfcase>
|
||||
<cfcase value=2>f</cfcase>
|
||||
<cfcase value=3>m</cfcase>
|
||||
</cfswitch>)</td>
|
||||
<td class="c">#is_actual#</td>
|
||||
<td class="c">#hash#</td>
|
||||
<td class="c">#version#</td>
|
||||
<td class="c">#name_version#</td>
|
||||
<td class="c">#date_accept#</td>
|
||||
<td class="c">#dateFormat(date_nop,'YYYY-MM-DD')#</td>
|
||||
<td class="c">#dateFormat(date_end,'YYYY-MM-DD')#</td>
|
||||
<td class="c"><cfif is_easy GT 0>Простая<cfelseif is_easy EQ 0>Композитная<cfelse>is_easy=#is_easy#</cfif></td>
|
||||
<td class="c">#param_cnt#</td>
|
||||
|
||||
<!--- <td class="c">#additional_agreement_uid#</td> --->
|
||||
<td class="c"><a href="additional_agreement.cfm?__id=#additional_agreement_uid#&#tr.fwx#">#additional_agreement#</a></td>
|
||||
</tr>
|
||||
</cfoutput>
|
||||
</table>
|
||||
</cfif>
|
||||
|
||||
|
||||
<layout:page section="footer"/>
|
||||
@@ -13,6 +13,7 @@
|
||||
<m:filterparam filter=#filter# param="contragent_id" ftype="guid" compare="EQ" field="k.__id" default=""/>
|
||||
<m:filterparam filter=#filter# param="wz" ftype="string" compare="LIKE%" field="k.id_klienta" default=""/>
|
||||
<m:filterparam filter=#filter# param="status_id" ftype="numeric" compare="EQ" field="d.__status_status" default=""/>
|
||||
<m:filterparam filter=#filter# param="__index" ftype="numeric" compare="EQ" field="d.__index" default=""/>
|
||||
</m:filter_settings>
|
||||
|
||||
<cfif isDefined("resetAndClose") or isDefined("saveAndClose")>
|
||||
@@ -46,6 +47,14 @@ $(document).ready(function() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Номер сделки</div>
|
||||
<div class="td">
|
||||
<input type="text" name="__index" value="#__index#" size="5"/>
|
||||
<i></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Название сделки</div>
|
||||
<div class="td">
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
<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">
|
||||
|
||||
<m:prepare_filter entity="deal" accessObject="" lsPage="deal_ls" pageInfoOut="pageInfo" trackOut="tr"/>
|
||||
|
||||
<m:filter_settings target="deal_ls"><!---*** вводит в заблуждение--->
|
||||
<m:filterparam filter=#filter# param="__name" ftype="string" compare="LIKE%" field="d.__name" default=""/>
|
||||
<m:filterparam filter=#filter# param="contragent" ftype="string" compare="LIKE%" field="k.__name" default=""/>
|
||||
<m:filterparam filter=#filter# param="contragent_id" ftype="guid" compare="EQ" field="k.__id" default=""/>
|
||||
<m:filterparam filter=#filter# param="wz" ftype="string" compare="LIKE%" field="k.id_klienta" default=""/>
|
||||
<m:filterparam filter=#filter# param="status_id" ftype="numeric" compare="EQ" field="d.__status_status" default=""/>
|
||||
</m:filter_settings>
|
||||
|
||||
<cfif isDefined("resetAndClose") or isDefined("saveAndClose")>
|
||||
<cflocation url="#tr.backUrl#" addtoken="No"/>
|
||||
</cfif>
|
||||
|
||||
</m:silent><!--- ----------------------------------------------------------------------------
|
||||
---------------------------------------------------------------------------------------------
|
||||
---------------------------------------------------------------------------------------------
|
||||
---><layout:page section="header" pageInfo=#pageInfo#>
|
||||
<layout:attribute name="title"><cfoutput>Сделки - фильтр</cfoutput></layout:attribute>
|
||||
</layout:page>
|
||||
|
||||
<script type="text/javascript"/>
|
||||
$(document).ready(function() {
|
||||
try {
|
||||
$("#contragent_id").searchable({maxMultiMatch: 50});
|
||||
} catch (e) {alert(e)}
|
||||
});
|
||||
</script>
|
||||
|
||||
<cfoutput>
|
||||
<input type="hidden" name="track" value="#tr.self#"/>
|
||||
|
||||
<div class="detail">
|
||||
|
||||
<div class="tr">
|
||||
<div class="th"></div>
|
||||
<div class="td">
|
||||
<button type="button" name="reset" onClick="document.location.href='#request.thisPage#?reset=yes&track=#tr.self#'">#i18("Очистить","Clear")#</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Название сделки</div>
|
||||
<div class="td">
|
||||
<input type="text" name="__name" value="#__name#" size="50"/>
|
||||
<i>#i18("по вхождению подстроки","by substring")#</i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Контрагент</div>
|
||||
<div class="td">
|
||||
<input type="text" name="contragent" value="#contragent#" size="50"/>
|
||||
<i>#i18("по вхождению подстроки","by substring")#</i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">WZ</div>
|
||||
<div class="td">
|
||||
<input type="text" name="wz" value="#wz#" size="50"/>
|
||||
<i>#i18("по вхождению подстроки","by substring")#</i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Контрагент</div>
|
||||
<div class="td" style="vertical-align:top;">
|
||||
<cfquery name="qList">
|
||||
select __id::text as __id, __name, id_klienta
|
||||
from elma.companies
|
||||
order by __name
|
||||
</cfquery>
|
||||
<!--- <cfdump var=#qList#/> --->
|
||||
|
||||
<c:combo
|
||||
query=#qList#
|
||||
combo="contragent_id"
|
||||
id="contragent_id"
|
||||
key="__id"
|
||||
displayf="##__name## ##id_klienta##"
|
||||
selected=#contragent_id#
|
||||
empty=""
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Статус</div>
|
||||
<div class="td" style="vertical-align:top;">
|
||||
<cfquery name="qStatus" datasource="#request.DS#">
|
||||
with
|
||||
status (status, status_id, probability_pc) as (VALUES
|
||||
('Закрыта неуспешно',7,0),('Закрыта успешно',6,100),('Договор подписан',5,100),('Договор на подписании',15,90),('Договор на согласовании',12,70),
|
||||
('Тестирование',8,50),('Отправлено ТКП',10,20),('Внутреннее согласование',37,10),('Проработка решения',4,10),('Сбор потребностей',1,0)
|
||||
)
|
||||
select status_id, status, probability_pc
|
||||
from status
|
||||
order by status_id
|
||||
</cfquery>
|
||||
|
||||
<c:combo
|
||||
query=#qStatus#
|
||||
combo="status_id"
|
||||
id="status_id"
|
||||
key="status_id"
|
||||
displayf="##status_id## ##status## (##probability_pc##%)"
|
||||
selected=#status_id#
|
||||
empty=""
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div><!--- detail --->
|
||||
добавить сюда множественный выбор статуса
|
||||
|
||||
</cfoutput>
|
||||
|
||||
<layout:page section="footer" closeForm="Yes"/>
|
||||
<!--- <cfdump var=#filter#> --->
|
||||
+3
-2
@@ -52,9 +52,9 @@
|
||||
where d.__id = ANY(siv.deal)
|
||||
) as line_cnt
|
||||
</d:field> --->
|
||||
<!--- <d:field>(select count(*)
|
||||
<!--- <d:field title="Строк">(select count(*)
|
||||
from elma.deals_services siv
|
||||
where d.__id = ANY(siv.deal) AND siv.is_actual
|
||||
where d.__id = ANY(siv.deal) AND siv.is_actual AND siv."__deletedAt" IS NULL
|
||||
) as line_cnt_actual
|
||||
</d:field> --->
|
||||
<!---<d:field>(select sum(param_cost)
|
||||
@@ -176,6 +176,7 @@ select count(*) as cnt from elma.deals d where 1=1
|
||||
<c:column width="3%" field="__status_status"><c:td class="c"/></c:column>
|
||||
<c:column width="5%" field="status"><c:td class="c"/></c:column>
|
||||
<c:column width="3%" field="probability_pc"><c:td class="c"/></c:column>
|
||||
<!--- <c:column width="3%" field="line_cnt_actual"><c:td class="c"/></c:column> --->
|
||||
<c:column width="5%" field="__createdAt" formatter=#function(dt){return dateformat(dt,"YYYY-MM-DD");}#><c:td class="c"/></c:column>
|
||||
<c:column width="8%" field="owner"><c:td class="l"/></c:column>
|
||||
<c:column width="5%" field="f_additional_agreement"><c:td class="l"/></c:column>
|
||||
|
||||
+80
-44
@@ -145,6 +145,7 @@
|
||||
from elma.service_parametrs p
|
||||
join elma.deals_services siv on (p.__id = ANY (siv.params))
|
||||
where siv.__id=<cfqueryparam cfsqltype="cf_sql_other" value=#d.__id# null=#!isValid("guid",d.__id)#/>
|
||||
AND p."__deletedAt" IS NULL
|
||||
</cfquery>
|
||||
<b>#nFmt(qParamCost.line_cost)#</b> по строке, с количеством и скидкой (<b>#nFmt(qParamCost.param_cost)#</b> по компонентам)
|
||||
</div>
|
||||
@@ -177,24 +178,24 @@
|
||||
,(select
|
||||
sum(siv.cnt*(100-COALESCE(siv.discount,0))/100*p.price*p.cnt*(100-COALESCE(p.discount,0))/100)
|
||||
from elma.service_parametrs p
|
||||
where p.__id = ANY (siv.params)
|
||||
where p.__id = ANY (siv.params) AND p."__deletedAt" IS NULL
|
||||
) as line_cost
|
||||
from elma.deals_services siv
|
||||
left outer join elma.additional_agreements a on (a.__id = ANY(siv.additional_agreement))
|
||||
join elma.deals d on (d.__id = ANY(siv.deal))
|
||||
left outer join status on (d.__status_status = status.status_id)
|
||||
where hash=<cfqueryparam cfsqltype="cf_sql_varchar" value=#d.hash#/>
|
||||
AND siv.is_actual
|
||||
order by siv.__index, siv.version
|
||||
AND siv."__deletedAt" IS NULL AND siv.is_actual
|
||||
order by d.__index --siv.__index, siv.version
|
||||
</cfquery>
|
||||
<cfloop query=#qV#>
|
||||
<cfif __id EQ toString(d.__id)>
|
||||
<b>#aa_version#:#version#[#__index#]</b>
|
||||
<cfelse>
|
||||
<a href="deal_service.cfm?__id=#__id#&#tr.fwx#">#aa_version#:#version#[#__index#]</a>
|
||||
<a href="deal_service.cfm?__id=#__id#&#tr.fwx#" title="версия_дс : версия_строки [индекс_сделки]">#aa_version#:#version#[#__index#]</a>
|
||||
</cfif>
|
||||
</cfloop>
|
||||
(только актуальные и со сделкой)
|
||||
(версия_дс : версия_строки [индекс_сделки], только актуальные и со сделкой)
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -241,10 +242,10 @@
|
||||
</cfquery>
|
||||
<!--- <cfdump var=#qDeal#/> --->
|
||||
<cfif qDeal.recordCount>
|
||||
<a href="deal.cfm?__id=#qDeal.__id#&#tr.fwx#">#qDeal.__id#</a> |
|
||||
<a href="deal.cfm?__id=#qDeal.__id#&#tr.fwx#">#qDeal.__index# #qDeal.__id#</a> |
|
||||
<a href="contragent.cfm?__id=#qDeal.contragent_uid#&#tr.fwx#">#qDeal.contragent# #qDeal.wz#</a> |
|
||||
#qDeal.__name# |
|
||||
_plannedDueDate: <cfif len(qDeal._plannedDueDate)><b>#dateFormat(qDeal._plannedDueDate,'DD.MM.YYYY')#</b><cfelse>--</cfif>
|
||||
<!--- _plannedDueDate: <cfif len(qDeal._plannedDueDate)><b>#dateFormat(qDeal._plannedDueDate,'DD.MM.YYYY')#</b><cfelse>--</cfif> --->
|
||||
<b>#qDeal.__status_status#: #qDeal.status# (#qDeal.probability_pc#%)</b>
|
||||
</cfif>
|
||||
</div>
|
||||
@@ -256,12 +257,17 @@
|
||||
<cfquery name="qAdditionalAgreement">
|
||||
select
|
||||
a.__id::text
|
||||
,b.__id::text as base_by_uid
|
||||
,a.__index
|
||||
,a.__name as additional_agreement
|
||||
,a2.__id::text as base_by_uid
|
||||
,a2.__index
|
||||
,a2.__name as base_by
|
||||
,a.contract_uid::text
|
||||
,a.is_actual
|
||||
,a.last_aa
|
||||
,a.deal_uid::text
|
||||
,a2.deal_uid::text as deal2_uid
|
||||
,d2.__name as deal2
|
||||
,c.__name as contract
|
||||
,c.agreement_id
|
||||
,c.date_of_aggrement
|
||||
@@ -270,23 +276,37 @@
|
||||
,z.id_klienta as wz
|
||||
from elma.deals_services siv
|
||||
join elma.additional_agreements a on (a.__id = ANY(siv.additional_agreement))
|
||||
join elma.additional_agreements b on (b.__id = ANY(a.base_by))
|
||||
left outer join elma.additional_agreements a2 on (a2.__id = ANY(a.base_by))
|
||||
left outer join elma.deals d2 on (a2.deal_uid = d2.__id)
|
||||
left outer join elma.aggrements c on (a.contract_uid=c.__id)
|
||||
left outer join elma.companies z on (c.company_uid=z.__id)
|
||||
where siv.__id=<cfqueryparam cfsqltype="cf_sql_other" value=#d.__id# null=#!isValid("guid",d.__id)#/>
|
||||
</cfquery>
|
||||
<!--- <cfdump var=#qAdditionalAgreement#/> --->
|
||||
<cfif len(qAdditionalAgreement.__id)>
|
||||
<a href="additional_agreement.cfm?__id=#qAdditionalAgreement.__id#&#tr.fwx#">#qAdditionalAgreement.__id#</a> |
|
||||
<a href="contragent.cfm?__id=#qAdditionalAgreement.contragent_uid#&#tr.fwx#">#qAdditionalAgreement.contragent# #qAdditionalAgreement.wz#</a> |
|
||||
<a href="contract.cfm?__id=#qAdditionalAgreement.contract_uid#&#tr.fwx#">#qAdditionalAgreement.contract# (#qAdditionalAgreement.agreement_id#)
|
||||
#dateFormat(qAdditionalAgreement.date_of_aggrement,"YYYY-MM-DD")#
|
||||
<a href="additional_agreement.cfm?__id=#qAdditionalAgreement.__id#&#tr.fwx#">
|
||||
#qAdditionalAgreement.__index# #qAdditionalAgreement.__id# #qAdditionalAgreement.additional_agreement#
|
||||
</a> |
|
||||
#qAdditionalAgreement.additional_agreement# |
|
||||
<a href="contragent.cfm?__id=#qAdditionalAgreement.contragent_uid#&#tr.fwx#">
|
||||
#qAdditionalAgreement.contragent# #qAdditionalAgreement.wz#
|
||||
</a> |
|
||||
Договор
|
||||
<a href="contract.cfm?__id=#qAdditionalAgreement.contract_uid#&#tr.fwx#">
|
||||
#qAdditionalAgreement.contract# (#qAdditionalAgreement.agreement_id#)
|
||||
#dateFormat(qAdditionalAgreement.date_of_aggrement,"YYYY-MM-DD")#
|
||||
</a>
|
||||
|
||||
<br/>
|
||||
is_actual: <b>#qAdditionalAgreement.is_actual#</b>
|
||||
last_aa: <b>#qAdditionalAgreement.last_aa#</b>
|
||||
base_by: <a href="additional_agreement.cfm?__id=#qAdditionalAgreement.base_by_uid#&#tr.fwx#">#qAdditionalAgreement.base_by_uid#</a>
|
||||
base_by: <a href="additional_agreement.cfm?__id=#qAdditionalAgreement.base_by_uid#&#tr.fwx#">
|
||||
#qAdditionalAgreement.base_by_uid#
|
||||
#qAdditionalAgreement.base_by#
|
||||
</a>
|
||||
(<a href="deal.cfm?__id=#qAdditionalAgreement.deal2_uid#&#tr.fwx#" title="сделка base_by">
|
||||
#qAdditionalAgreement.deal2_uid#
|
||||
#qAdditionalAgreement.deal2#
|
||||
</a>)
|
||||
</cfif>
|
||||
</div>
|
||||
</div>
|
||||
@@ -414,16 +434,20 @@
|
||||
left outer join elma.deals d on (d.__id = ANY(siv.deal))
|
||||
left outer join status on (d.__status_status = status.status_id)
|
||||
where hash=<cfqueryparam cfsqltype="cf_sql_varchar" value=#d.hash#/>
|
||||
order by siv.__index, siv.version
|
||||
order by d.__index
|
||||
</cfquery>
|
||||
|
||||
<cfquery name="qVerActual" dbtype="query">
|
||||
select * from qVer where is_actual > 0
|
||||
</cfquery>
|
||||
</cfquery> <!--- не повторяем сортировку, хотя это некорректно --->
|
||||
|
||||
<cfquery name="qVerDraft" dbtype="query">
|
||||
select * from qVer where is_actual = 0 OR is_actual IS NULL
|
||||
</cfquery><!--- не повторяем сортировку, хотя это некорректно --->
|
||||
|
||||
|
||||
<cfoutput>
|
||||
<h4>Версии строки (без черновиков) (#qVerActual.recordCount#)</h4>
|
||||
<h4>Версии строки без черновиков (#qVerActual.recordCount#)</h4>
|
||||
</cfoutput>
|
||||
|
||||
<table class="worktable">
|
||||
@@ -431,47 +455,53 @@
|
||||
<tr>
|
||||
<th>Индекс версии</th>
|
||||
<th>Создана</th>
|
||||
<th>Версия доп.с.</th>
|
||||
<th>Верс. доп.с.</th>
|
||||
<th>Версия строки</th>
|
||||
<th>is_actual</th>
|
||||
<th>is actual</th>
|
||||
<th>НОУ</th>
|
||||
<th>КОУ</th>
|
||||
<th>User Description</th>
|
||||
<th>type</th>
|
||||
<th>Кол-во</th>
|
||||
<th>Скидка%</th>
|
||||
<th>Скид­ка%</th>
|
||||
<th>Ст-ть</th>
|
||||
<th>Сделка</th>
|
||||
<th>Статус</th>
|
||||
<th>Вер-ть</th>
|
||||
<th>Вер.</th>
|
||||
<th>Доп.с.</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<cfoutput query="qVerActual">
|
||||
<tr>
|
||||
<td class="c"><a href="deal_service.cfm?__id=#__id#&#tr.fwx#" title="#__id#">#__index#</a></td>
|
||||
<td class="c">#dateFormat(__createdAt,"YYYY-MM-DD")#</td>
|
||||
<td class="c">
|
||||
<cfif __id EQ toString(d.__id)>
|
||||
<b>#__index#</b>
|
||||
<cfelse>
|
||||
<a href="deal_service.cfm?__id=#__id#&#tr.fwx#" title="#__id#">#__index#</a>
|
||||
</cfif>
|
||||
</td>
|
||||
<td class="c nw">#dateFormat(__createdAt,"YYYY-MM-DD")#</td>
|
||||
<td class="c">#aa_version#</td>
|
||||
<td class="c">#version#</td>
|
||||
<td class="c">#is_actual#</td>
|
||||
<td class="c">#dateFormat(date_nop,"YYYY-MM-DD")#</td>
|
||||
<td class="r">#dateFormat(date_end,"YYYY-MM-DD")#</td>
|
||||
<td class="c">#user_description#</td>
|
||||
<td class="c nw">#dateFormat(date_nop,"YYYY-MM-DD")#</td>
|
||||
<td class="c nw">#dateFormat(date_end,"YYYY-MM-DD")#</td>
|
||||
<td>#user_description#</td>
|
||||
<td class="r">#type#</td>
|
||||
<td class="c">#cnt#</td>
|
||||
<td class="c">#discount#</td>
|
||||
<td class="r">#nFmt(line_cost)#</td>
|
||||
<td class="c"><a href="deal.cfm?__id=#deal_uid#&#tr.fwx#" title="#deal_uid#">#deal#</a></td>
|
||||
<td class="r nw">#nFmt(line_cost)#</td>
|
||||
<td class="l"><a href="deal.cfm?__id=#deal_uid#&#tr.fwx#" title="#deal_uid#">#deal#</a></td>
|
||||
<td class="c">#__status_status#</td>
|
||||
<td class="c">#probability_pc#</td>
|
||||
<td class="c"><a href="additional_agreement.cfm?__id=#aa_uid#&#tr.fwx#" title="#aa_uid#">#additional_agreement#</a></td>
|
||||
<td class="l"><a href="additional_agreement.cfm?__id=#aa_uid#&#tr.fwx#" title="#aa_uid#">#additional_agreement#</a></td>
|
||||
</tr>
|
||||
</cfoutput>
|
||||
</table>
|
||||
|
||||
|
||||
<cfoutput>
|
||||
<h4>Версии строки (включая черновики) (#qVer.recordCount#)</h4>
|
||||
<h4>Версии строки - черновики (#qVerDraft.recordCount#)</h4>
|
||||
</cfoutput>
|
||||
|
||||
<table class="worktable">
|
||||
@@ -479,40 +509,46 @@
|
||||
<tr>
|
||||
<th>Индекс версии</th>
|
||||
<th>Создана</th>
|
||||
<th>Версия доп.с.</th>
|
||||
<th>Верс. доп.с.</th>
|
||||
<th>Версия строки</th>
|
||||
<th>is_actual</th>
|
||||
<th>is actual</th>
|
||||
<th>НОУ</th>
|
||||
<th>КОУ</th>
|
||||
<th>User Description</th>
|
||||
<th>type</th>
|
||||
<th>Кол-во</th>
|
||||
<th>Скидка%</th>
|
||||
<th>Скид­ка%</th>
|
||||
<th>Ст-ть</th>
|
||||
<th>Сделка</th>
|
||||
<th>Статус</th>
|
||||
<th>Вер-ть</th>
|
||||
<th>Вер.</th>
|
||||
<th>Доп.с.</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<cfoutput query="qVer">
|
||||
<cfoutput query="qVerDraft">
|
||||
<tr>
|
||||
<td class="c"><a href="deal_service.cfm?__id=#__id#&#tr.fwx#" title="#__id#">#__index#</a></td>
|
||||
<td class="c">#dateFormat(__createdAt,"YYYY-MM-DD")#</td>
|
||||
<td class="c">
|
||||
<cfif __id EQ toString(d.__id)>
|
||||
<b>#__index#</b>
|
||||
<cfelse>
|
||||
<a href="deal_service.cfm?__id=#__id#&#tr.fwx#" title="#__id#">#__index#</a>
|
||||
</cfif>
|
||||
</td>
|
||||
<td class="c nw">#dateFormat(__createdAt,"YYYY-MM-DD")#</td>
|
||||
<td class="c">#aa_version#</td>
|
||||
<td class="c">#version#</td>
|
||||
<td class="c">#is_actual#</td>
|
||||
<td class="c">#dateFormat(date_nop,"YYYY-MM-DD")#</td>
|
||||
<td class="r">#dateFormat(date_end,"YYYY-MM-DD")#</td>
|
||||
<td class="c">#user_description#</td>
|
||||
<td class="c nw">#dateFormat(date_nop,"YYYY-MM-DD")#</td>
|
||||
<td class="c nw">#dateFormat(date_end,"YYYY-MM-DD")#</td>
|
||||
<td class="l">#user_description#</td>
|
||||
<td class="r">#type#</td>
|
||||
<td class="c">#cnt#</td>
|
||||
<td class="c">#discount#</td>
|
||||
<td class="r">#nFmt(line_cost)#</td>
|
||||
<td class="c"><a href="deal.cfm?__id=#deal_uid#&#tr.fwx#" title="#deal_uid#">#deal#</a></td>
|
||||
<td class="r nw">#nFmt(line_cost)#</td>
|
||||
<td class="l"><a href="deal.cfm?__id=#deal_uid#&#tr.fwx#" title="#deal_uid#">#deal#</a></td>
|
||||
<td class="c">#__status_status#</td>
|
||||
<td class="c">#probability_pc#</td>
|
||||
<td class="c"><a href="additional_agreement.cfm?__id=#aa_uid#&#tr.fwx#" title="#aa_uid#">#additional_agreement#</a></td>
|
||||
<td class="l"><a href="additional_agreement.cfm?__id=#aa_uid#&#tr.fwx#" title="#aa_uid#">#additional_agreement#</a></td>
|
||||
</tr>
|
||||
</cfoutput>
|
||||
</table>
|
||||
|
||||
@@ -0,0 +1,562 @@
|
||||
<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="deals_services" accessObject="" key="__id" pageInfoOut="pageInfo"/>
|
||||
|
||||
<d:bean readonly=true table="elma.deals_services" datasource="#request.DS#" output="d" status="status">
|
||||
<d:param field="__id" type="uuid" key/>
|
||||
<d:param field="__name" type="varchar" size="255" preprocessor=#cleanInput# forNull=""/>
|
||||
<d:param field="__index" type="integer" forNull=""/>
|
||||
<d:param field="user_description" type="varchar" preprocessor=#plain2HtmClean# forNull=""/>
|
||||
<d:param field="modifier" type="varchar" size="255" preprocessor=#cleanInput# forNull=""/>
|
||||
<d:param field="modifier_code" type="varchar" size="255" preprocessor=#cleanInput# forNull=""/>
|
||||
<d:param field="cnt" type="integer" forNull="" default="0" init="0"/>
|
||||
<d:param field="type" type="integer" forNull="" default="0" init="0"/>
|
||||
<d:param field="abstractive_service_code" type="varchar" size="255" preprocessor=#cleanInput# forNull=""/>
|
||||
<d:param field="deal" type="ARRAY" forNull=""/>
|
||||
<d:param field="additional_agreement" type="ARRAY" forNull=""/>
|
||||
<d:param field="date" type="timestamp" forNull=""/>
|
||||
<d:param field="abstractive_service" type="varchar" size="255" preprocessor=#cleanInput# forNull=""/>
|
||||
<d:param field="is_actual" type="bit" forNull=""/>
|
||||
<d:param field="hash" type="varchar" size="255" preprocessor=#cleanInput# forNull=""/>
|
||||
<d:param field="discount" type="numeric" forNull=""/>
|
||||
<d:param field="version" type="varchar" size="255" preprocessor=#cleanInput# forNull=""/>
|
||||
<d:param field="name_version" type="varchar" size="255" preprocessor=#cleanInput# forNull=""/>
|
||||
<d:param field="date_nop" type="timestamp" forNull=""/>
|
||||
<d:param field="date_end" type="timestamp" forNull=""/>
|
||||
<d:param field="is_easy" type="bit" forNull=""/>
|
||||
</d:bean>
|
||||
|
||||
|
||||
<m:dispatch_detail
|
||||
usePRG="No"<!---*** --->
|
||||
pageInfo=#pageInfo#
|
||||
id="#d.__id#"
|
||||
status=#pageInfo.status#
|
||||
trackOut="tr"
|
||||
idAttributesOut="id"
|
||||
/>
|
||||
|
||||
<!--- decoration --->
|
||||
<cfquery name="qDecoration" datasource="#request.DS#">
|
||||
select
|
||||
ds."__createdAt"
|
||||
from elma.deals_services ds
|
||||
where ds.__id=<cfqueryparam cfsqltype="cf_sql_other" value=#d.__id# null=#!isValid("guid",d.__id)#/>
|
||||
</cfquery>
|
||||
|
||||
|
||||
</m:silent><!---
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
---><layout:page section="header" pageInfo=#pageInfo#>
|
||||
<layout:attribute name="title">
|
||||
<cfoutput>
|
||||
Версия строки спецификации
|
||||
<cfif len(d.__id)>
|
||||
<b>#d.__name#</b>
|
||||
[#d.__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="__id" value="#d.__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">__id</div>
|
||||
<div class="td">
|
||||
#d.__id#
|
||||
|
||||
<span style="background-color:##e0e0e0">__index </span> #d.__index#
|
||||
|
||||
<span style="background-color:##e0e0e0">__createdAt </span> #dateTimeFormat(qDecoration.__createdAt,"yyyy-MM-dd HH:nn:ss.SSSZ")#
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th"></div>
|
||||
<div class="td"></div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Ключ строки</div>
|
||||
<div class="td">#d.hash#</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Тип периодичности</div>
|
||||
<div class="td">#d.type#</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Код</div>
|
||||
<div class="td">#d.abstractive_service_code#.#d.modifier_code#</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Пользовательское описание</div>
|
||||
<div class="td">#d.user_description#</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Количество</div>
|
||||
<div class="td">#d.cnt#</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Скидка</div>
|
||||
<div class="td">#d.discount# %</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Сумма</div>
|
||||
<div class="td">
|
||||
<cfquery name="qParamCost">
|
||||
select
|
||||
sum(p.price*p.cnt*(100-COALESCE(p.discount,0))/100) as param_cost
|
||||
,sum(siv.cnt*(100-COALESCE(siv.discount,0))/100*p.price*p.cnt*(100-COALESCE(p.discount,0))/100) as line_cost
|
||||
from elma.service_parametrs p
|
||||
join elma.deals_services siv on (p.__id = ANY (siv.params))
|
||||
where siv.__id=<cfqueryparam cfsqltype="cf_sql_other" value=#d.__id# null=#!isValid("guid",d.__id)#/>
|
||||
AND p."__deletedAt" IS NULL
|
||||
</cfquery>
|
||||
<b>#nFmt(qParamCost.line_cost)#</b> по строке, с количеством и скидкой (<b>#nFmt(qParamCost.param_cost)#</b> по компонентам)
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Версия</div>
|
||||
<div class="td">
|
||||
#d.version# <i>вообще не понимаю, какой смысл вкладывается в эту цифру...</i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Версии</div>
|
||||
<div class="td">
|
||||
|
||||
<cfquery name="qV">
|
||||
with
|
||||
status(status, status_id, probability_pc) as (VALUES
|
||||
('Закрыта неуспешно',7,0),('Закрыта успешно',6,100),('Договор подписан',5,100),('Договор на подписании',15,90),('Договор на согласовании',12,70),
|
||||
('Тестирование',8,50),('Отправлено ТКП',10,20),('Внутреннее согласование',37,10),('Проработка решения',4,10),('Сбор потребностей',1,0)
|
||||
)
|
||||
select siv.__id::text, siv.__index, siv.version
|
||||
, siv.date_nop, siv.date_end, siv.user_description
|
||||
, siv.type, siv.is_easy, siv.cnt, siv.discount
|
||||
, siv.is_actual, siv."__createdAt"
|
||||
, d.__id::text as deal_uid, d.__index as deal_index, d.__name as deal, d.__status_status
|
||||
, a.__id::text as aa_uid, a.index as aa_version, a.__name as additional_agreement
|
||||
, status.status, status.probability_pc
|
||||
,(select
|
||||
sum(siv.cnt*(100-COALESCE(siv.discount,0))/100*p.price*p.cnt*(100-COALESCE(p.discount,0))/100)
|
||||
from elma.service_parametrs p
|
||||
where p.__id = ANY (siv.params)
|
||||
) as line_cost
|
||||
from elma.deals_services siv
|
||||
left outer join elma.additional_agreements a on (a.__id = ANY(siv.additional_agreement))
|
||||
join elma.deals d on (d.__id = ANY(siv.deal))
|
||||
left outer join status on (d.__status_status = status.status_id)
|
||||
where hash=<cfqueryparam cfsqltype="cf_sql_varchar" value=#d.hash#/>
|
||||
AND siv.is_actual
|
||||
order by d.__index --siv.__index, siv.version
|
||||
</cfquery>
|
||||
<cfloop query=#qV#>
|
||||
<cfif __id EQ toString(d.__id)>
|
||||
<b>#aa_version#:#version#[#__index#]</b>
|
||||
<cfelse>
|
||||
<a href="deal_service.cfm?__id=#__id#&#tr.fwx#" title="версия_дс : версия_строки [индекс_сделки]">#aa_version#:#version#[#__index#]</a>
|
||||
</cfif>
|
||||
</cfloop>
|
||||
(версия_дс : версия_строки [индекс_сделки], только актуальные и со сделкой)
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">is_actual</div>
|
||||
<div class="td">#d.is_actual#</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Начало тарификации</div>
|
||||
<div class="td">#dateFormat(d.date_nop,'DD.MM.YYYY')#</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Окончание тарификации</div>
|
||||
<div class="td">#dateFormat(d.date_end,'DD.MM.YYYY')#</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Сделка</div>
|
||||
<div class="td">
|
||||
<cfquery name="qDeal">
|
||||
with
|
||||
s(status, status_id, probability_pc) as (VALUES
|
||||
('Закрыта неуспешно',7,0),('Закрыта успешно',6,100),('Договор подписан',5,100),('Договор на подписании',15,90),('Договор на согласовании',12,70),
|
||||
('Тестирование',8,50),('Отправлено ТКП',10,20),('Внутреннее согласование',37,10),('Проработка решения',4,10),('Сбор потребностей',1,0)
|
||||
)
|
||||
select
|
||||
d.__id::text
|
||||
,d.__name
|
||||
,c.__name as contragent
|
||||
,c.__id as contragent_uid
|
||||
,d."_plannedDueDate"
|
||||
,d.__index
|
||||
,d.__status_status
|
||||
,c.id_klienta as wz
|
||||
,s.status
|
||||
,s.probability_pc
|
||||
from elma.deals_services siv
|
||||
join elma.deals d on (d.__id = ANY(siv.deal))
|
||||
left outer join elma.companies c on (d._companies=c.__id)
|
||||
left outer join s on (d.__status_status=s.status_id)
|
||||
where siv.__id=<cfqueryparam cfsqltype="cf_sql_other" value=#d.__id# null=#!isValid("guid",d.__id)#/>
|
||||
</cfquery>
|
||||
<!--- <cfdump var=#qDeal#/> --->
|
||||
<cfif qDeal.recordCount>
|
||||
<a href="deal.cfm?__id=#qDeal.__id#&#tr.fwx#">#qDeal.__index# #qDeal.__id#</a> |
|
||||
<a href="contragent.cfm?__id=#qDeal.contragent_uid#&#tr.fwx#">#qDeal.contragent# #qDeal.wz#</a> |
|
||||
#qDeal.__name# |
|
||||
<!--- _plannedDueDate: <cfif len(qDeal._plannedDueDate)><b>#dateFormat(qDeal._plannedDueDate,'DD.MM.YYYY')#</b><cfelse>--</cfif> --->
|
||||
<b>#qDeal.__status_status#: #qDeal.status# (#qDeal.probability_pc#%)</b>
|
||||
</cfif>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tr">
|
||||
<div class="th">Доп. соглашение</div>
|
||||
<div class="td">
|
||||
<cfquery name="qAdditionalAgreement">
|
||||
select
|
||||
a.__id::text
|
||||
,a.__index
|
||||
,a.__name as additional_agreement
|
||||
,a2.__id::text as base_by_uid
|
||||
,a2.__index
|
||||
,a2.__name as base_by
|
||||
,a.contract_uid::text
|
||||
,a.is_actual
|
||||
,a.last_aa
|
||||
,a.deal_uid::text
|
||||
,a2.deal_uid::text as deal2_uid
|
||||
,d2.__name as deal2
|
||||
,c.__name as contract
|
||||
,c.agreement_id
|
||||
,c.date_of_aggrement
|
||||
,z.__name as contragent
|
||||
,z.__id as contragent_uid
|
||||
,z.id_klienta as wz
|
||||
from elma.deals_services siv
|
||||
join elma.additional_agreements a on (a.__id = ANY(siv.additional_agreement))
|
||||
left outer join elma.additional_agreements a2 on (a2.__id = ANY(a.base_by))
|
||||
left outer join elma.deals d2 on (a2.deal_uid = d2.__id)
|
||||
left outer join elma.aggrements c on (a.contract_uid=c.__id)
|
||||
left outer join elma.companies z on (c.company_uid=z.__id)
|
||||
where siv.__id=<cfqueryparam cfsqltype="cf_sql_other" value=#d.__id# null=#!isValid("guid",d.__id)#/>
|
||||
</cfquery>
|
||||
<!--- <cfdump var=#qAdditionalAgreement#/> --->
|
||||
<cfif len(qAdditionalAgreement.__id)>
|
||||
<a href="additional_agreement.cfm?__id=#qAdditionalAgreement.__id#&#tr.fwx#">
|
||||
#qAdditionalAgreement.__index# #qAdditionalAgreement.__id# #qAdditionalAgreement.additional_agreement#
|
||||
</a> |
|
||||
<a href="contragent.cfm?__id=#qAdditionalAgreement.contragent_uid#&#tr.fwx#">
|
||||
#qAdditionalAgreement.contragent# #qAdditionalAgreement.wz#
|
||||
</a> |
|
||||
Договор
|
||||
<a href="contract.cfm?__id=#qAdditionalAgreement.contract_uid#&#tr.fwx#">
|
||||
#qAdditionalAgreement.contract# (#qAdditionalAgreement.agreement_id#)
|
||||
#dateFormat(qAdditionalAgreement.date_of_aggrement,"YYYY-MM-DD")#
|
||||
</a>
|
||||
|
||||
<br/>
|
||||
is_actual: <b>#qAdditionalAgreement.is_actual#</b>
|
||||
last_aa: <b>#qAdditionalAgreement.last_aa#</b>
|
||||
base_by: <a href="additional_agreement.cfm?__id=#qAdditionalAgreement.base_by_uid#&#tr.fwx#">
|
||||
#qAdditionalAgreement.base_by_uid#
|
||||
#qAdditionalAgreement.base_by#
|
||||
</a>
|
||||
(<a href="deal.cfm?__id=#qAdditionalAgreement.deal2_uid#&#tr.fwx#" title="сделка base_by">
|
||||
#qAdditionalAgreement.deal2_uid#
|
||||
#qAdditionalAgreement.deal2#
|
||||
</a>)
|
||||
</cfif>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!--- <div class="tr">
|
||||
<div class="th">Параметры</div>
|
||||
<div class="td">
|
||||
<cfquery name="qParam">
|
||||
select params::text
|
||||
from elma.deals_services siv
|
||||
where siv.__id=<cfqueryparam cfsqltype="cf_sql_other" value=#d.__id# null=#!isValid("guid",d.__id)#/>
|
||||
</cfquery>
|
||||
#qParam.params# (обратная ссылка)
|
||||
</div>
|
||||
</div> --->
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</cfoutput>
|
||||
|
||||
<layout:page section="extension" closeForm="Yes"/>
|
||||
|
||||
<cfif len(d.__id)>
|
||||
<cfquery name="qParam">
|
||||
select
|
||||
p.__id
|
||||
,p.__index
|
||||
,p.__name
|
||||
,p.type
|
||||
,p.price
|
||||
,p.code
|
||||
,p.cnt
|
||||
,p.name
|
||||
,p.ed_izm
|
||||
,p.discount
|
||||
,p.deal::text
|
||||
,p.__index
|
||||
,(p.price*p.cnt*(100-COALESCE(p.discount,0))/100) as param_cost
|
||||
from elma.service_parametrs p
|
||||
join elma.deals_services siv on (p.__id = ANY (siv.params))
|
||||
where siv.__id=<cfqueryparam cfsqltype="cf_sql_other" value=#d.__id# null=#!isValid("guid",d.__id)#/>
|
||||
order by type
|
||||
</cfquery>
|
||||
<cfquery name="qParamTotal" dbtype="query">
|
||||
select
|
||||
sum(param_cost) as total_cost
|
||||
from qParam
|
||||
</cfquery>
|
||||
|
||||
<cfoutput>
|
||||
<h4>Параметры (компоненты) (#qParam.recordCount#)</h4>
|
||||
</cfoutput>
|
||||
|
||||
<!--- <layout:render_query query=#qService#/> --->
|
||||
<table class="worktable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>__index</th>
|
||||
<!--- <th>__name</th> --->
|
||||
<th>type</th>
|
||||
<th>code</th>
|
||||
<th>name</th>
|
||||
<th>Кол-во</th>
|
||||
<th>Ед.изм.</th>
|
||||
<th>Цена</th>
|
||||
<th>Скидка %</th>
|
||||
<th>Ст-ть</th>
|
||||
<!--- <th>deal</th> --->
|
||||
<th>__id</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<cfoutput query="qParam">
|
||||
<tr>
|
||||
<td class="c">#__index#</td>
|
||||
<!--- <td class="c">#__name#</td> --->
|
||||
<td class="c">#type#</td>
|
||||
<td class="c">#code#</td>
|
||||
<td class="c">#name#</td>
|
||||
<td class="r">#cnt#</td>
|
||||
<td class="c">#ed_izm#</td>
|
||||
<td class="r">#price#</td>
|
||||
<td class="c">#discount#</td>
|
||||
<td class="r">#nFmt(param_cost)#</td>
|
||||
<!--- <td class="c">#deal#</td> --->
|
||||
<td class="c">#__id#</td>
|
||||
</tr>
|
||||
</cfoutput>
|
||||
<cfoutput query="qParamTotal">
|
||||
<tr>
|
||||
<td class="r b" colspan="8">Итого</td>
|
||||
<td class="r b">#nFmt(total_cost)#</td>
|
||||
<td colspan="2"></td>
|
||||
</tr>
|
||||
</cfoutput>
|
||||
</table>
|
||||
</cfif>
|
||||
|
||||
|
||||
<cfquery name="qVer">
|
||||
with
|
||||
status(status, status_id, probability_pc) as (VALUES
|
||||
('Закрыта неуспешно',7,0),('Закрыта успешно',6,100),('Договор подписан',5,100),('Договор на подписании',15,90),('Договор на согласовании',12,70),
|
||||
('Тестирование',8,50),('Отправлено ТКП',10,20),('Внутреннее согласование',37,10),('Проработка решения',4,10),('Сбор потребностей',1,0)
|
||||
)
|
||||
select siv.__id::text, siv.__index, siv.version
|
||||
, siv.date_nop, siv.date_end, siv.user_description
|
||||
, siv.type, siv.is_easy, siv.cnt, siv.discount
|
||||
, siv.is_actual, siv."__createdAt"
|
||||
, d.__id::text as deal_uid, d.__index as deal_index, d.__name as deal, d.__status_status
|
||||
, a.__id::text as aa_uid, a.index as aa_version, a.__name as additional_agreement
|
||||
, status.status, status.probability_pc
|
||||
,(select
|
||||
sum(siv.cnt*(100-COALESCE(siv.discount,0))/100*p.price*p.cnt*(100-COALESCE(p.discount,0))/100)
|
||||
from elma.service_parametrs p
|
||||
where p.__id = ANY (siv.params)
|
||||
) as line_cost
|
||||
from elma.deals_services siv
|
||||
left outer join elma.additional_agreements a on (a.__id = ANY(siv.additional_agreement))
|
||||
left outer join elma.deals d on (d.__id = ANY(siv.deal))
|
||||
left outer join status on (d.__status_status = status.status_id)
|
||||
where hash=<cfqueryparam cfsqltype="cf_sql_varchar" value=#d.hash#/>
|
||||
order by d.__index
|
||||
</cfquery>
|
||||
|
||||
<cfquery name="qVerActual" dbtype="query">
|
||||
select * from qVer where is_actual > 0
|
||||
</cfquery> <!--- не повторяем сортировку, хотя это некорректно --->
|
||||
|
||||
<cfquery name="qVerDraft" dbtype="query">
|
||||
select * from qVer where is_actual = 0 OR is_actual IS NULL
|
||||
</cfquery><!--- не повторяем сортировку, хотя это некорректно --->
|
||||
|
||||
|
||||
<cfoutput>
|
||||
<h4>Версии строки без черновиков (#qVerActual.recordCount#)</h4>
|
||||
</cfoutput>
|
||||
|
||||
<table class="worktable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Индекс версии</th>
|
||||
<th>Создана</th>
|
||||
<th>Верс. доп.с.</th>
|
||||
<th>Версия строки</th>
|
||||
<th>is actual</th>
|
||||
<th>НОУ</th>
|
||||
<th>КОУ</th>
|
||||
<th>User Description</th>
|
||||
<th>type</th>
|
||||
<th>Кол-во</th>
|
||||
<th>Скид­ка%</th>
|
||||
<th>Ст-ть</th>
|
||||
<th>Сделка</th>
|
||||
<th>Статус</th>
|
||||
<th>Вер.</th>
|
||||
<th>Доп.с.</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<cfoutput query="qVerActual">
|
||||
<tr>
|
||||
<td class="c">
|
||||
<cfif __id EQ toString(d.__id)>
|
||||
<b>#__index#</b>
|
||||
<cfelse>
|
||||
<a href="deal_service.cfm?__id=#__id#&#tr.fwx#" title="#__id#">#__index#</a>
|
||||
</cfif>
|
||||
</td>
|
||||
<td class="c nw">#dateFormat(__createdAt,"YYYY-MM-DD")#</td>
|
||||
<td class="c">#aa_version#</td>
|
||||
<td class="c">#version#</td>
|
||||
<td class="c">#is_actual#</td>
|
||||
<td class="c nw">#dateFormat(date_nop,"YYYY-MM-DD")#</td>
|
||||
<td class="c nw">#dateFormat(date_end,"YYYY-MM-DD")#</td>
|
||||
<td>#user_description#</td>
|
||||
<td class="r">#type#</td>
|
||||
<td class="c">#cnt#</td>
|
||||
<td class="c">#discount#</td>
|
||||
<td class="r nw">#nFmt(line_cost)#</td>
|
||||
<td class="l"><a href="deal.cfm?__id=#deal_uid#&#tr.fwx#" title="#deal_uid#">#deal#</a></td>
|
||||
<td class="c">#__status_status#</td>
|
||||
<td class="c">#probability_pc#</td>
|
||||
<td class="l"><a href="additional_agreement.cfm?__id=#aa_uid#&#tr.fwx#" title="#aa_uid#">#additional_agreement#</a></td>
|
||||
</tr>
|
||||
</cfoutput>
|
||||
</table>
|
||||
|
||||
|
||||
<cfoutput>
|
||||
<h4>Версии строки - черновики (#qVerDraft.recordCount#)</h4>
|
||||
</cfoutput>
|
||||
|
||||
<table class="worktable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Индекс версии</th>
|
||||
<th>Создана</th>
|
||||
<th>Верс. доп.с.</th>
|
||||
<th>Версия строки</th>
|
||||
<th>is actual</th>
|
||||
<th>НОУ</th>
|
||||
<th>КОУ</th>
|
||||
<th>User Description</th>
|
||||
<th>type</th>
|
||||
<th>Кол-во</th>
|
||||
<th>Скид­ка%</th>
|
||||
<th>Ст-ть</th>
|
||||
<th>Сделка</th>
|
||||
<th>Статус</th>
|
||||
<th>Вер.</th>
|
||||
<th>Доп.с.</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<cfoutput query="qVerDraft">
|
||||
<tr>
|
||||
<td class="c">
|
||||
<cfif __id EQ toString(d.__id)>
|
||||
<b>#__index#</b>
|
||||
<cfelse>
|
||||
<a href="deal_service.cfm?__id=#__id#&#tr.fwx#" title="#__id#">#__index#</a>
|
||||
</cfif>
|
||||
</td>
|
||||
<td class="c nw">#dateFormat(__createdAt,"YYYY-MM-DD")#</td>
|
||||
<td class="c">#aa_version#</td>
|
||||
<td class="c">#version#</td>
|
||||
<td class="c">#is_actual#</td>
|
||||
<td class="c nw">#dateFormat(date_nop,"YYYY-MM-DD")#</td>
|
||||
<td class="c nw">#dateFormat(date_end,"YYYY-MM-DD")#</td>
|
||||
<td class="l">#user_description#</td>
|
||||
<td class="r">#type#</td>
|
||||
<td class="c">#cnt#</td>
|
||||
<td class="c">#discount#</td>
|
||||
<td class="r nw">#nFmt(line_cost)#</td>
|
||||
<td class="l"><a href="deal.cfm?__id=#deal_uid#&#tr.fwx#" title="#deal_uid#">#deal#</a></td>
|
||||
<td class="c">#__status_status#</td>
|
||||
<td class="c">#probability_pc#</td>
|
||||
<td class="l"><a href="additional_agreement.cfm?__id=#aa_uid#&#tr.fwx#" title="#aa_uid#">#additional_agreement#</a></td>
|
||||
</tr>
|
||||
</cfoutput>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
<!--- <cfdump var=#qVer#/> --->
|
||||
|
||||
|
||||
<layout:page section="footer"/>
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
12:58 09.10.2025 дополнительное соглашение к сделке. Шедевр
|
||||
Reference in New Issue
Block a user