041 inmem decimal fix, -m workaround
This commit is contained in:
+1
-1
@@ -109,7 +109,7 @@
|
|||||||
|
|
||||||
<!--- global settings --->
|
<!--- global settings --->
|
||||||
<!--- *************************************************************************************************************** --->
|
<!--- *************************************************************************************************************** --->
|
||||||
<cfset request.APP_VERSION="0.00.040"/><!--- ************************************************************************ --->
|
<cfset request.APP_VERSION="0.00.041"/><!--- ************************************************************************ --->
|
||||||
<!--- *************************************************************************************************************** --->
|
<!--- *************************************************************************************************************** --->
|
||||||
<cfheader name="X-Application-Version" value=#request.APP_VERSION#/>
|
<cfheader name="X-Application-Version" value=#request.APP_VERSION#/>
|
||||||
<cfset request.STAND=getStand()/>
|
<cfset request.STAND=getStand()/>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
component {
|
component {
|
||||||
|
/*0.04 precision fix DECIMAL(128,32) maybe too memory consumable*/
|
||||||
/*0.03 precision fix*/
|
/*0.03 precision fix*/
|
||||||
/*0.02 timestamp support*/
|
/*0.02 timestamp support*/
|
||||||
/**
|
/**
|
||||||
@@ -71,7 +72,7 @@ component {
|
|||||||
case "BIGINT": return "BIGINT";
|
case "BIGINT": return "BIGINT";
|
||||||
case "DOUBLE": case "FLOAT": case "REAL": return "DOUBLE";
|
case "DOUBLE": case "FLOAT": case "REAL": return "DOUBLE";
|
||||||
case "BOOLEAN": case "BIT": return "BIT";
|
case "BOOLEAN": case "BIT": return "BIT";
|
||||||
case "DECIMAL": case "NUMERIC": return "DECIMAL";
|
case "DECIMAL": case "NUMERIC": return "DECIMAL(128,32)";
|
||||||
case "TIMESTAMP": case "DATE": case "TIME": return "TIMESTAMP";
|
case "TIMESTAMP": case "DATE": case "TIME": return "TIMESTAMP";
|
||||||
default: return "LONGVARCHAR"; // И тут тоже
|
default: return "LONGVARCHAR"; // И тут тоже
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,7 +87,7 @@
|
|||||||
<!--- Важно: если в периоде было 2+ цены, то строки должны быть замножены, а цена за период перестает иметь смысл (не показывать же среднее арифметическое, это неправильно) --->
|
<!--- Важно: если в периоде было 2+ цены, то строки должны быть замножены, а цена за период перестает иметь смысл (не показывать же среднее арифметическое, это неправильно) --->
|
||||||
<!--- Left Outer Join with Free Tier --->
|
<!--- Left Outer Join with Free Tier --->
|
||||||
<cfquery name="qSpec" dbtype="query">
|
<cfquery name="qSpec" dbtype="query">
|
||||||
select s.catalogName as svc, s.component, s.serviceCode as service_code, NULL as sku_code, s.fullCode as code, s.measureShort as unit
|
select s.catalogName as svc, s.component, s.serviceCode as service_code, s.fullCode as sku_code, s.fullCode as code, s.measureShort as unit
|
||||||
, s.priceWVat as price
|
, s.priceWVat as price
|
||||||
,s.componentDiscount as component_discount, s.serviceDiscount as service_discount, s.serviceQuantity as service_quantity, s.componentQuantity as component_quantity
|
,s.componentDiscount as component_discount, s.serviceDiscount as service_discount, s.serviceQuantity as service_quantity, s.componentQuantity as component_quantity
|
||||||
,coalesce(s.serviceQuantity*(100-s.serviceDiscount)/100*s.priceWVat*(100-s.componentDiscount)/100,0) as discounted_price
|
,coalesce(s.serviceQuantity*(100-s.serviceDiscount)/100*s.priceWVat*(100-s.componentDiscount)/100,0) as discounted_price
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
|
|
||||||
UNION
|
UNION
|
||||||
|
|
||||||
select s.catalogName as svc, s.component, s.serviceCode as service_code, NULL as sku_code, s.fullCode as code, s.measureShort as unit
|
select s.catalogName as svc, s.component, s.serviceCode as service_code, s.fullCode as sku_code, s.fullCode as code, s.measureShort as unit
|
||||||
, s.priceWVat as price
|
, s.priceWVat as price
|
||||||
,s.componentDiscount as component_discount, s.serviceDiscount as service_discount, s.serviceQuantity as service_quantity, s.componentQuantity as component_quantity
|
,s.componentDiscount as component_discount, s.serviceDiscount as service_discount, s.serviceQuantity as service_quantity, s.componentQuantity as component_quantity
|
||||||
,coalesce(s.serviceQuantity*(100-s.serviceDiscount)/100*s.priceWVat*(100-s.componentDiscount)/100,0) as discounted_price
|
,coalesce(s.serviceQuantity*(100-s.serviceDiscount)/100*s.priceWVat*(100-s.componentDiscount)/100,0) as discounted_price
|
||||||
@@ -107,9 +107,9 @@
|
|||||||
WHERE s.fullCode NOT IN (<cfqueryparam value="#ValueList(qFreeTier.code)#" cfsqltype="cf_sql_varchar" list="true">)
|
WHERE s.fullCode NOT IN (<cfqueryparam value="#ValueList(qFreeTier.code)#" cfsqltype="cf_sql_varchar" list="true">)
|
||||||
AND s.serviceType = 3
|
AND s.serviceType = 3
|
||||||
</cfquery>
|
</cfquery>
|
||||||
<cfloop query="qSpec">
|
<!--- <cfloop query="qSpec">
|
||||||
<cfset qSpec.sku_code = (len(qSpec.code) GT 2) ? qSpec.code.left(qSpec.code.len() - 2) : qSpec.code/>
|
<cfset qSpec.sku_code = (len(qSpec.code) GT 2) ? qSpec.code.left(qSpec.code.len() - 2) : qSpec.code/>
|
||||||
</cfloop>
|
</cfloop> --->
|
||||||
|
|
||||||
<cfif (ATTRIBUTES.debug)>
|
<cfif (ATTRIBUTES.debug)>
|
||||||
qSpec (Left Outer Join with Free Tier)
|
qSpec (Left Outer Join with Free Tier)
|
||||||
|
|||||||
@@ -97,7 +97,8 @@
|
|||||||
priceWVat=local.component.priceWVat,
|
priceWVat=local.component.priceWVat,
|
||||||
componentDiscount=local.component.discount,
|
componentDiscount=local.component.discount,
|
||||||
atomicCode=local.component.atomicCode,
|
atomicCode=local.component.atomicCode,
|
||||||
fullCode="#local.component.componentCode#-#listGetAt('i,f,m',local.service.serviceType)#"
|
//fullCode="#local.component.componentCode#-#listGetAt('i,f,m',local.service.serviceType)#"
|
||||||
|
fullCode="#reReplace(local.component.componentCode, '-.$', '')#" //truncate -m garbage
|
||||||
}])/>
|
}])/>
|
||||||
</cfloop>
|
</cfloop>
|
||||||
</cfloop>
|
</cfloop>
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
|
|
||||||
SQL SELECT
|
|
||||||
s.code,m.code as m_code,s.service_code as service_code,s.svc,s.component,s.unit,
|
|
||||||
s.price*(100-s.discount)/100 as discounted_price
|
|
||||||
,s.price,s.discount,m.raw_metric,m.metric,s.serviceStart,s.serviceEnd,s.serviceHash,s.serviceCustomName,m.dt,s.free_tier,m.dimension_1,m.dimension_1_name ||'x' as dimension_1_name,m.dimension_2,m.dimension_2_name
|
|
||||||
FROM qSpec as s, qUnifiedMetric as m
|
|
||||||
WHERE m.wz='62'
|
|
||||||
AND s.code=m.code
|
|
||||||
AND s.serviceStart <= m.dt
|
|
||||||
AND (m.dt <= s.serviceEnd OR s.serviceEnd IS NULL)
|
|
||||||
|
|
||||||
|
|
||||||
UNION ALL
|
|
||||||
SELECT NULL, m.code, NULL, NULL, NULL, NULL, 0,
|
|
||||||
NULL, NULL, m.raw_metric, m.metric, NULL, NULL, NULL, NULL, m.dt, 0, m.dimension_1, m.dimension_1_name ||'y', m.dimension_2, m.dimension_2_name
|
|
||||||
FROM qUnifiedMetric as m where m.code NOT IN ('5','6')
|
|
||||||
|
|
||||||
UNION ALL
|
|
||||||
SELECT s.code, NULL, s.service_code, s.svc, s.component, s.unit, s.price*(100-s.discount)/100 as discounted_price,
|
|
||||||
s.price, s.discount, NULL, NULL, s.serviceStart, s.serviceEnd, s.serviceHash, s.serviceCustomName, NULL, 0, NULL, NULL, NULL, NULL
|
|
||||||
FROM qSpec as s where s.code NOT IN ('5','6')
|
|
||||||
order by m.dt, m.code, dimension_1, dimension_2
|
|
||||||
Reference in New Issue
Block a user