diff --git a/htdocs/accountancy/bookkeeping/export.php b/htdocs/accountancy/bookkeeping/export.php index ede15e0fc2d..b2924a7c186 100644 --- a/htdocs/accountancy/bookkeeping/export.php +++ b/htdocs/accountancy/bookkeeping/export.php @@ -1196,7 +1196,6 @@ while ($i < min($num, $limit)) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $objectstatic = new Facture($db); $objectstatic->fetch($line->fk_doc); - //$modulepart = 'facture'; $filename = dol_sanitizeFileName($line->doc_ref); $filedir = $conf->facture->dir_output.'/'.dol_sanitizeFileName($line->doc_ref); @@ -1208,11 +1207,10 @@ while ($i < min($num, $limit)) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; $objectstatic = new FactureFournisseur($db); $objectstatic->fetch($line->fk_doc); - //$modulepart = 'invoice_supplier'; $filename = dol_sanitizeFileName($line->doc_ref); - $filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($line->fk_doc, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref); - $subdir = get_exdir($objectstatic->id, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref); + $filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($line->fk_doc, 2, 0, 0, $objectstatic, $objectstatic->element).dol_sanitizeFileName($line->doc_ref); + $subdir = get_exdir($objectstatic->id, 2, 0, 0, $objectstatic, $objectstatic->element).dol_sanitizeFileName($line->doc_ref); $documentlink = $formfile->getDocumentsLink($objectstatic->element, $subdir, $filedir); } elseif ($line->doc_type == 'expense_report') { $langs->loadLangs(array('trips')); @@ -1220,7 +1218,6 @@ while ($i < min($num, $limit)) { require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; $objectstatic = new ExpenseReport($db); $objectstatic->fetch($line->fk_doc); - //$modulepart = 'expensereport'; $filename = dol_sanitizeFileName($line->doc_ref); $filedir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($line->doc_ref); diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 73fc53d8a29..d011f2f2158 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -218,7 +218,7 @@ if ($result) { $tabtype = array(); $tabmoreinfo = array(); - // Loop on each line into llx_bank table. For each line, we should get: + // Loop on each line into the llx_bank table. For each line, we should get: // one line tabpay = line into bank // one line for bank record = tabbq // one line for thirdparty record = tabtp @@ -333,9 +333,12 @@ if ($result) { break; } } + // Now loop on each link of record in bank (code similar to bankentries_list.php) foreach ($links as $key => $val) { if ($links[$key]['type'] == 'user' && !$is_sc && !$is_salary && !$is_expensereport) { + // We must avoid as much as possible this "continue". If we want to jump to next loop, it means we don't want to process + // the case the link is user (often because managed by hard coded code into another link), and we must avoid this. continue; } if (in_array($links[$key]['type'], array('sc', 'payment_sc', 'payment', 'payment_supplier', 'payment_vat', 'payment_expensereport', 'banktransfert', 'payment_donation', 'member', 'payment_loan', 'payment_salary', 'payment_various'))) { diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index a1bf3006328..e9b7b3022fb 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -1,13 +1,13 @@ - * Copyright (C) 2007-2010 Jean Heimburger - * Copyright (C) 2011 Juanjo Menent - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2013-2023 Alexandre Spangaro - * Copyright (C) 2013-2016 Olivier Geffroy - * Copyright (C) 2013-2016 Florian Henry - * Copyright (C) 2018 Frédéric France - * Copyright (C) 2018 Eric Seigne +/* Copyright (C) 2007-2010 Laurent Destailleur + * Copyright (C) 2007-2010 Jean Heimburger + * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2013-2024 Alexandre Spangaro + * Copyright (C) 2013-2016 Olivier Geffroy + * Copyright (C) 2013-2016 Florian Henry + * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018 Eric Seigne * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -175,8 +175,8 @@ if ($result) { $vatdata = getTaxesFromId($obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''), $mysoc, $mysoc, 0); $compta_tva = (!empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $account_vat); - $compta_localtax1 = (!empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $cpttva); - $compta_localtax2 = (!empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $cpttva); + $compta_localtax1 = (!empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $account_vat); + $compta_localtax2 = (!empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $account_vat); // Define array to display all VAT rates that use this accounting account $compta_tva if (price2num($obj->tva_tx) || !empty($obj->vat_src_code)) { diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 9bf237f50b0..f1e12b31210 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -520,7 +520,7 @@ class CommandeFournisseur extends CommonOrder $sql = "SELECT l.rowid, l.fk_commande, l.ref as ref_supplier, l.fk_product, l.product_type, l.label, l.description, l.qty,"; $sql .= " l.vat_src_code, l.tva_tx, l.remise_percent, l.subprice,"; $sql .= " l.localtax1_tx, l. localtax2_tx, l.localtax1_type, l. localtax2_type, l.total_localtax1, l.total_localtax2,"; - $sql .= " l.total_ht, l.total_tva, l.total_ttc, l.special_code, l.fk_parent_line, l.rang,"; + $sql .= " l.total_ht, l.total_tva, l.total_ttc, l.info_bits, l.special_code, l.fk_parent_line, l.rang,"; $sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.description as product_desc, p.tobatch as product_tobatch, p.barcode as product_barcode,"; $sql .= " l.fk_unit,"; $sql .= " l.date_start, l.date_end,"; @@ -621,6 +621,7 @@ class CommandeFournisseur extends CommonOrder $line->multicurrency_total_tva = $objp->multicurrency_total_tva; $line->multicurrency_total_ttc = $objp->multicurrency_total_ttc; + $line->info_bits = $objp->info_bits; $line->special_code = $objp->special_code; $line->fk_parent_line = $objp->fk_parent_line; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 6a24a4f64b7..88264cf918b 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1811,6 +1811,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr } // Refresh value of MAIN_IHM_PARAMS_REV before forging the parameter line. if (GETPOST('dol_resetcache')) { + include_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", getDolGlobalInt('MAIN_IHM_PARAMS_REV') + 1, 'chaine', 0, '', $conf->entity); } diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 8b91e9b53dc..fa28436a7c2 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -366,7 +366,7 @@ $sql .= ' FROM ' . MAIN_DB_PREFIX . 'product as p'; $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product_stock as s ON p.rowid = s.fk_product'; $sql .= ' AND s.fk_entrepot IN (' . $db->sanitize($list_warehouse) . ')'; -$list_warehouse_selected = ($fk_entrepot < 0 || empty($fk_entrepot)) ? '0' : $fk_entrepot; +$list_warehouse_selected = ($fk_entrepot < 0 || empty($fk_entrepot)) ? $list_warehouse : $fk_entrepot; $sql .= ' AND s.fk_entrepot IN (' . $db->sanitize($list_warehouse_selected) . ')'; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 1086b4caf4b..f462d08372a 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -1287,8 +1287,8 @@ foreach ($listofreferent as $key => $value) { $filedir = $conf->fournisseur->commande->multidir_output[$element->entity].'/'.dol_sanitizeFileName($element->ref); } elseif ($element_doc === 'invoice_supplier') { $element_doc = 'facture_fournisseur'; - $filename = get_exdir($element->id, 2, 0, 0, $element, 'product').dol_sanitizeFileName($element->ref); - $filedir = $conf->fournisseur->facture->multidir_output[$element->entity].'/'.get_exdir($element->id, 2, 0, 0, $element, 'invoice_supplier').dol_sanitizeFileName($element->ref); + $filename = get_exdir($element->id, 2, 0, 0, $element, 'invoice_supplier').dol_sanitizeFileName($element->ref); + $filedir = $conf->fournisseur->facture->multidir_output[$element->entity].'/'.$filename; } print '
';