011 some totals
This commit is contained in:
parent
9033dcd59a
commit
2a3781fcea
@ -69,7 +69,7 @@
|
|||||||
<!--- <cfset this.datasources["#this.datasource#"]=getDS("#this.datasource#","datasource_#this.datasource#")/> --->
|
<!--- <cfset this.datasources["#this.datasource#"]=getDS("#this.datasource#","datasource_#this.datasource#")/> --->
|
||||||
|
|
||||||
<cfset request.RECORDS_PER_PAGE=500/>
|
<cfset request.RECORDS_PER_PAGE=500/>
|
||||||
<cfset request.APP_VERSION="0.00.010"/>
|
<cfset request.APP_VERSION="0.00.011"/>
|
||||||
|
|
||||||
<cflock scope="application" type="readonly" timeout=3>
|
<cflock scope="application" type="readonly" timeout=3>
|
||||||
<cfset request.APP_NAME=this.Name/>
|
<cfset request.APP_NAME=this.Name/>
|
||||||
|
@ -298,6 +298,10 @@
|
|||||||
order by i.specification_id
|
order by i.specification_id
|
||||||
</cfquery>
|
</cfquery>
|
||||||
|
|
||||||
|
<cfquery dbtype="query" name="qTotal">
|
||||||
|
select sum(cost) as cost from qItem
|
||||||
|
</cfquery>
|
||||||
|
|
||||||
<cfoutput>
|
<cfoutput>
|
||||||
<p>
|
<p>
|
||||||
Строки спецификаций (#qItem.recordCount#) (все суммы без вероятности)
|
Строки спецификаций (#qItem.recordCount#) (все суммы без вероятности)
|
||||||
@ -385,6 +389,13 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</cfoutput>
|
</cfoutput>
|
||||||
</cfoutput>
|
</cfoutput>
|
||||||
|
<cfoutput query="qTotal">
|
||||||
|
<tr>
|
||||||
|
<td colspan="13"></td>
|
||||||
|
<td class="r" style="font-size:120%">#cost#</td>
|
||||||
|
<td colspan="99"></td>
|
||||||
|
</tr>
|
||||||
|
</cfoutput>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
</cfif>
|
</cfif>
|
||||||
|
@ -188,11 +188,15 @@
|
|||||||
,(select siv.price from specification_item_version siv
|
,(select siv.price from specification_item_version siv
|
||||||
join agreement a on (siv.agreement_version=a.agreement_version AND a.contract_id=s.contract_id)
|
join agreement a on (siv.agreement_version=a.agreement_version AND a.contract_id=s.contract_id)
|
||||||
where siv.specification_item_uid=i.specification_item_uid AND a.is_actual
|
where siv.specification_item_uid=i.specification_item_uid AND a.is_actual
|
||||||
order by siv.agreement_version desc limit 1) as price,
|
order by siv.agreement_version desc limit 1) as price
|
||||||
(select siv.price*siv.quantity from specification_item_version siv
|
,(select siv.price*siv.quantity from specification_item_version siv
|
||||||
join agreement a on (siv.agreement_version=a.agreement_version AND a.contract_id=s.contract_id)
|
join agreement a on (siv.agreement_version=a.agreement_version AND a.contract_id=s.contract_id)
|
||||||
where siv.specification_item_uid=i.specification_item_uid AND a.is_actual
|
where siv.specification_item_uid=i.specification_item_uid AND a.is_actual
|
||||||
order by siv.agreement_version desc limit 1) as cost
|
order by siv.agreement_version desc limit 1) as cost
|
||||||
|
,(select siv.price*siv.quantity*a.probability_perc/100 from specification_item_version siv
|
||||||
|
join agreement a on (siv.agreement_version=a.agreement_version AND a.contract_id=s.contract_id)
|
||||||
|
where siv.specification_item_uid=i.specification_item_uid AND a.is_actual
|
||||||
|
order by siv.agreement_version desc limit 1) as cost_p
|
||||||
,(select siv.dt_from from specification_item_version siv
|
,(select siv.dt_from from specification_item_version siv
|
||||||
join agreement a on (siv.agreement_version=a.agreement_version AND a.contract_id=s.contract_id)
|
join agreement a on (siv.agreement_version=a.agreement_version AND a.contract_id=s.contract_id)
|
||||||
where siv.specification_item_uid=i.specification_item_uid AND a.is_actual
|
where siv.specification_item_uid=i.specification_item_uid AND a.is_actual
|
||||||
@ -211,6 +215,10 @@
|
|||||||
order by 2
|
order by 2
|
||||||
</cfquery>
|
</cfquery>
|
||||||
|
|
||||||
|
<cfquery dbtype="query" name="qTotal">
|
||||||
|
select sum(cost) as cost, sum(cost_p) as cost_p from qItem
|
||||||
|
</cfquery>
|
||||||
|
|
||||||
<cfoutput>
|
<cfoutput>
|
||||||
<p>
|
<p>
|
||||||
Фактура - строки спецификации, актуальная версия (#qItem.recordCount#)
|
Фактура - строки спецификации, актуальная версия (#qItem.recordCount#)
|
||||||
@ -238,6 +246,7 @@
|
|||||||
<th>Количество</th>
|
<th>Количество</th>
|
||||||
<th>Цена</th>
|
<th>Цена</th>
|
||||||
<th>Стоимость</th>
|
<th>Стоимость</th>
|
||||||
|
<th>Ст-сть с вер.</th>
|
||||||
|
|
||||||
<th> </th>
|
<th> </th>
|
||||||
|
|
||||||
@ -264,7 +273,7 @@
|
|||||||
<td class="r">#quantity#</td>
|
<td class="r">#quantity#</td>
|
||||||
<td class="r">#price#</td>
|
<td class="r">#price#</td>
|
||||||
<td class="r">#cost#</td>
|
<td class="r">#cost#</td>
|
||||||
|
<td class="r">#cost_p#</td>
|
||||||
|
|
||||||
<td class="c"></td>
|
<td class="c"></td>
|
||||||
<td class="c">#item_version_count#</td>
|
<td class="c">#item_version_count#</td>
|
||||||
@ -281,6 +290,14 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</cfoutput>
|
</cfoutput>
|
||||||
|
<cfoutput query="qTotal">
|
||||||
|
<tr>
|
||||||
|
<td colspan="8"></td>
|
||||||
|
<td class="r" style="font-size:120%">#cost#</td>
|
||||||
|
<td class="r" style="font-size:120%">#cost_p#</td>
|
||||||
|
<td colspan="8"></td>
|
||||||
|
</tr>
|
||||||
|
</cfoutput>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
Можно собрать версию спецификации на произвольную дату, а можно по версии определенного соглашения (это возможно, потому что соглашение меняет каждую строку не более 1 раза)
|
Можно собрать версию спецификации на произвольную дату, а можно по версии определенного соглашения (это возможно, потому что соглашение меняет каждую строку не более 1 раза)
|
||||||
|
@ -257,7 +257,9 @@
|
|||||||
order by 2
|
order by 2
|
||||||
</cfquery>
|
</cfquery>
|
||||||
|
|
||||||
<!--- <cfdump var=#qItem#/> --->
|
<cfquery dbtype="query" name="qTotal">
|
||||||
|
select sum(cost) as cost, sum(cost_p) as cost_p from qItem
|
||||||
|
</cfquery>
|
||||||
|
|
||||||
<cfoutput>
|
<cfoutput>
|
||||||
<p>
|
<p>
|
||||||
@ -316,22 +318,25 @@
|
|||||||
<td class="r">#quantity#</td>
|
<td class="r">#quantity#</td>
|
||||||
<td class="r">#price#</td>
|
<td class="r">#price#</td>
|
||||||
<td class="r">#cost#</td>
|
<td class="r">#cost#</td>
|
||||||
<td class="r">#cost_p#</td>
|
<td class="r">#cost_p#</td>
|
||||||
|
|
||||||
<td class="c">#dateFormat(dt_from,'DD.MM.YYYY')#</td>
|
<td class="c">#dateFormat(dt_from,'DD.MM.YYYY')#</td>
|
||||||
<td class="c">#dateFormat(dt_to,'DD.MM.YYYY')#</td>
|
<td class="c">#dateFormat(dt_to,'DD.MM.YYYY')#</td>
|
||||||
|
<td class="c"></td>
|
||||||
<td class="c"></td>
|
|
||||||
|
|
||||||
<td class="c">#item_version_count#</td>
|
<td class="c">#item_version_count#</td>
|
||||||
<td><a href="agreement.cfm?contract_id=#contract_id#&agreement_version=#agreement_version#&#tr.fwx#">#agreement# #dateFormat(dt_agreement,'DD.MM.YYYY')# <cfif len(probability_perc)>#probability_perc#%</cfif></td>
|
<td><a href="agreement.cfm?contract_id=#contract_id#&agreement_version=#agreement_version#&#tr.fwx#">#agreement# #dateFormat(dt_agreement,'DD.MM.YYYY')# <cfif len(probability_perc)>#probability_perc#%</cfif></td>
|
||||||
<td class="c"><a href="specification_item_version.cfm?specification_item_uid=#specification_item_uid#&agreement_version=#qItem.agreement_version#&#tr.fwx#">#qItem.agreement_version#</a> <cfif is_actual><img src="img/ok.png"/></cfif></td>
|
<td class="c"><a href="specification_item_version.cfm?specification_item_uid=#specification_item_uid#&agreement_version=#qItem.agreement_version#&#tr.fwx#">#qItem.agreement_version#</a> <cfif is_actual><img src="img/ok.png"/></cfif></td>
|
||||||
|
|
||||||
|
|
||||||
<td class="c">
|
<td class="c">
|
||||||
<c:link_del canWrite=#pageInfo.writePermitted()# entity="specification_item" key="specification_item_uid" id=#specification_item_uid# fwx=#tr.fwx#/>
|
<c:link_del canWrite=#pageInfo.writePermitted()# entity="specification_item" key="specification_item_uid" id=#specification_item_uid# fwx=#tr.fwx#/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</cfoutput>
|
||||||
|
<cfoutput query="qTotal">
|
||||||
|
<tr>
|
||||||
|
<td colspan="8"></td>
|
||||||
|
<td class="r" style="font-size:120%">#cost#</td>
|
||||||
|
<td class="r" style="font-size:120%">#cost_p#</td>
|
||||||
|
<td colspan="8"></td>
|
||||||
|
</tr>
|
||||||
</cfoutput>
|
</cfoutput>
|
||||||
</table>
|
</table>
|
||||||
<br/>
|
<br/>
|
||||||
|
Loading…
Reference in New Issue
Block a user