004 number clean fix

This commit is contained in:
msyu 2025-06-19 16:31:34 +03:00
parent 62de4c0de6
commit c61b42ddfe
3 changed files with 23 additions and 4 deletions

View File

@ -69,7 +69,7 @@
<!--- <cfset this.datasources["#this.datasource#"]=getDS("#this.datasource#","datasource_#this.datasource#")/> --->
<cfset request.RECORDS_PER_PAGE=500/>
<cfset request.APP_VERSION="0.00.003"/>
<cfset request.APP_VERSION="0.00.004"/>
<cflock scope="application" type="readonly" timeout=3>
<cfset request.APP_NAME=this.Name/>

View File

@ -60,7 +60,17 @@ function filterOn(filter) {
request.filterOn = filterOn;
function stripWhiteSpace(sNumber) {
return reReplace(sNumber, "[[:space:]]", "", "ALL");
function hexToChar( required string hexEncoded ) {
return( chr( inputBaseN( hexEncoded, 16 ) ) );/*https://www.bennadel.com/blog/4516-which-whitespace-characters-does-trim-remove-in-coldfusion.htm*/
}
return reReplace(sNumber, "[[:space:]"
& hexToChar('00A0') & hexToChar('180E')
& hexToChar('2000')& hexToChar('2001')& hexToChar('2002')& hexToChar('2003')& hexToChar('2004') & hexToChar('2005')
& hexToChar('2006')& hexToChar('2007')& hexToChar('2008')& hexToChar('2009')& hexToChar('200A')
& hexToChar('200B') & hexToChar('202F') & hexToChar('205F') & hexToChar('3000') & hexToChar('FEFF') &
"]", "", "ALL");
/*return reReplace(sNumber, "[[:space:]"& chr(0x00A0) & "]", "", "ALL");*/
}
request.stripWhiteSpace = stripWhiteSpace;
/*

View File

@ -38,6 +38,15 @@
<cfset queryAddRow(qLastVersion,[0,1,0,""])/>
<!--- <cfdump var=#lastVersion#/> --->
</cfif>
<cfquery name="qAgreement">
select a.agreement, a.dt_agreement, a.contract_id
from specification_item si
join specification s on (si.specification_id=s.specification_id)
join agreement a on (s.contract_id=a.contract_id)
where si.specification_item_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#specification_item_uid#" null=#!IsValid('guid',specification_item_uid)#/>
AND a.agreement_version = <cfqueryparam cfsqltype="cf_sql_integer" value="#agreement_version#" null=#!IsValid('integer',agreement_version)#/>
</cfquery>
<!--- <cfdump var=#pageInfo#/>
@ -51,7 +60,7 @@
<d:param field="specification_item_version" type="varchar" size="1023" init="#qLastVersion.specification_item_version#" preprocessor=#cleanInput#/>
<d:param field="quantity" type="numeric" init=#qLastVersion.quantity#/>
<d:param field="price" type="numeric" init=#qLastVersion.price# preprocessor=#request.stripWhiteSpace#/>
<d:param field="dt_from" type="timestamp" format="yyyy-MM-dd" forNull="" init="#dateFormat(Now(),'YYYY-MM-DD')#"/> <!--- !!! Important yyyy-MM-dd NOT YYYY-MM-DD --->
<d:param field="dt_from" type="timestamp" format="yyyy-MM-dd" forNull="" init="#qAgreement.dt_agreement#"/> <!--- !!! Important yyyy-MM-dd NOT YYYY-MM-DD --->
<d:param field="dt_to" type="timestamp" format="yyyy-MM-dd" forNull="" init=""/> <!--- !!! Important yyyy-MM-dd NOT YYYY-MM-DD --->
<d:param field="creator_id" type="integer" value="#request.usr_id#" skipUpdate/>
@ -162,7 +171,7 @@
/>
(версия-номер соглашения)
<!--- *** можно придумать коструктор ссылок с декоратором tr.fwx --->
<cfif d.agreement_version GT 0>
<cfif d.agreement_version GE 0>
<a href="agreement.cfm?agreement_version=#d.agreement_version#&contract_id=#qSpecificationItem.contract_id#&#tr.fwx#">
#d.agreement_version#
</a>