Add debug logging for deselect flow

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
John Pinkyfloyd 2026-03-09 10:11:54 -07:00
parent 65f236268c
commit 120930db4c

View file

@ -489,14 +489,17 @@
<cfelse>
<!--- Deselecting: for modifiers that are default-checked, keep with Quantity=0 --->
<!--- For root items or non-defaults, delete normally --->
<cfset arrayAppend(request.attachDebug, "DESELECT: ParentLineItemID=#ParentLineItemID#, ItemID=#ItemID#, qExisting.ID=#qExisting.ID#")>
<cfif ParentLineItemID GT 0>
<cfset qItemCheck = queryTimed(
"SELECT IsCheckedByDefault FROM Items WHERE ID = ? LIMIT 1",
[ { value = ItemID, cfsqltype = "cf_sql_integer" } ],
{ datasource = "payfrit" }
)>
<cfset arrayAppend(request.attachDebug, "DESELECT: qItemCheck.IsCheckedByDefault=#val(qItemCheck.IsCheckedByDefault)#")>
<cfif qItemCheck.recordCount GT 0 AND val(qItemCheck.IsCheckedByDefault) EQ 1>
<!--- Default modifier: keep with Quantity=0 for "NO X" display --->
<cfset arrayAppend(request.attachDebug, "DESELECT: Setting Quantity=0 for LIID=#qExisting.ID#")>
<cfset queryTimed(
"UPDATE OrderLineItems SET Quantity = 0 WHERE ID = ?",
[ { value = qExisting.ID, cfsqltype = "cf_sql_integer" } ],