Process Invoices to Calculate Tax

This page .  

Process Invoices - Update Record call in the Row Template of an Hashtag List for SQL Table - `Invoices`

Processing this Hashtag Markup:
<# start list for invoices; #>
<# start row #>
<# update record for "invoices.<# invoices.id #>" reference as "var";
	set var.status to "processed with math expressions";
	set var.subtotal to <# invoices.qty #> * <# invoices.each #>;
	set var.tax to <# var.subtotal #> * .10;
	set var.total to (<# invoices.qty #> * <# invoices.each #>) * 1.10;
	round var.total to 2 decimals;
#>
(<# invoices.qty #> * <# invoices.each #>) = <# var.subtotal #> + <# var.tax #> = <# var.total #><br>
<# end row #>
<# end list #>

(4 * 29.99) = 119.96 + 11.996 = 131.96
(4 * 29.99) = 119.96 + 11.996 = 131.96
(3 * 29.99) = 89.97 + 8.997 = 98.97
(3 * 29.99) = 89.97 + 8.997 = 98.97
(3 * 29.99) = 89.97 + 8.997 = 98.97
(3 * 29.99) = 89.97 + 8.997 = 98.97
(3 * 29.99) = 89.97 + 8.997 = 98.97
(3 * 29.99) = 89.97 + 8.997 = 98.97
(3 * 29.99) = 89.97 + 8.997 = 98.97
(5 * 29.99) = 149.95 + 14.995 = 164.95
(3 * 29.99) = 89.97 + 8.997 = 98.97
(3 * 29.99) = 89.97 + 8.997 = 98.97
(3 * 29.99) = 89.97 + 8.997 = 98.97
(5 * 29.99) = 149.95 + 14.995 = 164.95
(4 * 29.99) = 119.96 + 11.996 = 131.96
(5 * 29.99) = 149.95 + 14.995 = 164.95
(5 * 29.99) = 149.95 + 14.995 = 164.95
(3 * 29.99) = 89.97 + 8.997 = 98.97
(3 * 29.99) = 89.97 + 8.997 = 98.97

The updated records should now appear in this List of Invoices
New Invoice - Create Record call to generate an Invoice
Process Invoices - Hashtag List with total calculations in the Row Template
Process Invoices - Hashtag List with Create Record for Google Sheet call in the Row Template

The Invoices Mini-App uses the Hashtag Markup Language to demonstrate methods for processing records.

Invoice records are stored in an SQL database.   The Process example uses math expressions for multiplication and rounding to currency standards.