Skip to content
+1-888-319-3663

COMMUNITY FORUM

Purchase Order Header Taxes calculated from Lines

Arthur asked 3 years ago
I am importing a purchase order that has tax calculated at the line level but I can’t seem to find a way to sum the calculated tax to use in the header, anyone got any ideas?
Answers
Patrick Roth Staff answered 3 years ago
Arthur,
It isn’t possible to do a SUM on a calculation in SC.  However what you can do is that after you get your calculated tax amount – store that in a custom global variable that you create such as GBL_TOTALTAX.
So your code is something like (simple for example):
taxamount = _EXTENDEDCOST * .20
return taxamount
just store that in the global
taxamount = _EXTENDEDCOST * .20
GBL_TOTALTAX = GBL_TOTALTAX  + taxamount 
return taxamount
Then make another calculation for the “total” tax amount which is simple – it just needs that value.
CALC_TOTALTAX
return GBL_TOTALTAX
Lastly if you are integrating multiple po’s at a time, you’ll want to clear that value so that the previous doc amount tax doesn’t roll into the 2nd document.
Easiest is to make a “before document” task and clear the variable
CLEAR_VARIABLE
GBL_TOTALTAX = 0
return true
 
 
 
 
Arthur replied 3 years ago

Hi Patrick,

Will this still calculate when I am grouping the header and only returning one line for the header?

thanks

Ethan Sorenson Staff replied 2 years ago

Arthur,

Yes it will, because it will parse through each line in the line mapping and create the calculation so the total is available before the header is created.


If you would like to submit an answer or comment, please sign in to the eOne portal.