Topic: Purchase order delivery changes purch_data table

FA 2.4.11 default theme

When I enter a new purchase order, then click the Purchase Order Delivery link the data in the purch_data table changes.

Specifically the supplier_description data changes from e.g.

梨山武陵頂級烏龍茶 - 75 g - Wu Ling

to:

Wu Ling 75 grams

This shorter English description matches the description column of the item_codes table.

I would appreciate some ideas on why this is happening and how to prevent it.

Re: Purchase order delivery changes purch_data table

purchasing/includes/purchasing_db.inc

Line 113

    if ($description != "")
        $sql .= ",supplier_description=".db_escape($description);
    $sql .= " WHERE stock_id=".db_escape($stock_id)." AND supplier_id=".db_escape($supplier_id);

Why???

This means if the description is not empty e.g. already has data, change the supplier description.

If there is a reason for this, it does not work for me, as every time I receive an order my supplier description changes.

If I change the first line to 

if ($description = "")

then the supplier data remains intact.

I think it would make more sense to scrap this section of code and simply check that the description is not empty when creating a product, which I'm pretty sure FA does already.