Fix subtotal/itemCount null handling in history API
Use val() instead of ?: for SUM results that may be empty strings Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
e9eb708de1
commit
405914c586
1 changed files with 2 additions and 2 deletions
|
|
@ -109,8 +109,8 @@ try {
|
||||||
AND (OrderLineItemIsDeleted = 0 OR OrderLineItemIsDeleted IS NULL)
|
AND (OrderLineItemIsDeleted = 0 OR OrderLineItemIsDeleted IS NULL)
|
||||||
", { orderId: { value = row.OrderID, cfsqltype = "cf_sql_integer" } });
|
", { orderId: { value = row.OrderID, cfsqltype = "cf_sql_integer" } });
|
||||||
|
|
||||||
itemCount = qItems.ItemCount ?: 0;
|
itemCount = val(qItems.ItemCount);
|
||||||
subtotal = qItems.Subtotal ?: 0;
|
subtotal = val(qItems.Subtotal);
|
||||||
tax = subtotal * 0.0875;
|
tax = subtotal * 0.0875;
|
||||||
total = subtotal + tax;
|
total = subtotal + tax;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue