A/R Invoice - Create two outgoing payments

Hi,
We have issue here regading A/R Invoice Payment.
The A/R Invoice is $100, the payment is $200 with Interact card (Direct account payment) with $100 cash return.
The present does not work in B1; but will be developed in future release.
The present can be solved according to Peter Dominik, B1 Solution Management as follow:
Create two outgoing payments:
- payment to vendor (payment for his bill)
- payment on account reposting balance from Bank Account to some
PettyCash account (cash
withdrawal from bank account)
Now I need to source code for the present solution; because all SDK is 1 A/R Invoice and 1 Payment. Now we have to do 2 outgoing payments. We need your help for this solution.
Please find the code for one transaction below; we need 2 payment transactions.
Thank you,
Rune
oPayments = (SAPbobsCOM.Payments)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oIncomingPayments);
oPayments.Invoices.DiscountPercent = 0;
oPayments.Invoices.DocEntry = vmp_DocEntry_Int32;
oPayments.Invoices.DocLine = 0;
oPayments.Invoices.InvoiceType = SAPbobsCOM.BoRcptInvTypes.it_Invoice;//13;
oPayments.Invoices.SumApplied = vmp_Amount_double;
oPayments.Invoices.Add();
oPayments.CardCode = vmp_CardCode_string;
oPayments.DocDate = DateTime.Now;
oPayments.JournalRemarks = "Incoming - Payment Bank Transfer";
oPayments.TaxDate = DateTime.Now;
oPayments.TransferAccount = vmp_BankAccount_string;// "_SYS00000000343";
oPayments.TransferDate = DateTime.Now;
oPayments.TransferReference = vmp_CardCode_string;
oPayments.TransferSum = vmp_Amount_double;
vc_Message_Result_Int32 = oPayments.Add();
if (vc_Message_Result_Int32 != 0)

hi Vitor,
I need a code sample for Peter's suggestion using the code I provided:
Create two outgoing payments:
- payment to vendor (payment for his bill)
- payment on account reposting balance from Bank Account to some
PettyCash account (cash
withdrawal from bank account)
Thank you,
Rune

Similar Messages

  • AP Invoice not in Outgoing Payment

    Hi experts,
    I have an issue where I am trying to create an outgoing payment for a certain business partner.  This supplier has 5 pending invoices but only 3 are appearing in the outgoing payment.
    Do you have any idea why this might be please?
    Thanks,

    Hi
    Please Check follwoing things;
    1.The Status of the AP Invoices "Status = Open"
    2.BP Master> AccountingTab> Payemnt Consolidation field having any valie or empty.
    3.AP INvoice --> Accounting Tab --> Chekc the Journal Entry and BP whether the posting is done in the same BP as you are selecting for the payment.
    I hope this will work out,

  • Problem creating an outgoing payment with DI API

    Hi
    I've created a form that allows a user to select a BP and automatically reconcile the accounts for this BP by creating an Outgoing Payment. It all works fine for Invoices, Credits, Purchase Invoices etc., however if the account balance contains Incoming or outgoing payments I am not sure how to treat these as there is not an invoice type (SAPbobsCOM.BoRcptInvTypes) for these. For the other types of document I simply declare what type of invoice the document to be added to the outgoing payment is by looking at the Transtype field of the record from the JDT1 table. I then use the JDT1.BaseRef field to retrieve the document's DocNum which I use to return the DocEntry by looking in the relevant table e.g. for invoices - OINV. All I then need to do is set the OutgoingPayments.Invoices.DocEntry value to this DocEntry and Add the line.
    I also have the same problem with Opening Balances as I can't seem to figure out what to set the DocEntry value to as this seems to be stored as a Journal Entry which uses the TransId for it's primary key, however this does not seem to work.
    Thanks a lot.
    Steve

    Hello Steven,
    You can use createdby field to determine the docentry of the base document instead of quering docentry by docnum
    select createdby, transtype, baseref from jdt1
    Note: Always set the correct document type for payments: (createdby is ok in integer format)
    Example:
    Opening Balance:  JE # 8 amount 1000, created by Opening balance (not JE)
       vPay.Invoices.DocEntry = 8
       vPay.Invoices.InvoiceType = BoRcptInvTypes.it_OpeningBalance
       vPay.Invoices.SumApplied = 1000
       Call vPay.Invoices.Add
    Opening Balance:  JE # 8 amount 1000, created by Journal Entry
       vPay.Invoices.DocEntry = 8
       vPay.Invoices.InvoiceType = BoRcptInvTypes.it_JournalEntry
       vPay.Invoices.SumApplied = 1000
       Call vPay.Invoices.Add
    Sales Invoice:  DocEntry: 11  amount 1000
       vPay.Invoices.DocEntry = 11
       vPay.Invoices.InvoiceType = BoRcptInvTypes.it_Invoice
       vPay.Invoices.SumApplied = 1000
       Call vPay.Invoices.Add
    Regards,
    J.

  • I encountered an error in the Payment Wizard screen as I was creating an Outgoing Payment for petty cash expenses. On the "Recommendation Report" screen, I clicked "Non-Included Trans." and saw that one of the vendors (Vendor Code: WILCO) has the followi

    Hello,
    I encountered an error in the Payment Wizard screen as I was creating an Outgoing Payment for petty cash expenses. On the “Recommendation Report” screen, I clicked “Non-Included Trans.” and saw that one of the vendors (Vendor Code: WILCO) has the following error:
    “The document amount is greater than the max. amount allowed in the payment methods linked to the BP”
    Upon checking, the “PCF-W” Payment Method linked to WILCO does not have any restrictions, nor does WILCO have any credit/commitment limit set. I have also appropriately defined the Dummy Business Partner Bank (under Payment Terms) as well as checked the “Included” box for PCF-W on the Payment Run-Payment Methods screen.
    Could anyone please help me on this?
    Salamat,
    Cat

    PS - have found other posts indicating that clips smaller than 2s or sometimes 5s, or "short files" can cause this. Modern style editing often uses short takes ! Good grief I cannot believe Apple. Well I deleted a half a dozen short sections and can export, but now of course the video is a ruined piiece of junk and I need to re-do the whole thing, the sound etc. which is basically taking as much time as the original. And each time I re-do it I risk again this lovely error -50 and again trying to figure out what thing bugs it via trial and error instead of a REASONABLE ERROR MESSAGE POINTING TO THE CLIP IT CAN'T PROCESS. What a mess. I HATE this iMovie application - full of BUGS BUGS BUGS which Apple will not fix obviously, since I had this product for a few years and see just hundreds of hits on Google about this error with disappointed users. Such junk I cannot believe I paid money for it and Apple does not support it with fixes !!!
    If anyone knows of a GOOD reasonably priced video editing program NOT from APPLE I am still looking for suggestions. I want to do more video in future, but obviously NOT with iMovie !!!

  • FB01 - Create an outgoing payment with a Bapi

    Hi there, I'm trying to simulate outgoing payments with BAPI_ACC_GL_POSTING_POST but I'm finding problems, does someone knows if this is the right bapi ??
    I'm finding problems 'cause the bapi needs a gl account but I have to put the vendor code and I don't know if I'm doing right, I'm putting the code for the items (25 and 50) in the accountgl-doc_type field.

    You don't need to put posting key ( In fact with the Doc Type and the amount sign +/-, the Bapi deduce posting keys )
    For the header you need :
    [code]
      documentheader-obj_type = 'BKPFF'.
      documentheader-obj_key = '$'. " If external Num.
      CONCATENATE sy-sysid 'CLNT' sy-mandt INTO documentheader-obj_sys.
      documentheader-username   = sy-uname.
      documentheader-bus_act    = 'RFBU'.
      documentheader-header_txt = s_notilus-header_txt.
      documentheader-comp_code  = s_notilus-comp_code.
      documentheader-fisc_year  = sy-datum(4).
      documentheader-doc_date   = s_notilus-doc_date.
      documentheader-pstng_date = sy-datum.
      documentheader-doc_type   = s_notilus-doc_type.
      documentheader-ref_doc_no = s_notilus-ref_doc_no.
    [/code]
    Hope it helps
    erwan

  • How to Close A/P Invoice in SAP B1 9.0 using SDK without creating an outgoing payment

    Hi Team;
    I have an issue about of how to close an A\P invoice that has two different tax definitions because I have recorded in a sap Business One A\P Invoice that Have Withholding tax (3%) and have Value Added Tax (18%) at once but when doing Payment of those invoices I did it separately without linking A\P  invoice with payment so that I can do a journal entry that credit the VAT Account and debit the Supplier to record that VAT while doing reconciliation I get I message ‘’ Use the same payment category withholding tax code for all transactions during reconciliation  [Message 3821-32]”” I need your help if there is a way that I can close (Changing the status of those invoices because they still open ) invoices without doing A reversal Transaction that affect the accounting  report in SDK.
    Please anyone can help me.

    Hi pallavi p,
    That's good but as I said above when I add the reference of UI API Version 9.0 in the project which has the system form or user form of sap b1 it exactly gives errors in menu.vb of the project.
    So let me give you the way you can try.
    1. Open new project/ visual basic/ sap business one/ sap business one add-on project. and save it any where
    2. Right click on your project
    3. Add new item
    4. Sap Business One
    5. System form (Employee master data) or user form
    6. Add
    And then if your form is opened
    7. Go to add the reference of UI API Version 9.0
    8. Check errors found in menu.vb (or in OutPut)
    So if it's possible try to solve that problem.
    Please anyone can help me.

  • MM INVOICE created with different Payment Terms and 2 differents PO.

    I will explain with an example to understand better the issue and why this could happen, (for the same Co.Code):
    On 05.09.2011, 5203795529 was posted with payment terms D030.
    At that time, PO #: 4501105395 was having payment terms D030 while PO #: 4501232207 was having payment term D031.
    Invoice 5203795529 was posted successfully.
    On 12.09.2011, 5203806574 was posted with payment terms D030.
    At that time, PO #: 4501105395 was having payment terms D030 while PO #: 4501232207 was having payment term D031.
    Invoice 5203795529 was posted successfully.
    In OCT, user receives another invoice for this 2 POs (4501232207 & 4501105395) and trying to post MIRO again but this time, user encountered error 'Payment terms in purchase order 4501232207 differ from current terms'. In order to proceed, user has changed payment term for 4501105395 from D030 to D031 on 17.10.2011 and proceed with invoice posting without error. 5203878342 was posted on 17.10.2011.
    The vendor always has the same Payment Term: D031
    Now the question is, why user is able to post without any problem previously even though there's different payment terms on both POs and not now anymore?.
    Thanks

    Thanks Jayavar,
    Nobody has changed anything, (I mean the PO Payment terms),  until October in PO. 4501105395
    The error message is when the user try to post with MIRO PO´s (4501232207 & 4501105395):
    "Terms of payment in purchase order 4501232207 (always with Payment term D031), differ from current terms"
    Message no. M8349
    Diagnosis:
    The terms of payment in the current invoice differ from those in the current purchase order 4501232207, other terms of payment were stipulated:
    Terms of payment key D031
    1st cash discount period 31 days 0,000%
    Either you have selected more purchase orders with different terms of payment, or you have changed the terms of payment manually.
    But the strange thing is in SEP, there's already this difference & there is no problem posting the invoice & the problem only comes when in OCT.
    Thanks and Rgs
    Francisco

  • TDS Enteries  does not display AP Invoice in  Outgoing Payments

    Hi All,
    I am Using SAP 2007 B PL 08.
    I am Using TDS Addon Ver. 4.8
    I have Create the one Vendor . In this Vendor I have Select the WTax Codes Allowed is  Contractor
    Now i have create Service AP Invoice.
    Journal Entry is
    Vendor  is Credit - 98
    TDS Payable Contractor is Credit - 2
    Security Charges is Debit - 100
    Now i have Create the OutGoing Payments.that time i have select the Type is Account.
    We take account is TDS Payable Contractor Account after i Click on Select TDS Entries button
    So  TDS Entries Windows Open. but dose not display the AP invoice.
    My Issue is TDS Enteries  does not display AP Invoice in  Outgoing Payments
    So Please any one can know the Solution?????
    Dixit Patel
    Edited by: Dixit Patel on Nov 28, 2008 1:14 PM

    hi Dixit Patel,
    You can contact Harish or Sushanth of Citixsys at the following email Id:
    harish.kumar(at)citixsys.com
    sushant.mohanthy(at)citixsys.com or
    if required contact Harish Kumar (Citixsys) on 01142696666
    Regards,
    Abhishek

  • How to create a single outgoing payment?

    Hi All,
    Can any body tell me that how can i create an Outgoing Payment without Invoic references? I can In the BusinessOne UI, but I can't with DI API.
    If any body having the code for creating Outgoing Payment without Invoice reference, please send to me.
    Please Help me!
    Thanks in Advance,
    J

    Hi József,
    Just look at the SDK Helpcenter for the Payment sample,  and don't use the oPayment.Invoice part.
    Hope this helps,
    Ian

  • Outgoing payment vs invoice due date

    Dear Forum,
    Our management wants to get historical due date outgoing payment compare to invoice due date. So we know if out finance paid accordingly based on the invoice due date. 
    The fields ;
    Invoice Number     
    Invoice Date     
    Invoice Value     
    Invoice Due date     
    Outgoing Payment Number     
    Outgoing Payment Date     
    Type of Payment ( check / cash /bank transfer)     
    Due Date Check/Cash/Bank Transfer
    Out Going Value
    If any experts can help me to get the query? thanks

    Hai!
    Run this Query in SAP Query Manager.
    Declare @FromDate datetime
    Declare @Todate datetime
    set @FromDate = (select min(S0.DocDate) from OPCH S0 where S0.DocDate >= '[%0]')
    set @ToDate = (select max(S1.DocDate) from OPCH S1 where S1.DocDate <= '[%1]')
    Select
    P0.DocNum as 'Invoice Number',
    P0.DocDate as 'Invoice Date ',
    P0.DocTotal as 'Invoice Value ',
    P0.DocDueDate as 'Outgoing Payment Number',
    V0.DocNum as 'Outgoing Payment Date ',
    V0.DocDate,
    (case
    when V0.CashSum > 0 then 'Cash'
    when V0.CheckSum > 0 then 'Check'
    when V0.TrsfrSum > 0 then 'Bank transfer'
    end) as 'Payment Type',
    V0.DocDueDate as 'Due Date Check/Cash/Bank Transfer',
    V0.DocTotal as 'Out Going Value'
    From OPCH P0, OVPM V0, VPM2 V2
    Where
    V0.Docentry=V2.DocNum and
    V2.Docentry = P0.Docentry and
    P0.DocDate >= @FromDate and
    P0.DocDate <= @ToDate
    Regards,
    Thanga Raj.K

  • Printing the invoice date in the outgoing payment.

    Hi Experts,
    Please help me with this scenario.
    I need to print the invoice date and the item description and also the due date of the invoice in an outgoing payment in PLD.
    I think this can be done through wring a query in UDF through the formatted search.
    Could anyone help me with an alternate solution or a step by step procedure for writing the query.
    Your help is highly appreciated.
    Thanks,
    Hari Dharen

    Hi,
    Are you really wanting to have invoice date, item description and invoice due date or it is also including payment date and payment means ?
    Here is the query:
    SELECT distinct T1.[DocDate], T2.[Dscription],
    T1.[DocDueDate] FROM VPM2 T0  INNER
    JOIN OPCH T1 ON T0.DocEntry = T1.DocEntry
    INNER JOIN PCH1 T2 ON
    T1.DocEntry = T2.DocEntry
    Let me know if you need to know other field.
    Rgds,

  • Outgoing Payment (Check) via DI API SDK

    Hey everyone, I'm trying to create an outgoing payment to a customer as a check through the DI API and I'm getting this error "[ORCT] , 'Error (-1004) encountered.'". I believe this is the incoming payment table so I'm not sure why it's part of the message.
    The payment object I am creating is "GetBusinessObject(oIncomingPayments)" so that may be part of it but there isn't an "oOutgoingPayments" for me to use. I've only completed the required fields to reduce the chance of errors being caused by something else (except for object code indicating it's an outgoing payment but maybe outgoing payments require more info). Also, these checks aren't based on any invoices.
    I noticed there is an "oVendorPayments" object as well so I'm not sure if I should be using this one or not.
    Here's the code I am using:
    Payments _payment = (Payments)SBOCompany.GetBusinessObject(BoObjectTypes.oIncomingPayments);
    _payment.CardCode = "C0001";
    _payment.CashSum = 19.95;
    _payment.TransferAccount = "112200-01";
    _payment.TransferSum = 19.95;
    payment.DocObjectCode = BoPaymentsObjectType.bopotOutgoingPayments;
    _payment.Checks.BankCode = "CBT-GA";
    _payment.Checks.CheckSum = 19.95;
    _payment.Checks.Add();
    if (_payment.Add() != 0)
      //failed

    Hi Barend,
    Thanks for the help. I'm now able to create outgoing payments after much trial and error ;). My only question now is how can I use the GL Account number (eg. 112200) instead of the internal account code (_SYS00000000004)? If I switch to 112200 or 112200-01 I get an error "[OACT] , 'No matching records found (ODBC -2028)'" but when I look in the OACT table, the SYS00000000004 record has 112200 for Segment0 and 01 for Segment_1. All the samples I've seen just use the GL account number so I'm not sure what I'm doing wrong.
    Payments _payment = (Payments)SBOCompany.GetBusinessObject(BoObjectTypes.oVendorPayments);
    _payment.CardCode = "C0001";
    _payment.DocDate = DateTime.Now;
    _payment.DocType = BoRcptTypes.rCustomer;
    payment.CheckAccount = "SYS00000000004";
    _payment.Checks.BankCode = "TEST";
    _payment.Checks.CheckSum = 19.95;
    _payment.Checks.Add();
    if (_payment.Add() != 0)
      //failed

  • Outgoing payment based on CreditNote

    Hi,
    How do I create an Outgoing payment for customer based on a fresh CreditNote  with the DI API in C# please ?
    I did try many combination from many different BoObjectTypes to many different BoRcptInvType and the code bellow is the last one I did try and I know it doesn't work
    // Maybe it's not the one for CreditMemo
    SAPbobsCOM.Payments Payment = (SAPbobsCOM.Payments)oCompany.GetBusinessObject(BoObjectTypes.oVendorPayments);
    Payment.DocObjectCode =  BoPaymentsObjectType.bopot_OutgoingPayments;
    Payment.CardCode = Document.CardCode;
    Payment.DocDate = DateTime.Now;
    Payment.DocCurrency = Document.DocCurrency;
    Payment.LocalCurrency = BoYesNoEnum.tYES;
    Payment.DocType = BoRcptTypes.rCustomer;
    Payment.HandWritten = BoYesNoEnum.tNO;
    Payment.CashSum = double.Parse(HeadersTable.Field["pos_DocTotal"].ToString());
    Payment.DocRate = 0;
    Payment.TaxDate = DateTime.Now;
    Payment.ContactPersonCode = Document.ContactPersonCode;
    Payment.ApplyVAT = BoYesNoEnum.tYES;
    Payment.JournalRemarks = Document.JournalMemo;
    Payment.Invoices.AppliedFC = 0;
    Payment.Invoices.DocEntry = int.Parse(ObjectCode);           // The CreditMemo I just created...
    Payment.Invoices.InvoiceType = BoRcptInvTypes.it_Return;  // MUST BE WRONG HERE
    Payment.Invoices.SumApplied = Payment.CashSum;
    Payment.Invoices.Add();
    if (Payment.Add() != 0)
        oCompany.GetLastError(out ErrorCode, out ErrorMsg);
        LogError(ErrorCode.ToString() + " : " + ErrorMsg);
        oCompany.EndTransaction(BoWfTransOpt.wf_RollBack);
    else
        oCompany.EndTransaction(BoWfTransOpt.wf_Commit);

    here the entire method that creates my CreditMemo which works fine and have no error on it.
    private void CreateCreditMemo()
                try
                    SAPbobsCOM.Documents Document = (SAPbobsCOM.Documents)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oCreditNotes);
                    SAPbobsCOM.BusinessPartners bp = (SAPbobsCOM.BusinessPartners)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oBusinessPartners);
                    SAPbobsCOM.Items Items = (SAPbobsCOM.Items)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems);
                    string CardCode = HeadersTable.Field["pos_CardCode"].ToString();
                    // The business partner is necessary
                    if (bp.GetByKey(CardCode))
                        Document.CardCode = CardCode;
                        Document.HandWritten = BoYesNoEnum.tNO;
                        Document.PaymentGroupCode = -1;
                        Document.DocDate = DateTime.Parse(HeadersTable.Field["pos_DocDate"].ToString());
                        Document.DocType = BoDocumentTypes.dDocument_Items;
                        Document.DocCurrency = bp.Currency;
                        Document.NumAtCard = HeadersTable.Field["pos_Ref1"].ToString();
                        Document.Series = GetSeriesFromCardCode(CardCode, DOCTYPE.RETURN);
                        // Now adding the detail for this credit memo
                        while (!DetailsTable.EOF)
                            // I did it this way to debug variables faster.  That's all
                            string ItemCode = DetailsTable.Field["detail_ItemCode"].ToString();
                            string ItemDescription = DetailsTable.Field["detail_ItemDesc"].ToString();
                            double PriceAfterVAT = double.Parse(DetailsTable.Field["detail_PriceOfVat"].ToString());
                            double Price = double.Parse(DetailsTable.Field["detail_Price"].ToString());
                            double Quantity = double.Parse(DetailsTable.Field["detail_Quantity"].ToString());
                            string WhsCode = DetailsTable.Field["detail_WhsCode"].ToString();
                            if (!Items.GetByKey(ItemCode))
                                LogError("The ItemCode " + ItemCode + " doesn't exist");
                                return;
                            else
                                Document.Lines.ItemCode = ItemCode;
                                Document.Lines.ItemDescription = ItemDescription;
                                Document.Lines.PriceAfterVAT = PriceAfterVAT;
                                Document.Lines.Price = Price;
                                Document.Lines.Quantity = Quantity;
                                Document.Lines.WarehouseCode = WhsCode;
                                Document.Lines.TaxCode = SAP.GetTaxCodeFromAddresses(bp.Addresses);
                                DetailsTable.MoveNext();
                                if (!DetailsTable.EOF)
                                    Document.Lines.Add();
                        if (Document.Add() != 0)
                            oCompany.GetLastError(out ErrorCode, out ErrorMsg);
                            LogError(ErrorCode.ToString() + " : " + ErrorMsg + " when adding the credit memo " + CardCode);
                        else
                            CreateOutgoingPayment(Document);
                    else
                        LogError("The business partner " + CardCode + " doesn't exist in SAP Business Partners");
                catch (Exception ex)
                    LogError(ex.Message + " when creating credit memo for " + blabla + " on " + DateTime.Now.ToString());

  • Outgoing Payment Error on approved payments

    Dear Experts,
    Can somebody please guide, there is an approval on outgoing payment, when user creates an outgoing payment against invoice(s), it goes for approval, and when user receives the outgoing payment back (approved) and try to add it in the system it gives an error "Withholding tax amount has changed on linked documents; create a new payment."
    Whereas if I add the same outgoing payment by selecting the same invoice(s) but without approval it does not give any error and add it in the system.
    Thanks & Regards,

    Hi,
    Please check the scenario in the Note No. : [1507246|https://b1-support.wdf.sap.corp/sap/support/notes/1507246] and see whether your issue is similar to the one reported.
    Kind Regards,
    Jitin
    SAP Business One Forum Team

  • Issue in Outgoing Payment

    Hi All,
    I am getting an issue in the outgoing payment. If I create an outgoing payment and save it as a draft, next time if open the draft payment doc and change its posting date, it de-selects all the invoices that I initially selected prior to saving it as draft. Please advice how to takle it.
    Regards,
    Siddiq

    Hi Muhammad.....
    Your list if invoices are depenedent on the posting date....
    So you just check which date you are selecting......
    Regards,
    Rahul

Maybe you are looking for