Package: dolibarr
Version: 4.0.2+dfsg4-2
Severity: normal

Dear Maintainer,

After having added a customer in Dolibarr, I gave this customer an
absolute discount. Then, I tried to create a proposal, however, applying
the discount fails with the error message:

"You have an error in your SQL syntax; check the manual that corresponds
to your MariaDB server version for the right syntax to use near ' 0)' at
line 1 sql=INSERT INTO llx_propaldet (fk_propal, fk_parent_line, label,
description, fk_product, product_type, fk_remise_except, qty, tva_tx,
localtax1_tx, localtax2_tx, localtax1_type, localtax2_type, subprice,
remise_percent, info_bits, total_ht, total_tva, total_localtax1,
total_localtax2, total_ttc, fk_product_fournisseur_price, buy_price_ht,
special_code, rang, fk_unit, date_start, date_end, fk_multicurrency,
multicurrency_code, multicurrency_subprice, multicurrency_total_ht,
multicurrency_total_tva, multicurrency_total_ttc) VALUES (1, null, null,
'test discount', null, '0', '1', 1, 19, 0, 0, '0', '0', -100, 0, '2',
-100, -19, 0, 0, -119, null, '0', 0, -1, NULL, null, null, null, '', 0,
0, , 0)"

Apparently, the SQL statement is invalid. I tried to manually execute
the statement through the mysql tool and added a value of '0' at the
last but one position in the value vector. This has actually worked, so
the discount is now correctly applied in the offer.

I then tried to find a quickfix for this problem. The SQL statement is
crafted in the file
"/usr/share/dolibarr/htdocs/comm/propal/class/propal.class.php" on lines
3252 and following. The class member "multicurrency_total_tva" seems to
be uninitialized, so I just changed line 3098 to:

    var $multicurrency_total_tva = 0;

As I am not using multiple currency currently, this seems to be an
adequate fix for me now.

Best,
Maximilian

-- System Information:
Debian Release: 8.8
  APT prefers stable
  APT policy: (900, 'stable'), (800, 'testing'), (500, 'stable-updates')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages dolibarr depends on:
ii  fonts-dejavu-core                           2.34-1
ii  javascript-common                           11
ii  libapache2-mod-php                          1:7.0+49
ii  libapache2-mod-php7.0 [libapache2-mod-php]  7.0.16-3
ii  libjs-jquery                                3.1.1-2
ii  libjs-jquery-cookie                         11-3
ii  libjs-jquery-flot                           0.8.2+dfsg-1
ii  libjs-jquery-ui                             1.10.1+dfsg-1
ii  libnusoap-php                               0.9.5-3
ii  libphp-adodb                                5.20.9-1
ii  php-curl                                    1:7.0+49
ii  php-gd                                      1:7.0+49
ii  php-ldap                                    1:7.0+49
ii  php-pclzip                                  2.8.2-4
ii  php-tcpdf                                   6.0.093+dfsg-1
ii  php7.0-cli [php-cli]                        7.0.16-3
ii  php7.0-curl [php-curl]                      7.0.16-3
ii  php7.0-gd [php-gd]                          7.0.16-3
ii  php7.0-ldap [php-ldap]                      7.0.16-3
ii  php7.0-mysql [php-mysqli]                   7.0.16-3
ii  xdg-utils                                   1.1.0~rc1+git20111210-7.4

Versions of packages dolibarr recommends:
ii  apache2 [httpd]       2.4.25-3
ii  default-mysql-client  1.0.2
ii  default-mysql-server  1.0.2

Versions of packages dolibarr suggests:
pn  php-geoip          <none>
ii  w3m [www-browser]  0.5.3-19+deb8u1

-- no debconf information


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to