DI API: Wrong PriceAfterVAT value in credit note based on A/R invoice

Hi all,
I have serious problem with creating Credit Note based on existing A/R Invoice in Sales module.
I use SBO 2004A patch level 32. With SDK I've created A/R Invoice with 2 items. First item has discount percent 0% and price after VAT 1. Second item has 100% discount, this means, doctotal is 1. Document VAT is 7,6% and VAT is calculated correctly in invoice. Then I've created credit note only with 1 item and this row is bounded with 1 row in invoice. After calling oCreditNote.Add, in Business One this credit note has all prices (price, price after VAT, row total) with the same value -> there is no vat calculated although in invoice the vat calculated is.
Is it bug in DI API or do I something wrong?
I use the standard ways to create new invoice and credit note through DI API.
Many thanks for your answers.
Best regards
Libor.

Hi Libor,
To create a Credit note for a Invoice you should use the Invoice as the base document for the Credit note. Here is an example of how I create a GRPO from a draft GRPO. Try this (for your Invoice - Credit Note) and see if it does not work for you (SAP suggests this way of doing it).
(Draft will be your invoice - GRPO will be your credit note)
Dim oDraft As SAPbobsCOM.Documents
Dim oGRPO As SAPbobsCOM.Documents
If oDraft.GetByKey(YourInvoiceNumber) Then
                        'Build the GRPO (new GRPO Obj for each GRPO Doc)
                        oGRPO = oComp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes)
                        oGRPO.DocDate = oDraft.DocDate
                        oGRPO.DocDueDate = oDraft.DocDueDate
                        oGRPO.DiscountPercent = oDraft.DiscountPercent
                        oGRPO.CardCode = oDraft.CardCode
                        For i = 0 To oDraft.Lines.Count - 1
                            oDraft.Lines.SetCurrentLine(i)
                            oGRPO.Lines.BaseType = oDraft.Lines.BaseType
                            oGRPO.Lines.BaseEntry = oDraft.Lines.BaseEntry
                            oGRPO.Lines.BaseLine = oDraft.Lines.BaseLine
                            If i < oDraft.Lines.Count - 1 Then
                                oGRPO.Lines.Add()
                            End If
                        Next i
                        'Add the GRPO
                        iRetCode = oGRPO.Add
                        If iRetCode <> 0 Then
                            oComp.GetLastError(iRetCode, sErrMsg)
                            Log.WriteLog("Error Adding GRPO : " & sErrMsg, EventLogEntryType.Warning)
                            Return False
                        End If
                    End If

Similar Messages

  • Credit note based on AR invoice but base unit changed to Yes

    Is there anyway to improve the current design which allow the users to change the base unit column to Yes if the credit note is copied from AR invoice?

    What is your reason to change unit?  It may not be logical to change it even if you wrongly created your invoice.  When you create Credit Memo, it has to be consistent with AR invoice even if it is wrong!
    Thansk,
    Gordon

  • Creating Credit Note based on Invoice

    HI there,
    I am trying to create a Credit Note through the DIAPI using VB. This Credit Note must be linked to the Invoice 88 for example :
      Try *
                'Get the required business object *
                ''Dim oCreditDoc As SAPbobsCOM.Documents = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oCreditNotes)*
                Dim queryString As String*
                Dim oRecSet As SAPbobsCOM.Recordset*
                oRecSet = oCompany.GetBusinessObject(300)*
                queryString = "SELECT T0.CardCode from OINV T0 where T0.DocNum = 88 "*
                oRecSet.DoQuery(queryString)*
               Dim oCreditDoc As SAPbobsCOM.Documents = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oCreditNotes)*
                'Set the business partner code*
                oCreditDoc.CardCode = oRecSet.Fields.Item(0).Value*
                'set the documents due date -mandatory*
                oCreditDoc.DocDueDate = Now*
                'add first line on invoice*
                'use the SO order specified in the text box *
                'as a base document*
                oCreditDoc.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oInvoices*
                oCreditDoc.Lines.BaseEntry = CInt("88")*
                oCreditDoc.Lines.BaseLine = 0*
                'add the new invoice document*
                lRetCode = oCreditDoc.Add*
                'check return code*
                If lRetCode <> 0 Then*
                    oCompany.GetLastError(lErrCode, sErrMsg)*
                    MsgBox("Error : " & lErrCode & " : " & sErrMsg)*
                Else*
                    'store newly created object code in a new string*
                    '(could have stored it in OrdCodeStr)*
                    Dim OrdCodeStr2 As String*
                    OrdCodeStr2 = ""*
                    oCompany.GetNewObjectCode(OrdCodeStr2)*
                    MsgBox(" Created Credit Note : " & OrdCodeStr2)*
               End If*
            Catch ex As Exception*
                MsgBox("Exception. Connect: " & ex.Message)*
            End Try*
    I am getting an "Item code missing" error. Does this mean i must set up each and every line to credit? What if there are millions of lines? Can we not just set a BaseEntry and BaseType for the document as a whole so it knows which Invoice needs to be credited completely?
    Kind regards,
    Greeshma
    p.s. i tried to get this to display as code but seems this editor is either confusing me or it doesnt work! sorry. when i find the right person to complain about it to i will!
    Edited by: Greeshma Gulab on Nov 18, 2009 11:13 AM
    Edited by: Greeshma Gulab on Nov 18, 2009 11:15 AM

    Hi,
    I am not able to make out ur code because of the formating problem, but anyways check the below thread, it might be helpful to u..
    Create Credit Memo based on A/R Invoice
    Vasu Natari.

  • AP Credit Note copied from AP Reserve Invoice

    Hi all
    AP Credit Note copied from AP Reserve Invoice cannot be posted with missing G/L account error.
    This is similar to error posting AP Reserve Invoice and fixed by SBO version 9 patch 10 in SAP Note 1893780.
    Now the error when posting AP Reserve Invoice is solved but cannot post when copied AP Reserve Invoice to AP Credit Note.
    Kedalene

    Hi
    Please see error message.

  • Create Credit Memo based on A/R Invoice

    Hello Gurus,
    Is it possible to create a A/R Credit Memo based on A/R Invoices through DI API or DI Server?  Please help.

    Hi Gilbert Ngo
    Yes it is possible, here is an example of how i added a invoice based on a sales order, just change it as you require.
    Dim oInvoice As SAPbobsCOM.Documents
            oInvoice = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)
            oInvoice.CardCode = BPCode.Text
            oInvoice.DocDueDate = Now
            oInvoice.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oOrders
            oInvoice.Lines.BaseEntry = CInt(OrderStr)
            oInvoice.Lines.BaseLine = 0
            oInvoice.Lines.Add()
            oInvoice.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oOrders
            oInvoice.Lines.BaseEntry = CInt(OrderStr)
            oInvoice.Lines.BaseLine = 1
            lRetCode = oInvoice.Add
            oCompany.GetLastError(lErrCode, sErrMsg)
            If lRetCode <> 0 Then
                MessageBox.Show("Not Added" & lErrCode & " " & sErrMsg)
            ElseIf lRetCode = 0 Then
                'oCompany.GetNewObjectCode(OrderStr)
                MsgBox("Added Invoice")
            End If
    PLEASE NOTE THAT oInvoice.Lines.BaseEntry = CInt(OrderStr) is refereing TO THE DOCENETRY AND NOT THE DOCNUM of the base doc.
    Hope this helps

  • Invoice value on Credit Note

    Hello All,
    I intend to get the actual AR invoice value on the AR credit note.
    This is considering that I am not creating the credit note to the full value of the invoice.
    I would essentially like to show the actual AR INvoice value, the correct value (diff bw the invoice value and teh credit note value) and the difference.
    I am editing the standard AR CN layout, and cant find the invoice tables in the database list.
    How to resolve this ?
    Cheers,
    Gautam

    Yes Gordon, I am using PLD.
    However when I use the copy to function from AR Inv -> AR CN , how is the relationship between these two tables maintained ?
    I am sure there must be some field in the ARCN table which at least keeps the parent invoice number ? Is there any such field present,which I can query and use ?
    Thanks,
    Gautam

  • Wrong taxes while issueing credit note to customer

    Hi,
    We are using FB75 to create credit note to customer as we charged excess amount in original service tax bill through oversight.
    Invoice details are as below.
    Basic Cost              1,75,000.00
    Service tax 10.3% -  18,025.00
    Total                        1,93.025.00
    But in credit note service tax is calculated at 16% even though we are using same tax code as per original invoice.
    Kindly help.
    With Best Regards,
    Rajkumar

    Dear Rajkumr,
    This may be caused due to configuration change after the original invoice and before the credit note posting. Please check the configuration (specially tax rate) in FTXP transaction.
    Thanks!!!
    Murlidhar Khatri

  • How can we identify which credit note applied to which AR Invoice?

    Hi,
    We are in 11.5.10.2.
    We want to migrate all the open transactions data of AR.I have few questions as given below :
    1.How do we identify in Invoice Entry screen where a credit memo is linked to Invoice.
    2.One credit note & 3 Invoices are applied with a Receipt,so how we can identify the invoice which is applied with credit note.
    3.Is there any possibility of applying credit memo directly to AR Invoice with out the receipt screen.

    Hello.
    1.How do we identify in Invoice Entry screen where a credit memo is linked to Invoice.
    2.One credit note & 3 Invoices are applied with a Receipt,so how we can identify the invoice which is applied with credit note.Query the invoice and navigate to Action/Installments/Activities.
    3.Is there any possibility of applying credit memo directly to AR Invoice with out the receipt screen. You probably can use an API. There are a lot of questions about this is the forum.
    Octavio

  • Credit Note With Out Incoming Excise invoice

    Hi guys,
    I want to know what are the A/R Credit Memos that still has not been converted intlo Incoming Excise Invoices.
    will any  body please provide me a query for the same.
    I have tried a query for displaying the Incoming Excise Invoices which has credit note as a  base document by this query.
    SELECT distinct T0.[DocNum], T0.[DocDate], T0.[CardName],  T1.[BaseRef] as 'Credit Note No', T1.[BaseType]
    FROM OIEI T0  INNER JOIN IEI1 T1 ON T0.DocEntry = T1.DocEntry
    WHERE T0.[DocDate] between '[%0]' and '[%1]' and T1.BaseType ='14'
    Thanks & Regards,
    Vamsi.

    You may try:
    SELECT distinct T0.[DocNum], T0.[DocDate], T0.[CardName]
    FROM dbo.ORIN T0 
    INNER JOIN dbo.RIN1 T1 ON T0.DocEntry = T1.DocEntry
    WHERE T0.[DocDate] between '[%0]' and '[%1]' and T1.TargetType != XXX
    You need to replace XXX with the object type for Incoming Excise invoice.
    You may check these threads if you don't know the type:
    list of object type for sp_transactionnotification
    SP_Notification | From where to find the list of Object Type details

  • One  credit  note  with reference to several invoices??

    Hello,
    my  customer  came  up  with  specia  requirement ,
    Is  it  possible  to  have  One  credit  note request  with reference to several invoices??
    I  never  seen  but  your  input  would  be  helpful.
    Points  will  be  added  for  helpful  answer.
    Thanks  and  best  regards
    L

    yes its possible. go like thru va01 with return order type then go to menu-> sales document->create with reference
    you can copy more than one invoices for raise credit request.
    Reg
    NAr

  • AR Credit Note not being added.

    Hi All,
    I'm trying to add a AR Credit Note based on a AR Invoice. The only thing that I change is the Warehouse code that the credit note should be credited to. The error that I receive is "Document cannot be added because the base document row was updated. Copy the document again from its base document. Message[439-197]".
    Can this be because of the warehouse code I changed? We change the warehouse code continuesly without error this is the first one.
    I'm on SBO 2007A SP00 PL42.
    Any help will be greatly appreciated.
    Thanks
    Lou

    hiii Lourens
    NO, that should not be the reason, i guess you have some returns, try adding taking base doc as return?
           check this thread
    This document cannot be added Error
                                                              Good Luck 
                                                                              RIYAZ

  • Credit note for invoice with item with negative value

    Hi,
    is it possible to create credit note for invoice, where in one line is negative value (its non stock item).
    There exists 2 possibilities:
    negative qty and positive price (its possible create only through SDK, not SBO)
    positive price and negative qty
    for example
    itemcode 123
    qty -1
    price 1000
    How to create credit note from this invoice?
    Thanks a lot for hints.
    Petr

    Hello Petr Verner,
    It's a standard functionality of Business one, that it is impossible to enter a negative amount in an independant credit note or in a credit note based on a invoice with negative amount.
    To solve this issue:
    1.  For the rows with the positive Row Total, create an "independent" Credit Memo (not based on an Invoice).
    2.  For the rows with the negative Row Total, create another Invoice with a positive Row Total opposite to the original negative Row, and reconcile between the two rows manually via Banking => Bank Statements and Reconciliations => Reconciliation.
    Hope the above helps.
    Wilma Wang
    SAP Business One Forums Team

  • Value Contracts for Credit note

    Dear Friends,
    Can we create Value contracts for Credit note processing?
    Please refer to the below scenario:
    I have certain budget that needs to be distributed to some of the customers depending upon the claims (Credit Notes).
    This budget is included in Value contract and values are released through orders (Credit note order). I specify total budget in Target Value of Value contract and as and when the credit note is created, the value of credit note is updated in Released Value.
    But when I create credit note, order value is being captured in Negative in released value of Contract document.
    If total target value is utilized, I need to restrict the user to create more credit note orders with reference to Value contract.
    Can anyone please help with the scenario.
    Regards,
    Praveen.

    Dear Sri,
    These are the steps to to configure the output type for credit note.
    SPRO>IMG>Sales and Distribution>Basic Functions>Output Control>Output Determination>Output Determination Using the Condition Technique-->Maintain Output Determination for Billing Documents
    -->Maintain Condition Tables
    -->Maintain Output Types
    -->Maintain Access Sequences
    -->Assign Output Types To Partner Functions
    -->Maintain Output Determination Procedure
    -->Assign Output Determination Procedures
    Here you just copy the standard output type RD00 then rename it according to you, then assign the Z form for that output type.
    Maintain condition record through VV31 transaction with your credit note document type.
    I hope this will help you,
    Regards,
    Murali.

  • WRONG COGS IN CREDIT NOTE FOR SERIALISED ITEM

    Hi all
    Please feedback to Developer for improvement.
    1.       set Item A u2018 as FIFO,
    2.       place 2 PO. Serial# 1001 is at cost $1 and serial # 1002 at cost $2.
    3.       sell these 2 serial item. COGS would be $3
    4.       when I do a credit note of serial# 1002, the system should take the COGS at $2. System currently taking as $1 (using the FIFO method).
    Kedalene Chong

    Hello Petr Verner,
    It's a standard functionality of Business one, that it is impossible to enter a negative amount in an independant credit note or in a credit note based on a invoice with negative amount.
    To solve this issue:
    1.  For the rows with the positive Row Total, create an "independent" Credit Memo (not based on an Invoice).
    2.  For the rows with the negative Row Total, create another Invoice with a positive Row Total opposite to the original negative Row, and reconcile between the two rows manually via Banking => Bank Statements and Reconciliations => Reconciliation.
    Hope the above helps.
    Wilma Wang
    SAP Business One Forums Team

  • Invoice and Credit note posting not matching

    Hi All,
    An invoice was issued with two items so the credit note in reference to that invoice (to reverse the invoice) has been issued item wise. The problem is that the amount of credit note and the invoice is not matching so the posting does not clear.
    Any idea, what could be the reason. Its critical to business so urgent.
    People with similar problem too are requested to share their experience.
    Regd
    Vk

    Hi Vinay,
    go to copy control from the invoice type to credit memo type. In the 'item' level, Chevk out the 'pricing type' field. If u want the same old values from the invoice as it is, then use the pricing type as 'D'. This will copy all values unchanging them.
    This will solve ur problem.
    Regards,
    Prashant

Maybe you are looking for

  • AR Invoice Presentation / Invoice Lines diff than Sales Order Lines

    Hi, Due to business rules I got the following requirement, I'd like to get advice or second opinions please: Instead of showing 200 lines we want to show 1 line in the invoice summarizing the job done. The requirement is: The invoice should summarize

  • Not able to install SQL server on windows 7 - Installation halts during pre-installation.

    Hi Team, Am not able to install SQL Server on my windows. i have checked several links and sites. But nothing helped. Following is captured in the boot strap logs. 2014-09-19 12:31:48 Slp: Running Action: StartSqmSession 2014-09-19 12:31:48 Slp: Sco:

  • Date prompt issue in obiee 10g

    Hi Experts, Am facing the date prompt error, but the type is mentioned as date, after this also am getting same problem plz help Thanks Vijay

  • Mailbox Behaviors – Big Problem

    In Apple Mail, under Preferences / Accounts / Mailbox Behaviors, I have set the Trash preferences to "Move deleted messages to the Trash mailbox" and "Store deleted messages on the server" by checking the boxes next to those commands. BUT, this is no

  • TechTool Deluxe wont install

    I got the TechTool Deluxe CD with my Applecare back in 2006. I am trying to resolve some issues with World of Warcraft crashing my computer since the day I've had it. I'm trying to either install TechTool Deluxe or boot the system up from the CD but