My assumption is that this is possible but I'm quite stuck.
I've written a simple test function using a form object and it seems like it should work but I haven't been able to figure out how to call it.
Here's the function as I've written it:
- float newSale.CalculateGrandTotal(New_Sale newSale)
- {
- grandTotal = 0.0;
- if (newSale.Type_of_Payment == "Cash/Check")
- {
- grandTotal = (newSale.Price_before_Tax * (1 + newSale.Sales_Tax / 100)).round(2);
- }
- return grandTotal;
- }
Will this work as I've written it and how do I call it to simply return 'grandTotal' into 'input.grandTotal'?