Continuing to work with my POS change calculating routine. Basically works fine except for one kink. Based on an amount placed in a UDF called amount tendered on the totals tab, my script calculates change due (or balance due). Net amount of payment gets put into the deposit field. Unfortunately, the net invoice field does not automatically update until you hit QUICK PRINT or ACCEPT (at which time everything looks consistent) Alternatively, if you have already entered your payment and you go back to the lines tab and change something, then go back to the totals tab, the net invoice changes, but my script will not fire because none of the input fields on the totals tab have changed. Tried attached the script to the write event of the detail lines, however the invoice totals have not yet updated when the event fires so the change calculation is still not done correctly until such time as you hit QUICK PRINT ACCEPT. Trying to eliminate the confusion of a cashier looking at the screen which has not yet updated the change due field before they print/accept. So the question becomes how do you force the a recalc of all the totals short of toggling between tabs? If found the CalculateTotals() function of SO_InvoiceHeader, but it doesn't seem to do anything. Can only assume I'm not using it correctly. retval = oHeaderObj.CalculateTotals() // attached to a script in the SO_InvoiceDetail - oHeaderObj.InvoiceTotal doesn't change? retval from the function seems to indicate success (value of 1)
↧