Error on config file

Hello,

Please what does the message below imply and how can i resolve it

Warning, your config file (htdocs/conf/conf.php ) can be overwritten by the web server. This is a serious security hole. Modify permissions on file to be in read only mode for operating system user used by Web server. If you use Windows and FAT format for your disk, you must know that this file system does not allow to add permissions on file, so can’t be completely safe. This security warning will remain active as long as the vulnerability is present.

Thank you

unfortunately you didn’t write which operating system you have.
you only have to give your config read rights.
with a Linux (ubuntu) operating system it works like this

chmod -R 400 /var/www/dolibarr/htdocs/conf/conf.php

follow my installation guide

Installieren und Härten von Dolibarr

is in german

for windows open dolibarr folder/htdocs/conf/
right-click conf.php and set it to read-only

reg. Scalar

Thank you Scalar, well appreciated. Will try it out.

Can you help with stock issues i am experiencing?

  1. Product Stock Alert on dashboard not showing

Hello Scalar,

I didnt find htdocs…

How can i locate it?

Apache Version 2.4.57
MySQL Version 10.5.20-MariaDB-cll-lve-log
Architecture x86_64
Operating System linux

just use the comand i give you for Linux system

log in to your Server
user with root right and password

sudo -s

my be he ask again for password

chmod -R 400 /var/www/"name of your dolibarr installation"/htdocs/conf/conf.php

and this it is!

if you serching for htdocs folder

dir /var/www/"name of your dolibarr installation"/

reg Scalar

please explain

  • is it related to dolibarr or the server setting?
  • which alarm you want to serve
  • what you do to get an alarm

reg Scalar

Thank you Scalar, would try this out

@Scalar Thanks once again.

Its not about server settings but a module (Products and Stocks)

When a stock quantity is set, it is expected that the Product Stock Alert widget on the dashboard captures that information so the warehouse officer or anyone placed in charge can see and refill or raise a purchase order.

Rignt now, even when the product stock has gone below the Alert quantity, nothing shows on the stock alert on the dashboard.

I have checked all settings covering Products and Stock yet no change. Could this be a bug?

@Scalar just use the comand i give you for Linux system

log in to your Server
user with root right and password

sudo -s

my be he ask again for password

chmod -R 400 /var/www/"name of your dolibarr installation"/htdocs/conf/conf.php

and this it is!

if you serching for htdocs folder

dir /var/www/"name of your dolibarr installation"/

reg Scalar

I will try this out too

Thanks

Hi Absmachin

This module is also dependent on other modules.

“i” When module Lot/Serial is on, automatic stock decrease is forced to ‘Decrease real stocks on shipping validation’ and automatic increase mode is forced to ‘Increase real stocks on manual dispatching into warehouses’ and can’t be edited. Other options can be defined as you want.

“i” If you use the Point of Sale module (POS) provided by default or an external module, this setup may be ignored by your POS module. Most POS modules are designed by default to create an invoice immediately and decrease stock irrespective of the options here. So if you need or not to have a stock decrease when registering a sale from your POS, check also your POS module setup.

The - Stock alerts for products - is displayed on the front page, here move the widget to the position you want.
I only use this widget in the test environment and therefore have very little experience with it.

reg Scalar

@Scalar , thank you so much, you have been of tremendous help.

The product stock alert now shows, but only 5 on the list. I have to do a refresh each time to get the next set of alert. I was able to trace to the stock alert source file and saw ($Max = 5). I changed it to 50 to accommodate listing incase they are much in number, but it isnt going beyond 5 still even after saving, logging out and relogging in.

Beside, is there not a way te stock laert can be like a report where the warehouse officer checks daily to do his work more efficiently?

If it should be on the dashboard, then it should be able to also go beyond 5 or there is a button to use to get full list view.

Pls can you help with this? maybe i dont know where to check the full list, tho i have looked for it

Thank you

@Scalar

This is the code showing max number of product stock alert quantity when displayed on the dashboard.

It was 5 before now, and the max output is 5, now we want output of the product stock alert to show 50pcs or more. After changing to 50 as seen in the code, it still shows 5 rows only max.

include_once DOL_DOCUMENT_ROOT.‘/core/boxes/modules_boxes.php’;
include_once DOL_DOCUMENT_ROOT.‘/product/class/product.class.php’;

/**

  • Class to manage the box to show too low stocks products
    */
    class box_produits_alerte_stock extends ModeleBoxes
    {
    public $boxcode = “productsalertstock”;
    public $boximg = “object_product”;
    public $boxlabel = “BoxProductsAlertStock”;
    public $depends = array(“produit”);

    /**

    • @var DoliDB Database handler.
      */
      public $db;

    public $param;

    public $info_box_head = array();
    public $info_box_contents = array();

    /**

    • Constructor

    • @param DoliDB $db Database handler

    • @param string $param More parameters
      */
      public function __construct($db, $param = ‘’)
      {
      global $conf, $user;

      $this->db = $db;

      $listofmodulesforexternal = explode(‘,’, $conf->global->MAIN_MODULES_FOR_EXTERNAL);
      $tmpentry = array(‘enabled’=>((isModEnabled(“product”) || isModEnabled(“service”)) && isModEnabled(‘stock’)), ‘perms’=>!empty($user->rights->stock->lire), ‘module’=>‘product|service|stock’);
      $showmode = isVisibleToUserType(($user->socid > 0 ? 1 : 0), $tmpentry, $listofmodulesforexternal);
      $this->hidden = ($showmode != 1);
      }

    /**

    • Load data into info_box_contents array to show array later.

    • @param int $max Maximum number of records to load

    • @return void
      */
      public function loadBox($max = 50)
      {
      global $user, $langs, $conf, $hookmanager;

      $this->max = $max;

      include_once DOL_DOCUMENT_ROOT.‘/product/class/product.class.php’;
      $productstatic = new Product($this->db);

      $this->info_box_head = array(‘text’ => $langs->trans(“BoxTitleProductsAlertStock”, $max));

      if (($user->rights->produit->lire || $user->rights->service->lire) && $user->rights->stock->lire) {
      $sql = “SELECT p.rowid, p.label, p.price, p.ref, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.barcode, p.seuil_stock_alerte, p.entity,”;
      $sql .= " p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export,“;
      $sql .= " p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export,”;
      $sql .= " SUM(“.$this->db->ifsql(“s.reel IS NULL”, “0”, “s.reel”).”) as total_stock";
      $sql .= " FROM ".MAIN_DB_PREFIX.“product as p”;

What is actually the problem?

Pls anyone with this understanding can help too.

Thank you

Why do you want to change that in the source code.

go to

Products | Services → Stock
click - edit stock limit for alert
enter the minimum stock here

done

reg Scalar

@Scalar

Thank you for the feedback

It is not product minimum or limit i want to set.

see picture below that shows on the dashboard as output for products below minimum set quantity. It lists only 5 products even when there are more than 5

So i edited the code for max number from 5 to 50 or above, but no effect, still shows 5 as seen.

Another way i thought would work was to use the stock report directly, but it doesn’t show warehouse to know which is for which. No place to add extrafield for it or sort… according to warehouses

Hope this is clearer now

thank you

Hi Absmachin

I hope now I have understood you correctly
you want to show more rows in the alert widget

Menu Path: Home → Setup → Widgets

scroll all down

set up:
Max. number of lines for widgets - “insert your number”

reg Scalar

@Scalar ,

Gracious thank you. It worked. WOW!!!

Would it be out of place to humbly request a small Q&A session with some of us here that are newbie to this awesome application? :grinning:

Pls besides, can you help with how we can print directly to a printer as against first downloading the document(like invoice receipt) before before initiating printing

This scenario is pathetic because customers want to get their receipt almost immediately and other softwares do this with ease.

Also, we use a thermal printer to print (80mm x 210mm). i have tried possible best to make the invoice receipt to fit into the size for printing, but it has been difficult. Either it cuts half of the page or its so tiny you cant even read.

So for now we dont use the printer, we still issue hard copy invoice

can you help us?

Thank you

Hi Absmachin

This is a bit more than just an attitude.
What you are looking for is a completely new module.

For the document, I would recommend you to create an ODT that fits your specifications

Create an ODT document template

reg Scalar

@Scalar

Thank you for the response.

I apologize if my attitude is perceived otherwise.

would try the solution you gave

thank you, i appreciate your support

you should ask a developer for that
I’m just a simple user
the real ones can be found here

Developing for Dolibarr

Thank you @saclar,
You have been of tremendous help.

Gracia