From c6cb179447df6e8a964d3e0d476a1250c051e95d Mon Sep 17 00:00:00 2001 From: Tim Otte Date: Mon, 7 Sep 2020 15:43:36 +0200 Subject: [PATCH 1/9] Added filterable table columns --- htdocs/product/fournisseurs.php | 184 +++++++++++++++++++++----------- 1 file changed, 121 insertions(+), 63 deletions(-) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 77073763503..5a8b0fbeda7 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -858,6 +858,52 @@ SCRIPT; print_barre_liste($langs->trans('SupplierPrices'), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit, 1); + // Definition of fields for lists + // Some fields are missing because they are not included in the database query + $arrayfields = array( + 'pfp.datec'=>array('label'=>$langs->trans("AppliedPricesFrom"), 'checked'=>1, 'position'=>1), + 's.nom'=>array('label'=>$langs->trans("Suppliers"), 'checked'=>1, 'position'=>2), + 'pfp.fk_availability'=>array('label'=>$langs->trans("Availability"), 'enabled' => !empty($conf->global->FOURN_PRODUCT_AVAILABILITY), 'checked'=>0, 'position'=>4), + 'pfp.quantity'=>array('label'=>$langs->trans("QtyMin"), 'checked'=>1, 'position'=>5), + 'pfp.unitprice'=>array('label'=>$langs->trans("UnitPriceHT"), 'checked'=>1, 'position'=>9), + 'pfp.multicurrency_unitprice'=>array('label'=>$langs->trans("UnitPriceHTCurrency"), 'enabled' => $conf->multicurrency->enabled, 'checked'=>0, 'position'=>10), + 'pfp.delivery_time_days'=>array('label'=>$langs->trans("NbDaysToDelivery"), 'checked'=>1, 'position'=>13), + 'pfp.supplier_reputation'=>array('label'=>$langs->trans("ReputationForThisProduct"), 'checked'=>1, 'position'=>14), + 'pfp.barcode'=>array('label'=>$langs->trans("BarcodeValue"), 'enabled' => $conf->barcode->enabled, 'checked'=>0, 'position'=>15), + 'pfp.fk_barcode_type'=>array('label'=>$langs->trans("BarcodeType"), 'enabled' => $conf->barcode->enabled, 'checked'=>0, 'position'=>16), + 'pfp.packaging'=>array('label'=>$langs->trans("PackagingForThisProduct"), 'enabled' => !empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING), 'checked'=>0, 'position'=>17), + 'pfp.tms'=>array('label'=>$langs->trans("DateModification"), 'enabled' => $conf->barcode->enabled, 'checked'=>1, 'position'=>18), + ); + + // fetch optionals attributes and labels + $extrafields->fetch_name_optionals_label("product_fournisseur_price"); + $extralabels = $extrafields->attributes["product_fournisseur_price"]['label']; + + if (!empty($extralabels)) { + foreach ($extralabels as $key => $value) { + // Show field if not hidden + if (!empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) { + if (!empty($extrafields->attributes["product_fournisseur_price"]['langfile'][$key])) $langs->load($extrafields->attributes["product_fournisseur_price"]['langfile'][$key]); + if (!empty($extrafields->attributes["product_fournisseur_price"]['help'][$key])) $extratitle = $form->textwithpicto($langs->trans($value), $langs->trans($extrafields->attributes["product_fournisseur_price"]['help'][$key])); + else $extratitle = $langs->trans($value); + $arrayfields['ef.'.$key] = array('label'=>$extratitle, 'checked'=>0, 'position'=>(end($arrayfields)['position']+1)); + } + } + } + + // Selection of new fields + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + + $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; + $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields + + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + // Suppliers list title print '
'; print ''; @@ -865,42 +911,37 @@ SCRIPT; $param = "&id=".$object->id; print ''; - print_liste_field_titre("AppliedPricesFrom", $_SERVER["PHP_SELF"], "pfp.datec", "", $param, "", $sortfield, $sortorder); - print_liste_field_titre("Suppliers", $_SERVER["PHP_SELF"], "s.nom", "", $param, "", $sortfield, $sortorder); + if (!empty($arrayfields['pfp.datec']['checked'])) print_liste_field_titre("AppliedPricesFrom", $_SERVER["PHP_SELF"], "pfp.datec", "", $param, "", $sortfield, $sortorder); + if (!empty($arrayfields['s.nom']['checked'])) print_liste_field_titre("Suppliers", $_SERVER["PHP_SELF"], "s.nom", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("SupplierRef", $_SERVER["PHP_SELF"], "", "", $param, "", $sortfield, $sortorder); - if (!empty($conf->global->FOURN_PRODUCT_AVAILABILITY)) print_liste_field_titre("Availability", $_SERVER["PHP_SELF"], "pfp.fk_availability", "", $param, "", $sortfield, $sortorder); - print_liste_field_titre("QtyMin", $_SERVER["PHP_SELF"], "pfp.quantity", "", $param, '', $sortfield, $sortorder, 'right '); + if (!empty($arrayfields['pfp.fk_availability']['checked'])) print_liste_field_titre("Availability", $_SERVER["PHP_SELF"], "pfp.fk_availability", "", $param, "", $sortfield, $sortorder); + if (!empty($arrayfields['pfp.quantity']['checked'])) print_liste_field_titre("QtyMin", $_SERVER["PHP_SELF"], "pfp.quantity", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("PriceQtyMinHT", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); - if ($conf->multicurrency->enabled) { - print_liste_field_titre("PriceQtyMinHTCurrency", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); - } - print_liste_field_titre("UnitPriceHT", $_SERVER["PHP_SELF"], "pfp.unitprice", "", $param, '', $sortfield, $sortorder, 'right '); - if ($conf->multicurrency->enabled) { - print_liste_field_titre("UnitPriceHTCurrency", $_SERVER["PHP_SELF"], "pfp.multicurrency_unitprice", "", $param, '', $sortfield, $sortorder, 'right '); - print_liste_field_titre("Currency", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right '); - } + if ($conf->multicurrency->enabled) print_liste_field_titre("PriceQtyMinHTCurrency", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); + if (!empty($arrayfields['pfp.unitprice']['checked'])) print_liste_field_titre("UnitPriceHT", $_SERVER["PHP_SELF"], "pfp.unitprice", "", $param, '', $sortfield, $sortorder, 'right '); + if (!empty($arrayfields['pfp.multicurrency_unitprice']['checked'])) print_liste_field_titre("UnitPriceHTCurrency", $_SERVER["PHP_SELF"], "pfp.multicurrency_unitprice", "", $param, '', $sortfield, $sortorder, 'right '); + if ($conf->multicurrency->enabled) print_liste_field_titre("Currency", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("DiscountQtyMin", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); - print_liste_field_titre("NbDaysToDelivery", $_SERVER["PHP_SELF"], "pfp.delivery_time_days", "", $param, '', $sortfield, $sortorder, 'right '); - print_liste_field_titre("ReputationForThisProduct", $_SERVER["PHP_SELF"], "pfp.supplier_reputation", "", $param, '', $sortfield, $sortorder, 'center '); - if ($conf->barcode->enabled) { - print_liste_field_titre("BarcodeValue", $_SERVER["PHP_SELF"], "pfp.barcode", "", $param, '', $sortfield, $sortorder, 'center '); - print_liste_field_titre("BarcodeType", $_SERVER["PHP_SELF"], "pfp.fk_barcode_type", "", $param, '', $sortfield, $sortorder, 'center '); - } - if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) print_liste_field_titre("PackagingForThisProduct", $_SERVER["PHP_SELF"], "pfp.packaging", "", $param, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre("DateModification", $_SERVER["PHP_SELF"], "pfp.tms", "", $param, '', $sortfield, $sortorder, 'right '); + if (!empty($arrayfields['pfp.delivery_time_days']['checked'])) print_liste_field_titre("NbDaysToDelivery", $_SERVER["PHP_SELF"], "pfp.delivery_time_days", "", $param, '', $sortfield, $sortorder, 'right '); + if (!empty($arrayfields['pfp.supplier_reputation']['checked'])) print_liste_field_titre("ReputationForThisProduct", $_SERVER["PHP_SELF"], "pfp.supplier_reputation", "", $param, '', $sortfield, $sortorder, 'center '); + if (!empty($arrayfields['pfp.barcode']['checked'])) print_liste_field_titre("BarcodeValue", $_SERVER["PHP_SELF"], "pfp.barcode", "", $param, '', $sortfield, $sortorder, 'center '); + if (!empty($arrayfields['pfp.fk_barcode_type']['checked'])) print_liste_field_titre("BarcodeType", $_SERVER["PHP_SELF"], "pfp.fk_barcode_type", "", $param, '', $sortfield, $sortorder, 'center '); + if (!empty($arrayfields['pfp.packaging']['checked'])) print_liste_field_titre("PackagingForThisProduct", $_SERVER["PHP_SELF"], "pfp.packaging", "", $param, 'align="center"', $sortfield, $sortorder); + if (!empty($arrayfields['pfp.tms']['checked'])) print_liste_field_titre("DateModification", $_SERVER["PHP_SELF"], "pfp.tms", "", $param, '', $sortfield, $sortorder, 'right '); // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label("product_fournisseur_price"); $extralabels = $extrafields->attributes["product_fournisseur_price"]['label']; + if (!empty($extralabels)) { foreach ($extralabels as $key => $value) { // Show field if not hidden if (!empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) { if (!empty($extrafields->attributes["product_fournisseur_price"]['langfile'][$key])) $langs->load($extrafields->attributes["product_fournisseur_price"]['langfile'][$key]); if (!empty($extrafields->attributes["product_fournisseur_price"]['help'][$key])) $extratitle = $form->textwithpicto($langs->trans($value), $langs->trans($extrafields->attributes["product_fournisseur_price"]['help'][$key])); - else $extratitle = $langs->trans($value); - print_liste_field_titre($extratitle, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); + else $extratitle = $langs->trans($value); + if (!empty($arrayfields['ef.'.$key]['checked'])) print_liste_field_titre($extratitle, $_SERVER["PHP_SELF"], 'ef.'.$key, '', $param, '', $sortfield, $sortorder, 'right '); } } } @@ -910,7 +951,7 @@ SCRIPT; $parameters = array('id_fourn'=>$id_fourn, 'prod_id'=>$object->id); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); } - print_liste_field_titre(''); + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); print "\n"; if (is_array($product_fourn_list)) @@ -920,10 +961,14 @@ SCRIPT; print ''; // Date from - print ''; + if (!empty($arrayfields['pfp.datec']['checked'])) { + print ''; + } // Supplier - print ''; + if (!empty($arrayfields['s.nom']['checked'])) { + print ''; + } // Supplier ref if ($usercancreate) // change required right here @@ -934,7 +979,7 @@ SCRIPT; } // Availability - if (!empty($conf->global->FOURN_PRODUCT_AVAILABILITY)) + if (!empty($arrayfields['pfp.fk_availability']['checked'])) { $form->load_cache_availability(); $availability = $form->cache_availability[$productfourn->fk_availability]['label']; @@ -942,16 +987,18 @@ SCRIPT; } // Quantity - print ''; + if (!empty($arrayfields['pfp.quantity']['checked'])) { + print ''; + } // VAT rate print ''; + if (!empty($arrayfields['pfp.unitprice']['checked'])) { + print ''; + } - if ($conf->multicurrency->enabled) { - // Unit price in currency + // Unit price in currency + if (!empty($arrayfields['pfp.multicurrency_unitprice']['checked'])) { print ''; + print '';} - // Currency + // Currency + if ($conf->multicurrency->enabled) { print ''; @@ -994,24 +1044,30 @@ SCRIPT; print ''; // Delivery delay - print ''; + if (!empty($arrayfields['pfp.delivery_time_days']['checked'])) { + print ''; + } // Reputation - print ''; } - print''; - if ($conf->barcode->enabled) { - // Barcode + // Barcode + if (!empty($arrayfields['pfp.barcode']['checked'])) { print ''; - - // Barcode type + print ''; + } + + // Barcode type + if (!empty($arrayfields['pfp.fk_barcode_type']['checked'])) { print ''; } // Date - print ''; + if (!empty($arrayfields['pfp.tms']['checked'])) { + print ''; + } // Extrafields if (!empty($extralabels)) { @@ -1045,14 +1102,14 @@ SCRIPT; if ($resql) { if ($db->num_rows($resql) != 1) { foreach ($extralabels as $key => $value) { - if (!empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) { + if (!empty($arrayfields['ef.'.$key]['checked']) && !empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) { print ""; } } } else { $obj = $db->fetch_object($resql); foreach ($extralabels as $key => $value) { - if (!empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) { + if (!empty($arrayfields['ef.'.$key]['checked']) && !empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) { print '"; } } @@ -1087,6 +1144,7 @@ SCRIPT; print '
'.dol_print_date(($productfourn->fourn_date_creation ? $productfourn->fourn_date_creation : $productfourn->date_creation), 'dayhour').''.dol_print_date(($productfourn->fourn_date_creation ? $productfourn->fourn_date_creation : $productfourn->date_creation), 'dayhour').''.$productfourn->getSocNomUrl(1, 'supplier').''.$productfourn->getSocNomUrl(1, 'supplier').''; - print $productfourn->fourn_qty; - // Units - if ($conf->global->PRODUCT_USE_UNITS) { - $unit = $object->getLabelOfUnit(); - if ($unit !== '') { - print '  '.$langs->trans($unit); - } - } - print ''; + print $productfourn->fourn_qty; + // Units + if ($conf->global->PRODUCT_USE_UNITS) { + $unit = $object->getLabelOfUnit(); + if ($unit !== '') { + print '  '.$langs->trans($unit); + } + } + print ''; @@ -971,18 +1018,21 @@ SCRIPT; } // Unit price - print ''; - print price($productfourn->fourn_unitprice); - //print $objp->unitprice? price($objp->unitprice) : ($objp->quantity?price($objp->price/$objp->quantity):" "); - print ''; + print price($productfourn->fourn_unitprice); + //print $objp->unitprice? price($objp->unitprice) : ($objp->quantity?price($objp->price/$objp->quantity):" "); + print ''; print price($productfourn->fourn_multicurrency_unitprice); - print ''; print $productfourn->fourn_multicurrency_code ? currency_name($productfourn->fourn_multicurrency_code) : ''; print ''; - print $productfourn->delivery_time_days; - print ''; + print $productfourn->delivery_time_days; + print ''; - if (!empty($productfourn->supplier_reputation) && !empty($object->reputations[$productfourn->supplier_reputation])) { - print $object->reputations[$productfourn->supplier_reputation]; + if (!empty($arrayfields['pfp.supplier_reputation']['checked'])) { + print ''; + if (!empty($productfourn->supplier_reputation) && !empty($object->reputations[$productfourn->supplier_reputation])) { + print $object->reputations[$productfourn->supplier_reputation]; + } + print''; print $productfourn->barcode; - print ''; $productfourn->barcode_type = !empty($productfourn->fk_barcode_type) ? $productfourn->fk_barcode_type : 0; $productfourn->fetch_barcode(); @@ -1020,17 +1076,18 @@ SCRIPT; } // Packaging - if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) - { + if (!empty($arrayfields['pfp.packaging']['checked'])) { print ''; print price2num($productfourn->packaging); print ''; - print dol_print_date(($productfourn->fourn_date_modification ? $productfourn->fourn_date_modification : $productfourn->date_modification), "dayhour"); - print ''; + print dol_print_date(($productfourn->fourn_date_modification ? $productfourn->fourn_date_modification : $productfourn->date_modification), "dayhour"); + print ''.$extrafields->showOutputField($key, $obj->{$key})."
'; print '
'; + print '
'; } } } From a9a95c8a839a3ace9e91b0632a48935faba86c43 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 7 Sep 2020 13:47:26 +0000 Subject: [PATCH 2/9] Fixing style errors. --- htdocs/product/fournisseurs.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 5a8b0fbeda7..6c6e4dbfd3a 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -893,7 +893,7 @@ SCRIPT; // Selection of new fields include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; - + $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields @@ -1065,7 +1065,7 @@ SCRIPT; print $productfourn->barcode; print ''; } - + // Barcode type if (!empty($arrayfields['pfp.fk_barcode_type']['checked'])) { print ''; From ca32a93c0b555f767c32262d8527beb4242d4719 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 7 Sep 2020 22:03:41 +0200 Subject: [PATCH 3/9] NEW Link on balance to bookkeeping --- htdocs/accountancy/bookkeeping/balance.php | 2 +- htdocs/accountancy/class/accountingaccount.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 059e1eb57b1..358fdc36a2a 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -290,7 +290,7 @@ if ($action != 'export_csv') { $accountingaccountstatic->fetch(null, $line->numero_compte, true); if (!empty($accountingaccountstatic->account_number)) { - $accounting_account = $accountingaccountstatic->getNomUrl(0, 1, 1, '', 1); + $accounting_account = $accountingaccountstatic->getNomUrl(0, 1); } else { $accounting_account = length_accountg($line->numero_compte); } diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 7cb30a74bc6..aee1c4c2f29 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -460,7 +460,7 @@ class AccountingAccount extends CommonObject $result = ''; - if (empty($option)) { + if (empty($option) || $option == 'bookkeeping') { $url = DOL_URL_ROOT . '/accountancy/bookkeeping/list.php?search_accountancy_code_start=' . $this->account_number . '&search_accountancy_code_end=' . $this->account_number; } elseif ($option == 'bookkeepinglistbyaccount') { $url = DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start=' . $this->account_number . '&search_accountancy_code_end=' . $this->account_number; From 939933f4f7fbaedf0a785e14c6cefeaee72c7231 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 8 Sep 2020 04:24:18 +0200 Subject: [PATCH 4/9] Add some language key --- htdocs/accountancy/bookkeeping/balance.php | 4 ++-- htdocs/accountancy/class/accountingaccount.class.php | 7 +++++-- htdocs/langs/en_US/accountancy.lang | 2 ++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 358fdc36a2a..b06a3ffc63a 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -252,8 +252,8 @@ if ($action != 'export_csv') print $langs->trans('to'); print $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array(), 1, 1, ''); print ''; - print ''; - $searchpicto = $form->showFilterAndCheckAddButtons(0); + print ''; + $searchpicto = $form->showFilterButtons(); print $searchpicto; print ''; diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index aee1c4c2f29..6936d7499fa 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -462,10 +462,13 @@ class AccountingAccount extends CommonObject if (empty($option) || $option == 'bookkeeping') { $url = DOL_URL_ROOT . '/accountancy/bookkeeping/list.php?search_accountancy_code_start=' . $this->account_number . '&search_accountancy_code_end=' . $this->account_number; + $labelurl = $langs->trans("ShowAccountingAccountInBookKeeping"); } elseif ($option == 'bookkeepinglistbyaccount') { $url = DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start=' . $this->account_number . '&search_accountancy_code_end=' . $this->account_number; + $labelurl = $langs->trans("ShowAccountingAccountInBookKeepingByAccount"); } elseif ($option == 'accountcard') { $url = DOL_URL_ROOT . '/accountancy/admin/card.php?id=' . $this->id; + $labelurl = $langs->trans("ShowAccountingAccount"); } // Add param to save lastsearch_values or not @@ -483,7 +486,7 @@ class AccountingAccount extends CommonObject $labeltoshow = $this->labelshort; } - $label = ''.$langs->trans("ShowAccountingAccount").''; + $label = ''.$labelurl.''; if (!empty($this->account_number)) $label .= '
'.$langs->trans('AccountAccounting').': '.length_accountg($this->account_number); if (!empty($labeltoshow)) @@ -495,7 +498,7 @@ class AccountingAccount extends CommonObject { if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { - $label = $langs->trans("ShowAccountingAccount"); + $label = $labelurl; $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 29a857c914b..6fb2a152d8f 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -89,6 +89,8 @@ SubledgerAccount=Subledger account SubledgerAccountLabel=Subledger account label ShowAccountingAccount=Show accounting account ShowAccountingJournal=Show accounting journal +ShowAccountingAccountInBookKeeping=Show accounting account in ledger +ShowAccountingAccountInBookKeepingByAccount=Show accounting account in ledger by account AccountAccountingSuggest=Accounting account suggested MenuDefaultAccounts=Default accounts MenuBankAccounts=Bank accounts From a050ee8385f2951c5616dbf29ea8b77ccbcfa889 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 8 Sep 2020 04:24:27 +0200 Subject: [PATCH 5/9] Typo --- htdocs/core/class/html.form.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c6ebb7511bb..5f5a7bcf0ff 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7538,11 +7538,11 @@ class Form } /** - * Return HTML to show the search and clear seach button + * Return HTML to show the search and clear search button * * @param string $cssclass CSS class * @param int $calljsfunction 0=default. 1=call function initCheckForSelect() after changing status of checkboxes - * @param string $massactionname Mass action button name that will launch an action on the selected items + * @param string $massactionname Mass action button name that will launch an action on the selected items * @return string */ public function showCheckAddButtons($cssclass = 'checkforaction', $calljsfunction = 0, $massactionname = "massaction") @@ -7610,7 +7610,7 @@ class Form */ public function selectExpenseCategories($selected = '', $htmlname = 'fk_c_exp_tax_cat', $useempty = 0, $excludeid = array(), $target = '', $default_selected = 0, $params = array()) { - global $db, $conf, $langs, $user; + global $db, $langs, $user; $out = ''; $sql = 'SELECT rowid, label FROM '.MAIN_DB_PREFIX.'c_exp_tax_cat WHERE active = 1'; @@ -7930,7 +7930,7 @@ class Form */ public function searchComponent($arrayofcriterias, $search_component_params, $arrayofinputfieldsalreadyoutput = array()) { - global $conf, $langs; + global $langs; $ret = ''; From a4c581b34d402e29ef6f542376e84b57af788f28 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 8 Sep 2020 04:44:04 +0200 Subject: [PATCH 6/9] Modify link on chart of accounts --- htdocs/accountancy/admin/account.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index f6a4adac21e..e6264648159 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -390,7 +390,7 @@ if ($resql) if (!empty($arrayfields['aa.account_number']['checked'])) { print ""; - print $accountstatic->getNomUrl(1, 0, 0, '', 0, 1); + print $accountstatic->getNomUrl(1, 0, 0, '', 0, 1, 0, 'accountcard'); print "\n"; if (!$i) $totalarray['nbfield']++; } From df7ca14b2c770308d8b833ed1b54388034ed91ec Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 8 Sep 2020 04:58:25 +0200 Subject: [PATCH 7/9] Security access --- htdocs/accountancy/admin/card.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index bc695da0203..4ad131f5170 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -44,6 +44,8 @@ $cancel = GETPOST('cancel', 'alpha'); $accountingaccount = GETPOST('accountingaccount', 'alpha'); // Security check +if ($user->socid > 0) accessforbidden(); +if (!$user->rights->accounting->chartofaccount) accessforbidden(); $object = new AccountingAccount($db); From 6a04f39fbef46085b48e424ac03377fc6e9951dd Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 8 Sep 2020 04:58:42 +0200 Subject: [PATCH 8/9] Wrong language key --- htdocs/core/lib/accounting.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php index 16b124443da..f2d1f6a2763 100644 --- a/htdocs/core/lib/accounting.lib.php +++ b/htdocs/core/lib/accounting.lib.php @@ -56,7 +56,7 @@ function accounting_prepare_head(AccountingAccount $object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/accountancy/admin/card.php?id='.$object->id; - $head[$h][1] = $langs->trans("Asset"); + $head[$h][1] = $langs->trans("AccountAccounting"); $head[$h][2] = 'card'; $h++; From 476cb642f4c38a2f5db29ad678fbfe4f125acb18 Mon Sep 17 00:00:00 2001 From: Romain DESCHAMPS Date: Wed, 9 Sep 2020 19:01:45 +0200 Subject: [PATCH 9/9] Fix ToSell/ToBuy tag in supplier products list #14691 --- htdocs/fourn/product/list.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/product/list.php b/htdocs/fourn/product/list.php index 91cd3636bbe..53ef035c151 100644 --- a/htdocs/fourn/product/list.php +++ b/htdocs/fourn/product/list.php @@ -127,7 +127,7 @@ if (in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = $massactionbutton = $form->selectMassAction('', $arrayofmassactions); -$sql = "SELECT p.rowid, p.label, p.ref, p.fk_product_type, p.entity,"; +$sql = "SELECT p.rowid, p.label, p.ref, p.fk_product_type, p.entity, tosell, tobuy,"; $sql .= " ppf.fk_soc, ppf.ref_fourn, ppf.price as price, ppf.quantity as qty, ppf.unitprice,"; $sql .= " s.rowid as socid, s.nom as name"; // Add fields to SELECT from hooks @@ -296,6 +296,8 @@ if ($resql) $productstatic->ref = $objp->ref; $productstatic->type = $objp->fk_product_type; $productstatic->entity = $objp->entity; + $productstatic->status = $objp->tosell; + $productstatic->status_buy = $objp->tobuy; print $productstatic->getNomUrl(1, 'supplier'); print '';