Create AP Down Payment Invoice

Dear All,
I have a problem when I creating AP Down payment Invoice using SDK SAP2007. Error message like this
"Chosen BP is not customer  ODP1.Cardcode line: 1, 'v181'"
When i check in SAP B1 2007, V181 is already set to VENDOR.
Here is the code :
Set oCompany = New SAPbobsCOM.Company
    With oCompany
        .Server = "T9\sql2005"
        .CompanyDB = "blive"
        .UserName = "n2301"
        .Password = "n7hfd8sd22"
        .DbServerType = dst_MSSQL2005
        .language = ln_English
        .UseTrusted = False
        .DbUserName = "sa"
        .DbPassword = "23dsasdh8d"
    ierr = oCompany.Connect()
        If ierr <> 0 Then
            Call oCompany.GetLastError(lErr, sErr)
            MsgBox sErr
        Else
            MsgBox "OK"
        End If
    End With
    Set oDP = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDownPayments)
    With oDP
        .CardCode = "V181"
        .NumAtCard = "Ticket 001"
        .DownPaymentPercentage = CDbl(100)
        .DocDate = Now
        .DocDueDate = Now
        .DownPaymentType = SAPbobsCOM.DownPaymentTypeEnum.dptInvoice
        .Lines.ItemCode = "C1"
        .Lines.Quantity = CDbl("10")
        .Lines.Price = CDbl("200")
        .Lines.VatGroup = "ZI"
    End With
        lErr = oDP.Add()
        If lErr <> 0 Then
            Call oCompany.GetLastError(lErr, sErr)
            MsgBox sErr
        Else
            MsgBox "OK"
        End If
Thanks before
rgrds,
Edited by: Lunatic on Jun 25, 2009 6:24 AM

HI
Use the BoObjectTypes.oPurchaseDownPayments for A/P Down payments (purchase).
oDownPayments object is a A/R  Down payment for (sales)
Regards,
J.
Edited by: Janos  Nagy on Jun 25, 2009 9:32 AM

Similar Messages

  • How to create A/R Down payment Invoice

    Hi;
    I am trying to create A/R Down Payment Invoice through DI API by using the below mentioned object but the system is giving me the following error "Invalid Value. {DPI1.ExLineNo} {Line No. 1}".
      SAPbobsCOM.Documents oDoc SAPbobsCOM.Documents)x.CompanyObject.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDownPayments);
                oDoc.Lines.SetCurrentLine(0);
                oDoc.CardCode = "C0001";
                oDoc.Lines.ItemCode = "Test";
                oDoc.Lines.Quantity = 2;
                oDoc.Lines.UnitPrice = 10;
                oDoc.Lines.ActualDeliveryDate = DateTime.Now.Date;
                oDoc.Lines.BaseType = 17;
                oDoc.Lines.BaseLine = 1;
                oDoc.Lines.BaseEntry = 1;
                oDoc.Lines.ExLineNo
                int oRetVal = oDoc.Add();
                if (oRetVal != 0)
                    MessageBox.Show(x.CompanyObject.GetLastErrorDescription());
    Please suggest me how I can create AR Down Payment Invoice along with Incoming Payment and then wanted to link AR down payment invoice with AR invoice.
    Regards;
    Deepak

    Hi
    Try this code
    Try
    'Create DownPayment Invoice Object
            oDPM = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDownPayments)
            'Set Down Payment Header Values
            oDPM.CardCode = "Some Card code"
            oDPM.DocDueDate = "Suitable Date"
            oDPM.DownPaymentPercentage =" Numeric value (Double)"
            oDPM.DownPaymentType = SAPbobsCOM.DownPaymentTypeEnum.dptInvoice
            'Set Down Payment Line Values
            oDPM.Lines.ItemCode =" Some Item Code"
            oDPM.Lines.Quantity =" Quantity"
            oDPM.Lines.Price =" Item Price"
            lRetCode = oDPM.Add ' Try to add the invoice to the database
            If lRetCode <> 0 Then
                 oCompany.GetLastError(lErrCode, sErrMsg)
                 MsgBox(lErrCode & " " & sErrMsg) ' Display error message
            Else
                 MsgBox("Down Paymeny Invoice Added to DataBase", MsgBoxStyle.Information, "Invoice Added")
            End If
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    Regards
    Arun

  • Creation of A/R Down Payment Invoice  based on Sales Order not logical

    When creating a A/R Down Payment Invoice based on a Sales Order you
    have the option to create multible ones. Which by itself could be
    usefull to create one of 50 % for a certain day and decide they need to
    pay another 25 % at a later date.
    But SBO does not track what already have been posted. Therefore you can
    create a sum more then a 100% without warning or blockage.
    Tested this in SBO 2007 A SP:00 PL:00
    Scenario:
    Sales - AR>Sales Order
    Create and post a Sales Order
    Sales - AR>A/R Down Payment Invoice
    Create an A/R Down Payment
    Select the BP and copy the Sales Order
    Set DPM to 40%
    Post the A/R Down Payment
    Sales - AR>A/R Down Payment Invoice
    Create an A/R Down Payment
    Select the BP and copy the Sales Order
    Set DPM to 100%
    Post the A/R Down Payment
    Sales - AR>A/R Down Payment Invoice
    Create an A/R Down Payment
    Select the BP and copy the Sales Order
    Set DPM to 70%
    Post the A/R Down Payment
    Making the total for the Sales Order 210% worth of Down Payment
    Invoices without warning/blocking. I would expected that you would only
    be able to set the rest sum %. For instance first scenario I entered
    60% therefore setting the second Down Payment Invoice to a max of 40%
    Untill you have used up the 100% and you cannot select the Sales Order
    in question..
    If multible users do the same work, SBO doesn't show that it has
    already been done. Same if you forgot you already created it you can
    still create one. Plus sometimes it will happenyou create the Down
    Payment Invoice and not paying attention you create the first one with
    a 100% and later with the intended percentage..

    Hello Petronella,
    you are right that B1 is not checking the total value of DP created from the Sales Order.
    The logic and checking procedure here is only between Sales Order -> Delivery/Invoice.
    DP Invoice is considered as transaction related to document the receipt of the money (parallel to the sales process). Between the moment of basing of DP to Sales Order it is still possibility to adjust Sales Order as there is no posting behind Sales Order.
    The question is what would be a checking  procedure in case that on Sales Order there is based Delivery and DP? What would be the system priority to take into a consideration?
    Regards,
    Martin Slavik
    Regional Solution Manager

  • Customer Down Payment invoice (from delivery) not automatically assigned

    If I create a Down payment invoice from Sales Order (and I paied it) on the final invoice the sistem automatically assigne the down payment invoice on the final invoice for the order.
    If I do the same think but crerating the Down payment invoice from the delivery (and I paid it) when I create the final invoice I need to assigned it manually.
    SBO 8.81 PL 06
    I haven't found any set up for this, so I think is an error the sistem must work on the same way if the document is copied from the Sales order or delivey.
    Someone know if there is some set up? or I need to open an error message to SAP?
    Thanks

    My question is:
    If I make a sales order.
    I create a down payment invoice using copy from SO.
    I make the incomuing payment for the down payment invoice.
    I create the delivery from the SO
    I create the invoice from the delivery
    The system apply automaticaly the down payment invoice to the invoice (because I select a delivery that is linked to the so that I used to create the down payment invoice).
    If I make a sales order.
    I create the delivery from the SO
    I create a down payment invoice using copy from delivey.
    I make the incomuing payment for the down payment invoice.
    I create the invoice from the delivery
    The system DO NOT apply automaticaly the down payment invoice to the invoice (even if also this document is linked to the delivery that I use to create the down payment invoice).
    I know that I can select it manually. But I can select it manually also if I use the SO to create the down payment instead of the
    delivery. Why if the situation is the same in the firs case the system do it automatil^cally and in the second case I need to do it manually?
    Of course if I create a Down Payment invoice without selecting any document (SO, delivery..) the system don't know if you want to apply the payment to the final invoice.
    But If I select the delivey to create the down payment (the same if I select the SO): I want to apply the down payment to the final invoice of this delivery and not to another delivery.

  • How to block a delivery when an A/R Down Payment Invoice is not paid?

    1. Create and add a Sales Order
    2. Create and add an A/R Down Payment Invoice based on the created Sales Order (set DPM % to 50)
    3. Create and add a Delivery based on the created Sales Order
    The delivery is not blocked.
    Is there an easy workaround/alternative to ensure goods are stopped from being delivered when a customer hasn't paid a certain amount upfront?

    Hi Suda,
    Unfortunately my usage of the sql queries is a bit rusty and am not sure if I am doing this correctly.
    Next to that I don't exactly see how it should work (hence my comment being rusty - haven't used this very often). I see that it checks the AR Down Payment Invoice document and lines, but how it checks to which sales order it is connected to stop the delivery.. Plus I always want it to stop any delivery when an AR Down Payment for any percentage hasn't paid in full untill it has been paid/approved by someone to be delivered. If no AR Down Payment has been done, there is no issue.
    Anyway I have copied your query to the Query Generator and saved it.
    I created an approval procedure based on delivery documents and based it on the saved query.
    Added a sales order and created a Down Payment Invoice based on the sales order with 40% that has to be paid upfront. Created a delivery based on the sales order and added the document. I only gotten an internal error (it went so quickly I can't see the actual whole message because I get the created message straight after), but it created the delivery anyway.. (same as you described maybe?)
    I'm missing something obviously, let me know what to do.
    Regards,
    Petronella

  • Amout check on Down payment Invoice

    Dear All,
    while creating a down payment invoice, the system have not any check on the amount of the base document. as if we have a purchase order of amount 100$ and we create a down payment invoice initially of 30% and pay it through out going payments, and again we create a down payment invoice and assign 100% the system allow us to create it against the same vender without show the remaining balance or any amount exceeding notification.
    so in actual the amount would be 130$ and when we try to create the A/P Invoice with reference to that PO. system will not allow us to create invoice as the total will be higher then the actual PO.
    Kindly guide me in this regard. how can we control the down payments amount with reference to due amount.
    Regards,
    Awais

    Hi,
    it is a system default which will allow you to create as many down payment invoice as possible.
    it is just based on the BP code.You can create a standalone down payment invoice for any BP,item or service type and then you can link this to your Invoice.
    During the invoice you will be selecting your down payments in the invoice window.Here you will be seeing only the down payments which you have made already the payments.
    And if you try to select the down payments whose total is greater than invoice system will block you.
    If you want to link down payment based on PO then i think through coding it is possible
    Regards
    Md.nazeer Shaikh

  • Is there a way to deduct TDS on outgoing payment without making AP down payment Invoice?

    Hi
    One of my client want to deduct TDS on out going payment but they do not want to create AP down payment invoice for this.
    Please suggest me the best way.
    Regards
    Ashish

    Hi,
    No other feasible workaround other than creating AP Down Payment Invoice to record the TDS.
    Kind Regards,
    Jitin
    SAP Business One Global Support

  • Final invoice without paying existing down payment invoice

    One of our customers demands some changes within the Business One.
    The support in Ireland advised us to post these requirements in this Forum.
    The customer has created an AR down payment invoice. This invoice was not paid, but the delivery took place anyway. Now it's not possible to create the final AR invoice, without paying the down payment invoice first.
    In my opinion that's logical but our customer demands this possibility anyway.

    Hi,
    No other feasible workaround other than creating AP Down Payment Invoice to record the TDS.
    Kind Regards,
    Jitin
    SAP Business One Global Support

  • A/P Down Payment Invoice error....

    Hi all....
    Please Help me...
    I done all setup relevant to Vendor/Supplier for Business Partner Data...........
    But whan I am creating A/PDown payment Invoice I got error...
    In Vendor AP Down Payment Invoice I got error i.e "No Matching Records Found"
    so what is the solutions.....
    I am not getting error for my customer... when I am creating A/R Down Payment Invoice...
    Please help me...
    Regards
    Umang

    Hi... Nagesh ......
    Dear Please... see here  What I done....
    First I done...
    Admin--> set up --> Finance -> G/L Acct .. determination
    Set control Account for Sales & Purchase.
    2)
    Then I assigned Control Account in Accounting Tab of Business Partner Records...
    3) I created AP Down Payment Invoice for Vendor Based on Goods Receipt PO ....... After adding that ... Then I go for AP Invoice .....
    Whn I click on DPM Tab It gives me error....."No Matching Records Found"
    Ok .... If you have solution plz tell me....
    Please ! do in your system .... and chk where I do mistake ?
    Note :  For Customer I am not getting error
    Regards
    Umang

  • Down Payment Invoices - Is there any date restrictions?

    Hi All,
    I created a down payment invoice (A/P or A/R) and draw the down payment invoice from the invoice.
    The thing is that the down payment invoice can be drawn only on certain posting date of the invoice.
    For example, when the date of the down payment invoice is 02 Jan, the invoice can only be between 02-05 Jan, cannot be later than that date.
    For some cases it can even only be drawn on the same date as the down payment invoice is issued.
    Could be any settings in the database related to this? Because when I tried on different database (with same version) there is no problem.
    Thank you.
    Regards,
    Marini

    Hi All,
    It's solved already. It was because the exchange rate of System Currency on the date the down payment invoice was issued was different from the exchange rate on the date it was drawn to invoice. 
    So I run the Conversion Differences first and then create the invoice again.
    Cheers,
    Marini

  • Error in creating document series at A/R Down payment Invoice

    Dear All,
    One of my client has 4 Regional Offices,one in Delhi,one in Mumbai,one in Chennai and one in Gurgaon.
    For all the other RO's I have created seperate document number series for A/R Down payment Invoice but when I am trying to create a new series for Gurgaon RO, I am receiving an error message as"Another User is Modified(NMC1) ".
    Please put your valuable thought on this issue and help me to resolve this issue.
    Thanks & Regards,
    Ashish

    Close the Document Numbering Screen and Open again and Update the Series.
    Ensure that the Series Nos don't overlap

  • Close Open Amount on A/P Down Payment Invoice

    Hi,
    I have the following scenario:
    I have created an A/P down payment invoice for 1000$
    Create an Outgoing Payment for this A/P Down Payment Invoice for 1000$
    This payment is closing the A/P Down Payment invoice
    Create an A/P Invoice for 800$ - apply this amount from the A/P Down Payment invoice (updating Amount to draw to 800$). The A/P invoice will close.
    The issue is how to get the money back from the supplier closing also the open amount of 200$ from the AP Down Payment Invoice.
    I have tried to apply an A/P credit memo to the A/P Down Payment Invoice but the system does not display the open amount from Down Payment invoice.
    Another way I have tried to create a manual A/P Credit Memo to BP and manually closing the open amount on A/P Down Payment Invoice but the system would not allowed me to cancel or remove the open amount on the Down payment.
    Do you have any other ideas?
    I am working with SAP B1 2007 PL42.
    Thank you,
    Alex

    Hi Alex
    please create a message for SAP Business One Support with high priority and all the details.
    regards
    Rui Pereira
    SAP Business One Forums Team

  • A/P Down payment invoice Problem

    Hi all,
    I have the ff. scenario
    1.     Create PO
    2.     Create A/P DP invoice(20%) against this PO
    3.     Create outgoing payment against A/P DP invoice of 20%
    4.     Create A/P DP invoice(30%) against this PO
    5.     Create outgoing payment against A/P DP invoice of 30%
    6.     Create A/P DP invoice(60%) against this PO
    7.     Create outgoing payment against A/P DP invoice of 60%
    8.     Create a regular A/P invoice against the 3 DP
    Problem 1. We have exceeded our payment against the PO w/c in this case is 110%, but SBO allowed to post these Down payments. How can we prevent overpayment base on a specific PO?
    Problem 2. Since we have overpayment what we should do on 10% overpayment?
    Please help.
    Fidel

    Hi Fidel,
    Sorry for the late post, quite a busy day for me today.
    edit - start
    Errrrr, line 12 actually should be IF @iBaseType (less-than-symbol)(greater-than-symbol) 22
    Why this forum remove those 2 symbols whenever I write them? Anyway, you should understand it, I mean "IF @iBaseType is not equat to 22" in SQL script. Just curious why SDN automatically remove whenever those 2 symbols adjacent to each other, weird...
    And the same thing apply to line 25, should be AND TargetType (less-than-symbol)(greater-than-symbol) 19
    edit - end
    IF @object_type='204'AND @transaction_type='A' -- 204 is object type for A/P DP Invoice
      BEGIN
        DECLARE @iBaseType AS INT               -- To contain base document type of A/P DP Invoice
        DECLARE @lDpmPrcnt AS DECIMAL(18,2) -- To contain sum of DP% related to the based PO
         SELECT @iBaseType=BaseType
         FROM ODPO T0
         INNER JOIN DPO1 T1 ON T0.DocEntry=T1.DocEntry
              WHERE T1.DocEntry=@list_of_cols_val_tab_del
         IF @iBaseType<>22          -- Make sure in order to create DP, a PO is required (PO object type is 22)
           BEGIN
              SET @error=-1
              SET @error_message='PO required in order to create purchase down payment'
           END
         ELSE
           BEGIN
              SELECT @lDpmPrcnt=SUM(DpmPrcnt)
              FROM ODPO T0
              INNER JOIN DPO1 T1 ON T0.DocEntry=T1.DocEntry
                   WHERE BaseType=22
                   AND BaseEntry=(SELECT BaseEntry FROM DPO1 WHERE DocEntry=@list_of_cols_val_tab_del)
                   -- Line above is to select all DP related to base PO
                   AND TargetType<>19
                   -- Line above is to make sure DP that already reversed using A/P Credit Memo is excluded
                   AND LineNum=0
                   -- Make sure to add line above due to facts that DP% located in document header
                   -- and since we join ODPO with DPO1,
                   -- if line above doesn't exist, the sum of DP% will duplicated accordingly to number of line items in document
              IF @lDpmPrcnt>100
                BEGIN
                   SET @error=-1
                   SET @error_message='Down payment percentage already exceeded 100% of PO'
                END
           END
      END
    Inform me if you have any inquiry or problem regarding this SP.
    Best Regards,
    Hendry Wijaya
    Edited by: Hendry Wijaya on Sep 8, 2011 5:42 PM

  • A/R down payment invoice not allowing tax

    Hi Experts,
    We use SAP Business One 2007A PL-08. While posting A/R down payment with percentage on DPM (For example 50%), the system is not calculating GST on it though we put the GST tax code in the invoice.
    Any idea how this can be resolved?
    Is there a workaround for this?
    Thank you,

    Thanks Gordon. As a workaround, we created a dummy item number for the GST to be input into the A/R Down payment invoice. The problem here is that when we add a line item for the GST using this item number, the G/L account is defaulting to customer deposits account and its now allowing us to change the G/L account to the relevant GST G/L. Is there a way we can change the G/L?
    Please let me know!!
    Thanks

  • No Freight cost on AR Down Payment Invoice

    Hello,
    My customer needs to create an 100% AR Down Payment Invoice based on a Sales Order with freight costs. But this is not copied across, plus you don't have the option to add this either..
    How can this be done, I don't see an option.
    Regards,
    Petronella

    Hi,
    Could that be manipulated with SDK?! (The down payment module does not have the option to add additional expesnes. It will only work with Line item totals.)
    Thanks for the other option, I'll advice the client about this.
    Regards,
    Petronella

Maybe you are looking for