Skip to main content
Question

Purchase Order, adding a Detail changes an existing detail unit cost


I have a Purchase Order with three line-items (Details). I create the PO and there’s no problem, but when I do to add a Detail, it randomly updates a different Detail. The new detail has no id (because it is new) and has a LineNbr of -1.

Here is the PO details when I first create it:


Here is the payload which I PUT to the PurchaseOrder endpoint

{
  "id": "bdb7e18e-5300-f011-8368-065d7e32b4d5",
  "Details": [
    {
      "AlternateID": {
        "value": "8b974d0f-5f8a-b586-5e1a-a3d3900830ed"
      },
      "Account": {
        "value": "Accounts Payable (A/P)"
      },
      "BranchID": {
        "value": "SOURCE"
      },
      "OrderNbr": {
        "value": "24-TST2-024"
      },
      "InventoryID": {
        "value": "OTHER"
      },
      "LineType": {
        "value": "Service"
      },
      "LineNbr": {
        "value": -1
      },
      "LineDescription": {
        "value": "Measure & Install Trip"
      },
      "UOM": {
        "value": "EACH"
      },
      "OrderQty": {
        "value": 1
      },
      "UnitCost": {
        "value": 3500
      },
      "ExtendedCost": {
        "value": 3500
      },
      "Description": {
        "value": "COGS Contra - Fees"
      },
      "Project": {
        "value": "24-TST2"
      },
      "ProjectTask": {
        "value": "PURCHASE"
      },
      "Cancelled": {
        "value": false
      },
      "TaxCategory": {
        "value": "NT"
      }
    }
  ],
  "Description": {
    "value": "CO-01"
  },
  "OrderNbr": {
    "value": "24-TST2-024"
  },
  "OrderTotal": {
    "value": 9767.06
  }
}

After adding the new detail, for some reason it not only adds the new detail, but seemingly randomly modifies the unit cost of the second detail:

 

What is going on here? 

 

 

Forum|alt.badge.img+6
  • Captain II
  • March 14, 2025

You don’t need to include the LineNbr field when adding a new line - I’d be tempted to remove it. If you don't identify an existing line it will be appended.

Is the id value you’re sending at the top the NoteID of the purchase order vs sending the Type and OrderNbr fields?


RohitRattan88
Acumatica Moderator
Forum|alt.badge.img+4

@geoffatsource 

In addition to what ​@Django mentioned, I believe issue is caused by OrderTotal in your payload.

Before:

Before

After:

After

 

System seems to make OrderTotal same as provided in the payload by fixing/screwing-up a line amount

I suggest removing orderTotal from payload as it will be automatically calculated based on sum of lines


So this seems be a different issue, which is happening when I update the quantity on an existing detail. Here’s my test for you to repro:

  1. Create a new Purchase Order: PUT {{EndpointURL}} /PurchaseOrder
    {
      "Details": [
        {
          "AlternateID": {
            "value": "094fc35a-7a17-4b5d-bab6-a703de36de60"
          },
          "Account": {
            "value": "Accounts Payable (A/P)"
          },
          "BranchID": {
            "value": "SOURCE"
          },
          "OrderNbr": {
            "value": "{{acu_po_number}}"
          },
          "InventoryID": {
            "value": "PRODUCT"
          },
          "LineType": {
            "value": "Service"
          },
          "LineDescription": {
            "value": "BLR-600 Drapery @ Billard's Room"
          },
          "UOM": {
            "value": "EACH"
          },
          "OrderQty": {
            "value": 1
          },
          "UnitCost": {
            "value": 1401.5
          },
          "Description": {
            "value": "COGS Contra - Product"
          },
          "Project": {
            "value": "24-TST2"
          },
          "ProjectTask": {
            "value": "PURCHASE"
          },
          "Cancelled": {
            "value": false
          },
          "TaxCategory": {
            "value": "TAXABLE"
          }
        },
        {
          "AlternateID": {
            "value": "fb6b243d-c683-4491-9526-4b716dd98a3b"
          },
          "Account": {
            "value": "Accounts Payable (A/P)"
          },
          "BranchID": {
            "value": "SOURCE"
          },
          "OrderNbr": {
            "value": "{{acu_po_number}}"
          },
          "InventoryID": {
            "value": "PRODUCT"
          },
          "LineType": {
            "value": "Service"
          },
          "LineDescription": {
            "value": "BLR-601 Drapery Divider @ Billard's Room"
          },
          "UOM": {
            "value": "EACH"
          },
          "OrderQty": {
            "value": 2
          },
          "UnitCost": {
            "value": 2432.5
          },
          "Description": {
            "value": "COGS Contra - Product"
          },
          "Project": {
            "value": "24-TST2"
          },
          "ProjectTask": {
            "value": "PURCHASE"
          },
          "Cancelled": {
            "value": false
          },
          "TaxCategory": {
            "value": "TAXABLE"
          }
        },
        {
          "AlternateID": {
            "value": "b3c2e639-545b-47ad-842c-d74ad90cb1fa"
          },
          "Account": {
            "value": "Accounts Payable (A/P)"
          },
          "BranchID": {
            "value": "SOURCE"
          },
          "OrderNbr": {
            "value": "{{acu_po_number}}"
          },
          "InventoryID": {
            "value": "VENDOR_FREIGHT"
          },
          "LineType": {
            "value": "Service"
          },
          "LineDescription": {
            "value": "Invoice 1018"
          },
          "UOM": {
            "value": "EACH"
          },
          "OrderQty": {
            "value": 1
          },
          "UnitCost": {
            "value": 2433.06
          },
          "Description": {
            "value": "COGS Contra - Fees"
          },
          "Project": {
            "value": "24-TST2"
          },
          "ProjectTask": {
            "value": "PURCHASE"
          },
          "Cancelled": {
            "value": false
          },
          "TaxCategory": {
            "value": "NT"
          }
        }
      ],
      "Hold": {
        "value": false
      },
      "Date": {
        "value": "2024-12-02"
      },
      "Description": {
        "value": ""
      },
      "OrderNbr": {
        "value": "{{acu_po_number}}"
      },
      "Project": {
        "value": "24-TST2"
      },
      "Type": {
        "value": "PD"
      },
      "VendorID": {
        "value": "V0000230"
      }
    }
  2. Place on hold (PUT PurchaseOrder)
    {
        "id": "{{acu_purchase_order_id}}",
        "Hold": {
            "value": true
        }
    }
     
  3. Update an existing detail (PUT PurchaseOrder)
    {
      "id": "{{acu_purchase_order_id}}",
      "Details": [
        {
          "id": "{{acu_purchase_order_detail_id}}",
          "AlternateID": {
            "value": "fb6b243d-c683-4491-9526-4b716dd98a3b"
          },
          "LineDescription": {
            "value": "BLR-601 Drapery Divider @ Billard's Room"
          },
          "UOM": {
            "value": "EACH"
          },
          "OrderQty": {
            "value": 1
          },
          "UnitCost": {
            "value": 2432.5
          },
          "Cancelled": {
            "value": false
          }
        }
      ],
      "Description": {
        "value": "CO-01"
      }
    }

    As you can see, the quantity changes but the total becomes $3500 instead of remaining $2432.50.

  4. Resubmit exact same update request (PUT PurchaseOrder) 

    Now it is correct.
     

This appears to be some sort of bug in Acumatica. SIDE NOTE: If I use a different VendorID when I create the purchaseOrder, the incorrect $3500 value is something else. Sometimes $0 or $34.95 or some other value… always the same though for that specific vendor.

What could be going on? I am running Acumatica 24.114.0020 on my instance. This is a sandbox. I am using an API extended from the Default 23.200.001 (with no other changes)

 


@RohitRattan88 can I get this escalated? Thanks!


RohitRattan88
Acumatica Moderator
Forum|alt.badge.img+4

@geoffatsource 

I has a chance to review this but I could not reproduce above scenario for 24.114.0020 SalesDemo, on 23.200.001 endpoint with no customizations published. See below:

Create PO: Put /PurchaseOrder

{
    "Hold": {
        "value": false
    },
	"Branch": {
        "value": "PRODWHOLE"
    },
    "CurrencyID": {
        "value": "USD"
    },
    "Date": {
        "value": "2025-03-21T00:00:00-04:00"
    },
    "Description": {"value": "Test Purchase Order"},
    "Location": {
        "value": "MAIN"
    },
    "Project": {
        "value": "X"
    },
    "Terms": {
        "value": "30D"
    },
    "Type": {
        "value": "Normal"
    },
    "VendorID": {
        "value": "CONNETJENN"
    },
    "Details": 
	[
		{
            "BranchID": {
                "value": "PRODWHOLE"
            },
            "InventoryID": {
                "value": "CONBABY1"
            },
            "LineDescription": {
                "value": "South Shore Savannah Changing Table"
            },
            "OrderQty": {
                "value": 1.000000
            },
            "OrderType": {
                "value": "RO"
            },
            "Project": {
                "value": "X"
            },
            "TaxCategory": {
                "value": "TAXABLE"
            },
            "UnitCost": {
                "value": 100.00000
            },
            "UOM": {
                "value": "EA"
            },
            "WarehouseID": {
                "value": "WHOLESALE"
            }
        }, 
		{
            "BranchID": {
                "value": "PRODWHOLE"
            },
            "InventoryID": {
                "value": "CONBABY2"
            },
            "LineDescription": {
                "value": "Little Tikes Bold n Bright Table & Chairs"
			},
            "OrderQty": {
                "value": 2.000000
            },
            "OrderType": {
                "value": "RO"
            },
            "Project": {
                "value": "X"
            },
            "TaxCategory": {
                "value": "TAXABLE"
            },
            "UnitCost": {
                "value": 150.00000
            },
            "UOM": {
                "value": "EA"
            },
            "WarehouseID": {
                "value": "WHOLESALE"
            }
        },
		{
            "BranchID": {
                "value": "PRODWHOLE"
            },
            "InventoryID": {
                "value": "CONBABY3"
            },
            "LineDescription": {
                "value": "Grac Pack N Play with Newborn Napperstation"
            },
			"OrderQty": {
                "value": 1.000000
            },
            "OrderType": {
                "value": "RO"
            },
            "Project": {
                "value": "X"
            },
            "TaxCategory": {
                "value": "TAXABLE"
            },
            "UnitCost": {
                "value": 125.00000
            },
            "UOM": {
                "value": "EA"
            },
            "WarehouseID": {
                "value": "WHOLESALE"
            }
        }
    ]
}

Result:

Put on Hold: 

{
    "id": "04edcad5-8b06-f011-87ec-2c0da700c223",
    "Hold": {
        "value": true
    }
}

Update line 2: Put /PurchaseOrder

{
    "id": "04edcad5-8b06-f011-87ec-2c0da700c223",
    "Details": 
    [
        {
            "id": "00e6fedb-8b06-f011-87ec-2c0da700c223",
            "LineDescription": {
                "value": "Little Tikes Bold n Bright Table & Chairs - updated"
            },
            "OrderQty": {
                "value": 1.000000
            },
            "UnitCost": {
                "value": 175.000000
            },
            "UOM": {
                "value": "EA"
            }
        }
    ]   
}

Result:

 

Please review any setup and/or customizations published on the site.

If you require us to help identify issue, I suggest creating a DEV support case with Acumatica

Cheers


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings