Apply Cash Payment and Credit Memo to an Invoice via DI API

Hi, All:
I would like to be able to create an invoice and apply cash and a credit memo to it which equals the total of the invoice.  This will close out the invoice.
Does anyone out here know if this can be done through the DI API?  If so, some sample code would be greatly appreciated.
Thanks.

For those of you who are wondering, here is an example:
                int invoiceDocEntry = 0;
                int creditMemoDocEntry = 0;
                Documents invoice = (Documents)company.GetBusinessObject(BoObjectTypes.oInvoices);
                invoice.CardCode = "S001600";
                invoice.DocDate = DateTime.Today;
                invoice.DocDueDate = DateTime.Today;
                invoice.Lines.ItemCode = "A2-IC-6"; //$78.00
                invoice.Lines.Quantity = 2;
                invoice.Add();
                if(invoice.Add() != 0)
                    throw new Exception("Could not add invoice: " + company.GetLastErrorDescription());
                invoiceDocEntry = Int32.Parse(company.GetNewObjectKey());
                System.Runtime.InteropServices.Marshal.ReleaseComObject(invoice);
                Documents creditMemo = (Documents)company.GetBusinessObject(BoObjectTypes.oCreditNotes);
                creditMemo.CardCode = "S001600";
                creditMemo.DocDate = DateTime.Today;
                creditMemo.DocDueDate = DateTime.Today;
                creditMemo.Lines.ItemCode = "B4-HDMI-.7";
                creditMemo.Lines.Quantity = 1;   // $10.00
                if(creditMemo.Add() != 0)
                    throw new Exception("Could not add credit memo: " + company.GetLastErrorDescription());
                creditMemoDocEntry = Int32.Parse(company.GetNewObjectKey());
                System.Runtime.InteropServices.Marshal.ReleaseComObject(creditMemo);
                Payments payment = (Payments)company.GetBusinessObject(BoObjectTypes.oIncomingPayments);
                payment.CardCode = "S001600";
                payment.Checks.CheckSum = 68.00;
                payment.Checks.CheckNumber = 100;
                payment.Invoices.DocEntry = creditMemoDocEntry;
                payment.Invoices.InvoiceType = BoRcptInvTypes.it_CredItnote;
                payment.Invoices.Add();
                payment.Invoices.DocEntry = invoiceDocEntry;
                payment.Invoices.InvoiceType = BoRcptInvTypes.it_Invoice;
                if(payment.Add() != 0)
                    throw new Exception("Could not add payment: " + company.GetLastErrorDescription());
                System.Runtime.InteropServices.Marshal.ReleaseComObject(payment);

Similar Messages

  • Automatic programme for  Down payments and  Credit memos & pratial payment

    Hi Guysis
    vendor credit memo is 5000rs when i  Excute the Automatic programme for the APP it asks enter payment method for the Incoming payments.
    how to slove this error.
    vendor down payments Automatic payment programme is possible or not
    please give sollution Immdieatly.
    with regards
    srinivas

    Hi,
    rao
    i understood your problem
    we can do it in a different way.
    i think you have a due amount and one credit memo..
    if it is ok
    then in F110
    GO to proposal change and select first the invoice document and REALOCATE then change the bank details
    for ex.
    payment method      M
    bank                        SBI
    account                  curr
    and press shift+F1
    and go back
    select second one that is credit memo
    and REALOCATE
    there you can find the bank
    select that and shift+F1
    thus you do the payment
    this can solve your problem
    thank you
    Shankarchitupolu

  • Incoming payment for incoming payment, credit memo, journal entry &invoice

    The message subject is expression of my f**king confusing.
    Suppose, we received payment on account 120 Ringgit, invoice amount 210 Ringgit, JE transaction amount 10 Ringgit and credit memo amount (without copied from a certain invoice) 5 Ringgit.
    In one new incoming payment, I pay all the 4 transactions, is it correct procedure ? it means the balance of the customer will be zero, that's what we want to do. Thanks in advance
    Balaj

    First and foremost, I would like to stay that this is a Public Forum and you must refrain from using improper language.  There are people here to help you.
    If you want to adjust the JE, Payment on Account and Credit Memo aginst the Invoice and receive the balance amount, it is possible through incoming Payment.
    You will highlight the Invoice, CM, JE and check the Payment on Account box to include the On account amount, go to Payment means and in the amount column press CTRL+B to copy the balance amount and ADD the payment
    Suda

  • Payment document  having invoices and credit memos

    How to identify when a payment document has both invoices and credit memos in it?Is there any criteria?

    Hi Savitha,
    This can be identified by document type.
    Ashven

  • Goods Return and Credit Memo

    Hi Experts,
    I've stuck with one problem on implementation project. The scenario is as below.
    Cut-off data is 30th Apr 2009
    Go live date declared is 30th April 2009, but the client has one specific requirement regarding the Return goods from customer.
    The industry is a publication industry. Their customers are all around the world.
    When they sale some material the goods may return after 3 years from the sale date and they give the cash back according to the invoice amount at the invoice date.
    1) We shall upload all the balances as on 30th April 2009.
    2) If any customer returns the goods which we had sold in year 2006.
    3) How to book return order, delivery and Credit Memo.
    4) What will be the effect on Inventory stock and price and according to Balance sheet.
    5) We don't have back dated data (in Year 2006) in SAP system.
    6) Client don't want to refer legacy system for the exchange rate and rate at the invoice time.
    Please guide me how to map this scenario.
    Regards
    Amol

    Hi,
    1.  If you are using ERS, then running MRRL transaction will automatically generate credit memo for your return delivery with movement type 122.
    2.  MIR5 is the one you should look into.
    3.  Take a look into ME80FN report.  Yet, this report does not indicate specifically for movement type 122.  If it is required that this movement type shall be chosen as part of selection parameters, then you should develop your own report.
    4.  There is not any particular difference if you are using movement type 161.  The only difference is that in case of using 161, you will have to raise a new return PO and make necessary GR and IR posting.  However, the disadvantage is that you will lose the track of your original PO (and PO history).
    Cheers,
    HT

  • TERMS OF PAYMENT AND CREDIT CONTROL AREA

    WHERE AND HOW EXACTLY TERMS OF PAYMENT AND CREDIT CONTROL AREA MAINTAINED IN CUSTOMER MASTER RECORD WILL REFLECT WITH EACH OTHER?  AND
    HOW DOES CREDIT CONTROL AREA CONTROLS THE
    TERMS OF PAYMENT OF CUSTOMER MASTER RECORD?

    hi
    1) terms of pay ment and credit memo----
    under customer master record, company code data, and payment transaction tab  there terms of pay ment field is there.
    2)FD32-----customer credit Matins
    regards
    sar

  • AP credit memo for AP invoice but applied amount zero

    Hi all!
    I have problem when i use function AP credit memo for AP invoice. IN AP invoice, i have status closed and Applied equal total value of AP invoice.
    In AP credit memo, i still have Status is Closed but applied amount is zero and open Balance is equal total value of AP invoice.
    I don't understand how why system show this.
    Please tell me advice.
    My figure:  [http://i720.photobucket.com/albums/ww201/tiencruise/tien.jpg]
    Thanks!

    Hi,
    Please check whether the AP Invoice and the Credit Memo is appearing in the Business Partner Internal Reconciliation window.
    Check the Note :     1258628 and check whether the detect query returns any result for the same.
    Please make sure that you perform the following in the COPY of the database in TEST ENVIORMENT :
    If you have the COPY of the database available, you can test by reconciling the documents in the Internal Reconciliation window and then run the detect query in the Note 1258628 and see whether now the documents appear or not.
    Kind Regards,
    Jitin
    SAP Business One Forum Team

  • Program to create Debit and Credit Memos

    Hello everybody!
    I am new to SAP and I need to develop ABAP program to create Debit and Credit Memos...
    1. Debit/Credit memos created with header (Higher level) item and sub item/s
    2. One Debit/Credit memo created per customer
    3. A part of information for memos program will receive through XI (Excel file coming through XI)
    maybe someone can help?
    Helpfull answers will be awarded!
    BR, M.

    You dont need a custom prog to create a debit memo or credit memo.
    You can raise a Credit Memo for a Vendor using the transction code FB65 (without reference to an invoice) or MIRO (if it is with reference to an invoice) and the system would pass the following accounting entry
    Dr. Expenses A/c
    Cr. Vendor A/c
    This particular document would have a payment term and payment due date. While running Automatic Payment Process, depending on the payment method the system will pick up the document and create a cheque / electronic transfer etc for the vendor with the following entry
    Dr. Vendor A/c
    Cr. Bank Clearing A/c
    In the case of Customer you can account the credit memo (without reference to invoice) using FB75 or VA01 (Order Type CR, if it is with reference to an invoice). While you create the billing document for the order type CR the system would raise the following accounting
    Dr. Expenses A/c
    Cr. Customer A/c
    This particular document would have a payment term and payment due date. While running Automatic Payment Process, depending on the payment method the system will pick up the document and create a cheque / electronic transfer etc for the customer with the following entry
    Dr. Customer A/c
    Cr. Bank Clearing A/c

  • Cash bill and credit bill

    Hi Experts
    client want separate report and transaction for cash bill and credit bill
    so can do separate sales document type and billing document type  to map above requirement
    e.g. Z1OR  and Z1F2  for cash bill
          Z2OR  and  Z2F2  for credit bill
    if customer pay in cash they will use Z1OR
    if customer want thr credit they will use Z2OR
    is it right solution ?
    please suggest
    regards

    It depends on how your delivery document should be generated.
    If for cash sales, if you want delivery document to be generated automatically in the bacground once sale order is created but not for credit sales, then you should have two sale order types. 
    Otherwise, it is not necessary to have two order types. Also it is recommended to have two billing types for your requirement but again it depends on the process how it is going to be.
    If you are asking whether it is required only for reporting purpose, then I can say, yes you can have one billing type.  But I am sure, Payment Terms and Inco Terms should be different for these scenarios and that is why, I said to have two billing types.
    thanks
    G. Lakshmipathi

  • Automatic Payment Program - Credit Memos

    Hi Experts,
    I have one client scenario.
    There are 3 invoices for the vendor and 1 credit memo. 1 st invoice: 10000, 2nd Invoice is 8000 and third invoice is 7000 and credit memo is 4000.
    Now i have to make individual payment to invoice 1 and 2. I want to clear the third invoice with the credit memo and for the rest of the 3000 i have to clear.
    This all process should go through in APP. How i have to make it possible.
    Thanks,
    SravanK

    Hi Sravan
    if you want invoice wise separate checks you have to enable the tick mark for separate payment for each ref in paying company codes at FBZP t.code.
    first you set of the credit memo against invoice in residual method.ater run the F110. you can get invoice wise checks.
    satish

  • Establish receivables and credit memos from suppliers

    hi,
    How I can Establish receivables and credit memos from suppliers to whom the authority has made duplicate or erroneous payments and indicate them separately so as consider this while processing future payments to the party
    how i can implement this functionality
    thanks

    Hello,
    That will help but we have 400 records. I guess we will write some logic in staging table to update all those records which have that prefix in invoice number.
    Thank you.

  • Subsequent debit, credit and credit memo

    Hi,
      what is the difference between subsequent debit, credit and credit memo in MIRO transaction.
       In case of vendor had given us credit note with relevant to particular for which we had already completed the invoice verification and payment also paid.
       in this case what document should i use i.e crdit memo, subsequent credit memo or subsequent debit memo??
    plz suggest

    Hi
    You need to use a credit memo.
    Subsequent debit is used if you have already invoiced
    You have already received an invoice from your vendor for all the goods received. Subsequently, freight costs are to be taken into account, however, the invoice quantity remains the same.
    Subsequent credit is used if you already have done a credit memo on the PO
    You have already received a credit memo from your vendor for all the goods received. Subsequently, freight costs are to be credited to your company, however, the credit memo quantity remains the same.
    Thanks & Regards
    Kishore

  • Need Debit Memo and Credit Memo

    Hi,
    What is the purpose of Debit Memo and Credit Memo, Is it bothe useful for Customer and Vendor.
    If any body having document on this pls. What are the steps need to process.
    Urgent
    Rgds
    sunfico

    Hi,
    Good morning and greetings,
    You can raise a Credit Memo for a Vendor using the transction code FB65 (without reference to an invoice) or MIRO (if it is with reference to an invoice) and the system would pass the following accounting entry
    Dr. Expenses A/c
    Cr. Vendor A/c
    This particular document would have a payment term and payment due date. While running Automatic Payment Process, depending on the payment method the system will pick up the document and create a cheque / electronic transfer etc for the vendor with the following entry
    Dr. Vendor A/c
    Cr. Bank Clearing A/c
    In the case of Customer you can account the credit memo (without reference to invoice) using FB75 or VA01 (Order Type CR, if it is with reference to an invoice). While you create the billing document for the order type CR the system would raise the following accounting
    Dr. Expenses A/c
    Cr. Customer A/c
    This particular document would have a payment term and payment due date. While running Automatic Payment Process, depending on the payment method the system will pick up the document and create a cheque / electronic transfer etc for the customer with the following entry
    Dr. Customer A/c
    Cr. Bank Clearing A/c
    Hope this meets your requirement...Please reward points if found useful
    Thanking you
    With kindest regards
    GVR

  • Apply credit memo to an invoice header (not to a line) using Autoinvoice

    Hi,
    Does anyone know if it's possible to apply a credit memo to an invoice header, as opposed to an invoice line using autoinvoice? I know how to apply on account and at invoice line level, but can't get it to apply at the invoice header. I don't even know if it's possible.
    Thanks

    Hi,
    Does anyone know if it's possible to apply a credit memo to an invoice header, as opposed to an invoice line using autoinvoice? I know how to apply on account and at invoice line level, but can't get it to apply at the invoice header. I don't even know if it's possible.
    Thanks

  • Unable to Apply Refund activity against Credit Memo

    Hi ,
    I have created a Credit memo for Rs.100 /- . I want to Apply this credit meme against Refund Activity through Front end.
    Navigation is Transaction Screen -> Actions -> Application .
    When i select Refund Activity in the Activity Screen and Tab out Applied amount is Defaulting as -100 Rs...When i am trying to save the record it is giving me the Error message "APP-AR-295224: Only positive refund amounts are allowed"...When i changed the Amount to +ve value ( 100 Rs.) and tried to save the record it is again giving different Error "APP-AR-295232: You cannot refund more than the credit memo amount".
    Can anybody tell me what is the Problem . Why i am not able to Apply Refund Activity against "Credit Memo".
    Thanks & Regards,
    Surfraz Mitegar

    check the transtion type for this credit memo, i think its Natural applicaiton is enabled (uncheck it)
    Nitin

Maybe you are looking for

  • Numbers: How to create a spreadsheet with columns

    I would appreciate help with something which seems quite basic, but I cannot figure it out from the manual. I need to track invoices. I would like columns with invoice number, supplier`s name, dates, and then of course numbers. I cannot see how to ch

  • Since installing Photoshop CC I can't access Camera Raw from the program Bridge.

    Since installing Photoshop CC I can't access Camera Raw from the program Bridge.  When I try, I get a message that says, "Camera Raw editing is not enabled. Camera Raw editing requires that a qualifying product has been launched at least once to enab

  • External table constarints

    Hi all, why external table doesnt support constraints? Please advice.

  • Email subject line

    i want to change subject line of email which r used for notification.wat can b done??

  • AdfPage.PAGE.findComponent FAILED with WebCenter

    Dear all, I have to get in javascript a component with id="pdfBtn" BUT I have to set the parameter r1:0:pdfBtn => AdfPage.PAGE.findComponent('r1:0:pdfBtn') It works when I develop a task flow and manage by myself, but it failed when I add this into W