From d6f3a5c046396d200ef7026f5293d1561d3abc3b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Mar 2016 15:01:39 +0100 Subject: [PATCH 1/7] Fix bad path --- htdocs/product/document.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/document.php b/htdocs/product/document.php index eb8530259da..6a8ee778590 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -70,8 +70,8 @@ if ($id > 0 || ! empty($ref)) { $result = $object->fetch($id, $ref); - if (! empty($conf->product->enabled)) $upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, 'product').dol_sanitizeFileName($object->ref); - elseif (! empty($conf->service->enabled)) $upload_dir = $conf->service->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, 'product').dol_sanitizeFileName($object->ref); + if (! empty($conf->product->enabled)) $upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product').dol_sanitizeFileName($object->ref); + elseif (! empty($conf->service->enabled)) $upload_dir = $conf->service->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product').dol_sanitizeFileName($object->ref); if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) // For backward compatiblity, we scan also old dirs { From a9058df75371aa2dc8dbdfa16f449c6b76171774 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Mar 2016 10:47:17 +0100 Subject: [PATCH 2/7] Fix bad field in select --- htdocs/core/lib/tax.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index 2387332e670..0a3c4942857 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -108,7 +108,7 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction if ($modetax == 1) { // If vat paid on due invoices (non draft) - $sql = "SELECT s.rowid as socid, s.nom as name, s.siren as tva_intra, s.tva_assuj as assuj,"; + $sql = "SELECT s.rowid as socid, s.nom as name, s.tva_intra as tva_intra, s.tva_assuj as assuj,"; $sql.= " sum(f.$total_ht) as amount, sum(f.".$total_tva.") as tva,"; $sql.= " sum(f.localtax1) as localtax1,"; $sql.= " sum(f.localtax2) as localtax2"; From f87bb1206eb42b26c64b5663cfe9a1c0faa7cbb0 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 11 Mar 2016 15:42:14 +0100 Subject: [PATCH 3/7] Fix: wrong fk_parent_line in credit note with invoiceAvoirWithLines option --- htdocs/compta/facture.php | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 9fa6f7c7938..5fab485e655 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -755,10 +755,17 @@ if (empty($reshook)) $facture_source = new Facture($db); // fetch origin object if ($facture_source->fetch($object->fk_facture_source)>0) { + $fk_parent_line = 0; foreach($facture_source->lines as $line) { + // Reset fk_parent_line for no child products and special product + if (($line->product_type != 9 && empty($line->fk_parent_line)) || $line->product_type == 9) { + $fk_parent_line = 0; + } + $line->fk_facture = $object->id; + $line->fk_parent_line = $fk_parent_line; $line->subprice =-$line->subprice; // invert price for object $line->pa_ht = -$line->pa_ht; @@ -768,9 +775,14 @@ if (empty($reshook)) $line->total_localtax1=-$line->total_localtax1; $line->total_localtax2=-$line->total_localtax2; - $line->insert(); + $result = $line->insert(); $object->lines[] = $line; // insert new line in current object + + // Defined the new fk_parent_line + if ($result > 0 && $line->product_type == 9) { + $fk_parent_line = $result; + } } $object->update_price(1); @@ -1749,7 +1761,7 @@ if (empty($reshook)) } } } - + // bascule du statut d'un contact else if ($action == 'swapstatut') { @@ -1759,13 +1771,13 @@ if (empty($reshook)) dol_print_error($db); } } - + // Efface un contact else if ($action == 'deletecontact') { $object->fetch($id); $result = $object->delete_contact($lineid); - + if ($result >= 0) { header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id); exit(); @@ -1854,7 +1866,7 @@ if ($action == 'create') if ($element == 'project') { $projectid = $originid; - + if (!$cond_reglement_id) { $cond_reglement_id = $soc->cond_reglement_id; } @@ -1867,7 +1879,7 @@ if ($action == 'create') if (!$dateinvoice) { // Do not set 0 here (0 for a date is 1970) $dateinvoice = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$dateinvoice); - } + } } else { // For compatibility if ($element == 'order' || $element == 'commande') { @@ -2564,7 +2576,7 @@ else if ($id > 0 || ! empty($ref)) $qualified_for_stock_change = $object->hasProductsOrServices(1); } - if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change && $object->statut >= 1) + if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change && $object->statut >= 1) { $langs->load("stocks"); require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php'; @@ -2755,7 +2767,7 @@ else if ($id > 0 || ! empty($ref)) } // Clone confirmation - if ($action == 'clone') + if ($action == 'clone') { // Create an array for form $formquestion = array( @@ -2766,7 +2778,7 @@ else if ($id > 0 || ! empty($ref)) $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('CloneInvoice'), $langs->trans('ConfirmCloneInvoice', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } - if (! $formconfirm) + if (! $formconfirm) { $parameters = array('lineid' => $lineid); $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook @@ -3557,14 +3569,14 @@ else if ($id > 0 || ! empty($ref)) // modified by hook if (empty($reshook)) { // Editer une facture deja validee, sans paiement effectue et pas exporte en compta - if ($object->statut == 1) + if ($object->statut == 1) { // On verifie si les lignes de factures ont ete exportees en compta et/ou ventilees $ventilExportCompta = $object->getVentilExportCompta(); - if ($resteapayer == $object->total_ttc && empty($object->paye) && $ventilExportCompta == 0) + if ($resteapayer == $object->total_ttc && empty($object->paye) && $ventilExportCompta == 0) { - if (! $objectidnext && $object->is_last_in_cycle()) + if (! $objectidnext && $object->is_last_in_cycle()) { if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->creer)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->facture->invoice_advance->unvalidate))) From 7953f77b073c7a3b45f2d9b5ed757cff7103e00d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 11 Mar 2016 18:08:27 +0100 Subject: [PATCH 4/7] Fix: $fileparams is not defined --- htdocs/commande/card.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 83ad4d0ce70..83bd4d2e1ec 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1165,9 +1165,9 @@ if (empty($reshook)) - if (! $error && ! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->commande->creer) + if (! $error && ! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->commande->creer) { - if ($action == 'addcontact') + if ($action == 'addcontact') { if ($object->id > 0) { $contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid')); @@ -1188,7 +1188,7 @@ if (empty($reshook)) } // bascule du statut d'un contact - else if ($action == 'swapstatut') + else if ($action == 'swapstatut') { if ($object->id > 0) { $result = $object->swapContactStatus(GETPOST('ligne')); @@ -1198,7 +1198,7 @@ if (empty($reshook)) } // Efface un contact - else if ($action == 'deletecontact') + else if ($action == 'deletecontact') { $result = $object->delete_contact($lineid); @@ -1241,7 +1241,7 @@ if ($action == 'create' && $user->rights->commande->creer) $projectid = 0; $remise_absolue = 0; - + if (! empty($origin) && ! empty($originid)) { // Parse element/subelement (ex: project_task) $element = $subelement = $origin; @@ -1252,7 +1252,7 @@ if ($action == 'create' && $user->rights->commande->creer) if ($element == 'project') { $projectid = $originid; - + if (!$cond_reglement_id) { $cond_reglement_id = $soc->cond_reglement_id; } @@ -1444,7 +1444,7 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; // TODO How record was recorded OrderMode (llx_c_input_method) - + // Project if (! empty($conf->projet->enabled) && $socid > 0) { @@ -1542,7 +1542,7 @@ if ($action == 'create' && $user->rights->commande->creer) default: $newclassname = $classname; } - + print '' . $langs->trans($newclassname) . '' . $objectsrc->getNomUrl(1) . ''; print '' . $langs->trans('TotalHT') . '' . price($objectsrc->total_ht) . ''; print '' . $langs->trans('TotalVAT') . '' . price($objectsrc->total_tva) . ""; @@ -2021,7 +2021,7 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; // TODO How record was recorded OrderMode (llx_c_input_method) - + // Project if (! empty($conf->projet->enabled)) { @@ -2377,6 +2377,7 @@ if ($action == 'create' && $user->rights->commande->creer) $ref = dol_sanitizeFileName($object->ref); include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; + $fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+'); $file = $fileparams['fullname']; // Define output language From 731d1cfe41c9a6d82330fb7b6f5eab299b636728 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 12 Mar 2016 12:07:11 +0100 Subject: [PATCH 5/7] Update changelog for 3.8.4 --- ChangeLog | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/ChangeLog b/ChangeLog index 29666714337..47106e6170d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,109 @@ Upgrading to any other version or any other database system is abolutely require make a Dolibarr upgrade. +***** ChangeLog for 3.8.4 compared to 3.8.3 ***** +FIX: #3694 +FIX: #3798 #2519 Cron jobs would never be executed +FIX: #4155 Search Categories error +FIX: #4239 +FIX: #4272 Error when trying to print the page "Linked objects" of a Thirdparty +FIX: #4291 Correctly filter bank card GETPOSTs +FIX: #4291 Correctly filter external calendar GETPOSTs +FIX: #4341 +FIX: #4394 Untranslated label in list of expense reports +FIX: #4414 Supplier invoices use FAC_FORCE_DATE_VALIDATION client invoices property +FIX: #4418 +FIX: #4425 Missing "VAT" translation in supplier order popup +FIX: #4434 Weird behaviour when enabling multiprices +FIX: #4440 Wrong price is filled by Product::fetch into multiprices arrays +FIX: #4453 SEPA Direct Debit generated XML shows a trailing comma in RmtInf field +FIX: #4528 +FIX: #4556 desiredstock and seuil_stock_alerte cleared on modify product card +FIX: #4580 +FIX: #4583 Incorrect call of Categories::containing throws a DoliDB error +FIX: #4649 Wrong parameters order +FIX: #4768 +FIX: #4785 +FIX: Add a test to show bugged module with a bad declaration of dictionaries to avoid to see clean module to be breaked. +FIX: add Croatia into list of country in EEC +FIX: add missing global def for ttc column +FIX: ajax error with multicompany module +FIX: Avoid errors when batch stock is negative +FIX: bad field in select +FIX: bad path +FIX: bad transaction level due to code of situation invoices +FIX: best sql request +FIX: bookmark's user change after update if the user hasn't superadmin right +FIX: call trigger LINEBILL_SUPPLIER_CREATE +FIX: Can not disabled an opened service line in a contract +FIX: can't clone event +FIX: can't send mail to thirdparty contact if no mail defined on thirdparty card +FIX: Check stock of batch on shippment +FIX: code corrupting database +FIX: compatibility with multicompany transversal mode +FIX: compatibility with multicompany transversal mode and more security issue +FIX: Contrat card don't consider user permissions to show active/unactive service button +FIX: CVE CVE-2015-8685 +FIX: Deadlock situation. Can't edit anymore contract. FIX: List of automatic events was not visible. +FIX: disable main.inc.php hooks +FIX: do not show warning if account defined +FIX: don't see the sales representative of anothers entities +FIX: duration format +FIX: Correct problem of rights beetween tax and salaries module +FIX: Email templates not compatible with Multicompany +FIX: $fileparams is not defined +FIX: filter by socid if from customer card +FIX: for avoid conflict with "global $m" in memory.lib.php +FIX: for avoid division by 0 +FIX: hover css +FIX: If option to hide automatic ECM is on, dont show menu. +FIX: if we dont use SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE the hour is displayed on pdf +FIX: Introduce hidden option to disable feature than hangs when too much data +FIX: ISSUE #4506 : make working the PROPAL_CLONE_ON_CREATE_PAGE hidden constant +FIX: issue when bank module is disabled FIX: missing entity filter for lines of payment +FIX: list of leave request was not showing label correctly. +FIX: MAIN_THIRDPARTY_CREATION_INDIVIDUAL syntax error in name +FIX: markRate can be 100 +FIX: minor css error (pixel size must have "px"). Compatibility with old behaviour. +FIX: missing field "label" +FIX: missing signature and uniformize code between card and script +FIX: missing traduction +FIX: missing translation +FIX: missing translation key +FIX: nblignes not calculated after hook and hook can't modify this value. Usefull for modules +FIX: no database structure change is allowed into minor versions +FIX: no transaction in this place +FIX: Noway to validate a leave request for some uer even if they have permission for. +FIX: Option to disable meteo was not set correctly in edit mode +FIX: $outputlangs is not defined (dolibarr 3.7, 3.8, 3.9) +FIX: path to copyrighted files +FIX: php unit to work both with old and new setup +FIX: Purge of temp files was broken +FIX: Relative discount decimals are not saved +FIX: Removed a bugged list. Fixed another one to not count data of previous year. +FIX: retrieve correct pu_ttc (set by printObjectLine function) like in 3.7 +FIX: search product in customer product prices doesn't work +FIX: Some filters are lost when paging +FIX: sql injection #4341 +FIX: sql injection even when code is on several lines +FIX: sql request and total for time spen for current month +FIX: Sql syntax error in doc_generic_task_odt +FIX: Status filter don't work +FIX: Strict Standards: Only variables should be passed by reference +FIX: The part added with hidden option MAIN_DOC_USE_TIMING was included with a . instead of -. This make os think it is part of extension instead of file name. +FIX: The third dashboard don't consider user permissions +FIX: the view my task must show only task you are assigned to +FIX: to allow phpunit of migration process for 3.4 to 3.5 +FIX: to allow phpunit of migration process for 3.5 to 3.6 +FIX: userlocaltax +FIX: view of product image when using old path +FIX: size of image uploaded on user. +FIX: We must ue the "small" size of imge to show on card pages. +FIX: When we make a direct assignement on a task to a user, we must check he is also assigned to project (and if not assign it) +FIX: wrong fk_parent_line in credit note with invoiceAvoirWithLines option +FIX: wrong modelpdf var name +FIX: wrong object name + ***** ChangeLog for 3.8.3 compared to 3.8.2 ***** FIX: #3805 FIX: #3231 [Members] Public subscription page displays GeoIP error From eb65707da8e431f0b4a495039ced1586e62aff5c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 12 Mar 2016 12:50:05 +0100 Subject: [PATCH 6/7] Fix code to publishing packages on foundation server --- build/makepack-dolibarr.pl | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 9a6a9175ca7..7482d181c64 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -1086,6 +1086,14 @@ if ($nboftargetok) { "$DESTI/standard/$FILENAMETGZ.tgz"=>'Dolibarr ERP-CRM', "$DESTI/standard/$FILENAMETGZ.zip"=>'Dolibarr ERP-CRM' ); + %filestoscanstableasso=( + "$DESTI/package_rpm_generic/$FILENAMERPM"=>'package_rpm_generic', + "$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'package_debian-ubuntu', + "$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'package_windows', + "$DESTI/standard/$FILENAMETGZ.tgz"=>'standard', + "$DESTI/standard/$FILENAMETGZ.zip"=>'standard' + ); + use POSIX qw/strftime/; foreach my $file (sort keys %filestoscansf) { @@ -1128,13 +1136,15 @@ if ($nboftargetok) { if ($target eq 'SF') { $destFolder="$NEWPUBLISH/$filestoscan{$file}/".$MAJOR.'.'.$MINOR.'.'.$BUILD; - print "Publish file ".$file." to $NEWPUBLISH/".$filestoscan{$file}."\n"; } + elsif ($target eq 'ASSO' && $NEWPUBLISH =~ /stable/) { + $destFolder="$NEWPUBLISH/$filestoscanstableasso{$file}"; + } else { $destFolder="$NEWPUBLISH"; - print "Publish file ".$file." to $NEWPUBLISH\n"; } + print "Publish file ".$file." to ".$destFolder."\n"; # mkdir #my $ssh = Net::SSH::Perl->new("frs.sourceforge.net"); From 0727ee88e6ea4dd205949af5f9644be9226d68f9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 12 Mar 2016 18:33:32 +0100 Subject: [PATCH 7/7] More robust initdemo script. --- dev/initdata/initdemo.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dev/initdata/initdemo.sh b/dev/initdata/initdemo.sh index e8ea47c71b2..10dc671e09d 100755 --- a/dev/initdata/initdemo.sh +++ b/dev/initdata/initdemo.sh @@ -171,6 +171,8 @@ then fi #echo "mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile" #mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile +#echo "drop old table" +echo "drop table llx_accounting_account;" | mysql -P$port -u$admin $passwd $base echo "mysql -P$port -u$admin -p***** $base < $mydir/$dumpfile" mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile export res=$?