VAT Query for sales in spain

Hello,
Can SAP 8.8 deal with sales invoices to spain, specifically with something call a 'pharmacy scheme'. I'm informed that there are two elements to the VAT under this scheme. 1) Value added Tax. (18%)  2) Equivelance VAT (4%). Does SAP deal with this at all and if so, Is it possible to report on this for VAT purposes ?
Regards,
Juan

Have contacted SAP directly.

Similar Messages

  • Query for Sales Order Analysis

    Dear Experts
    I have written a Query for Sales Order Analysis and would like to have help on this.
    The query is used for generating daily report for Sales Order on number of documents (Sales Order), total amount of sales orders and total GP of Sales Order. The query is written as below:
    SELECT T0.[DocNum], SUM(T0.DocTotal) AS 'Total', SUM(T0.U_Total_GP) AS 'Total GP'
    FROM ORDR T0 WHERE T0.[DocDate] =[%0] GROUP BY T0.[DocNum] ORDER BY T0.[DocNum]
    where U_Total_GP is a UDF for storing the GP of each order.
    After executing the query, a selection criteria of date appears and after a date is selected, the report shown information required. However, the query does not calculate column total for total amount and total GP. Although I know the total for each column can be displayed by pressing "Ctrl" + Click on the column title, it would have to be done from time to time.
    Therefore, I would like to modify my query in order to calculate the column totals when executed. Are there any suggestions for this?
    Thank you
    Regards
    Elton

    Hi Elton,
    Try this:
    SELECT T0.[DocNum], SUM(T0.DocTotal) AS 'Total', SUM(T0.U_Total_GP) AS 'Total GP'
    FROM ORDR T0 WHERE T0.[DocDate] =[%0] GROUP BY T0.[DocNum]
    Union ALL
    SELECT '', SUM(T0.DocTotal) AS 'Total', SUM(T0.U_Total_GP) AS 'Total GP'
    FROM ORDR T0 WHERE T0.[DocDate] =[%0]
    ORDER BY T0.[DocNum]
    Thanks,
    Gordon

  • Req:validtion query for sales quotation

    Hi,
    I would like to put validation for sales quotation when Freight1 Tax Code at line level is not empty
    My query is:
    if @object_type ='23' and @transaction_type in ('A','U')
    begin
    if exists(SELECT *  FROM [dbo].[OQUT]  T0 INNER JOIN QUT2 T1 ON T0.DocEntry = T1.DocEntry
    INNER JOIN QUT1 T2 ON T0.DocEntry = T2.DocEntry
    WHERE T1.TaxCode is not null and T0 .DocEntry = @list_of_cols_val_tab_del and
    T2 .DocEntry =@list_of_cols_val_tab_del )
    select @error=N'001'
    select @error_message =N'Freight1 Tax code should be empty.'
    end
    but didnot get the result.Plz give the solution.

    Hi Md Zak,
    Try dis..
    IF (@object_type = '23' and (@transaction_type IN ('A','U')))
    BEGIN
    If Exists (SELECT T0.DocEntry  FROM OQUT T0 INNER JOIN QUT2 T1 ON T0.DocEntry = T1.DocEntry
    INNER JOIN QUT1 T2 ON T0.DocEntry = T2.DocEntry
    WHERE T1.TaxCode is not null and T0 .DocEntry = @list_of_cols_val_tab_del)
      Begin
      set @error = N'001'
      set @error_message = N'Freight1 Tax code should be empty.'
      End
    END
    Hope Helpfull
    Regards::::
    Atul Chakraborty

  • Query for Sales order and corr.AR Invoice Info

    Hi,
    I need to write a query which gives the flollowing sales order info along with the coressponding AR invoices info
    Sales Order columns reqd:
    OPERATING_UNIT
    ORDER_NUMBER
    CUSTOMER_NUM
    CUSTOMER_NAME
    ORDERED_DATE
    FLOW_STATUS_CODE
    TOTAL_ORDER_AMOUNT
    AR invoice columns reqd for the sales orders:
    Invoice number,
    Invoice date,
    Invoice Total.
    Can anyone help me out with this?
    Thanks,
    Ash

    Hi Ash,
    There are some issues that must be defined before you have the exact query.
    Do you have freight charges or non-inclusive tax? If you have, freight charges and tax amounts must be included?
    Depending on you grouping rule, you can have lines from more than one order in a single invoice. In this case, as invoice amount you want the sum of all lines, or only the lines from that order?
    Below is an example using two views. It assumes that grouping rules split lines from different order into different invoices.
    Hope it helps,
    Ketter Ohnes
    create or replace view order_summary as
    select oh.org_id,
    oh.ORDER_NUMBER,
    oh.header_id,
    ott.name tt_name,
    ca.account_number,
    p.party_name,
    oh.ordered_date,
    oh.flow_status_code,
    sum(ol.ordered_quantity*ol.unit_selling_price) total,
    sum(ol.tax_value) tax,
    (select sum(operand)
    from OE_PRICE_ADJUSTMENTS_v x
    where x.header_id = oh.header_id
    and x.adjustment_type_code='FREIGHT_CHARGE') freight_charge
    from oe_order_headers_all oh,
    oe_order_lines_all ol,
    hz_cust_accounts ca,
    hz_parties p,
    oe_transaction_types_tl ott
    where ol.header_id=oh.header_id
    and oh.sold_to_org_id = ca.cust_account_id
    and ca.party_id = p.party_id
    and oh.order_type_id = ott.transaction_type_id
    and ott.language =
    (select language_code
    from fnd_languages
    where installed_flag = 'B')
    group by oh.org_id,
    oh.header_id,
    oh.ORDER_NUMBER ,
    ott.name,
    ca.account_number,
    p.party_name,
    oh.ordered_date,
    oh.flow_status_code;
    create or replace view invoice_summary as
    select a.interface_header_context,
    a.trx_date,
    a.trx_number,
    b.interface_line_attribute1,
    b.interface_line_attribute2 tt_name,
    a.customer_trx_id,
    sum(b.extended_amount) invoice_total
    from ra_customer_trx_all a,
    ra_customer_trx_lines_all b
    where a.customer_trx_id = b.customer_trx_id
    and b.interface_line_context = 'ORDER ENTRY'
    and b.line_type in ('LINE','FREIGHT')
    group by a.interface_header_context,
    a.trx_date, a.trx_number,
    b.interface_line_attribute1,
    b.interface_line_attribute2,
    a.customer_trx_id;
    select *
    from order_summary o,
    invoice_summary i
    where o.order_number between :1 and :2
    and o.order_number = i.interface_line_attribute1
    and o.tt_name = i.tt_name;

  • Query for Sales Order and AR Invoice Information

    Hi,
    I need to write a query which gives the flollowing sales order info along with the coressponding AR invoices info
    Sales Order columns reqd:
    OPERATING_UNIT     
    ORDER_NUMBER     
    CUSTOMER_NUM     
    CUSTOMER_NAME     
    ORDERED_DATE     
    FLOW_STATUS_CODE     
    TOTAL_ORDER_AMOUNT
    AR invoice columns reqd for the sales orders:
    Invoice number,
    Invoice date,
    Invoice Total.
    Can anyone help me out with this?
    Thanks,
    Ash

    Hi Ash,
    Table RA_CUSTOMER_TRX_ALL can be joined to RA_CUSTOMER_TRX_LINES_ALL table through CUSTOMER_TRX_ID column. The table RA_CUSTOMER_TRX_LINES_ALL.INTERFACE_LINE_ATTRIBUTE6 = OE_ORDER_LINES_ALL.LINE_ID. And from the LineId, you can get the HeaderId os the OE_ORDER_HEADERS_ALL table.
    You must have visualized the query by now.
    Thanks
    Sumit

  • How to Create Specific SAP Query for Sales BOM

    Dear All Salute !!
    How I can create a SAP Query which provide information from the Sales Order-Line Item, this specific material is having any BOM or not?
    Suppose, user want Input,
    Sales Order No., Product Category, Duration of Sales Order Release.
    want Output,
    Sales Order No., Customer No., Customer Description, Sales Order Line Item, Material No., Material Description, Delivery Date, Quantity, Sales Order release Date
    Users requirement is, List of All Line Items for which BOM is yet to be Uploaded in the System.
    Please provide complete detail with Table & field by using SAP Query.
    Rgds
    Srivastav
    +91-9973504950

    If I am correct, in table KDST, you can see the details of Sales BOM with sale order.  Since right now, I dont have access to SAP, I am unable to confirm this.  You have to consider this table and develop on your own logic with the help of ABAPer.
    thanks
    G. Lakshmipathi

  • Warranty related query for sales item

    hi I need a report for checking an sales item is under warranty or not & also I want to know the status of the products which comes under warranty is in open state or closed state Regards, K.Ramasamy

    Hi,
    Try this query:
    SELECT T0.[ItemCode], T0.[ItemName], T1.[TmpltName], T1.[Deleted] FROM OITM T0  inner join OCTT T1 on  T0.[WarrntTmpl]  =  T1.[TmpltName] WHERE T0.[SellItem]  = 'y'
    Thanks.

  • Query For Sales Order Amendments

    Hi,
    Does anyone have a query that lists the amendments to a Sales Order?
    I basically want to create an alert that runs this query once a day and shows me the sales orders that have been amended that particular day.
    Any help on this would be gratefully received.
    Regards
    David

    Hi..
    Try These Query in Alert you will get your req. fulfill
    SELECT T0.[DocNum], T0.[DocStatus], T0.[DocDate], T0.[DocDueDate], T0.[CardCode], T0.[CardName] FROM ADOC T0 WHERE T0.[ObjType] = 17 AND  T0.[UpdateDate] = GETDATE()
    Regards,
    Bhavank
    Edited by: Bhavank on Sep 28, 2010 5:50 PM

  • Problems with Query for Sales

    i have problems with a query, i need that have the follows fields.
    SELECT T0.[DocNum] AS #Doc, T0.[NumAtCard] AS Referencia, T0.[docDate] AS Fecha, T0.[LicTradNum] AS RFC, T0.[CardName] AS 'Nombre del Cliente', T0.[DocTotalFC] AS TotME, T0.[DocRate] AS 'TC Fact', T0.[DocTotal] AS TotMS, T0.[VatSumFC] AS 'IVA ME', T0.[VatSum] FROM [dbo].[OINV]  T0
    But i need to know if this invoices have a PR, RF, RC,etc.
    I saw that ORIN(RIN1) is for -> RC, OINV(INV9) -> RF, ORCT  -> PR but i dont know how make a correctly INNER JOIN. When the invoice have a PR giveme Num of  PR, if the invoice have a RC giveme the number of document destination.
    So, how can i join these tables for get that information.
    Thank you for you help.

    SELECT *  FROM ORDR T0 
    INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry
    This is a basic inner join created from the SAP Query Generator
    Template would be
    Select <field names> FROM <base table name>
    Inner join <table you want to join> on <<condition you want to two tables to joins>>
    or
    Simply you can write it
    SELECT *  FROM ORDR T0, RDR1 T1 WHERE  T0.DocEntry = T1.DocEntry
    it will do the same thing and you can simply join more tables.
    Hope this will help...
    Sanjaya

  • Query For Sale Register

    Hi Expert I am trying a query in this query i got these feild - TransType,Docdate,Docnum,CardName,Tinno,Impoexp,Exportsale,Outward Transfer/Central Sale,form No,Total sale,Local sale,Taxcode, output tax amount total Sale including Tax,Receiver Location . Through This Query----
    select tmp1.form as [TRANS TYPE],tmp1.Docdate,tmp1.DocNum,tmp1.CardName,tmp1.TaxId11 as [TIN NO.],tmp1.IMPOREXP ,tmp1.Import as [EXPORT SALE],tmp1.INVTRANS as 'OutWard Transfer/Central Sale',tmp1.FormNo ,tmp1.Import+tmp1.INVTRANS 'TotalSale',tmp1.B4Tax as [LOCAL SALE],tmp1.TaxCode AS [TAX CODE],tmp1.VatSum as [OUTPUT TAX AMOUNT] ,tmp1.DocTotal 'TOTAL SALE INCLUDING TAX' ,tmp1.Location AS [RECEIVER LOCATION] from ( SELECT 1 'Order1','Sales-N' 'Form', T0.Docdate,T0.DocNum ,T0.CardName,T2.TaxId11 ,(case when t3.TfcId=1 then T0.DocTotal else 0 end)DocTotal ,(case when t3.TfcId=2 then T0.DocTotal else 0 end) 'INVTRANS' ,'' 'FormNo' , (case when t3.TfcId=1 then T1.TaxCode else null end)TaxCode ,(case when t3.TfcId=1 then T0.VatSum else 0 end)VatSum, (case when t3.TfcId=1 then (T0.Doctotal-T0.VatSum-t0.totalexpns) else 0 end) 'B4Tax' ,T2.IMPOREXP, 0 'Import' ,T5.Location FROM [dbo].[OINV] T0 Left Outer Join INV1 T1 ON T0.DocEntry = T1.DocEntry left outer join INV12 T2 on T0.DocEntry = T2.DocEntry left outer join OSTC T3 on T1.TaxCode = T3.Code left Outer join owhs T4 on T4.whsCode = T1.WhsCode left OUTER Join OLCT T5 on T5.Code = T4.Location where T1.LineNum = (select Top 1 linenum from INV1 where INV1.DocEntry = T0.DocEntry ) and T3.TfcId in('1','2') and T2.IMPOREXP 'Y' and T0.DocType = 'I' and t0.docdate>='[%0]' and t0.docdate<='[%1]' Union SELECT 2 'Order1','Sales-Y' 'Form',T0.Docdate,T0.DocNum ,T0.CardName,T2.TaxId11 ,0 ,0,'','', 0,0 ,T2.IMPOREXP,T0.DocTotal 'Import' ,T5.Location FROM [dbo].[OINV] T0 Left Outer Join INV1 T1 ON T0.DocEntry = T1.DocEntry left outer join INV12 T2 on T0.DocEntry = T2.DocEntry left outer join OSTC T3 on T1.TaxCode = T3.Code left Outer join owhs T4 on T4.whsCode = T1.WhsCode left OUTER Join OLCT T5 on T5.Code = T4.Location where T1.LineNum = (select Top 1 linenum from INV1 where INV1.DocEntry = T0.DocEntry ) --and T3.TfcId = 1 and T2.IMPOREXP = 'Y' and T0.DocType = 'I' and t0.docdate>='[%0]' and t0.docdate<='[%1]' union select tmp3.Order1,'INV' 'Form', tmp3.DocDate,tmp3.DocNum,tmp3.[CardName], tmp3.TaxId11,0,sum(tmp3.DocTotal) 'INVTRANS',isnull(tmp3.FormNo,'') 'FormNo' ,'' 'TaxCode', 0 'VatSum', 0 'B4Tax', '' 'IMPOREXP' , 0 'Import', tmp3.fromloc from (SELECT 3 'Order1',T4.Location 'fromloc',T0.[DocNum], T0.[DocDate],T0.U_INV_Transferor, T0.[CardName] ,T6.Transcat,(t10.credit)DocTotal ,T0.U_TIN_NO, T9.TaxId11,T6.FormNo FROM OWTR T0 INNER JOIN WTR1 T1 ON T0.DocEntry = T1.DocEntry AND T1.LINENUM = 0 AND Substring(T0.Filler,1,3) <> Substring(T1.WhsCode,1,3) INNER JOIN WTR12 T6 ON T0.DocEntry = T6.DocEntry INNER JOIN OJDT T7 ON T0.TransId = T7.TransId and T0.objtype = T7.transtype inner join jdt1 t10 on t7.transid=t10.transid left outer join owhs T2 on T2.whsCode = T0.filler left Outer join owhs T3 on T3.whsCode = T1.WhsCode left OUTER Join OLCT T4 on T4.Code = T2.Location left OUTER Join OLCT T5 on T5.Code = T3.Location left outer join OCRD T8 on T0.CardCode = T8.CardCode left outer join (select * from crd7 where crd7.addrtype = 'S') T9 on T8.CardCode = T9.CardCode and isnull(T9.Address,'') '' where T0.Jrnlmemo 'Cancelled' and isnull(T0.Comments,'') not like 'Inventory transfer no. % has been cancelled' --and T4.Location = 'MUMBAI' and t0.docdate>='[%0]' and t0.docdate<='[%1]' ) tmp3 group by tmp3.Order1, tmp3.DocDate,tmp3.DocNum,tmp3.U_INV_Transferor, tmp3.TaxId11,tmp3.[CardName], tmp3.U_TIN_NO,tmp3.FormNo, tmp3.fromloc union SELECT 4 'Order1','AR Credit-N' 'Form', T0.Docdate,T0.DocNum ,T0.CardName,T2.TaxId11 ,(case when t3.TfcId=1 then -T0.DocTotal else 0 end)DocTotal ,0 'INVTRANS','' 'FormNo' , (case when t3.TfcId=1 then T1.TaxCode else null end)TaxCode ,(case when t3.TfcId=1 then -T0.VatSum else 0 end)VatSum, (case when t3.TfcId=1 then -(T0.Doctotal-T0.VatSum-t0.totalexpns) else 0 end) 'B4Tax' ,T2.IMPOREXP, 0 'Import' ,T5.Location FROM [dbo].[ORIN] T0 Left Outer Join RIN1 T1 ON T0.DocEntry = T1.DocEntry left outer join RIN12 T2 on T0.DocEntry = T2.DocEntry left outer join OSTC T3 on T1.TaxCode = T3.Code left Outer join owhs T4 on T4.whsCode = T1.WhsCode left OUTER Join OLCT T5 on T5.Code = T4.Location where T1.LineNum = (select Top 1 linenum from RIN1 where RIN1.DocEntry = T0.DocEntry ) and T0.DocType = 'I' and T3.TfcId = 1 and T2.IMPOREXP <> 'Y' and t0.docdate>='[%0]' and t0.docdate<='[%1]' union SELECT 5 'Order1','AR Credit-Y' 'Form',T0.Docdate,T0.DocNum ,T0.CardName,T2.TaxId11 ,0 ,0,'','', 0,0 ,T2.IMPOREXP,-T0.DocTotal 'Import' ,T5.Location FROM [dbo].[ORIN] T0 Left Outer Join RIN1 T1 ON T0.DocEntry = T1.DocEntry left outer join RIN12 T2 on T0.DocEntry = T2.DocEntry left outer join OSTC T3 on T1.TaxCode = T3.Code left Outer join owhs T4 on T4.whsCode = T1.WhsCode left OUTER Join OLCT T5 on T5.Code = T4.Location where T1.LineNum = (select Top 1 linenum from RIN1 where RIN1.DocEntry = T0.DocEntry ) --and T3.TfcId = 1 and T2.IMPOREXP = 'Y' and T0.DocType = 'I' and t0.docdate>='[%0]' and t0.docdate<='[%1]' )tmp1 --where Tmp1.Location = 'SAHIBABAD' order by docdate, order1
    Now i want modifiy this report like TransType,Docdate,Docnum,CardName,Tinno,Impoexp,Exportsale,Central Sale,TAx Code of central Tax,TAx Amount of central Tax,form No,Total sale,Local sale,Taxcode, output tax amount total Sale including Tax,Inventory Transfer Doctotal,Receiver Location .
    Thanks in Advance & regard Khan

    Hi Khan,
    Can you share your solved Sales Register query with us?
    Regards,
    Vincent

  • Approval Query  for Sale Delivery Problem

    Hello,
    I have to set approval procedure of Sale Delivery in following condition
    If i add sale order for Specific item for 10 Qty for example C01 customer & after that i add sale order for same item qty 10 for another customer ie C02 & i have stock for that item 50 but user give delivery first to C02 in staid of C01 but C01 give me first order
    on this condition i have to set approval user can't deliver second sale order first he have to take approval from manager to do this & he deliver first order first then then don't have to need approval.
    Can any one help me?

    Hi,
    Row level approval is not possible in SBO.
    You may check this for your reference: http://www.beonesolutions.com/ip/Solutions/ap.html
    Thanks,
    Joseph

  • Vat window for sales order

    hi,
         how to print and download vatwindow for salesorder.plz give me any ex.

    Hi,
    What is your requirement?  Vat window means is it in form or any other window,
    any you can down load a form from Utilities-> More Utilities-> Download
    from there you can download the form and priting the form With T-Code NACE
    you have to assign your Form and Driver prg. name.
    Regards
    Ganesh

  • Select query for sales order for particular customer oder text and storage

    Hi All,
    I am trying to retriev customer order text and customer storage bin from the following select query, but it's giving huge number of records, I want to restrict the number of records.
    Select customer order text, customer storage bin
                       Select STXH–TDOBJECT, STXH–TDID
                       Where  TDOBJECT = VBBP
                              TDID = Y001
                              TDID = Y007
    Please let me know how to restirct the number of records.
    Thanks,
    Ranjan

    Try using the FM 'READ_TEXT'.
    NAME will be the order number concatenated with the item number.
    And you have the ID and OBJECT.  You may also need to use the LANGUAGE.
    Message was edited by:
            Matt Nagel

  • Query for Totals on a Sales Order

    Does someone have a query for sales order that sums the total # of orders for each user and sums total quantity and Amts?
    Thanks

    That would not be a hard query to write.  If you have started on the query, you may paste it if you are having difficulties getting the desired result.
    Suda

  • Report for Sales and purchase tax (selection criteria-Tax code)

    Hi
    I have one query for sales tax details which gives me detail for all A/R invoices and taxes involved in it. But i want that while executing query system should ask tax code and gives detail of tax amount in front of item and invoice according to tax code selected.
    The query is:
    SELECT M.DocNum AS 'Inv.No ', M.DocDate as 'Date', M.CardName as 'Customer Name',L.Dscription,L.Quantity,L.Price, (Select Sum(LineTotal) FROM INV1 L Where L.DocEntry=M.DocEntry) as 'Base Amt.(Rs.)', (SELECT Avg(TaxRate) FROM INV4 where statype=1 and DocEntry=M.DocEntry) as ' VAT % ', (SELECT Sum(TaxSum) FROM INV4 where statype=1 and DocEntry=M.DocEntry) as ' VAT (Rs.) ', (SELECT Avg(TaxRate) FROM INV4 where statype=4 and DocEntry=M.DocEntry) as ' CST % ', (SELECT Sum(TaxSum) FROM INV4 where statype=4 and DocEntry=M.DocEntry) as ' CST (Rs.) ', (SELECT Avg(TaxRate) FROM INV4 where statype=7 and DocEntry=M.DocEntry) as ' TAXEXEMPT % ', (SELECT Sum(TaxSum) FROM INV4 where statype=7 and DocEntry=M.DocEntry) as ' TAXEXEMPT ', (SELECT Avg(TaxRate) FROM INV4 where statype=8 and DocEntry=M.DocEntry) as ' VAT% ', (SELECT Sum(TaxSum) FROM INV4 where statype=8 and DocEntry=M.DocEntry) as 'VAT12.5 ', (SELECT Avg(TaxRate) FROM INV4 where statype=9 and DocEntry=M.DocEntry) as ' CST 2% ', (SELECT Sum(TaxSum) FROM INV4 where statype=9 and DocEntry=M.DocEntry) as ' CST @2 ', (SELECT Avg(TaxRate) FROM INV4 where statype=11 and DocEntry=M.DocEntry) as ' CENVCST % ', (SELECT Sum(TaxSum) FROM INV4 where statype=11 and DocEntry=M.DocEntry) as ' CENVCST ', (SELECT Avg(TaxRate) FROM INV4 where statype=-90 and DocEntry=M.DocEntry) as ' BED % ', (SELECT Sum(TaxSum) FROM INV4 where statype=-90 and DocEntry=M.DocEntry) as ' BED ', (SELECT Avg(TaxRate) FROM INV4 where statype=-60 and DocEntry=M.DocEntry) as ' Cess% ', (SELECT Sum(TaxSum) FROM INV4 where statype=-60 and DocEntry=M.DocEntry) as ' Cess ', (SELECT Avg(TaxRate) FROM INV4 where statype=-55 and DocEntry=M.DocEntry) as ' HCess % ', (SELECT Sum(TaxSum) FROM INV4 where statype=-55 and DocEntry=M.DocEntry) as ' Hcess ', L.LineTotal as 'Row Total (Rs.)',M.DocTotal as 'Doc Total' FROM OINV M LEFT OUTER JOIN INV1 L on L.DocEntry=M.DocEntry LEFT OUTER JOIN INV4 T on T.DocEntry=L.DocEntry and L.LineNum=T.LineNum LEFT OUTER JOIN INV5 J ON M.DocEntry = J.AbsEntry LEFT OUTER JOIN INV3 Q ON M.DocEntry = Q.DocEntry WHERE (M.DocDate >= '[%0]' AND M.DocDate <= '[%1]') AND TargetType ! = 14 GROUP BY M.DocNum,M.DocDate,M.CardName,M.NumAtCard,M.DocEntry,M.DiscSum,M.WTSum,L.Dscription,L.Quantity,L.Price,L.LineTotal,M.DocTotal ORDER BY M.DocNum,M.DocDate,M.CardName,M.NumAtCard,M.DocEntry,M.DiscSum,M.WTSum,L.Dscription,L.Quantity,L.Price,L.LineTotal,M.DocTotal
    I want 2 queries which asks tax code during selection criteria for both cases sales and purchase.

    Hi Malhotra,
    Try this,
    1st remove the FROM/TO Doc. Date where Condition in your Query report.
    AND add the below where condition in your Query report.
    WHERE statype = '[%0]'
    OR
    Try this Query Report.
    SELECT
    M.DocNum as 'A/R Invoice No.',
    M.DocDate as 'Inv. Date',
    M.CardCode as 'Customer Code',
    M.CardName as 'Customer Name',
    M.NumAtCard as 'Bill No. & Date',
    ISNULL(L.ItemCode,'Service Item') as 'Item Code',
    L.Dscription,
    L.Quantity,
    L.LineTotal,
    L.TaxCode,
    L.[VatSum],
    M.WTSum AS 'TDS (Rs.)',
    M.DocTotal as 'Total (Rs.)'
    FROM OINV M
    LEFT OUTER JOIN INV1 L on L.DocEntry=M.DocEntry
    LEFT OUTER JOIN INV4 T on T.DocEntry=L.DocEntry and L.LineNum=T.LineNum
    LEFT OUTER JOIN INV5 J ON M.DocEntry = J.AbsEntry
    LEFT OUTER JOIN INV3 Q ON M.DocEntry = Q.DocEntry
    WHERE
    (M.DocDate >= '[%0]' AND M.DocDate <= '[%1]')
    AND
    L.TaxCode='[%2]'
    GROUP BY
    M.DocNum,M.DocDate,M.CardCode,M.CardName,M.NumAtCard,L.ItemCode,L.Dscription,L.Quantity,
    L.LineTotal,M.DocEntry,M.[DiscSum],L.TaxCode,L.[VatSum],M.WTSum,M.DocTotal
    ORDER BY
    M.DocNum,M.DocDate,M.CardCode,M.CardName,M.NumAtCard,L.ItemCode,L.Dscription,L.Quantity,
    L.LineTotal,M.DocEntry,M.[DiscSum],L.TaxCode,L.[VatSum],M.WTSum,M.DocTotal
    Regards,
    Madhan.

Maybe you are looking for