014 agreement_sum
This commit is contained in:
+15
-1
@@ -33,6 +33,8 @@
|
||||
<d:field title="Дата договора">d.dt_contract</d:field>
|
||||
<d:field title="Контрагент">k.contragent</d:field>
|
||||
<d:field title="Строк изменено">(select count(*) from specification_item_version siv join specification_item si on (siv.specification_item_uid=si.specification_item_uid) join specification s on (si.specification_id=s.specification_id) where a.contract_id=s.contract_id AND a.agreement_version=siv.agreement_version) as change_cnt</d:field>
|
||||
<d:field title="Сумма">(select sum(quantity*price) from specification_item_version siv join specification_item si on (siv.specification_item_uid=si.specification_item_uid) join specification s on (si.specification_id=s.specification_id) where a.contract_id=s.contract_id AND a.agreement_version=siv.agreement_version) as agreement_sum</d:field>
|
||||
<d:field title="Сумма с в.">(select sum(quantity*price)*a.probability_perc/100 from specification_item_version siv join specification_item si on (siv.specification_item_uid=si.specification_item_uid) join specification s on (si.specification_id=s.specification_id) where a.contract_id=s.contract_id AND a.agreement_version=siv.agreement_version) as agreement_sum_p</d:field>
|
||||
</d:field_set>
|
||||
from agreement a
|
||||
join contract d on (a.contract_id=d.contract_id)
|
||||
@@ -107,6 +109,15 @@ select count(*) as cnt from agreement where 1=1
|
||||
</cfsavecontent>
|
||||
</cfoutput>
|
||||
|
||||
<cffunction name="_nFmt">
|
||||
<cfargument name="n"/>
|
||||
<cfif n EQ 0 OR !isNumeric(n)>
|
||||
<cfreturn "">
|
||||
<cfelse>
|
||||
<cfreturn replace(NumberFormat(n, ",.00"), ",", " ", "ALL")/>
|
||||
</cfif>
|
||||
</cffunction>
|
||||
|
||||
<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:th><!--- <a href="agreement.cfm?contract_id=&agreement_version="><img src="img/add.gif"/></a> ---></c:th>
|
||||
@@ -123,12 +134,15 @@ select count(*) as cnt from agreement where 1=1
|
||||
<c:column width="5%" field="dt_agreement" formatter=#function(dt){return dateformat(dt,"YYYY-MM-DD");}#><c:td class="c"/></c:column>
|
||||
<c:column width="15%" field="descr"/>
|
||||
<c:column width="2%" field="change_cnt"><c:td class="c"/></c:column>
|
||||
<c:column width="2%" field="agreement_sum" formatter=#_nFmt#><c:td class="r"/></c:column>
|
||||
<c:column width="2%" field="agreement_sum_p" formatter=#_nFmt#><c:td class="r"/></c:column>
|
||||
<c:column width="1%" sortable="false">
|
||||
<c:td field="f_link_del" class="c"/>
|
||||
</c:column>
|
||||
</c:table>
|
||||
<cfoutput>#gridFooter#</cfoutput>
|
||||
Создавать сделки (соглашения) нужно из договоров
|
||||
Под суммой понимается здесь сумма измененных позиций, а не изменение суммы от предыдущей версии!
|
||||
Создавать сделки (соглашения) нужно из договоров (потому что у нас сделка - это базовая или дополнительная версия фактуры договора с вероятностью, дополнительное или базовое соглашение к договору)
|
||||
|
||||
</cfif>
|
||||
<layout:page section="footer"/>
|
||||
|
||||
Reference in New Issue
Block a user