Tuesday, December 01, 2015

Calculate Sales Order Tax and Lines / Order Total

Standard Package to show Sales order Line Basic/ Tax Value and Total Value (Basic+Tax)

Sometime we Need to show Line wise or Complete Order Taxes / Tax+Basic in few reports, for this , oracle has provided a standard Package to Calculate these values, based on parameter passed.



Package Name: oe_totals_grp.get_order_total

Below are the Illustration of this package with example.

For Example: 1 Order have 3 lines, and each one have taxes attached on it.


  Header ID: 23096

  Line ID: 36492----Line Value=1,045.00----Tax on this Line ----87.52----TOTAL VALUE---1132.52
  Line ID: 36494----Line Value=505.00-----Tax on This Line ----42.3-----T0TAL VALUE---547.3
  Line ID: 36495----Line Value=1,750.00---Tax on this Line ----146.56---T0TAL VALUE---1896.56



  Calculate Line wise Tax

    select nvl(oe_totals_grp.get_order_total (HEADER_ID, LINE_ID, 'TAXES'),0) from dual;
 
 For Ex:
 
    select nvl(oe_totals_grp.get_order_total (23096, 36492, 'TAXES'),0) LINE_Tax from dual;
   
    Output : LINE_Tax=87.52
 
 
  Calculate Order Taxes (All Lines)


    select nvl(oe_totals_grp.get_order_total (HEADER_ID, NULL, 'TAXES'),0) from dual;
 
 
   Ex:
 
   select nvl(oe_totals_grp.get_order_total (23096, null, 'TAXES'),0) Order_Tax from dual;
 
 
   Output : Order_Tax: 276.38
 
 
 
 
 
    Calculate Line wise Value (Without Tax)

    select nvl(oe_totals_grp.get_order_total (HEADER_ID, LINE_ID, 'LINES'),0) from dual;
 
 
    Ex:
 
      select nvl(oe_totals_grp.get_order_total (23096, 36492, 'LINES'),0)  LINE_BASIC from dual;
   
   
      Output : LINE_BASIC=1045
   
 
  Calculate All Lines Total (Without Tax)

    select nvl(oe_totals_grp.get_order_total (HEADER_ID, NULL, 'LINES'),0) from dual;
 
 
     Ex:
 
   select nvl(oe_totals_grp.get_order_total (23096, null, 'LINES'),0) Order_Basic from dual;
 
 
   Output : Order_Basic: 3300
 
 
 
 
   Calculate Line wise Value ( With Tax)

    select nvl(oe_totals_grp.get_order_total (HEADER_ID, LINE_ID, 'ALL'),0) from dual;
 
 
     Ex:
 
      select nvl(oe_totals_grp.get_order_total (23096, 36492, 'ALL'),0)  LINE_TOTAL from dual;
   
   
      Output : LINE_TOTAL=1132.52
 


    
  Calculate Order Total Value (With Tax)

    select nvl(oe_totals_grp.get_order_total (HEADER_ID, NULL, 'ALL'),0) from dual;
 
     Ex:
 
   select nvl(oe_totals_grp.get_order_total (23096, null, 'ALL'),0) Order_Total from dual;
 
 
   Output : Order_Total: 3576.38

3 comments:

  1. Excellent Blog! I would like to thank for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. I wanted to thank you for this websites! Thanks for sharing. Great websites! קורס מכירות

    ReplyDelete
  2. I really appreciate the kind of topics you post here. Thanks for sharing us a great information that is actually helpful. Good day! federal tax bracket calculator

    ReplyDelete

Clear BNE Cache for WebADI Changes

It Sometime happens that WebAdi Changes doesn't reflect once migrated in controlled instances. Here are the quick steps(Generally perfor...