v1.0.99: шаг7 — isNumeric валидация price/qty/sum

This commit is contained in:
2026-06-22 07:50:38 +04:00
parent aa16b12d53
commit c195844466
2 changed files with 7 additions and 7 deletions
+6 -6
View File
@@ -75,9 +75,9 @@
<cfif action EQ "ADD">
<cfset nr = op.new_row>
<cfset nm = structKeyExists(nr, 'name') ? nr.name : ''>
<cfset pr = (structKeyExists(nr, 'price') AND len(nr.price)) ? nr.price : ''>
<cfset qt = (structKeyExists(nr, 'qty') AND len(nr.qty)) ? nr.qty : ''>
<cfset sm = (structKeyExists(nr, 'sum') AND len(nr.sum)) ? nr.sum : ''>
<cfset pr = (structKeyExists(nr, 'price') AND isNumeric(nr.price)) ? nr.price : ''>
<cfset qt = (structKeyExists(nr, 'qty') AND isNumeric(nr.qty)) ? nr.qty : ''>
<cfset sm = (structKeyExists(nr, 'sum') AND isNumeric(nr.sum)) ? nr.sum : ''>
<cfset ds = (structKeyExists(nr, 'date_start') AND len(nr.date_start)) ? nr.date_start : ''>
<cfquery name="evt" datasource="baza">
@@ -120,9 +120,9 @@
<cfthrow message="UPDATE target not found: #th#">
</cfif>
<cfset nv = structKeyExists(op, 'new_values') ? op.new_values : {}>
<cfset newPrice = structKeyExists(nv, 'price') AND len(nv.price) ? nv.price : old.price>
<cfset newQty = structKeyExists(nv, 'qty') AND len(nv.qty) ? nv.qty : old.qty>
<cfset newSum = structKeyExists(nv, 'sum') AND len(nv.sum) ? nv.sum : old.sum>
<cfset newPrice = structKeyExists(nv, 'price') AND isNumeric(nv.price) ? nv.price : old.price>
<cfset newQty = structKeyExists(nv, 'qty') AND isNumeric(nv.qty) ? nv.qty : old.qty>
<cfset newSum = structKeyExists(nv, 'sum') AND isNumeric(nv.sum) ? nv.sum : old.sum>
<cfset newDate = structKeyExists(nv, 'date_start') AND len(nv.date_start) ? nv.date_start : old.date_start>
<cfquery name="evt" datasource="baza">