Skip to content

Commit

Permalink
#487 [Config] fix: call to conf value
Browse files Browse the repository at this point in the history
  • Loading branch information
Théo David committed Aug 21, 2023
1 parent 458dd33 commit 8a4690c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions admin/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,13 @@
if (isModEnabled('barcode')) {
$product->barcode = -1;
}
if ($conf->global->$timesheetProductAndService['code'] > 0) {
$productID = $product->fetch($conf->global->$timesheetProductAndService['code']);
$confName = $timesheetProductAndService['code'];
if ($conf->global->$confName > 0) {
$productID = $product->fetch($conf->global->$confName);
} else {
$productID = $product->create($user);
dolibarr_set_const($db, $confName, $productID, 'integer', 0, '', $conf->entity);
}
dolibarr_set_const($db, $timesheetProductAndService['code'], $productID, 'integer', 0, '', $conf->entity);
}

dolibarr_set_const($db, 'DOLISIRH_PRODUCT_SERVICE_SET', 2, 'integer', 0, '', $conf->entity);
Expand Down

0 comments on commit 8a4690c

Please sign in to comment.