025 interface imptovements
This commit is contained in:
+82
-46
@@ -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
|
||||
,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)#/>
|
||||
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>
|
||||
|
||||
Reference in New Issue
Block a user