From 791a652a9b9c9818b300f1747f271fcbc972aaf3 Mon Sep 17 00:00:00 2001 From: msyu Date: Fri, 29 Aug 2025 09:56:27 +0300 Subject: [PATCH] 018 some costs added --- Application.cfc | 2 +- contragent.cfm | 1 + deal.cfm | 19 ++++++++++--- deal_service.cfm | 72 +++++++++++++++++++++++++++++++++++++++++++----- 4 files changed, 82 insertions(+), 12 deletions(-) diff --git a/Application.cfc b/Application.cfc index 39eac9e..9e9365a 100644 --- a/Application.cfc +++ b/Application.cfc @@ -99,7 +99,7 @@ - + diff --git a/contragent.cfm b/contragent.cfm index f6b085f..9c9bf31 100644 --- a/contragent.cfm +++ b/contragent.cfm @@ -121,6 +121,7 @@ +сюда добавить сделок, договоров и т.д. additional_agreement @@ -288,7 +298,8 @@ #dateFormat(date_nop,'YYYY-MM-DD')# #dateFormat(date_end,'YYYY-MM-DD')# ПростаяКомпозитнаяis_easy=#is_easy# - #params# + #param_cnt# + #nFmt(line_cost)# #additional_agreement# diff --git a/deal_service.cfm b/deal_service.cfm index 6839c7b..66fbc9a 100644 --- a/deal_service.cfm +++ b/deal_service.cfm @@ -117,9 +117,36 @@
#d.user_description#
+
+
Количество
+
#d.cnt#
+
+ +
+
Скидка
+
#d.discount# %
+
+ +
+
Сумма
+
+ + 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= + + #nFmt(qParamCost.line_cost)# по строке, с количеством и скидкой (#nFmt(qParamCost.param_cost)# по компонентам) +
+
+
Версия
-
#d.version#
+
#d.version# + +
@@ -215,7 +242,9 @@ #qParam.params# (обратная ссылка)
- + + + type code name cnt ed_izm price - discount + Скидка% + Ст-ть deal __index @@ -273,20 +309,42 @@ #__id# - #__name# + #type# #code# #name# - #cnt# + #cnt# #ed_izm# - #price# + #price# #discount# + #nFmt(param_cost)# #deal# #__index# + + + Итого + #nFmt(total_cost)# + + + + + select __id::text, __index, version, date_nop, date_end, user_description, type, is_easy, cnt, discount, is_actual + ,(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 + where hash= + order by __index, version + + + + \ No newline at end of file