cancel
Showing results for 
Search instead for 
Did you mean: 

How to add outgoing payment on account in PHP, SAP B1?

former_member183402
Participant
0 Kudos

Hi all,

I know how to add outgoing or incoming payment with Invoices in PHP it works fine, but I tried to add outgoing payment on account it does not work, below is my codes I tried to do I do know if there is something I forget

$oIncoming=$mycomp->GetBusinessObject(46);
$oIncoming->CardCode="303000";
$oIncoming->DocDate="2019-02-07";
$oIncoming->TaxDate="2019-02-07";
$oIncoming->BPLId=4;
$oIncoming->Series=78;

$oIncoming->CashSum=1000;
$oIncoming->CashAccount="561100";

$oIncoming->AccountPayments->AccountCode = "303000";
$oIncoming->AccountPayments->SumPaid = 1000;
$oIncoming->AccountPayments->OcrCode="AB";
$RetCode=$oIncoming->AccountPayments->Add;

$RetCode=$oIncoming->Add;
if ($RetCode==0)
{
echo"Added";
}
else
{
echo"Not added";
}

Please anyone can help me

Accepted Solutions (0)

Answers (1)

Answers (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Rurangwa Schadrack,

Check the following thread:

outgoing payments(account) via DI API SDK

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

former_member183402
Participant
0 Kudos

Hi ANKIT,

I checked the link you sent, is there the static value I can use to initialize DocType instead of using SAPbobsCOM.BoRcptTypes.rAccount ? because PHP cannot understand it.

I tried to add DocType field in my codes like this

$oIncoming->DocType="rAccount";  //OR

$oIncoming->DocType="Account";  //OR

$oIncoming->DocType="A";

All above codes displays error message ( ! ) com_exception: Parameter 0: Type mismatch.

I think the problem is there

Thank you

former_member183402
Participant
0 Kudos

Hi ANKIT,

I created journal entry instead of incoming payment on account, that solved my problem.

Thank you