Add OrderTotalCents to task details for cash collection

Returns order total in cents as integer for Flutter Works app
to display exact cash amount due for cash payment tasks.

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

View file

@ -114,6 +114,7 @@
"OrderRemarks": qTask.Remarks ?: "",
"OrderSubmittedOn": isDate(qTask.SubmittedOn) ? (dateFormat(qTask.SubmittedOn, "yyyy-mm-dd") & "T" & timeFormat(qTask.SubmittedOn, "HH:mm:ss")) : "",
"OrderTotal": 0,
"OrderTotalCents": 0,
"ServicePointID": qTask.ServicePointID ?: 0,
"ServicePointName": qTask.ServicePointName ?: "",
"ServicePointTypeID": qTask.ServicePointTypeID ?: 0,
@ -187,7 +188,9 @@
<cfset tipAmount = val(qTask.TipAmount)>
<cfset deliveryFee = (val(qTask.OrderTypeID) EQ 3) ? val(qTask.DeliveryFee) : 0>
<cfset platformFee = subtotal * 0.05>
<cfset result.OrderTotal = numberFormat(subtotal + taxAmount + tipAmount + deliveryFee + platformFee, "0.00")>
<cfset totalAmount = subtotal + taxAmount + tipAmount + deliveryFee + platformFee>
<cfset result.OrderTotal = numberFormat(totalAmount, "0.00")>
<cfset result.OrderTotalCents = round(totalAmount * 100)>
</cfif>
<cfset apiAbort({