Monday 15 June 2015

Credit Memo TAX Line for Applied Credit Memo

Oracle has provide the facility of Creating Credit memo with Invoice line Application Details i.e. when a Credit Note is imported into Oracle we can import it with the application details of an invoice or a Debit Memo.

The Application works for both LINE and TAX records but the way Oracle handles the Credit Memo application for TAX and LINE type records is different

For LINE type record AutoInvoice allows over application import even though the actual line amount is less that the CM line amount.

but for TAX line such case doesnt worl and the maximum amount permissible is the TAX line amount of the applied invoice

EG :

You have an invoice and a CN like below :


Now when we import the Credit Note into Oracle we will expect Oracle to import the Credit Note like the above scenario with Credit Lines having the amounts as expected with corresponsiding applications to invoice,
But when the import is done the credit Note gets Imported as below :

If you observe the TAX line 2 is imported with amount 75 and not 80 , but LINE 2 is imported with amount 180 as expected.

In this Case when Credit Note is imported LINE 1 will be applied to LINE 1 of invoice and will have 0 Open amount , Same for TAX line 1

For LINE 2 the amount 150 will be applied to Invoice LINE 2 and 30 will be open. For TAX line 2 the invoice will be imported with Amount 75 , same as the Invoice TAX line amount and the same will be fully applied 

This is how Autoinvoice is designed to work for Credit Note Applied TAX line import.

If you are faced with such a scenario to avoid in future you can follow the below approach :

1. Create On Account Credit Memo and perform the application manually in Oracle outside Auto Invoice import Process





Monday 1 June 2015

SQL to check Order Line Pricing

When we do a pricing of a Sales Order  on a bulk level we may need to check the Re-Pricing Status to see if all the lines have been re-priced successfully or not.

In order to see the if the line pricing is successful or not we can use the below SQL

    select distinct ooh.org_id,ool.creation_date,ool.line_id,ooh.order_number,ool.line_number,ool.ordered_item,ool.unit_selling_price,qlh.name,qll.operand,qll.start_date_active,ool.flow_status_code
 ,ool.calculate_price_flag,ool.unit_list_price
 from oe_order_headers_all ooh,
      oe_order_lines_all ool,
      wsh_delivery_details wdd,
      qp_list_headers qlh,
       qp_list_lines qll,
       qp_pricing_attributes qpa,
       mtl_system_items_b msib
 where ooh.header_id = ool.header_id
 and ool.line_id = wdd.source_line_id
 and wdd.released_status in ('R','B')
 and qlh.list_header_id = qpa.list_header_id
 and qpa.product_attr_value = to_char(msib.inventory_item_id)
 and msib.organization_id = :warehouse_id
 and msib.segment1 = ool.ordered_item
 and qpa.list_line_id = qll.list_line_id
 and ool.price_list_id = qlh.list_header_id
and ooh.order_number = :order_number
 and ool.unit_selling_price <>qll.operand
;

For the rows returned by the SQL we need to check the value of calculate_price_flag.
If Calculate_price_flag = N , if we see on front end the value will be Freeze which means that the item re-pricing will not be allowed,

If there are some records where calculate_price_flag = Y and no re-pricing is done please check if any manual modifier is applied on order line, If any modifier is applied overrding the Price List Price then re-pricing will not take place