FIX Accountancy - Product admin - SQL error when we affect accounting account with product_perentity activated

This commit is contained in:
Alexandre SPANGARO 2021-10-29 05:47:29 +02:00
parent 82a35f82b4
commit da52742421

View File

@ -198,7 +198,7 @@ if ($action == 'update') {
$nb_exists = $db->num_rows($resql_exists);
if ($nb_exists <= 0) {
// insert
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "product_perentity (fk_product, entity, '" . $db->escape($accountancy_field_name) . "')";
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "product_perentity (fk_product, entity, " . $db->escape($accountancy_field_name) . ")";
$sql .= " VALUES (" . ((int) $productid) . ", " . ((int) $conf->entity) . ", '" . $db->escape($accounting->account_number) . "')";
} else {
$obj_exists = $db->fetch_object($resql_exists);