cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Updating PurchaseDownPayments with a service layer error: "Unallowed item cost [DPO1.INMPrice]

shine_chen
Explorer
0 Kudos
422

hello:

I encountered an error while updating my PurchaseDownPayments using the service layer, prompting "Unallowed item cost [DPO1. INMPrice][line: 1]"

My steps are as follows:

1. A PurchaseDownPayments was added, POST :https://IP:50000/b1s/v1/PurchaseDownPayments,code:

{
   "DocDate":"2024-12-24",
    "U_HBYID":"YFK2412240004",
    "DocumentLines":[
        {
            "InventoryQuantity":20,
            "TaxTotal":28.99,
            "ItemCode":"111020031",
            "VatGroup":"J2",
            "LineNum":1,
            "BaseType":-1,
            "Price":11.150442,
            "PriceAfterVAT":12.6,
            "LineTotal":223.01,
            "GrossTotal":252,
            "LastBuyInmPrice": 0.0,
            "StockInmPrice": 0.0,
            "UnitsOfMeasurment":1
        },
        {
            "InventoryQuantity":30,
            "TaxTotal":34.51,
            "ItemCode":"111020031",
            "VatGroup":"J2",
            "LineNum":2,
            "BaseType":-1,
            "Price":8.849558,
            "PriceAfterVAT":10,
            "LineTotal":265.49,
            "GrossTotal":300,
            "LastBuyInmPrice": 0.0,
            "StockInmPrice": 0.0,
            "UnitsOfMeasurment":1
        }
    ],
    "TaxDate":"2024-12-24",
    "Comments":"",
    "BPL_IDAssignedToInvoice":1,
    "DownPaymentType":"dptRequest",
    "CardCode":"S0000006",
    "DocDueDate":"2024-12-24",
    "DocTotal":552
}

 2. I changed the ratio to 80% in the client

3. I used the service layer for patch update, PATCH :https://IP:50000/b1s/v1/PurchaseDownPayments,code:

{
   "DocDate":"2024-12-24",
    "U_HBYID":"YFK2412240004",
    "DocumentLines":[
        {
            "InventoryQuantity":20,
            "TaxTotal":28.99,
            "ItemCode":"111020031",
            "VatGroup":"J2",
            "LineNum":1,
            "BaseType":-1,
            "Price":11.150442,
            "PriceAfterVAT":12.6,
            "LineTotal":223.01,
            "GrossTotal":252,
            "LastBuyInmPrice": 0.0,
            "StockInmPrice": 0.0,
            "UnitsOfMeasurment":1
        },
        {
            "InventoryQuantity":30,
            "TaxTotal":34.51,
            "ItemCode":"111020031",
            "VatGroup":"J2",
            "LineNum":2,
            "BaseType":-1,
            "Price":8.849558,
            "PriceAfterVAT":10,
            "LineTotal":265.49,
            "GrossTotal":300,
            "LastBuyInmPrice": 0.0,
            "StockInmPrice": 0.0,
            "UnitsOfMeasurment":1
        }
    ],
    "TaxDate":"2024-12-24",
    "Comments":"",
    "BPL_IDAssignedToInvoice":1,
    "DownPaymentType":"dptRequest",
    "CardCode":"S0000006",
    "DocDueDate":"2024-12-24",
    "DocTotal":552
}

shine_chen_0-1735019871939.png

 

Then I got an error and the version I was using was 2411.

The above operations I can directly operate in the client successfully.

Accepted Solutions (0)

Answers (1)

Answers (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi shine_chen,

Can you check the LineTotal value in the JSON request?

It can be caused by the incorrect LineTotal value which you are trying to set.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

shine_chen
Explorer
0 Kudos

Hi ANKIT_CHAUHAN

You mean I shouldn't pass this value?

Ask a Question