Hi Community,
We need to support a use case that includes the creation of Purchase Credit Notes based on Purchase Invoices.
When we are posting the Purchas Credit Notes, the response we get is "Internal error (-5002) occurred"
We are not sure if it’s a bug in Service Layer or we are posting it wrong (same body works for posting a Purchase Invoices based on Purchase Delivery Note)
We are using SAP B1 9.3 PL3, but this bug is also replicated in other version 9.2pl4 and 9.2pl5.
Here are the posting we are doing –
First Step – post a simple Purchase Invoices
Post /PurchaseInvoices
{
"CardCode": "VO_Main",
"DocDate": "2018-06-20",
"DocDueDate": "2018-07-20",
"DocumentLines": [
{
"ItemCode": "SP234325",
"Quantity": "100",
"UnitPrice": "30"
}
]
}
Response – 201 Created
{
"DocEntry": 451,
.........
....
...
"DocumentLines": [
{
"LineNum": 0,
"ItemCode": "SP234325",
Second Step – Post Purchase Credit Notes based on Purchase Invoices from step 1 ("DocEntry": 451, one line with " BaseLine ": 0,)
Post /PurchaseCreditNotes
{
"CardCode": "VO_Main",
"DocumentLines": [
{
"BaseType": "18",
"BaseEntry": "451",
"BaseLine": "0"
}
]
}
Response - 400 Bad Request
{
"error": {
"code": -5002,
"message": {
"lang": "en-us",
"value": "Internal error (-5002) occurred"
}
}
}