From f101e919c899041e677f07b396a2f460e0dbff67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 5 Dec 2019 21:30:47 +0100 Subject: [PATCH 1/4] The variable $out does not seem to be defined for all execution paths --- htdocs/core/class/html.form.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 23d7e88b45b..b2dd53aff58 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7663,7 +7663,8 @@ class Form { global $db, $conf, $langs, $user; - $sql = 'SELECT rowid, label FROM '.MAIN_DB_PREFIX.'c_exp_tax_cat WHERE active = 1'; + $out = ''; + $sql = 'SELECT rowid, label FROM '.MAIN_DB_PREFIX.'c_exp_tax_cat WHERE active = 1'; $sql .= ' AND entity IN (0,'.getEntity('exp_tax_cat').')'; if (!empty($excludeid)) $sql .= ' AND rowid NOT IN ('.implode(',', $excludeid).')'; $sql .= ' ORDER BY label'; @@ -7752,6 +7753,7 @@ class Form { global $db, $conf, $langs; + $out = ''; $sql = 'SELECT rowid, range_ik FROM '.MAIN_DB_PREFIX.'c_exp_tax_range'; $sql .= ' WHERE entity = '.$conf->entity.' AND active = 1'; @@ -7789,6 +7791,7 @@ class Form { global $db, $langs; + $out = ''; $sql = 'SELECT id, code, label FROM '.MAIN_DB_PREFIX.'c_type_fees'; $sql .= ' WHERE active = 1'; From 39da0bef9ec7b48b4930171f967cc8ac8b11f443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 9 Dec 2019 23:56:46 +0100 Subject: [PATCH 2/4] Update server_order.php --- htdocs/webservices/server_order.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php index 59ccbc29df0..157d34652c1 100644 --- a/htdocs/webservices/server_order.php +++ b/htdocs/webservices/server_order.php @@ -447,7 +447,7 @@ function getOrder($authentication, $id = '', $ref = '', $ref_ext = '') 'date' => $order->date ?dol_print_date($order->date, 'dayrfc') : '', 'date_creation' => $order->date_creation ?dol_print_date($order->date_creation, 'dayhourrfc') : '', 'date_validation' => $order->date_validation ?dol_print_date($order->date_creation, 'dayhourrfc') : '', - 'date_modification' => $order->datem ?dol_print_date($order->datem, 'dayhourrfc') : '', + 'date_modification' => $order->date_modification ?dol_print_date($order->date_modification, 'dayhourrfc') : '', 'remise' => $order->remise, 'remise_percent' => $order->remise_percent, @@ -531,10 +531,10 @@ function getOrdersForThirdParty($authentication, $idthirdparty) { $linesorders=array(); - $sql.='SELECT c.rowid as orderid'; - $sql.=' FROM '.MAIN_DB_PREFIX.'commande as c'; - $sql.=" WHERE c.entity = ".$conf->entity; - if ($idthirdparty != 'all' ) $sql.=" AND c.fk_soc = ".$db->escape($idthirdparty); + $sql = 'SELECT c.rowid as orderid'; + $sql .= ' FROM '.MAIN_DB_PREFIX.'commande as c'; + $sql .= " WHERE c.entity = ".$conf->entity; + if ($idthirdparty != 'all' ) $sql .= " AND c.fk_soc = ".$db->escape($idthirdparty); $resql=$db->query($sql); @@ -677,7 +677,8 @@ function createOrder($authentication, $order) // Init and check authentication $objectresp = array(); - $errorcode = ''; $errorlabel = ''; + $errorcode = ''; + $errorlabel = ''; $error = 0; $fuser = check_authentication($authentication, $error, $errorcode, $errorlabel); @@ -820,7 +821,8 @@ function validOrder($authentication, $id = '', $id_warehouse = 0) // Init and check authentication $objectresp=array(); - $errorcode='';$errorlabel=''; + $errorcode=''; + $errorlabel=''; $error=0; if ($authentication['entity']) $conf->entity=$authentication['entity']; $fuser=check_authentication($authentication, $error, $errorcode, $errorlabel); @@ -851,7 +853,7 @@ function validOrder($authentication, $id = '', $id_warehouse = 0) $db->rollback(); $error++; $errorcode = 'KO'; - $errorlabel = $newobject->error; + $errorlabel = $order->error; } } else @@ -859,7 +861,7 @@ function validOrder($authentication, $id = '', $id_warehouse = 0) $db->rollback(); $error++; $errorcode = 'KO'; - $errorlabel = $newobject->error; + $errorlabel = $order->error; } } else @@ -867,7 +869,7 @@ function validOrder($authentication, $id = '', $id_warehouse = 0) $db->rollback(); $error++; $errorcode = 'KO'; - $errorlabel = $newobject->error; + $errorlabel = $order->error; } } From 5572102ae57fdc0e05528edecb429edcd3663b35 Mon Sep 17 00:00:00 2001 From: Arunas Ruksnaitis Date: Tue, 10 Dec 2019 00:30:47 +0000 Subject: [PATCH 3/4] Docker corrections --- build/docker/Dockerfile | 18 ++++++++++++------ build/docker/docker-compose.yml | 2 +- build/docker/docker-run.sh | 3 ++- build/docker/mariadb/Dockerfile | 3 +++ 4 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 build/docker/mariadb/Dockerfile diff --git a/build/docker/Dockerfile b/build/docker/Dockerfile index 0d5918c3f4c..507170c7368 100644 --- a/build/docker/Dockerfile +++ b/build/docker/Dockerfile @@ -1,31 +1,37 @@ -FROM php:7.0-apache +FROM php:7.2-apache ENV HOST_USER_ID 33 ENV PHP_INI_DATE_TIMEZONE 'UTC' -RUN apt-get update && apt-get install -y libpng-dev libjpeg-dev libldap2-dev \ +RUN apt-get update && apt-get install -y libpng-dev libjpeg-dev libldap2-dev zlib1g-dev libicu-dev g++\ && rm -rf /var/lib/apt/lists/* \ && docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \ && docker-php-ext-install gd \ && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \ && docker-php-ext-install ldap \ && docker-php-ext-install mysqli \ - && apt-get purge -y libjpeg-dev libldap2-dev + && docker-php-ext-install calendar \ + && docker-php-ext-configure intl \ + && docker-php-ext-install intl \ + && apt-get autoremove --purge -y libjpeg-dev libldap2-dev zlib1g-dev libicu-dev g++ + +RUN mkdir /var/documents +RUN chown www-data /var/documents COPY docker-run.sh /usr/local/bin/ RUN chmod +x /usr/local/bin/docker-run.sh -RUN pecl install xdebug-2.5.5 && docker-php-ext-enable xdebug +RUN pecl install xdebug && docker-php-ext-enable xdebug RUN echo 'zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so"' >> /usr/local/etc/php/php.ini RUN echo 'xdebug.remote_autostart=0' >> /usr/local/etc/php/php.ini RUN echo 'xdebug.remote_enable=1' >> /usr/local/etc/php/php.ini RUN echo 'xdebug.default_enable=0' >> /usr/local/etc/php/php.ini -RUN echo 'xdebug.remote_host=docker.for.mac.host.internal' >> /usr/local/etc/php/php.ini +RUN echo 'xdebug.remote_host=docker.host' >> /usr/local/etc/php/php.ini RUN echo 'xdebug.remote_port=9000' >> /usr/local/etc/php/php.ini RUN echo 'xdebug.remote_connect_back=0' >> /usr/local/etc/php/php.ini RUN echo 'xdebug.profiler_enable=0' >> /usr/local/etc/php/php.ini RUN echo 'xdebug.remote_log="/tmp/xdebug.log"' >> /usr/local/etc/php/php.ini - +RUN echo '172.17.0.1 docker.host' >> /etc/hosts EXPOSE 80 diff --git a/build/docker/docker-compose.yml b/build/docker/docker-compose.yml index a2017335197..3fe6125a874 100644 --- a/build/docker/docker-compose.yml +++ b/build/docker/docker-compose.yml @@ -1,5 +1,5 @@ mariadb: - image: mariadb:latest + build: mariadb environment: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: dolibarr diff --git a/build/docker/docker-run.sh b/build/docker/docker-run.sh index c151e1c3cab..df7272c317d 100644 --- a/build/docker/docker-run.sh +++ b/build/docker/docker-run.sh @@ -3,7 +3,8 @@ usermod -u $HOST_USER_ID www-data groupmod -g $HOST_USER_ID www-data -chown -hR www-data:www-data /var/www +chgrp -hR www-data /var/www/html +chmod g+rwx /var/www/html/conf if [ ! -f /usr/local/etc/php/php.ini ]; then cat < /usr/local/etc/php/php.ini diff --git a/build/docker/mariadb/Dockerfile b/build/docker/mariadb/Dockerfile new file mode 100644 index 00000000000..a4db0f42065 --- /dev/null +++ b/build/docker/mariadb/Dockerfile @@ -0,0 +1,3 @@ +FROM mariadb:latest +# Enable comented out UTF8 charset/collation options +RUN sed '/utf8/ s/^#//' /etc/mysql/mariadb.cnf >/tmp/t && mv /tmp/t /etc/mysql/mariadb.cnf From e078bc6f83ac57e938bb47db971142ee1d7a9ed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 10 Dec 2019 08:08:56 +0100 Subject: [PATCH 4/4] doxygen --- .../fourn/class/fournisseur.facture.class.php | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 7ec271c84ec..dba7392a9e4 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2804,15 +2804,70 @@ class SupplierInvoiceLine extends CommonObjectLine */ public $fk_prev_id; + /** + * VAT code + * @var string + */ + public $vat_src_code; + + /** + * VAT % + * @var float + */ public $tva_tx; + + /** + * Local tax 1 % + * @var float + */ public $localtax1_tx; + + /** + * Local tax 2 % + * @var float + */ public $localtax2_tx; + + /** + * Quantity + * @var double + */ public $qty; + + /** + * Percent of discount + * @var float + */ public $remise_percent; + + /** + * Total amount without taxes + * @var float + */ public $total_ht; + + /** + * Total amount with taxes + * @var float + */ public $total_ttc; + + /** + * Total amount of taxes + * @var float + */ public $total_tva; + + /** + * Total local tax 1 amount + * @var float + */ public $total_localtax1; + + /** + * Total local tax 2 amount + * @var float + */ public $total_localtax2; /** @@ -2820,8 +2875,24 @@ class SupplierInvoiceLine extends CommonObjectLine */ public $fk_product; + /** + * Type of the product. 0 for product 1 for service + * @var int + */ public $product_type; + + /** + * Label of the product + * @var string + */ public $product_label; + + /** + * List of cumulative options: + * Bit 0: 0 si TVA normal - 1 si TVA NPR + * Bit 1: 0 si ligne normal - 1 si bit discount (link to line into llx_remise_except) + * @var int + */ public $info_bits; /** @@ -2830,8 +2901,22 @@ class SupplierInvoiceLine extends CommonObjectLine public $fk_parent_line; public $special_code; + + /** + * @var int rank of line + */ public $rang; + + /** + * Total local tax 1 amount + * @var float + */ public $localtax1_type; + + /** + * Total local tax 2 amount + * @var float + */ public $localtax2_type; // Multicurrency