Question

Getting the error error":"'POAccrualAcctID' cannot be empty. when submitting a PO Receipt

  • 12 February 2024
  • 5 replies
  • 70 views

In our application we are creating Purchase Order Receipts and they had been working fine, but we had not used this function for 6 months or so  and are using it again. 

We are getting this error

GuzzleHttp\Exception\ClientException: Client error: `PUT https://prestigesalonproducts.acumatica.com/entity/ORDIO/20.200.001/PurchaseReceipt` resulted in a `422 Unprocessable Entity` response: {"id":"15468762-cac9-ee11-65424-12a215648465216","rowNumber":1,"note":null,"error":"'POAccrualAcctID' cannot be empty.;

 

Here is our code

return [

            'note' => $receipt->comment,

            'VendorID' => ['value' => $po->vendor_id],

            'PostPeriod' => ['value' => now()->format('mY')],

            'Details' => collect($receipt->products)->map(function ($product, $key) use ($po) {

                return [

                    'InventoryID' => ['value' => $product->inventory_id],

                    'ReceiptQty' => ['value' => $product->qty],

                    'POOrderNbr' => ['value' => $po->ref_number],

                    'POOrderType' => ['value' => 'Normal'],

                   

                ];

            })->values()->toArray(),

 

I don’t see where the variable POAccrualAcctID is part of the API I did find AccuralAccount

and tried adding 

'Account' => ['AccrualAccount' => ['value' => '2222']],

or 

'Account' => ['POAccrualAcctID' => ['value' => '2222']],

 

Thank you very much for your help 

 

 

 

 


5 replies

Userlevel 4
Badge

Have you verify that Inventory Item has Purchase Accrual account configured? 

Userlevel 7
Badge +12

@nextgendesigns 

Please check the GL accounts mapping done for Inventory ID and item class 

 

Userlevel 7
Badge +12

On the Purchase Receipt>Details you can add the Accrual Account so you can see what is being set to. Try manually doing the receipt using the same item and vendor and see if this is getting set as if it is you do not need to sent it in API call unless you want it to post somewhere else

 

Thank you all for the input! I had hoped that was the issue, but I checked and the items that we are having the error on have an AccrualAccount set and when comparing it to ones that do work they match for the Accrual Account

When I get the untruncated api reasponce it is

"AccrualAccount":{"error":"''Accrual Account'' cannot be empty."},

Even if I try to manually add in 


'Account' => ['AccrualAccount' => ['value' => '2222']],

It still gives same the error. 

If I do a manual Receipt it works fine and shows the Accrual account

 

 

When I use the API the top one 6700000 fails with the Accrual Account error and the bottom one 6700010 submits just fine if i enter a receipt though the api with just them on there 

Userlevel 7
Badge

Hi @nextgendesigns were you able to find a solution? Thank you!

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved