Skip to Content
1
Former Member
May 30, 2016 at 07:21 PM

SAP B1 Outgoing payment with tax withholding via DI API

1016 Views

Good evening,

I'm trying to create an Outgoing Payment to a Vendor using the DI API.

The payment is not linked to any document and it has the tax withholding .

I set the tax withholding code, the base sum amount and the tax withholding's amount.

The payment method is Transfer and I set in the field "TransferSum" the amount of the payment without the tax withholding.

When I create the document, it sets automatically the OVPM field "NoDocSum" with the amount of the payment, without the amount of the tax withholding.

In this way, the Outgoing Payment document created is wrong because it calculates twice the amount of the tax withholding.

Is there a way to set via DI API the field "NoDocSum" with the total amount of the document? (like it happens when an outgoing payment is created in SAP B1)

This is the code that i used:

 Payments oDoc =  (Payments)SBOCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oVendorPayments);

oDoc.CardCode = "FD1254"; oDoc.DocType = BoRcptTypes.rSupplier; oDoc.DocObjectCode = BoPaymentsObjectType.bopot_OutgoingPayments; oDoc.WTCode = "OA"; oDoc.WtBaseSum = "100.00"; oDoc.WTAmount = "20.00"; oDoc.TransferSum = "480.00" // Total amount of the document - amount of tax withholding oDoc.TransferAccount = "1254846"; if (oDoc.Add() != 0) { //fail }

Regards

Fabio Di Gregorio