Allow completing orphaned cash tasks without payment processing

Skip cash validation and processing for tasks with no linked order.
These are likely test tasks that were created before order linking.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
John Pinkyfloyd 2026-02-16 12:26:24 -08:00
parent dc2d66b50b
commit df903a9c75

View file

@ -110,7 +110,8 @@
<!--- === CASH TASK VALIDATION === --->
<cfset cashResult = {}>
<cfif isCashTask>
<!--- Skip cash processing for orphaned tasks (no order linked) --->
<cfif isCashTask AND qTask.OrderID GT 0>
<cfif CashReceivedCents LTE 0>
<cfset apiAbort({ "OK": false, "ERROR": "cash_required", "MESSAGE": "Cash amount is required for cash tasks." })>
</cfif>
@ -258,7 +259,7 @@
<!--- === CASH TRANSACTION PROCESSING === --->
<cfset cashProcessed = false>
<cfif isCashTask AND CashReceivedCents GT 0>
<cfif isCashTask AND CashReceivedCents GT 0 AND qTask.OrderID GT 0>
<!--- Credit customer change to their balance --->
<cfif changeCents GT 0 AND customerUserID GT 0>
<cfset queryTimed("