031 minor improvement

This commit is contained in:
2026-03-30 10:41:34 +03:00
parent e1ca12fb2e
commit ccf511afe5
2 changed files with 144 additions and 136 deletions
+1 -1
View File
@@ -97,7 +97,7 @@
<!--- <cfdump var=#this.datasources#/> --->
<cfset request.RECORDS_PER_PAGE=500/>
<cfset request.APP_VERSION="0.00.030"/>
<cfset request.APP_VERSION="0.00.031"/>
<cfset request.STAND=getStand()/>
<cflock scope="application" type="readonly" timeout=3>
+142 -134
View File
@@ -126,6 +126,147 @@
<cfif len(d.__id)>
<a href="#agreements" class="i">Договоры, допники, сделки - внизу</a>
<!--- ----------------------------------------------------- --->
<!--- ----------------------------------------------------- --->
<!--- ----------------------------------------------------- --->
<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
,p.price
,p.cnt as p_cnt
,p.ed_izm
,p.code
,p.discount as p_discount
,p.__id as p_uid
,p.name
,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)
join elma.service_parametrs p ON (p.__id = ANY (siv.params) AND p."__deletedAt" IS NULL)
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
AND a.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="20%">user_description</th>
<th width="25%">Компоненты</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 width="7%">additional_agreement</th>
</tr>
</thead>
<cfoutput query="qService" group="__index">
<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>
<table class="wide">
<cfset cost=0/>
<cfoutput group="p_uid">
<cfif p_cnt NEQ 0>
<tr>
<td class="nw">#code#</td>
<td>#name#</td>
<td>#p_cnt#</td>
<td>#ed_izm#</td>
<td class="r nw">#nFmt(price,3)#</td>
<td class="r">#p_discount#%</td>
</tr>
<cfset cost+=price*p_cnt*(100-(isNumeric(p_discount)?p_discount:0))/100 />
</cfif>
</cfoutput>
</table>
</td>
<td class="c">#cnt#</td>
<td class="c">#discount#%</td>
<td class="r">#nFmt(cost*cnt*(100-(isNumeric(discount)?discount:0))/100)#</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<cfif isDate(date_end) AND date_end LT Now()> err</cfif>">#dateFormat(date_end,'YYYY-MM-DD')#</td>
<td class="c">#is_easy#</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>
<!--- ----------------------------------------------------------------- --->
<!--- ----------------------------------------------------------------- --->
<!--- ----------------------------------------------------------------- --->
<cfquery name="qContract">
select
<d:field_set titleMapOut="titleMap" lengthOut="fieldCount">
@@ -143,7 +284,7 @@
</cfquery>
<cfoutput>
<h4>Договоры (#qContract.recordCount#)</h4>
<h4><a name="agreements">Договоры</a> (#qContract.recordCount#)</h4>
</cfoutput>
<table class="worktable">
<thead>
@@ -365,138 +506,5 @@
</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
,p.price
,p.cnt as p_cnt
,p.ed_izm
,p.code
,p.discount as p_discount
,p.__id as p_uid
,p.name
,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)
join elma.service_parametrs p ON (p.__id = ANY (siv.params) AND p."__deletedAt" IS NULL)
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
AND a.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="20%">user_description</th>
<th width="25%">Компоненты</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 width="7%">additional_agreement</th>
</tr>
</thead>
<cfoutput query="qService" group="__index">
<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>
<table>
<cfset cost=0/>
<cfoutput group="p_uid">
<cfif p_cnt NEQ 0>
<tr>
<td class="nw">#code#</td>
<td>#name#</td>
<td>#p_cnt#</td>
<td>#ed_izm#</td>
<td class="r nw">#nFmt(price,3)#</td>
<td class="r">#p_discount#%</td>
</tr>
<cfset cost+=price*p_cnt*(100-(isNumeric(p_discount)?p_discount:0))/100 />
</cfif>
</cfoutput>
</table>
</td>
<td class="c">#cnt#</td>
<td class="c">#discount#%</td>
<td class="r">#nFmt(cost*cnt*(100-(isNumeric(discount)?discount:0))/100)#</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<cfif isDate(date_end) AND date_end LT Now()> err</cfif>">#dateFormat(date_end,'YYYY-MM-DD')#</td>
<td class="c">#is_easy#</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><!--- len(d.__id) --->
<layout:page section="footer"/>